Skip to content

Commit

Permalink
fix static assets path error bug
Browse files Browse the repository at this point in the history
  • Loading branch information
liufee committed Sep 6, 2017
1 parent 5aa9280 commit daa1904
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README.md
@@ -1,7 +1,7 @@
yii2 swoole
===============================

让yii2运行在swoole上。
让yii2运行在swoole上。如果您在使用中遇到问题或者想学习yii2结合swoole可以加qq群258780872一起讨论


性能
Expand All @@ -13,7 +13,7 @@ yii2 swoole
----------------
各个演示站点后台 **用户名:feehicms 密码123456**
* php7.1.8 (php-fpm+nginx+yii2)
* 前台[http://demo.cms.qq.feehi.com/admin](http://demo.cms.qq.feehi.com/admin)
* 前台[http://demo.cms.qq.feehi.com/](http://demo.cms.qq.feehi.com)
* 后台1[http://demo.cms.qq.feehi.com/admin](http://demo.cms.qq.feehi.com/admin)
* php7.1.8 (swoole+nginx+yii2)
* 前台[http:/swoole.demo.cms.qq.feehi.com/](http://swoole.demo.cms.qq.feehi.com)
Expand Down
10 changes: 1 addition & 9 deletions src/console/SwooleController.php
Expand Up @@ -14,7 +14,6 @@
use feehi\web\Response;
use feehi\web\Session;
use feehi\swoole\SwooleServer;
use yii\web\AssetManager;
use yii\web\Application;

class SwooleController extends \yii\console\Controller
Expand Down Expand Up @@ -84,7 +83,7 @@ function dump($var){
*/
$server->runApp = function ($request, $response) use ($config, $web) {
$aliases = [
'@web' => $web,
'@web' => '',
'@webroot' => $web,
];
$config['aliases'] = isset($config['aliases']) ? array_merge($aliases, $config['aliases']) : $aliases;
Expand All @@ -101,19 +100,12 @@ function dump($var){
];
$config['components']['response'] = isset($config['components']['response']) ? array_merge($config['components']['response'], $responseComponent) : $responseComponent;

$authManagerComponent = [
'class' => AssetManager::className(),
'baseUrl' => '/assets'
];
$config['components']['assetManager'] = isset( $config['components']['assetManager'] ) ? array_merge($authManagerComponent, $config['components']['assetManager']) : $authManagerComponent;

$config['components']['session'] = [
"class" => Session::className()
];

try {
$application = new Application($config);
yii::setAlias('@web', $web);
yii::$app->setAliases($aliases);
$application->run();
}catch (\Exception $e){
Expand Down

0 comments on commit daa1904

Please sign in to comment.