yiinitializr

Library that will help boost your application installation with ease and also to run Yii applications from its bootstrap files on a much cleaner way that the framework currently proposes.

  • 所有者: 2amigos/yiinitializr
  • 平台:
  • 許可證: Other
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

IMPORTANT

DEPRECATED. At 2amigos we are not longer supporting Yii 1. We highly recommend you to adopt Yii 2 as soon as possible.

Yiinitializr

Library that will help boost your application installation with ease and also to run Yii applications from its
bootstrap files on a much cleaner way that the framework currently proposes. For example:


// if installed via composer
require('./../../common/lib/vendor/autoload.php');

Yiinitializr\Helpers\Initializer::create('./../', 'frontend', array(
	__DIR__ .'/../../common/config/main.php',
	__DIR__ .'/../../common/config/env.php',
	__DIR__ .'/../../common/config/local.php'
))->run();

##How to use it
If you are going to use Yiinitializr to make use of Yiinitializr\Helpers\Initializr you can easily install it via
composer, but if you are going to use it within your application structure in order to configure your application
according to your custom needs, then the recommended use is that you download
its source files and place them on a top level folder.

###Configuration Settings
As with Yii, you need to go through a bit of configuration settings if you wish to handle your project structure setup
with composer. Don't worry, is not going to be too hard, the following is an example configuration file:

\\ where am i?
$dirname = dirname(__FILE__);
\\ where is the application folder?
$app = $dirname . '/../../..';
\\ where is the root?
$root = $app . '/..';

return array(
    // yii configurations
	'yii' => array(
		// where is the path of the yii framework?
		// On this example we have installed yii with composer
		// and as it is used after composer installation, we 
		// can safely point to the vendor folder.
		'path' => $app . '/lib/vendor/yiisoft/yii/framework'
	),
	// yiinitializr specific settings
	'yiinitializr' => array(
	    // config folders
		'config' => array(
		    // we just need the console settings
		    // On this example, and due that I used environments
		    // i created a custom console.php app for 
		    // Yiinitializr\Composer\Callbak class (see below example)
			'console' => $dirname . '/console.php'
		),
		// application structure settings
		'app' => array(
			// where is the root?
			'root' => $root,
			// directories setup
			'directories' => array(
				// where are the different configuration files settings?
				'config' => array(
					// 'key' is the configuration name (see above init example)
					'main' => $app . '/config',
					'console' => $app . '/config',
					'test' => $app . '/config'
				),
				// where are my runtime folders?
				'runtime' => array(
					// heads up! only the folder location as "/config" will be 
					// appended
					$app
				),
				'assets' => array(
					// where to write the "assets folders"?
					$root . '/www'
				)
			),
			'files' => array(
				// files to merge the main configuration file with
				// initializr will merge it automatically
				'config' => array(
					'main' => array('env', 'local'),
					'console' => array('env', 'local'),
				)
			)		
		),
	)
);

Here is an example of a custom console.php settings file when working with environments. As you saw on the previous
code, this file on the example was located on the same Yiinitializr\config folder:

require_once dirname(__FILE__) . '/../Helpers/Initializer.php';
require_once dirname(__FILE__) . '/../Helpers/ArrayX.php';

return Yiinitializr\Helpers\ArrayX::merge(
	Yiinitializr\Helpers\Initializer::config('console', array('common', 'env', 'local')),
	array(
		'params' => array(
			// here is where the composer magic start.
			// Thanks! mr Tobias a.k.a Phundament man!
			'composer.callbacks' => array(
				'post-update' => array('yiic', 'migrate'),
				'post-install' => array('yiic', 'migrate'),
			)
		),
	)
);

####Examples

###Requirements
It works in conjunction with composer to install the boilerplate but
The minimum requirements by Yiinitializr that you have installed composer or have a composer.phar on your application
root in order to run and ** PHP 5.3+**

###Resources

2amigOS!
web development has never been so fun
www.2amigos.us

主要指標

概覽
名稱與所有者2amigos/yiinitializr
主編程語言PHP
編程語言PHP (語言數: 1)
平台
許可證Other
所有者活动
創建於2013-03-28 11:07:17
推送於2017-12-06 04:52:33
最后一次提交2017-12-06 05:52:33
發布數1
最新版本名稱1.0.1 (發布於 2013-04-23 19:28:45)
第一版名稱1.0.1 (發布於 2013-04-23 19:28:45)
用户参与
星數43
關注者數16
派生數16
提交數28
已啟用問題?
問題數21
打開的問題數10
拉請求數5
打開的拉請求數0
關閉的拉請求數2
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?