Skip to content

Commit e8e8d4e

Browse files
authored
Merge pull request #5453 from kenjis/fix-VENDORPATH
fix: VENDORPATH definition
2 parents 62e8806 + 623b102 commit e8e8d4e

3 files changed

Lines changed: 7 additions & 11 deletions

File tree

system/Test/bootstrap.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,6 @@ class_alias('Config\Services', 'CodeIgniter\Services');
8686

8787
// Now load Composer's if it's available
8888
if (is_file(COMPOSER_PATH)) {
89-
/*
90-
* The path to the vendor directory.
91-
*
92-
* We do not want to enforce this, so set the constant if Composer was used.
93-
*/
94-
if (! defined('VENDORPATH')) {
95-
define('VENDORPATH', realpath(ROOTPATH . 'vendor') . DIRECTORY_SEPARATOR);
96-
}
97-
9889
require_once COMPOSER_PATH;
9990
}
10091

system/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class_alias('Config\Services', 'CodeIgniter\Services');
117117
* We do not want to enforce this, so set the constant if Composer was used.
118118
*/
119119
if (! defined('VENDORPATH')) {
120-
define('VENDORPATH', realpath(ROOTPATH . 'vendor') . DIRECTORY_SEPARATOR);
120+
define('VENDORPATH', dirname(COMPOSER_PATH) . DIRECTORY_SEPARATOR);
121121
}
122122

123123
require_once COMPOSER_PATH;

user_guide_src/source/general/managing_apps.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,13 @@ This would have two apps, **foo** and **bar**, both having standard application
6969
and a **public** folder, and sharing a common **codeigniter** framework.
7070

7171
The **index.php** inside each application would refer to its own configuration,
72-
``../app/Config/Paths.php``, and the ``$systemDirectory`` variable inside each
72+
``../app/Config/Paths.php``, and the ``$systemDirectory`` variable in **app/Config/Paths.php** inside each
7373
of those would be set to refer to the shared common **system** folder.
7474

7575
If either of the applications had a command-line component, then you would also
7676
modify **spark** inside each application's project folder, as directed above.
77+
78+
When you use Composer autoloader, fix the ``COMPOSER_PATH`` constant in **app/Config/Constants.php** inside each
79+
of those::
80+
81+
defined('COMPOSER_PATH') || define('COMPOSER_PATH', ROOTPATH . '../vendor/autoload.php');

0 commit comments

Comments
 (0)