0

I have a shared hosting server set up with multiple Yii 1.1 applications running at the same time. What I have done is moved the common yii 1.1 framework folder one above the web root and modified the index.php in all the Yii applications to grab the framework files from that folder.

But with Yii 2.0 I'm not able to do that. I moved the vendor folder outside the application and then modified the index.php file to point to the new location, but there are further dependencies which are failing.

Has anyone set up their application this way?

E.g.

  • folder1
  • folder2
  • public_html or web or www

    • yii application 1
    • yii application 2
  • vendors

4

1 回答 1

2

在您的配置文件中,您可以指定 vendorPath 指向您的新供应商位置,所以

$config = [
'vendorPath' => 'relative/path/to/your/vendors/folder',
'components' => [...]
// ... other configurations

]

如果您打算使用 composer 更新组件,您还需要修改您的 composer.json 以指向新位置。这里有更完整的描述。

于 2015-03-18T00:34:10.940 回答