All Projects → yii2tech → install

yii2tech / install

Licence: other
basic script for project installation

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to install

Crontab
Yii2 extension for crontab support
Stars: ✭ 170 (+900%)
Mutual labels:  yii2, yii, yii2-extension
Yii2 Schemadump
Generate the schema from an existing database.
Stars: ✭ 78 (+358.82%)
Mutual labels:  yii2, yii, yii2-extension
yii2-facades
Facades for Yii 2
Stars: ✭ 21 (+23.53%)
Mutual labels:  yii2, yii, yii2-extension
filedb
ActiveRecord for static data definitions based on files
Stars: ✭ 72 (+323.53%)
Mutual labels:  yii2, yii, yii2-extension
Ar Softdelete
Soft delete behavior for ActiveRecord
Stars: ✭ 188 (+1005.88%)
Mutual labels:  yii2, yii, yii2-extension
Yii2 Assets Auto Compress
Automatic compilation of js + css + html
Stars: ✭ 147 (+764.71%)
Mutual labels:  yii2, yii, yii2-extension
Sitemap
Site map creation support
Stars: ✭ 59 (+247.06%)
Mutual labels:  yii2, yii, yii2-extension
ar-role
ActiveRecord behavior, which provides relation roles (table inheritance)
Stars: ✭ 34 (+100%)
Mutual labels:  yii2, yii, yii2-extension
Yii2 Aws S3
An Amazon S3 component for Yii2
Stars: ✭ 86 (+405.88%)
Mutual labels:  yii2, yii, yii2-extension
Ar Linkmany
ActiveRecord behavior for saving many-to-many relations
Stars: ✭ 83 (+388.24%)
Mutual labels:  yii2, yii, yii2-extension
ar-dynattribute
Provide ActiveRecord dynamic attributes stored into the single field in serialized state
Stars: ✭ 43 (+152.94%)
Mutual labels:  yii2, yii, yii2-extension
Ar Position
ActiveRecord behavior, which provides ability for custom records order setup
Stars: ✭ 107 (+529.41%)
Mutual labels:  yii2, yii, yii2-extension
ar-variation
Variation behavior for ActiveRecord
Stars: ✭ 46 (+170.59%)
Mutual labels:  yii2, yii, yii2-extension
Balance
Balance accounting (bookkeeping) system based on debit and credit principle
Stars: ✭ 162 (+852.94%)
Mutual labels:  yii2, yii, yii2-extension
yii2-presenter
Yii2 View Presenter
Stars: ✭ 13 (-23.53%)
Mutual labels:  yii2, yii, yii2-extension
Config
Yii2 application runtime configuration support
Stars: ✭ 54 (+217.65%)
Mutual labels:  yii2, yii, yii2-extension
behavior-trait
Allows handling events via inline declared methods, which can be added by traits
Stars: ✭ 18 (+5.88%)
Mutual labels:  yii2, yii, yii2-extension
yii2-formbuilder
A drag and drop form builder with jQuery for Yii2
Stars: ✭ 33 (+94.12%)
Mutual labels:  yii2, yii, yii2-extension
Csv Grid
Yii2 extension for CSV export
Stars: ✭ 83 (+388.24%)
Mutual labels:  yii2, yii, yii2-extension
Admin
Admin pack (actions, widgets, etc) for Yii2
Stars: ✭ 100 (+488.24%)
Mutual labels:  yii2, yii, yii2-extension

Install Extension for Yii 2


This extension provides ability for automated initialization of the project working copy, including local directories and files creation, running DB migrations and so on.

For license information check the LICENSE-file.

Latest Stable Version Total Downloads Build Status

Requirements

This extension requires Linux OS.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist yii2tech/install

or add

"yii2tech/install": "*"

to the require section of your composer.json.

If you wish to setup crontab during project installation, you will also need to install yii2tech/crontab, which is not required by default. In order to do so either run

php composer.phar require --prefer-dist yii2tech/crontab

or add

"yii2tech/crontab": "*"

to the require section of your composer.json.

Usage

This extension provides special console controller [[yii2tech\install\InitController]], which allows initialization of the project working copy. Such initialization includes:

  • check if current environment matches project requirements.
  • create local directories (the ones, which may be not stored in version control system) and make them write-able.
  • create local files, such as configuration files, from templates.
  • run extra shell commands, like 'yii migrate' command.
  • setup cron jobs.

In order to create an installer, you should create a separated console application entry script. This script should be absolutely stripped from the local configuration files, database and so on! See examples/install.php for the example of such script.

Once you have such script you can run installation process, using following command:

php install.php init

Working with local files

The most interesting feature introduced by [[yii2tech\install\InitController]] is creating local project files, such as configuration files, from thier examples in interactive mode. For each file, which content may vary depending on actual project environment, you should create a template file named in format {filename}.sample. This file should be located under the same directory, where the actual local file should appear. Inside the template file you can use placeholders in format: {{placeholderName}}. For example:

defined('YII_DEBUG') or define('YII_DEBUG', {{yiiDebug}});
defined('YII_ENV') or define('YII_ENV', '{{yiiEnv}}');

return [
    'components' => [
        'db' => [
            'dsn' => 'mysql:host={{dbHost}};dbname={{dbName}}',
            'username' => '{{dbUser}}',
            'password' => '{{dbPassword}}',
        ],
    ],
];

While being processed, file templates are parsed, and for all found placeholders user will be asked to enter a value for them. You can make this process more user-friendly by setting [[yii2tech\install\InitController::localFilePlaceholders]], specifying hints, type and validation rules. See [[yii2tech\install\LocalFilePlaceholder]] for more details.

Non interactive installation

Asking user for particular placeholder value may be not efficient and sometimes not acceptable. You may need to run project intallation in fully automatic mode without user input, for example after updating source code from version control system inside automatic project update. In order to disable any user-interaction, you should use interactive option:

php install.php init --interactive=0

In this mode for all local file placeholders the default values will be taken, but only in case such values are explicitely defined via [[yii2tech\install\InitController::localFilePlaceholders]]. Because install entry script usually stored under version control system and local file placeholder values (as well as other installation parameters) may vary depending on particular environment, [[yii2tech\install\InitController]] instroduce 'config' option. Using this option you may specify extra configuration file, which should be merged with predefined parameters. In order to create such configuration file, you can use following:

php install.php init/config @app/config/install.php

Once you have adjusted created configuration file, you can run installation with it:

php install.php init --config=@app/config/install.php --interactive=0
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].