Commit 0ad55efb by Rusinov Maxim

Merge branch 'master' of git://github.com/yiisoft/yii2 into 15-unit-tests-of-sqlite-driver

parents 452be102 b6e00221
...@@ -13,4 +13,4 @@ nbproject ...@@ -13,4 +13,4 @@ nbproject
Thumbs.db Thumbs.db
# composer vendor dir # composer vendor dir
/framework/vendor /yii/vendor
\ No newline at end of file \ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// comment out the following line to disable debug mode // comment out the following line to disable debug mode
defined('YII_DEBUG') or define('YII_DEBUG', true); defined('YII_DEBUG') or define('YII_DEBUG', true);
$frameworkPath = __DIR__ . '/../../framework'; $frameworkPath = __DIR__ . '/../../yii';
require($frameworkPath . '/Yii.php'); require($frameworkPath . '/Yii.php');
// Register Composer autoloader // Register Composer autoloader
......
...@@ -64,10 +64,10 @@ ...@@ -64,10 +64,10 @@
"source": "https://github.com/yiisoft/yii2" "source": "https://github.com/yiisoft/yii2"
}, },
"config": { "config": {
"vendor-dir": "framework/vendor" "vendor-dir": "yii/vendor"
}, },
"bin": [ "bin": [
"framework/yiic" "yii/yiic"
], ],
"require": { "require": {
"php": ">=5.3.0", "php": ">=5.3.0",
......
...@@ -5,7 +5,7 @@ define('YII_DEBUG', true); ...@@ -5,7 +5,7 @@ define('YII_DEBUG', true);
$_SERVER['SCRIPT_NAME'] = '/' . __DIR__; $_SERVER['SCRIPT_NAME'] = '/' . __DIR__;
$_SERVER['SCRIPT_FILENAME'] = __FILE__; $_SERVER['SCRIPT_FILENAME'] = __FILE__;
require_once(__DIR__ . '/../../framework/Yii.php'); require_once(__DIR__ . '/../../yii/Yii.php');
Yii::setAlias('@yiiunit', __DIR__); Yii::setAlias('@yiiunit', __DIR__);
......
<?php <?php
require(__DIR__ . '/../../../framework/Yii.php'); require(__DIR__ . '/../../../yii/Yii.php');
$application = new yii\web\Application('test', __DIR__ . '/protected'); $application = new yii\web\Application('test', __DIR__ . '/protected');
$application->run(); $application->run();
...@@ -158,8 +158,8 @@ class YiiBase ...@@ -158,8 +158,8 @@ class YiiBase
{ {
foreach ($namespaces as $name => $path) { foreach ($namespaces as $name => $path) {
if ($name !== '') { if ($name !== '') {
$name = '@' . str_replace('\\', '/', $name); $name = trim(strtr($name, array('\\' => '/', '_' => '/')), '/');
static::setAlias($name, $path); static::setAlias('@' . $name, rtrim($path, '/\\') . '/' . $name);
} }
} }
} }
...@@ -370,7 +370,8 @@ class YiiBase ...@@ -370,7 +370,8 @@ class YiiBase
include($classFile); include($classFile);
if (class_exists($className, false) || interface_exists($className, false)) { if (class_exists($className, false) || interface_exists($className, false) ||
function_exists('trait_exists') && trait_exists($className, false)) {
return true; return true;
} else { } else {
throw new UnknownClassException("Unable to find '$className' in file: $classFile"); throw new UnknownClassException("Unable to find '$className' in file: $classFile");
......
...@@ -203,7 +203,7 @@ class Controller extends Component ...@@ -203,7 +203,7 @@ class Controller extends Component
public function forward($route, $params = array()) public function forward($route, $params = array())
{ {
$status = $this->run($route, $params); $status = $this->run($route, $params);
exit($status); Yii::$app->end($status);
} }
/** /**
......
...@@ -69,8 +69,8 @@ class Request extends \yii\base\Request ...@@ -69,8 +69,8 @@ class Request extends \yii\base\Request
$result = Yii::$app->getUrlManager()->parseRequest($this); $result = Yii::$app->getUrlManager()->parseRequest($this);
if ($result !== false) { if ($result !== false) {
list ($route, $params) = $result; list ($route, $params) = $result;
$params = array_merge($_GET, $params); $_GET = array_merge($_GET, $params);
return array($route, $params); return array($route, $_GET);
} else { } else {
throw new HttpException(404, Yii::t('yii|Page not found.')); throw new HttpException(404, Yii::t('yii|Page not found.'));
} }
......
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