Browse Source

Fixes issue #439

tags/2.0.0-beta
Qiang Xue 12 years ago
parent
commit
2553e9a043
  1. 28
      apps/advanced/README.md
  2. 2
      apps/advanced/backstage/config/main.php
  3. 3
      apps/advanced/composer.json
  4. 2
      apps/advanced/console/config/main.php
  5. 2
      apps/advanced/frontend/config/main.php
  6. 14
      apps/advanced/init
  7. 0
      apps/advanced/init.bat

28
apps/advanced/README.md

@ -67,32 +67,32 @@ If you do not have [Composer](http://getcomposer.org/), you may download it from
curl -s http://getcomposer.org/installer | php curl -s http://getcomposer.org/installer | php
~~~ ~~~
You can then install the Bootstrap Application using the following command: You can then install the application using the following command:
~~~ ~~~
php composer.phar create-project --stability=dev yiisoft/yii2-app-advanced yii-advanced php composer.phar create-project --stability=dev yiisoft/yii2-app-advanced yii-advanced
~~~ ~~~
Now you should be able to access:
- the frontend using the URL `http://localhost/yii-advanced/frontend/www/`
- the backstage using the URL `http://localhost/yii-advanced/backstage/www/`
assuming `yii-advanced` is directly under the document root of your Web server.
### Install from an Archive File ### Install from an Archive File
This is not currently available. We will provide it when Yii 2 is formally released. This is not currently available. We will provide it when Yii 2 is formally released.
GETTING STARTED GETTING STARTED
--------------- ---------------
After template application and its dependencies are downloaded you need to initialize it and set some config values to After you install the application, you have to conduct the following steps to initialize
match your application requirements. the installed application. You only need to do these once for all.
1. Execute `install` command selecting `dev` as environment. 1. Execute the `init` command and select `dev` as environment.
2. Set `id` value in `console/config/main.php`, `frontend/config/main.php`, `backstage/config/main.php`. 2. Create a new database. It is assumed that MySQL InnoDB is used. If not, adjust `console/migrations/m130524_201442_init.php`.
3. Create new database. It is assumed that MySQL InnoDB is used. If not, adjust `console/migrations/m130524_201442_init.php`. 3. In `common/config/params.php` set your database details in `components.db` values.
4. In `common/config/params.php` set your database details in `components.db` values.
Now you should be able to access:
- the frontend using the URL `http://localhost/yii-advanced/frontend/www/`
- the backstage using the URL `http://localhost/yii-advanced/backstage/www/`
assuming `yii-advanced` is directly under the document root of your Web server.

2
apps/advanced/backstage/config/main.php

@ -9,7 +9,7 @@ $params = array_merge(
); );
return array( return array(
'id' => 'change-me', 'id' => 'app-backend',
'basePath' => dirname(__DIR__), 'basePath' => dirname(__DIR__),
'vendorPath' => dirname(dirname(__DIR__)) . '/vendor', 'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
'preload' => array('log'), 'preload' => array('log'),

3
apps/advanced/composer.json

@ -36,9 +36,6 @@
"frontend/runtime", "frontend/runtime",
"frontend/www/assets" "frontend/www/assets"
],
"yii-install-executable": [
"yii"
] ]
} }
} }

2
apps/advanced/console/config/main.php

@ -9,7 +9,7 @@ $params = array_merge(
); );
return array( return array(
'id' => 'change-me', 'id' => 'app-console',
'basePath' => dirname(__DIR__), 'basePath' => dirname(__DIR__),
'vendorPath' => dirname(dirname(__DIR__)) . '/vendor', 'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
'preload' => array('log'), 'preload' => array('log'),

2
apps/advanced/frontend/config/main.php

@ -9,7 +9,7 @@ $params = array_merge(
); );
return array( return array(
'id' => 'change-me', 'id' => 'app-frontend',
'basePath' => dirname(__DIR__), 'basePath' => dirname(__DIR__),
'vendorPath' => dirname(dirname(__DIR__)) . '/vendor', 'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
'preload' => array('log'), 'preload' => array('log'),

14
apps/advanced/install → apps/advanced/init

@ -4,27 +4,27 @@ $root = str_replace('\\', '/', __DIR__);
$envs = require("$root/environments/index.php"); $envs = require("$root/environments/index.php");
$envNames = array_keys($envs); $envNames = array_keys($envs);
echo "Yii Application Installation Tool v1.0\n\n"; echo "Yii Application Init Tool v1.0\n\n";
echo "Which environment do you want to install the application to?\n\n"; echo "Which environment do you want the application to be initialized in?\n\n";
foreach ($envNames as $i => $name) { foreach ($envNames as $i => $name) {
echo " [$i] $name\n"; echo " [$i] $name\n";
} }
echo "\n Your choice [0-" . (count($envs) - 1) . ', or "q" to quit] '; echo "\n Your choice [0-" . (count($envs) - 1) . ', or "q" to quit] ';
$answer = trim(fgets(STDIN)); $answer = trim(fgets(STDIN));
if (!ctype_digit($answer) || !isset($envNames[$answer])) { if (!ctype_digit($answer) || !isset($envNames[$answer])) {
echo "\n Quit installation.\n"; echo "\n Quit initialization.\n";
return; return;
} }
$env = $envs[$envNames[$answer]]; $env = $envs[$envNames[$answer]];
echo "\n Install the application under '{$envNames[$answer]}' environment? [yes|no] "; echo "\n Initialize the application under '{$envNames[$answer]}' environment? [yes|no] ";
$answer = trim(fgets(STDIN)); $answer = trim(fgets(STDIN));
if (strncasecmp($answer, 'y', 1)) { if (strncasecmp($answer, 'y', 1)) {
echo "\n Quit installation.\n"; echo "\n Quit initialization.\n";
return; return;
} }
echo "\n Start installation ...\n\n"; echo "\n Start initialization ...\n\n";
$files = getFileList("$root/environments/{$env['path']}"); $files = getFileList("$root/environments/{$env['path']}");
$all = false; $all = false;
foreach ($files as $file) { foreach ($files as $file) {
@ -47,7 +47,7 @@ if (isset($env['executable'])) {
} }
} }
echo "\n ... installation completed.\n\n"; echo "\n ... initialization completed.\n\n";
function getFileList($root, $basePath = '') function getFileList($root, $basePath = '')
{ {

0
apps/advanced/install.bat → apps/advanced/init.bat

Loading…
Cancel
Save