Configuring Yii2 to Use a Provider Folder in External HTTP Storage

I have several restful apis build using yii2 framework. I would like to use one vendor directory stored in a different address

it

I have an application hosted in www.example1.comand another hosted in , www.example2.comand I would like the provider files to be in www.example3.comso that in both examples1 and example2 I would need to load a resful folder without suppliers directories

After some searching in the yii2 extended folder, I found these lines in index.php

require(__DIR__ . '/_protected/vendor/autoload.php');
require(__DIR__ . '/_protected/vendor/yiisoft/yii2/Yii.php');

Ive tried to work by doing

require(__DIR__ . 'http:://example1.com/pathto/_protected/vendor/autoload.php');

But above fails, how best can I achieve this

+4
source share
3 answers

HTTP.

- NFS, vendor/. , .

, .

+1

. (autoload.php yii.php) . /config/web.php. vendorPath . /var/www/html/myapp/vendor /var/www/html/frameworks/yii2, . , composer.json( ), vendor-dir , :

// ... "config": {    "vendor-dir": " ",    "process-timeout": 1800 }, // ...

, " " ( , composer.json, ). , update -dry-run. .

0

: http. php (allow_url_include, allow_url_fopen). __ DIR __ php :

require('http://example1.com/pathto/_protected/vendor/autoload.php');

. . php. . script php http, . , http .

()

php -, , - , - .

, - multihost - () .

0

Source: https://habr.com/ru/post/1670856/


All Articles