PHPABTPL(1)

πŸ“¦
version 1.49build1 Β· 4 versions
, in ubuntu resolute, ubuntu stonking

✨ 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 πŸ‘‘
  • --basedir directory β€” 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.
  • --require composer_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.

  • --suggest composer_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-file file β€” 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 that phpabtpl doesn'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