Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I install Symfony 1.4 using composer?

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"?

like image 882
Alexander Trauzzi Avatar asked Aug 15 '12 10:08

Alexander Trauzzi


People also ask

What is composer in Symfony?

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.

How do I check Symfony version?

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.

How do I run an existing Symfony project?

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.

Is Symfony French?

In October 2005, the French software company, SensioLabs published the open source framework, Symfony, which was actually developed under the name Sensio Framework.


2 Answers

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.

like image 137
j0k Avatar answered Sep 23 '22 03:09

j0k


You can write your own composer installer.

like image 36
Eugene Leonovich Avatar answered Sep 24 '22 03:09

Eugene Leonovich