PHPABTPL(1)
β¨ PHPABTPL(1) β¨
okay bestie, gather round, because this is the manual page for phpabtpl from the pkg-php-tools crew and honestly? it's giving "small tool, huge main character energy" π
πΈ NAME πΈ
phpabtpl β generate phpab templates with dependency autoloading π
π¦ SYNOPSIS π¦
phpabtpl [OPTION...] [composer.json]
β¨ DESCRIPTION β¨
so phpabtpl is a command-line tool that generates phpab autoloader templates, and no cap, that's literally its whole job π«Ά
here's the tea though: it doesn't just do the regular autoloading of the package's own class files. on top of that, the template it spits out also includes automatic loading of dependencies and statically loaded files β and all of that is based on the spec it reads from a composer.json file. it's reading the vibes, and the vibes are thorough π
π OPTIONS π
-h,--helpβ prints a help message and then dips. that's it, that's the whole thing π--basedirdirectory β sets the base directory for"files"autoloading.
use this one to adjust the paths for statically loaded files (that's Composer's "files" section, iykyk), so they get treated as relative to this directory instead of to the source's root. typical use case: packages where the actual source files live in a sub-directory (usually "src") π
β οΈ limitation, and listen carefully bestie: this directory must be somewhere above the to-be-loaded files in the file hierarchy. it will not traverse upwards. no climbing, periodt.
--requirecomposer_package β adds one more required dependency to be loaded.
composer_package is the name of a Composer package, like "vendor/project". it gets treated as an extra entry in the composer.json "require" section. π
you can repeat this option to add multiple dependencies β stack 'em up, bestie.
--suggestcomposer_package β adds one more suggested dependency to be (optionally) loaded.
composer_package is the name of a Composer package, like "vendor/project". it gets treated as an extra entry in the composer.json "suggest" section. β¨
yep, this one repeats too β multiple dependencies, no problem.
--require-filefile β adds one more file to be loaded.
the file path gets adapted to --basedir, if you gave one. it's treated as an extra entry in the composer.json "autoload.files" section. π
and yes, repeatable. multiple files. go off.
π₯ EXAMPLES π₯
generate a template with dependency autoloading:
phpabtpl composer.json >autoload.php.tpl
generate a template for an autoloader that's gonna be placed in the "src" directory:
phpabtpl --basedir src composer.json >autoload.php.tpl
generate a template with manually specified dependencies:
phpabtpl --require proj1/pack1 --require-file src/autoload.php
π§ FILES π§
debian/pkg-php-tools-autoloadersβ autoloaders thatphpabtpldoesn't correctly identify by default can be manually specified in this file. it's the "not me having to do this by hand π" escape hatch.
the format is a set of lines, and each line has the following fields:
vendor_nameβ the Composer package's vendor name (e.g."vendor"in"vendor/project").project_nameβ the Composer package's project name (e.g."project"in"vendor/project").autoloader_pathβ the corresponding autoloader file (e.g."Vendor/Project/autoload.php").
it can be installed in /usr/share/pkg-php-tools/autoloaders/package. π
and that's the whole page, bestie!! this one came from pkg-php-tools, version 1.49build1, dated 2025-12-06 β so yeah, go forth, generate those templates, and slay πβ¨ππ¦πΈπ«Άπ
π¦ where this page comes from
- ubuntu resolute: pkg-php-tools 1.49build1 Β· LGPL-3.0-only
- ubuntu stonking: pkg-php-tools 1.49build1 Β· LGPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms