yiinitializr-advanced

Yii Framework project structure boilerplate for advanced application requirements

  • 所有者: tonydspaniard/yiinitializr-advanced
  • 平台:
  • 許可證:
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

YIInitializr-advanced

The following is a proposed project structure for advanced applications that works in conjunction with YIInitializr components.

YIInitializr vanilla projects make extensive use of Composer. We found at 2amigos.us that is easier to your extensions bundle outside of your application scope - thanks to Phundament and Tobias Munk for his knowledge and shares. Composer is your dependency package best friend.

The package is cleaned from extensions, you choose what you wish to include in your composer.json files. The only ones included are Yii Framework (obviously), YiiStrap and YiiWheels, the rest is up to you. We do not want to confuse you.

Setup and first run

  • Set up Git by following the instructions here.
  • Update the configurations in api/config/, frontend/config/, console/config/, backend/config/ and common/config/ to suit your needs. The common/config/main.php is configured to use sqllite by default. Change your common/config/env/dev.php to suit your database requirements.
  • Composer is required The package includes already a composer.phar file.
  • Browse through the composer.json and remove the dependencies you don't need also update the required versions of the extensions.
  • If you have composer installed globally:
    • Run composer self-update to make sure you have the latest version of composer.
    • Run composer install to download all the dependencies.
  • If you work the composer.phar library within the project boilerplate.
    • Run php composer.phar self-update to make sure you have the latest version of composer.
    • Run php composer.phar install to download all the dependencies.
  • Yiinitializr\Composer\Callback will configure everything required on your application: runtime and assets folders and migrations.

####Important
When you first run install and after the deployment script installs the dependencies, creates your runtime and assets folders, it will ask you for your environment. Make sure you use "dev" for your local development settings and "stage" or "prod" for their respective environment types. Also, is important that the files are actually there, do not say "master" without "master.php" not being actually there.

For more information about using Composer please see its documentation.

###How to configure the application

This boilerplate is very similar to YiiBoilerplate but differs from it for the easiness of its configuration. We focused to release the pain of configuring your application and combine your configuration files. Yiinitializr\Helpers\Initializr is very easy to use, check for example the bootstrap index.php file at the frontend:

require('./../../common/lib/vendor/autoload.php');
require('./../../common/lib/vendor/yiisoft/yii/framework/yii.php');

Yii::setPathOfAlias('Yiinitializr', './../../common/lib/Yiinitializr');

use Yiinitializr\Helpers\Initializer;

Initializer::create('./../', 'frontend', array(
	__DIR__ .'/../../common/config/main.php', // files to merge with
	__DIR__ .'/../../common/config/env.php',
	__DIR__ .'/../../common/config/local.php',
))->run();

For more information about Yiinitializr please check it at its github repo.

Overall Structure

Bellow the directory structure used:

  

Extensions

The following extensions are part of YIInitializr-basic template:

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

主要指標

概覽
名稱與所有者tonydspaniard/yiinitializr-advanced
主編程語言PHP
編程語言PHP (語言數: 5)
平台
許可證
所有者活动
創建於2013-04-09 13:52:53
推送於2019-05-02 17:19:00
最后一次提交2019-05-02 19:18:58
發布數1
最新版本名稱v1.0 (發布於 )
第一版名稱v1.0 (發布於 )
用户参与
星數66
關注者數16
派生數29
提交數51
已啟用問題?
問題數23
打開的問題數12
拉請求數11
打開的拉請求數0
關閉的拉請求數0
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?