how to use composer when application and system directory are not in webroot? |
(11-08-2019, 02:03 PM)daveĀ friend Wrote: Assuming you want vendor/ at the same level as application/ then, using the example code below, adjusting for some other file structure is automatic as long as vendor/ and application/ retain the same relationship in the file hierarchyMight this introduce any problems with composer? I'd point out that any composer changes, such as installing the packages I described in my OP, would be making adjustments to the composer.json file that exists as part of the basic CodeIgniter install. I worry that this might introduce problems. (11-08-2019, 02:03 PM)dave friend Wrote:I would point out that this would be problematic if my project had "application/" in its path already. E.g., if my project were called "my-application" instead of "project" and was installed at /var/www/my-application/. (11-08-2019, 02:03 PM)dave friend Wrote:That path, if I'm not mistaken, is where CodeIgniter assumes your autoload file is by default. You could just set it to TRUE and CodeIgniter would look in that spot for the autoload file. This is partly what prompted my question in the first place. If CodeIgniter by default looks for the autoload file at application/vendor/autoload.php, perhaps there is some compelling reason for that location to be used? Also, I prefer *not* to use the autoload feature myself because the vast majority of controller methods I've defined have no need for the libraries I'm installing using composer. There's no point in loading composer's autoloader for the vast majority of pages on my site. For this reason, I prefer to only load the autoloader manually when the libraries are needed like so: PHP Code: require_once APPPATH . "vendor/autoload.php"; |
Messages In This Thread |
how to use composer when application and system directory are not in webroot? - by sneakyimp - 11-08-2019, 09:38 AM
RE: how to use composer when application and system directory are not in webroot? - by dave friend - 11-08-2019, 02:03 PM
RE: how to use composer when application and system directory are not in webroot? - by sneakyimp - 11-10-2019, 09:28 AM
RE: how to use composer when application and system directory are not in webroot? - by dave friend - 11-10-2019, 02:40 PM
|