dgncan / init
There is no license information available for the latest version (0.6.1) of this package.
Initialize Script
0.6.1
2020-02-07 11:02 UTC
Requires
- symfony/console: ^3.4
Requires (Dev)
This package is auto-updated.
Last update: 2024-09-11 20:10:07 UTC
README
Init is a console application that helps to make for php projects first configuration and publish etc.
Key Features
- Update Assets
- Setting ini file
- Updating http conf
- Setting file permissions
- Runs sample tasks.
Installation
To install Init by using Composer:
$ composer require dgncan/init "^0.6"
Example composer.json file:
{ "require": { "dgncan/init": "^0.6", } }
Usage
Create an init.php file with the following contents:
<?php require_once __DIR__.'/vendor/dgncan/init/src/functions.php'; return [ 'application-name'=>'example-project', // required 'update-assets'=> [ // sample items. look example-project folder for detail example 'Update adminlte-minimal'=>[ 'vendor'=>'/vendor/dgncan/adminlte-minimal', 'public'=>'/public/adminlte', 'files' => [ '/dist/css/AdminLTE.min.css', '/dist/css/skins/_all-skins.min.css', ] ] ], 'update-tasks'=> [ 'Sample dummy process'=> function ($args) { print_r($args); echo "sample dummy processed\n"; }, /* //for sample use only. 'minify css/custom-style.css'=> function () { $cmd = "php vendor/tubalmartin/cssmin/cssmin -i " . getcwd() . "/public/css/custom-style.css -o " . getcwd() . "/public/css/custom-style.min.css -R"; system($cmd, $r); if ($r == 1) { throw new Exception("Fail cmd:" . $cmd); } } */ ], 'update-http-conf'=> [ 'confPath'=> [ 'local'=>'.', // optional for example: /usr/local/httpd_docs/conf/ 'test'=>'/work/test/conf/', // optional 'preprod'=>'/work/preprod/conf/', // optional 'prod'=>'/work/prod/conf/' // optional ] ], 'prod-ini-file' => '/sensitive-data-location-path/init/prod.ini', // optional 'permission' => [ 'chown'=>'www.www', // optional 'chmod'=>'755' // optional ] ];
Or to create empty init.php :
vendor/bin/init init
Example Project
Please look example-project folder to see example project skeleton.