Skip to content
This repository was archived by the owner on Jan 6, 2020. It is now read-only.

Allow building bootstrap.php.cache when app/autoload.php is absent #313

Merged
merged 1 commit into from
Apr 23, 2017
Merged

Allow building bootstrap.php.cache when app/autoload.php is absent #313

merged 1 commit into from
Apr 23, 2017

Conversation

BPScott
Copy link
Contributor

@BPScott BPScott commented Mar 16, 2017

If app/autoload.php is absent then use the autoload.php in Composer's
vendor directory.

symfony/symfony#21837 opens the door for removing app/autoload.php in Symfony apps. I tried removing that and updating the various reference to it in symfony-standard and my app works (:tada:), but when I run composer install/update it complains about the buildBootstrap task expecting to find app/autoload.php.

This fix tells the buildBootstrap task to use vendor/autoload.php if app/autoload.php is absent.

*/
protected static function useSymfonyAutoloader(array $options)
{
return isset($options['symfony-app-dir']) && is_file($options['symfony-app-dir'].PATH_SEPARATOR.'autoload.php');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to use PATH_SEPARATOR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh boy lots of goofs there for that few characters :D one - I meant DIRECTORY_SEPARATOR and two - is_file doesn't care if you just use /. Rebased and replaced with a /.

If app/autoload.php is absent then use the autoload.php in Composer's
vendor directory.
@HeahDude HeahDude added the Bug label Mar 17, 2017
Copy link
Contributor

@HeahDude HeahDude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@BPScott
Copy link
Contributor Author

BPScott commented Apr 22, 2017

Heya folks, any news on this? The fabbot failure is unrelated to this diff

@fabpot
Copy link
Member

fabpot commented Apr 23, 2017

Thank you @BPScott.

@fabpot fabpot merged commit 257ee2e into sensiolabs:master Apr 23, 2017
fabpot added a commit that referenced this pull request Apr 23, 2017
… is absent (BPScott)

This PR was merged into the 5.0.x-dev branch.

Discussion
----------

Allow building bootstrap.php.cache when app/autoload.php is absent

If app/autoload.php is absent then use the autoload.php in Composer's
vendor directory.

symfony/symfony#21837 opens the door for removing `app/autoload.php` in Symfony apps. I tried removing that and updating the various reference to it in symfony-standard and my app works (:tada:), but when I run composer install/update it complains about the buildBootstrap task expecting to find `app/autoload.php`.

This fix tells the buildBootstrap task to use `vendor/autoload.php` if `app/autoload.php` is absent.

Commits
-------

257ee2e Allow building bootstrap.php.cache when app/autoload.php is absent
fabpot added a commit to symfony/symfony-standard that referenced this pull request Apr 24, 2017
This PR was merged into the 3.3-dev branch.

Discussion
----------

Remove app/autoload.php

Now that symfony/symfony#21837 is merged, app/autoload.php can be removed and replaced with the standard Composer autoloader.

~WAIT! This can't be merged *just* yet, as it throws errors when running the `buildBootstrap` post install/update script. The fix for this is in sensiolabs/SensioDistributionBundle#313. That PR must be merged and this PR must be updated to use a version of SensioDistributionBundle that contains the fix before this is good to go.~

EDIT: sensiolabs/SensioDistributionBundle#313 is merged (as of 24/04), and this PR has been updated to use the latest version of SensioDistributionBundle. This is now good to merge

Commits
-------

298f8b2 Remove app/autoload.php
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants