I have some legacy Symfony 1.4 projects which I'd like to enhance with a composer.json file for their dependencies.
I've managed to configure composer to use the "plugins" directory as opposed to "vendors". However according to the Symfony 1.4 documentation, the library ideally should live in "lib/vendor" off of my project root.
If I were to configure a custom repository-package pointing to the latest 1.4.x svn in my composer.json, how would I get it so that it installs to "lib/vendor"?
Composer is the package manager used by modern PHP applications. Use Composer to manage dependencies in your Symfony applications and to install Symfony Components in your PHP projects. Since this article was first published, Composer installation has improved a lot.
If you have file system access to the project Look inside the file for a line like: const VERSION = '5.0. 4'; that's the Symfony version number.
Running your Symfony ApplicationOpen your browser and navigate to http://localhost:8000/ . If everything is working, you'll see a welcome page. Later, when you are finished working, stop the server by pressing Ctrl+C from your terminal.
In October 2005, the French software company, SensioLabs published the open source framework, Symfony, which was actually developed under the name Sensio Framework.
In fact, this is not really a problem to have symfony outside lib/vendor
. It's recommended to have it in this folder path because, that way, it will be automatically loaded.
Using vendor-dir
in Composer, you can configure where to put your vendor library. But this is a configuration set as root-only, so it can't be configured per require library (at least I think so).
But you can put symfony in your plugins/
directory and then say to your app you want to autoload everything here, using apps/frontend/config/autoload.yml
:
autoload:
symfony:
path: %SF_PLUGIN_DIR%/symfony/lib
recursive: on
Do not forget to change the path in your config/ProjectConfiguration.class.php
:
<?php
require_once dirname(__FILE__).'/../plugins/symfony/lib/autoload/sfCoreAutoload.class.php';
That should do the trick.
You can write your own composer installer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With