ApiGen
v7.0.0-alpha.6
ApiGen เป็นเครื่องมือสร้างเอกสาร API ที่ทันสมัยและใช้งานง่าย ซึ่งรองรับฟีเจอร์ PHP 8.3 ทั้งหมด
ApiGen มีให้เป็นอิมเมจ apigen/apigen Docker ซึ่งคุณสามารถใช้โดยตรงได้
docker run --rm --interactive --tty --volume " $PWD : $PWD " --workdir " $PWD "
apigen/apigen:edge
src --output docs
สิ่งนี้จะติดตั้ง ApiGen phar binary ให้กับ tools/apigen
mkdir -p tools
curl -L https://github.com/ApiGen/ApiGen/releases/latest/download/apigen.phar -o tools/apigen
chmod +x tools/apigen
tools/apigen src --output docs
สิ่งนี้จะติดตั้ง ApiGen ไปยังไดเร็กทอรี tools/apigen
โดยมีจุดเริ่มต้นที่สามารถเรียกใช้งานได้ใน tools/apigen/bin/apigen
composer create-project --no-dev apigen/apigen:^7.0@alpha tools/apigen
tools/apigen/bin/apigen src --output docs
สร้างเอกสาร API โดยส่งไดเรกทอรีต้นทางและตัวเลือกปลายทาง:
apigen src --output docs
คุณสามารถกำหนดค่า ApiGen ได้ด้วยไฟล์การกำหนดค่า apigen.neon
parameters :
# string[], passed as arguments in CLI, e.g. ['src']
paths : []
# string[], --include in CLI, included files mask, e.g. ['*.php']
include : [ ' *.php ' ]
# string[], --exclude in CLI, excluded files mask, e.g. ['tests/**']
exclude : []
# bool, should protected members be excluded?
excludeProtected : false
# bool, should private members be excluded?
excludePrivate : true
# string[], list of tags used for excluding class-likes and members
excludeTagged : [ ' internal ' ]
# string, --output in CLI
outputDir : ' %workingDir%/api '
# string | null, --theme in CLI
themeDir : null
# string, --title in CLI
title : ' API Documentation '
# string, --base-url in CLI
baseUrl : ' '
# int, --workers in CLI, number of processes that will be forked for parallel rendering
workerCount : 8
# string, --memory-limit in CLI
memoryLimit : ' 512M '