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

Merged
merged 2 commits into from Jun 9, 2012

Conversation

Projects
None yet
3 participants
Owner

Ocramius commented Jun 9, 2012

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).

We should have framework specific code here.

@guilhermeblanco guilhermeblanco and 1 other commented on an outdated diff Jun 9, 2012

bin/doctrine.php
@@ -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.
-EOT
- );
+$previousDir = null;
+$currentDir = __DIR__;
+
+while ($previousDir !== $currentDir && !@include_once($currentDir . '/vendor/autoload.php')) {
@guilhermeblanco

guilhermeblanco Jun 9, 2012

Owner

We should not have framework specific code here.

@Ocramius

Ocramius Jun 9, 2012

Owner

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

Owner

Ocramius commented Jun 9, 2012

@guilhermeblanco this looks better now :)

@guilhermeblanco guilhermeblanco added a commit that referenced this pull request Jun 9, 2012

@guilhermeblanco guilhermeblanco Merge pull request #365 from Ocramius/DDC-1860
DDC-1860 - Composer arbitrary for CLI and composer/autoload.php in different paths
7b75849

@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