Difference between #1 and #2 of
Yiinitializr: The Library

Revision #2 has been created by Antonio Ramirez on Apr 21, 2013, 9:53:56 AM with the memo:

fix syntax
« previous (#1)

Changes

Title unchanged

Yiinitializr: The Library

Category unchanged

Others

Yii version unchanged

Tags unchanged

yii, yiinitializr, application, configuration

Content changed

<h1>#Introduction</h1> For those who have created a project boilerplate with <a href="http://yiinitializr.2amigos.us/" target="_blank">Yiinitializr site</a>, you will find that is not just a project boilerplate what you just downloaded. Within the boilerplate comes a library named: <a href="http://yiinitializr.2amigos.us/" target="_blank">Yiinitializr</a> (not very original I know). The classes within this tiny library are simple, yet powerful, and will help you build your own project setup, the one that really fits your needs for your <a href="http://www.yiiframework.com" target="_blank">Yii </a>application. <h1>#The Classes Explained</h1>
The <a href="http://yiinitializr.2amigos.us/" target="_blank">Yiinitializr</a> classes will help boost your application installation with ease and also to run <a href="http://www.yiiframework.com" target="_blank">Yii</a> applications from its bootstrap files on a much cleaner way that the framework currently proposes. Let's have a look at the following example:
[...]
))->run();
```
<h2>##Yiinitializr\Cli namespace</h2>
This namespace brings utilities to interact with the terminal or 'cli'. <a href="https://github.com/nramenta/clio">A free beer goes to mr <strong>nramenta</strong> for them</a>.
<h3>Yiinitializr\Cli\Console</h3>
[...]
}
```
<h2>##Yiinitializr\Composer namespace</h2> I should just call this namespace <strong>Tobias Schmunk</strong> as he was the master guru behind this class, the only thing I did was to read the e-book of <strong><a href="http://getcomposer.org">Composer</a></strong> and studied every single piece of his fabulous <a href="http://www.phundament.com/"><strong>Phundament</strong></a> application boilerplate. To modify the class to become of more general usage out of <strong><a href="http://www.phundament.com/">Phundament</a> </strong>has no much credit. Here, we find the Callback class, a super useful class that will allow you to execute commands prior, post <strong>Composer</strong> extensions installations or updates. It makes use of the scripts configuration feature and even though for the current templates found at <strong><a href="http://yiinitializr.2amigos.us">Yiinitializr Site</a></strong> the only thing it does is to call <strong>Yiic migrate</strong> commands but I am sure that you are already thinking of its possibilities. <h2>##Yiinitializr\Helpers namespace</h2>
<h3>Yiinitializer\Helpers\ArrayX</h3>
This class includes cool functions to work with arrays. It contains one cloned from <strong>CMap</strong>, the <strong>mergeArray</strong> function, as we require this method in order to combine the different configuration files before the Yii application is even included. A clear example of it you find it on <strong>Yiinitializr/config/console</strong>, which is the file that where you set the configuration of your console application to run Composer callbacks. It has also
[...]
<li>Automatically merges different configuration files that you may have for the different type of applications - check the <a href="https://github.com/2amigos/yiinitializr/blob/master/Helpers/Initializer.php#L62" target="_blank">config function</a>.</li>
</ol>
<h1>#Final Notes</h1>
We truly hope at <a href="http://2amigos.us" target="_blank">2amigOS!</a> that you find this library as useful as it is for us. We do not expect that this procedure should be implemented at <a href="http://www.yiiframework.com" target="_blank">Yii</a>'s core but some of the features included in this small library are certainly something to consider on its future releases. Happy Yii coding!
<h1 id="hh1">References</h1>
<ul>
<li><a href="http://yiinitializr.2amigos.us/">Yiinitializr</a></li>
<li><a href="https://github.com/2amigos/yiinitializr">Yiinitializr Components</a></li>
[...]
14 0
23 followers
Viewed: 26 997 times
Version: 1.1
Category: Others
Written by: Antonio Ramirez
Last updated by: Antonio Ramirez
Created on: Apr 21, 2013
Last updated: 11 years ago
Update Article

Revisions

View all history