Revision #2 has been created by Antonio Ramirez on Apr 21, 2013, 9:53:56 AM with the memo:
« previous (#1)
Yiinitializr: The Library
yii, yiinitializr, application, configuration
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.
The Classes Explained
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:
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>.
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.
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>
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!
<li><a href="https://github.com/2amigos/yiinitializr">Yiinitializr Components</a></li>