A
A
Alexey Nikolaev2015-10-02 15:39:11
Yii
Alexey Nikolaev, 2015-10-02 15:39:11

How to run yiic in a project with a structure other than the default one?

Good afternoon!
There is a project in which Yii itself is installed via composer in the vendor folder. The structure looks like this:

../
   /assets
   /protected
      // тут находятся файлы проекта
   /vendor
      /yiisoft
         /yii
            // тут находится ядро движка

I try to create a migration using the standard yiic migrate create via the console, but in the end I get "Application base path "protected" is not a valid directory". There is a config/console file, the contents of the yiic.php file also seem to be correct:
// change the following paths if necessary
$yiic=dirname(__FILE__).'/../vendor/yiisoft/yii/framework/yiic.php';
$config=dirname(__FILE__).'/config/console.php';

require_once($yiic);

How to fix the error? I would be grateful for advice, thanks.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
matperez, 2015-10-02
@Heian

Write basePath to config
'basePath' => __DIR__ .'/../protected',

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question