Commit ab47d58c by Qiang Xue

path fixes.

parent 0c386552
...@@ -3,7 +3,7 @@ defined('YII_DEBUG') or define('YII_DEBUG', true); ...@@ -3,7 +3,7 @@ defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev'); defined('YII_ENV') or define('YII_ENV', 'dev');
require(__DIR__ . '/../../vendor/autoload.php'); require(__DIR__ . '/../../vendor/autoload.php');
require(__DIR__ . '/../../vendor/yiisoft/yii2/yii/Yii.php'); require(__DIR__ . '/../../vendor/yiisoft/yii2/Yii.php');
$config = yii\helpers\ArrayHelper::merge( $config = yii\helpers\ArrayHelper::merge(
require(__DIR__ . '/../config/main.php'), require(__DIR__ . '/../config/main.php'),
......
...@@ -3,7 +3,7 @@ defined('YII_DEBUG') or define('YII_DEBUG', true); ...@@ -3,7 +3,7 @@ defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev'); defined('YII_ENV') or define('YII_ENV', 'dev');
require(__DIR__ . '/../../vendor/autoload.php'); require(__DIR__ . '/../../vendor/autoload.php');
require(__DIR__ . '/../../vendor/yiisoft/yii2/yii/Yii.php'); require(__DIR__ . '/../../vendor/yiisoft/yii2/Yii.php');
$config = yii\helpers\ArrayHelper::merge( $config = yii\helpers\ArrayHelper::merge(
require(__DIR__ . '/../config/main.php'), require(__DIR__ . '/../config/main.php'),
......
...@@ -15,7 +15,7 @@ defined('YII_ENV') or define('YII_ENV', 'dev'); ...@@ -15,7 +15,7 @@ defined('YII_ENV') or define('YII_ENV', 'dev');
defined('STDIN') or define('STDIN', fopen('php://stdin', 'r')); defined('STDIN') or define('STDIN', fopen('php://stdin', 'r'));
require(__DIR__ . '/vendor/autoload.php'); require(__DIR__ . '/vendor/autoload.php');
require(__DIR__ . '/vendor/yiisoft/yii2/yii/Yii.php'); require(__DIR__ . '/vendor/yiisoft/yii2/Yii.php');
$config = yii\helpers\ArrayHelper::merge( $config = yii\helpers\ArrayHelper::merge(
require(__DIR__ . '/console/config/main.php'), require(__DIR__ . '/console/config/main.php'),
......
...@@ -3,7 +3,7 @@ defined('YII_DEBUG') or define('YII_DEBUG', false); ...@@ -3,7 +3,7 @@ defined('YII_DEBUG') or define('YII_DEBUG', false);
defined('YII_ENV') or define('YII_ENV', 'prod'); defined('YII_ENV') or define('YII_ENV', 'prod');
require(__DIR__ . '/../../vendor/autoload.php'); require(__DIR__ . '/../../vendor/autoload.php');
require(__DIR__ . '/../../vendor/yiisoft/yii2/yii/Yii.php'); require(__DIR__ . '/../../vendor/yiisoft/yii2/Yii.php');
$config = yii\helpers\ArrayHelper::merge( $config = yii\helpers\ArrayHelper::merge(
require(__DIR__ . '/../config/main.php'), require(__DIR__ . '/../config/main.php'),
......
...@@ -3,7 +3,7 @@ defined('YII_DEBUG') or define('YII_DEBUG', false); ...@@ -3,7 +3,7 @@ defined('YII_DEBUG') or define('YII_DEBUG', false);
defined('YII_ENV') or define('YII_ENV', 'prod'); defined('YII_ENV') or define('YII_ENV', 'prod');
require(__DIR__ . '/../../vendor/autoload.php'); require(__DIR__ . '/../../vendor/autoload.php');
require(__DIR__ . '/../../vendor/yiisoft/yii2/yii/Yii.php'); require(__DIR__ . '/../../vendor/yiisoft/yii2/Yii.php');
$config = yii\helpers\ArrayHelper::merge( $config = yii\helpers\ArrayHelper::merge(
require(__DIR__ . '/../config/main.php'), require(__DIR__ . '/../config/main.php'),
......
...@@ -15,7 +15,7 @@ defined('YII_ENV') or define('YII_ENV', 'prod'); ...@@ -15,7 +15,7 @@ defined('YII_ENV') or define('YII_ENV', 'prod');
defined('STDIN') or define('STDIN', fopen('php://stdin', 'r')); defined('STDIN') or define('STDIN', fopen('php://stdin', 'r'));
require(__DIR__ . '/vendor/autoload.php'); require(__DIR__ . '/vendor/autoload.php');
require(__DIR__ . '/vendor/yiisoft/yii2/yii/Yii.php'); require(__DIR__ . '/vendor/yiisoft/yii2/Yii.php');
$config = yii\helpers\ArrayHelper::merge( $config = yii\helpers\ArrayHelper::merge(
require(__DIR__ . '/console/config/main.php'), require(__DIR__ . '/console/config/main.php'),
......
...@@ -13,7 +13,7 @@ defined('YII_ENV') or define('YII_ENV', 'test'); ...@@ -13,7 +13,7 @@ defined('YII_ENV') or define('YII_ENV', 'test');
require_once(__DIR__ . '/../vendor/autoload.php'); require_once(__DIR__ . '/../vendor/autoload.php');
require_once(__DIR__ . '/../vendor/yiisoft/yii2/yii/Yii.php'); require_once(__DIR__ . '/../vendor/yiisoft/yii2/Yii.php');
// set correct script paths // set correct script paths
$_SERVER['SCRIPT_FILENAME'] = TEST_ENTRY_FILE; $_SERVER['SCRIPT_FILENAME'] = TEST_ENTRY_FILE;
......
...@@ -9,7 +9,7 @@ defined('YII_DEBUG') or define('YII_DEBUG', true); ...@@ -9,7 +9,7 @@ defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'test'); defined('YII_ENV') or define('YII_ENV', 'test');
require(__DIR__ . '/../vendor/autoload.php'); require(__DIR__ . '/../vendor/autoload.php');
require(__DIR__ . '/../vendor/yiisoft/yii2/yii/Yii.php'); require(__DIR__ . '/../vendor/yiisoft/yii2/Yii.php');
$config = require(__DIR__ . '/../tests/acceptance/_config.php'); $config = require(__DIR__ . '/../tests/acceptance/_config.php');
......
...@@ -5,7 +5,7 @@ defined('YII_DEBUG') or define('YII_DEBUG', true); ...@@ -5,7 +5,7 @@ defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev'); defined('YII_ENV') or define('YII_ENV', 'dev');
require(__DIR__ . '/../vendor/autoload.php'); require(__DIR__ . '/../vendor/autoload.php');
require(__DIR__ . '/../vendor/yiisoft/yii2/yii/Yii.php'); require(__DIR__ . '/../vendor/yiisoft/yii2/Yii.php');
$config = require(__DIR__ . '/../config/web.php'); $config = require(__DIR__ . '/../config/web.php');
......
...@@ -14,7 +14,7 @@ defined('YII_DEBUG') or define('YII_DEBUG', true); ...@@ -14,7 +14,7 @@ defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('STDIN') or define('STDIN', fopen('php://stdin', 'r')); defined('STDIN') or define('STDIN', fopen('php://stdin', 'r'));
require(__DIR__ . '/vendor/autoload.php'); require(__DIR__ . '/vendor/autoload.php');
require(__DIR__ . '/vendor/yiisoft/yii2/yii/Yii.php'); require(__DIR__ . '/vendor/yiisoft/yii2/Yii.php');
$config = require(__DIR__ . '/config/console.php'); $config = require(__DIR__ . '/config/console.php');
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
defined('YII_DEBUG') or define('YII_DEBUG', false); defined('YII_DEBUG') or define('YII_DEBUG', false);
require(__DIR__ . '/protected/vendor/yiisoft/yii2/yii/Yii.php'); require(__DIR__ . '/protected/vendor/yiisoft/yii2/Yii.php');
$config = [ $config = [
'id' => 'benchmark', 'id' => 'benchmark',
......
...@@ -13,7 +13,7 @@ defined('STDIN') or define('STDIN', fopen('php://stdin', 'r')); ...@@ -13,7 +13,7 @@ defined('STDIN') or define('STDIN', fopen('php://stdin', 'r'));
define('YII_DEBUG', true); define('YII_DEBUG', true);
require(__DIR__ . '/../framework/yii/Yii.php'); require(__DIR__ . '/../framework/Yii.php');
$application = new yii\console\Application([ $application = new yii\console\Application([
'id' => 'yii-build', 'id' => 'yii-build',
......
...@@ -44,7 +44,7 @@ class PhpDocController extends Controller ...@@ -44,7 +44,7 @@ class PhpDocController extends Controller
$except = []; $except = [];
if ($root === null) { if ($root === null) {
$root = dirname(dirname(YII_PATH)); $root = dirname(dirname(YII_PATH));
$extensionPath = "$root/extensions/yii"; $extensionPath = "$root/extensions";
foreach (scandir($extensionPath) as $extension) { foreach (scandir($extensionPath) as $extension) {
if (ctype_alpha($extension) && is_dir($extensionPath . '/' . $extension)) { if (ctype_alpha($extension) && is_dir($extensionPath . '/' . $extension)) {
Yii::setAlias("@yii/$extension", "$extensionPath/$extension"); Yii::setAlias("@yii/$extension", "$extensionPath/$extension");
...@@ -55,7 +55,7 @@ class PhpDocController extends Controller ...@@ -55,7 +55,7 @@ class PhpDocController extends Controller
'/apps/', '/apps/',
'/build/', '/build/',
'/docs/', '/docs/',
'/extensions/yii/composer/', '/extensions/composer/',
'/tests/', '/tests/',
'/vendor/', '/vendor/',
]; ];
......
...@@ -206,7 +206,7 @@ Storing RBAC hierarchy in database is less efficient performancewise but is much ...@@ -206,7 +206,7 @@ Storing RBAC hierarchy in database is less efficient performancewise but is much
a good management UI for it so in case you need permissions structure that is managed by end user DB is your choice. a good management UI for it so in case you need permissions structure that is managed by end user DB is your choice.
In order to get started you need to configure database connection in `db` component. After it is done [get `schema-*.sql` In order to get started you need to configure database connection in `db` component. After it is done [get `schema-*.sql`
file for your database](https://github.com/yiisoft/yii2/tree/master/framework/yii/rbac) and execute it. file for your database](https://github.com/yiisoft/yii2/tree/master/framework/rbac) and execute it.
Next step is to configure `authManager` application component in application config file (`web.php` or `main.php` Next step is to configure `authManager` application component in application config file (`web.php` or `main.php`
depending on template you've used): depending on template you've used):
......
...@@ -112,4 +112,4 @@ Auto-generating fixtures ...@@ -112,4 +112,4 @@ Auto-generating fixtures
Yii also can auto-generate fixtures for you based on some template. You can generate your fixtures with different data on different languages and formats. Yii also can auto-generate fixtures for you based on some template. You can generate your fixtures with different data on different languages and formats.
These feature is done by [Faker](https://github.com/fzaninotto/Faker) library and `yii2-faker` extension. These feature is done by [Faker](https://github.com/fzaninotto/Faker) library and `yii2-faker` extension.
See extension [guide](https://github.com/yiisoft/yii2/tree/master/extensions/yii/faker) for more docs. See extension [guide](https://github.com/yiisoft/yii2/tree/master/extensions/faker) for more docs.
...@@ -45,7 +45,7 @@ defined('YII_DEBUG') or define('YII_DEBUG', true); ...@@ -45,7 +45,7 @@ defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('STDIN') or define('STDIN', fopen('php://stdin', 'r')); defined('STDIN') or define('STDIN', fopen('php://stdin', 'r'));
require(__DIR__ . '/vendor/autoload.php'); require(__DIR__ . '/vendor/autoload.php');
require(__DIR__ . '/vendor/yiisoft/yii2/yii/Yii.php'); require(__DIR__ . '/vendor/yiisoft/yii2/Yii.php');
$config = require(__DIR__ . '/config/console.php'); $config = require(__DIR__ . '/config/console.php');
......
...@@ -12,9 +12,9 @@ that are actually visible to end user such as validation errors. ...@@ -12,9 +12,9 @@ that are actually visible to end user such as validation errors.
In order to start with message translation: In order to start with message translation:
1. Check `framework/yii/messages/config.php` and make sure your language is listed in `languages`. 1. Check `framework/messages/config.php` and make sure your language is listed in `languages`.
2. Go to `framework/yii` and run `yii message/extract messages/config.php`. 2. Go to `framework` and run `yii message/extract messages/config.php`.
3. Translate messages in `framework/yii/messages/your_language/yii.php`. Make sure file is saved using UTF-8 encoding. 3. Translate messages in `framework/messages/your_language/yii.php`. Make sure file is saved using UTF-8 encoding.
4. [Make a pull request](https://github.com/yiisoft/yii2/blob/master/docs/internals/git-workflow.md). 4. [Make a pull request](https://github.com/yiisoft/yii2/blob/master/docs/internals/git-workflow.md).
In order to keep your translation up to date you may run `yii message/extract messages/config.php` again. It will In order to keep your translation up to date you may run `yii message/extract messages/config.php` again. It will
......
...@@ -26,8 +26,8 @@ $yiiDirs = [ ...@@ -26,8 +26,8 @@ $yiiDirs = [
__DIR__ . '/../../../../yiisoft/yii2', // script is installed as a composer binary __DIR__ . '/../../../../yiisoft/yii2', // script is installed as a composer binary
]; ];
foreach($yiiDirs as $dir) { foreach($yiiDirs as $dir) {
if (file_exists($dir . '/yii/Yii.php')) { if (file_exists($dir . '/Yii.php')) {
require($dir . '/yii/Yii.php'); require($dir . '/Yii.php');
break; break;
} }
} }
......
...@@ -203,7 +203,7 @@ class Installer extends LibraryInstaller ...@@ -203,7 +203,7 @@ class Installer extends LibraryInstaller
* @license http://www.yiiframework.com/license/ * @license http://www.yiiframework.com/license/
*/ */
return require(__DIR__ . '/../../yii2-dev/framework/yii/$file'); return require(__DIR__ . '/../../yii2-dev/framework/$file');
EOF EOF
); );
......
...@@ -12,19 +12,19 @@ ...@@ -12,19 +12,19 @@
</testsuites> </testsuites>
<filter> <filter>
<blacklist> <blacklist>
<file>framework/yii/helpers/Json.php</file> <file>framework/helpers/Json.php</file>
<file>framework/yii/helpers/StringHelper.php</file> <file>framework/helpers/StringHelper.php</file>
<file>framework/yii/helpers/VarDumper.php</file> <file>framework/helpers/VarDumper.php</file>
<file>framework/yii/helpers/Html.php</file> <file>framework/helpers/Html.php</file>
<file>framework/yii/helpers/Inflector.php</file> <file>framework/helpers/Inflector.php</file>
<file>framework/yii/helpers/FileHelper.php</file> <file>framework/helpers/FileHelper.php</file>
<file>framework/yii/helpers/ArrayHelper.php</file> <file>framework/helpers/ArrayHelper.php</file>
<file>framework/yii/helpers/Console.php</file> <file>framework/helpers/Console.php</file>
<file>framework/yii/i18n/GettextFile.php</file> <file>framework/i18n/GettextFile.php</file>
<file>framework/yii/web/ResponseFormatterInterface.php</file> <file>framework/web/ResponseFormatterInterface.php</file>
<directory suffix="Exception.php">framework/yii/base</directory> <directory suffix="Exception.php">framework/base</directory>
<directory suffix=".php">framework/yii/db/mssql</directory> <directory suffix=".php">framework/db/mssql</directory>
<directory suffix=".php">framework/yii/bootstrap</directory> <directory suffix=".php">framework/bootstrap</directory>
</blacklist> </blacklist>
</filter> </filter>
</phpunit> </phpunit>
...@@ -13,7 +13,7 @@ $composerAutoload = __DIR__ . '/../../vendor/autoload.php'; ...@@ -13,7 +13,7 @@ $composerAutoload = __DIR__ . '/../../vendor/autoload.php';
if (is_file($composerAutoload)) { if (is_file($composerAutoload)) {
require_once($composerAutoload); require_once($composerAutoload);
} }
require_once(__DIR__ . '/../../framework/yii/Yii.php'); require_once(__DIR__ . '/../../framework/Yii.php');
Yii::setAlias('@yiiunit', __DIR__); Yii::setAlias('@yiiunit', __DIR__);
......
...@@ -17,7 +17,7 @@ class TestCase extends \yiiunit\TestCase ...@@ -17,7 +17,7 @@ class TestCase extends \yiiunit\TestCase
public static function loadClassMap() public static function loadClassMap()
{ {
$baseNameSpace = 'yii/authclient'; $baseNameSpace = 'yii/authclient';
$basePath = realpath(__DIR__. '/../../../../extensions/yii/authclient'); $basePath = realpath(__DIR__. '/../../../../extensions/authclient');
$files = FileHelper::findFiles($basePath); $files = FileHelper::findFiles($basePath);
foreach ($files as $file) { foreach ($files as $file) {
$classRelativePath = str_replace($basePath, '', $file); $classRelativePath = str_replace($basePath, '', $file);
......
...@@ -6,7 +6,7 @@ use Yii; ...@@ -6,7 +6,7 @@ use Yii;
use yii\elasticsearch\Connection; use yii\elasticsearch\Connection;
use yiiunit\TestCase; use yiiunit\TestCase;
Yii::setAlias('@yii/elasticsearch', __DIR__ . '/../../../../extensions/yii/elasticsearch'); Yii::setAlias('@yii/elasticsearch', __DIR__ . '/../../../../extensions/elasticsearch');
/** /**
* ElasticSearchTestCase is the base class for all elasticsearch related test cases * ElasticSearchTestCase is the base class for all elasticsearch related test cases
......
...@@ -6,7 +6,7 @@ use yii\imagine\Image; ...@@ -6,7 +6,7 @@ use yii\imagine\Image;
use Imagine\Image\Point; use Imagine\Image\Point;
use yiiunit\VendorTestCase; use yiiunit\VendorTestCase;
Yii::setAlias('@yii/imagine', __DIR__ . '/../../../../extensions/yii/imagine'); Yii::setAlias('@yii/imagine', __DIR__ . '/../../../../extensions/imagine');
abstract class AbstractImageTest extends VendorTestCase abstract class AbstractImageTest extends VendorTestCase
{ {
......
...@@ -57,7 +57,7 @@ class MongoDbTestCase extends TestCase ...@@ -57,7 +57,7 @@ class MongoDbTestCase extends TestCase
protected static function loadClassMap() protected static function loadClassMap()
{ {
$baseNameSpace = 'yii/mongodb'; $baseNameSpace = 'yii/mongodb';
$basePath = realpath(__DIR__. '/../../../../extensions/yii/mongodb'); $basePath = realpath(__DIR__. '/../../../../extensions/mongodb');
$files = FileHelper::findFiles($basePath); $files = FileHelper::findFiles($basePath);
foreach ($files as $file) { foreach ($files as $file) {
$classRelativePath = str_replace($basePath, '', $file); $classRelativePath = str_replace($basePath, '', $file);
......
...@@ -6,7 +6,7 @@ use yii\redis\Cache; ...@@ -6,7 +6,7 @@ use yii\redis\Cache;
use yii\redis\Connection; use yii\redis\Connection;
use yiiunit\framework\caching\CacheTestCase; use yiiunit\framework\caching\CacheTestCase;
Yii::setAlias('@yii/redis', __DIR__ . '/../../../../extensions/yii/redis'); Yii::setAlias('@yii/redis', __DIR__ . '/../../../../extensions/redis');
/** /**
* Class for testing redis cache backend * Class for testing redis cache backend
......
...@@ -6,7 +6,7 @@ use Yii; ...@@ -6,7 +6,7 @@ use Yii;
use yii\redis\Connection; use yii\redis\Connection;
use yiiunit\TestCase; use yiiunit\TestCase;
Yii::setAlias('@yii/redis', __DIR__ . '/../../../../extensions/yii/redis'); Yii::setAlias('@yii/redis', __DIR__ . '/../../../../extensions/redis');
/** /**
* RedisTestCase is the base class for all redis related test cases * RedisTestCase is the base class for all redis related test cases
......
...@@ -72,7 +72,7 @@ class SphinxTestCase extends TestCase ...@@ -72,7 +72,7 @@ class SphinxTestCase extends TestCase
protected static function loadClassMap() protected static function loadClassMap()
{ {
$baseNameSpace = 'yii/sphinx'; $baseNameSpace = 'yii/sphinx';
$basePath = realpath(__DIR__. '/../../../../extensions/yii/sphinx'); $basePath = realpath(__DIR__. '/../../../../extensions/sphinx');
$files = FileHelper::findFiles($basePath); $files = FileHelper::findFiles($basePath);
foreach ($files as $file) { foreach ($files as $file) {
$classRelativePath = str_replace($basePath, '', $file); $classRelativePath = str_replace($basePath, '', $file);
......
...@@ -6,7 +6,7 @@ use Yii; ...@@ -6,7 +6,7 @@ use Yii;
use yii\swiftmailer\Mailer; use yii\swiftmailer\Mailer;
use yiiunit\VendorTestCase; use yiiunit\VendorTestCase;
Yii::setAlias('@yii/swiftmailer', __DIR__ . '/../../../../extensions/yii/swiftmailer'); Yii::setAlias('@yii/swiftmailer', __DIR__ . '/../../../../extensions/swiftmailer');
/** /**
* @group vendor * @group vendor
......
...@@ -8,7 +8,7 @@ use yii\swiftmailer\Mailer; ...@@ -8,7 +8,7 @@ use yii\swiftmailer\Mailer;
use yii\swiftmailer\Message; use yii\swiftmailer\Message;
use yiiunit\VendorTestCase; use yiiunit\VendorTestCase;
Yii::setAlias('@yii/swiftmailer', __DIR__ . '/../../../../extensions/yii/swiftmailer'); Yii::setAlias('@yii/swiftmailer', __DIR__ . '/../../../../extensions/swiftmailer');
/** /**
* @group vendor * @group vendor
......
<?php <?php
require_once(__DIR__.'/../../../../framework/yii/requirements/YiiRequirementChecker.php'); require_once(__DIR__.'/../../../../framework/requirements/YiiRequirementChecker.php');
use yiiunit\TestCase; use yiiunit\TestCase;
......
<?php <?php
require(__DIR__ . '/../../../framework/yii/Yii.php'); require(__DIR__ . '/../../../framework/Yii.php');
$application = new yii\web\Application('test', __DIR__ . '/protected'); $application = new yii\web\Application('test', __DIR__ . '/protected');
$application->run(); $application->run();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment