Closed helprepair closed 2 years ago
@boehsermoe maybe you know something regarding this?
luyadev\luya-core\console\commands\ThemeController.php
// $basePath = $themeLocation . DIRECTORY_SEPARATOR . 'themes' . DIRECTORY_SEPARATOR . $themeName;
$basePath = $themeLocation . '/' . 'themes' . '/' . $themeName; // fix
$themeFolder = Yii::getAlias($basePath);
After I make this modification, I can create it successfully.
so the DIRECTORY_SEPARATOR was the problem?
But you mentioned you are on windows, so it should be \
not /
. But i think its because Yii::getAlias throws an exception here: https://github.com/yiisoft/yii2/blob/master/framework/BaseYii.php#L154
@helprepair could you provide me the value of $themeLocation and $basePath before and after running Yii::getAlias?
Update: From the exception it seems to be @app\themes\basic'
before running trough getAlias
$ php luya theme/create
Enter the name (lower case) of the theme you like to generate: basic
Enter the theme location where to generate (as path alias e.g. app, ): [app]
string(20) "$themeLocation :@app"
string(22) "DIRECTORY_SEPARATOR :\"
string(28) "$basePath :@app\themes\basic"
What steps will reproduce the problem?
php luya theme/create
What is the expected result?
developer@WCZ-PC MINGW64 /d/app/day01/example0001/1.1.8 $ php luya theme/create Enter the name (lower case) of the theme you like to generate: basic Enter the theme location where to generate (as path alias e.g. app, ): [app] Exception 'yii\base\InvalidArgumentException' with message 'Invalid path alias: @app\themes\basic'
in D:\app\day01\example0001\1.1.8\vendor\yiisoft\yii2\BaseYii.php:154
Stack trace:
0 D:\app\day01\example0001\1.1.8\vendor\luyadev\luya-core\console\commands\ThemeController.php(63): yii\BaseYii::getAlias('@ap
p\themes\bas...') luyadev/luya-kickstarter-bootstrap4#1 [internal function]: luya\console\commands\ThemeController->actionCreate('basic') luyadev/luya-kickstarter-bootstrap4#2 D:\app\day01\example0001\1.1.8\vendor\yiisoft\yii2\base\InlineAction.php(57): call_user_func_array(Array, Array) luyadev/luya-kickstarter-bootstrap4#3 D:\app\day01\example0001\1.1.8\vendor\yiisoft\yii2\base\Controller.php(178): yii\base\InlineAction->runWithParams(Array) luyadev/luya-kickstarter-bootstrap4#4 D:\app\day01\example0001\1.1.8\vendor\yiisoft\yii2\console\Controller.php(182): yii\base\Controller->runAction('create', Arr ay) luyadev/luya-kickstarter-bootstrap4#5 D:\app\day01\example0001\1.1.8\vendor\yiisoft\yii2\base\Module.php(552): yii\console\Controller->runAction('create', Array) luyadev/luya-kickstarter-bootstrap4#6 D:\app\day01\example0001\1.1.8\vendor\yiisoft\yii2\console\Application.php(180): yii\base\Module->runAction('theme/create', Array) luyadev/luya-kickstarter-bootstrap4#7 D:\app\day01\example0001\1.1.8\vendor\yiisoft\yii2\console\Application.php(147): yii\console\Application->runAction('theme/c reate', Array) luyadev/luya-module-cms#189 D:\app\day01\example0001\1.1.8\vendor\yiisoft\yii2\base\Application.php(384): yii\console\Application->handleRequest(Object( yii\console\Request)) luyadev/luya-kickstarter-bootstrap4#9 D:\app\day01\example0001\1.1.8\vendor\luyadev\luya-core\base\Boot.php(238): yii\base\Application->run() luyadev/luya-kickstarter-bootstrap4#10 D:\app\day01\example0001\1.1.8\vendor\luyadev\luya-core\bin\luya(36): luya\base\Boot->applicationConsole() luyadev/luya-kickstarter-bootstrap4#11 {main}
What do you get instead? (A Screenshot can help us a lot!)
LUYA Check ouput (run this script and post the result: luyacheck.php)
Additional infos