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

Use composer's autoload-dev feature #6205

Closed
wants to merge 1 commit into from
Closed

Use composer's autoload-dev feature #6205

wants to merge 1 commit into from

Conversation

Maks3w
Copy link
Member

@Maks3w Maks3w commented Apr 30, 2014

This feature exists since composer/composer#1344

This require update old composer installations

@localheinz
Copy link
Member

👍

@localheinz
Copy link
Member

@Maks3w

WTF, php-cs-fixer again.

@localheinz
Copy link
Member

@Maks3w

This change fabpot/PHP-CS-Fixer@86a0f41 results in a failure when null === $path.

See https://github.com/fabpot/PHP-CS-Fixer/pull/349.

@localheinz
Copy link
Member

@Maks3w

I guess the regression mentioned above affects a bunch of PRs again? How about fixing the php-cs-fixer dependency to a commit that has proved to work?

@localheinz
Copy link
Member

@Maks3w

Never mind, @fabpot has already merged!

Need to restart the build.

@Ocramius
Copy link
Member

Ocramius commented May 2, 2014

@Maks3w just a wild guess, but maybe the autoloader is only generated correctly with composer update?

@Maks3w
Copy link
Member Author

Maks3w commented May 4, 2014

Any change in composer.json implies a composer update.

@localheinz
Copy link
Member

@Maks3w

As I said, the build needs to be restarted.

@Ocramius
Copy link
Member

Ocramius commented May 4, 2014

@localheinz I restarted the build

@Ocramius Ocramius self-assigned this Jul 28, 2014
@Ocramius Ocramius added this to the 2.3.2 milestone Jul 28, 2014
@Ocramius Ocramius closed this in fd90bdd Jul 28, 2014
Ocramius added a commit that referenced this pull request Jul 28, 2014
@Ocramius
Copy link
Member

Manually rebased/merged

@Martin-P
Copy link
Contributor

This PR breaks PHPUnit testing on Windows machines.

D:\zf2-bugs\vendor\zf2\tests>phpunit
PHPUnit 4.2.6 by Sebastian Bergmann.

Configuration read from D:\zf2-bugs\vendor\zf2\tests\phpunit.xml

....
Fatal error: Class 'ZendTest\Form\TestAsset\InputFilterProvider' not found in D:\zf2-bugs\vendor\zf2\tests\ZendTest\Form\FormTest.php on line 187

When I place the original code back into _autoload.php all works fine again:

<?php
/**
 * Setup autoloading
 */

include_once __DIR__ . '/../vendor/autoload.php';

$loader = new Zend\Loader\StandardAutoloader(
    array(
        Zend\Loader\StandardAutoloader::LOAD_NS => array(
            'ZendTest' => __DIR__ . '/ZendTest',
        ),
    )
);
$loader->register();

@Martin-P
Copy link
Contributor

Martin-P commented Oct 1, 2014

Ping @Maks3w @Ocramius

@Ocramius
Copy link
Member

@Martin-P is that a path mismatch?

@Martin-P
Copy link
Contributor

@Ocramius The path is not recognized anymore due to changing the autoloader. I opened issue #6737 for it and got a solution for this. I now need to execute an additional command to make the autoloader recognize the assets: composer dump-autoload.

It was not necessary before, so I did not know I needed to perform this extra step now to make it work. I guess this change only needs an update in the docs.

@Ocramius
Copy link
Member

I think we didn't use the global phpunit since 2.2. As for dump-autoload, the first installation/update handles it if not executed with the --no-dev flag

@Martin-P
Copy link
Contributor

the first installation/update handles it

Only when installing ZF2 via composer, but when I fetch ZF2 directly from GitHub (as described in the README-GIT.md) there is no composer autoload involved.

@Ocramius
Copy link
Member

@Martin-P the first installation (even when testing) requires composer install anyway. This is indeed a documentation issue.

@Martin-P
Copy link
Contributor

My comment went a bit early... I never needed composer install for testing, just git fetch zf2.

@Ocramius
Copy link
Member

Yeah, that was changed a lot of time ago: guess we missed updating the contributing notes :-\

@Martin-P
Copy link
Contributor

Ah, okay, that explains my issue 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants