DDC-1860 - Composer arbitrary for CLI and composer/autoload.php in different paths #365

merged 2 commits into from Jun 9, 2012

3 participants

Doctrine member

DDC-1860 - Composer became a requirement to run CLI some time ago. This patch:

  1. Makes composer optional if the user defines his own autoloaders in cli-config.php
  2. Makes the CLI look for vendor/composer.php in various parent paths of the bin directory.

This pull request passes (merged 8231fb2 into 9445502).

Doctrine member

We should have framework specific code here.

@guilhermeblanco guilhermeblanco and 1 other commented on an outdated diff Jun 9, 2012
@@ -17,11 +17,12 @@
* <http://www.doctrine-project.org>.
-if (!@include __DIR__ . '/../../../autoload.php') {
- die(<<<'EOT'
-This command can only be run when Doctrine is installed through Composer.
- );
+$previousDir = null;
+$currentDir = __DIR__;
+while ($previousDir !== $currentDir && !@include_once($currentDir . '/vendor/autoload.php')) {
guilhermeblanco Jun 9, 2012 Doctrine member

We should not have framework specific code here.

Ocramius Jun 9, 2012 Doctrine member

@guilhermeblanco what framework specific code? This is composer support...

Doctrine member

@guilhermeblanco this looks better now :)

@guilhermeblanco guilhermeblanco merged commit 7b75849 into doctrine:master Jun 9, 2012

This pull request passes (merged 2f83cf0 into 9445502).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment