.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "PHPABTPL 1" .TH PHPABTPL 1 2024-03-03 1.45 pkg-php-tools .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME phpabtpl \- generate phpab templates with dependency autoloading .SH SYNOPSIS .IX Header "SYNOPSIS" \&\fBphpabtpl\fR [\fIOPTION\fR...] [\fIcomposer.json\fR] .SH DESCRIPTION .IX Header "DESCRIPTION" \&\fBphpabtpl\fR is a command-line tool used to generate \fBphpab\fR autoloader templates. In addition to the regular autoloading of the package's own class files, the generated template will also include automatic loading of dependencies and statically loaded files, based on the specification read from a \fIcomposer.json\fR file. .SH OPTIONS .IX Header "OPTIONS" .IP "\fB\-h, \-\-help\fR" 4 .IX Item "-h, --help" Print a help message and exit. .IP "\fB\-\-basedir\fR \fIdirectory\fR" 4 .IX Item "--basedir directory" Set the base directory for "files" autoloading. .Sp This option can be used to adjust the paths for statically loaded files (Composer's "files" section), to treat them as relative to the specified directory rather than to the source's root. This would typical be used for packages where the actual source files are kept in a sub-directory (commonly "src"). .Sp Limitation: This directory must be somewhere above the to-be-loaded files in the file hierarchy. It will not traverse upwards. .IP "\fB\-\-require\fR \fIcomposer_package\fR" 4 .IX Item "--require composer_package" Adds an additional required dependency to be loaded. .Sp \&\fIcomposer_package\fR is the name of a Composer package, e.g. "vendor/project". It is treated as an extra entry in the composer.json "require" section. .Sp This option can be repeated to add multiple dependencies. .IP "\fB\-\-suggest\fR \fIcomposer_package\fR" 4 .IX Item "--suggest composer_package" Adds an additional suggested dependency to be (optionally) loaded. .Sp \&\fIcomposer_package\fR is the name of a Composer package, e.g. "vendor/project". It is treated as an extra entry in the composer.json "suggest" section. .Sp This option can be repeated to add multiple dependencies. .IP "\fB\-\-require\-file\fR \fIfile\fR" 4 .IX Item "--require-file file" Adds an additional file to be loaded. .Sp The \fIfile\fR path will be adapted to \fB\-\-basedir\fR, if given. It is treated as an extra entry in the composer.json "autoload.files" section. .Sp This option can be repeated to add multiple files. .SH EXAMPLES .IX Header "EXAMPLES" .IP "Generate a template with dependency autoloading:" 4 .IX Item "Generate a template with dependency autoloading:" phpabtpl composer.json >autoload.php.tpl .IP "Generate a template for an autoloader to be placed in the ""src"" directory:" 4 .IX Item "Generate a template for an autoloader to be placed in the ""src"" directory:" phpabtpl \-\-basedir src composer.json >autoload.php.tpl .IP "Generate a template with manually specified dependencies:" 4 .IX Item "Generate a template with manually specified dependencies:" phpabtpl \-\-require proj1/pack1 \-\-require\-file src/autoload.php .SH FILES .IX Header "FILES" .IP \fIdebian/pkg\-php\-tools\-autoloaders\fR 4 .IX Item "debian/pkg-php-tools-autoloaders" Autoloaders that are not correctly identified by \fBphpabtpl\fR by default can be manually specified in this file. .Sp The format is a set of lines, with each line having the following fields: .RS 4 .IP \fIvendor_name\fR 6 .IX Item "vendor_name" The Composer package's vendor name (e.g. "vendor" in "vendor/project"). .IP \fIproject_name\fR 6 .IX Item "project_name" The Composer package's project name (e.g. "project" in "vendor/project"). .IP \fIautoloader_path\fR 6 .IX Item "autoloader_path" The corresponding autoloader file (e.g. "Vendor/Project/autoload.php"). .RE .RS 4 .Sp It can be installed in \fB/usr/share/pkg\-php\-tools/autoloaders/\fR\fIpackage\fR. .RE