codenamephp / prototype.library.platform
Prototype for library projects that includes the basic directory layout, build tools, composer, ... via a installer
Requires
- php: ^5.6 || ^7.0
- codenamephp/platform.di: ^2
- codenamephp/prototype.utils: ^1
- composer/composer: ^1
- symfony/filesystem: ^3
- twig/twig: ^1
Requires (Dev)
README
Prototype for library projects. Contains build, composer.json, basic PHP folder structure etc. The interactive installer eliminates the need to pass anything to the command line or do own configuration.
Usage
- Install the prototype with composer:
composer create-project "codenamephp/prototype.library.platform" projectFolder ["version"] [--no-dev] --kepp-vcs
- Follow the instructions on screen
- Check the dependency versions in composer.json and execute a composer update
- Open in Netbeans and be productive :)
Non-Interactive Mode
The installer can also be exectued in non interactive mode. You can then provide all the answers the installer needs in a serialized array that must be put into
answers.serialized
in the root folder before the installer is exectued. This can be used for web clients etc. that get all the answers needed before hand.
composer create-project "codenamephp/prototype.library.platform" projectFolder ["version"] [--no-dev] -n php -r "file_put_contents('projectFolder/answers.seralized', serialize(['question key' => 'answer']);" cd projectFolder composer run-script post-create-project-cmd
Notice the -n
when running the create-project
command. This puts the installer in non-interactive mode. If you don't do this, it will expect the answers from the
command line and not look for the file.
The following question keys need to be set:
- vendor: The vendor of the package
- displayName: The human readable name of the package
- componentName: The package name
- namespace: the base namespace of the project