qobo / phake-builder
A set of build and deploy files, based on jaz303/phake
Installs: 25 027
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 22
Forks: 0
Open Issues: 3
Requires
- gorkalaucirica/hipchat-v2-api-client: ~1.5
- jaz303/phake: ~0.6
- kmelia/monolog-stdout-handler: ~1.2
- monolog/monolog: ~1.11
- pdepend/pdepend: *
- phploc/phploc: *
- phpmd/phpmd: *
- phpunit/phpunit: ~5.3
- pyrech/composer-changelogs: ~1.4
- qobo/pattern: ~2.0
- qobo/search-replace-db: ~4.0
- sami/sami: ~3.2
- sebastian/phpcpd: *
- squizlabs/php_codesniffer: *
- symfony/filesystem: ~2.7
- symfony/finder: ~2.7
- twig/twig: ~1.2
- vlucas/phpdotenv: ~1.1
- zetacomponents/archive: 1.5
- dev-master
- v5.0.0
- v4.0.1
- v4.0.0
- v3.0.0
- v2.8.2
- v2.8.1
- v2.8.0
- v2.7.1
- v2.7.0
- v2.6.0
- v2.5.2
- v2.5.1
- v2.5.0
- v2.4.0
- v2.3.0
- v2.2.0
- v2.1.0
- v2.0.1
- v2.0.0
- v1.2.7
- v1.2.6
- v1.2.5
- v1.2.4
- v1.2.3
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.0
- v1.0.38
- v1.0.37
- v1.0.36
- v1.0.35
- v1.0.34
- v1.0.33
- v1.0.32
- v1.0.31
- v1.0.30
- v1.0.29
- v1.0.28
- v1.0.27
- v1.0.26
- v1.0.25
- v1.0.24
- v1.0.23
- v1.0.22
- v1.0.21
- v1.0.20
- v1.0.19
- v1.0.18
- v1.0.17
- v1.0.16
- v1.0.15
- v1.0.14
- v1.0.13
- v1.0.12
- v1.0.11
- v1.0.10
- v1.0.9
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- dev-remove-obsolete-package
- dev-1.0-fixes
This package is auto-updated.
Last update: 2023-04-07 12:20:22 UTC
README
A set of build and deploy files, based on jaz303/phake.
If you find this useful, have a look at other project templates, based on this one:
- project-template - generic PHP project template
- project-template-wordpress - an automated setup for WordPress CMS
- project-template-cakephp - a feature-rich setup of CakePHP framework
Install
Install with composer as so:
{ "require": { "qobo/phake-builder": "~2.0" } }
Usage
In the root of your project, create a Phakefile
(or Phakefile.php
) with the following:
<?php require_once 'vendor/qobo/phake-builder/Phakefile.php'; ?>
NOTE : the vendor Phakefile is not autoloaded, as it would be useless and annoying in every part of your project, except for the build configuration. So, include it manually only in this one place.
Now you can see the liset of available build targets by running:
$ ./vendor/bin/phake -T
The output should look something like this:
(in /path/to/your/project)
archive:compress Create ZIP or TAR archive
archive:extract Extract ZIP or TAR archive
builder:init Initialize builder configuration
composer:install Install composer dependencies
composer:update Update composer dependencies
default Default target
dotenv:create Create .env file
dotenv:delete Delete .env file
dotenv:reload Reload settings from .env
file:chgrp Change group ownership on path
file:chmod Change permissions on path
file:chown Change user ownership on path
file:download Download file from URL
file:link Create symbolic link
file:mkdir Create folder
file:mv Rename file or folder
file:process Process template file
file:rm Recursively remove file or folder
file:touch Create empty file or update timestamp of existing
git:changelog Git changelog
git:checkout Git checkout
git:pull Git pull
git:push Git push
mysql:access-file-allow Allow file operation
mysql:access-file-deny Deny file operation
mysql:access-grant Grant access
mysql:access-revoke Revoke access
mysql:connect Test MySQL database connection
mysql:database-create Create database
mysql:database-drop Drop database
mysql:database-import Import database
mysql:find-replace Find and replace across the database
system:service-restart Restart system service
system:service-start Start system service
system:service-stop Stop system service
You can run any of these targets like so:
$ ./vendor/bin/phake mysql:connect
Most of the included build targets require some parameters. You can provide
those parameters via the .env
file. For starters, you can just copy
the provided example file. You can even do so with phake-builder:
$ ./vendor/bin/phake dotenv:create
Alternatively, you can pass parameters from the command line. For example:
$ ./vendor/bin/phake mysql:connect DB_HOST=localhost DB_USER=root
Look through the .env.example
file for some examples and defaults for
parameters. Look through the task definitions in src/Phakefiles/*.php in
vendor/qobo/phake-builder
to see which tasks accept which parameters.
For those cases where you need to run a task several times with different
parameters, you can create your own task, either handling the parameters
differently, or simply calling the PHP functionality directly. Have a look
at the classes in vendor/qobo/phake-builder/src
folder, and associated
unit tests.
Now you are ready to create your own build targets. To keep these visually separate in the list of all, it is recommended that you do so in the 'app' group. Here is an example of such target for your own Phakefile:
<?php require_once 'vendor/qobo/phake-builder/Phakefile.php'; group('app', function() { desc("This is a test"); task('install', 'db:connect', function() { printSuccess('Awesome!'); }); }); ?>
Now you can install your app with:
$ ./vendor/bin/phake app:install
For more information read the documentation for Phake and phpdotenv.