Alexander Trauzzi
Alexander Trauzzi

Reputation: 7405

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

Upvotes: 8

Views: 3846

Answers (2)

Eugene Leonovich
Eugene Leonovich

Reputation: 934

You can write your own composer installer.

Upvotes: 1

j0k
j0k

Reputation: 22756

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.

Upvotes: 8

Related Questions