Skip to content

Transformation into a PSR-0 compliant library #10

Closed
wants to merge 3 commits into from

6 participants

@avinash
avinash commented Jan 16, 2012

Hi,

I needed to use PEST from Symfony2. I've done some changes to transform it into a PSR-0 compliant library so that the Symfony autoloader can load the classes properly.

@zuk
Educoder member
zuk commented Jan 26, 2012

I'm a little reluctant about pulling this in. It will probably introduce incapability with older versions of PHP (probably anything before 5.3?) .... then again I'm not really sure if Pest works with anything older than 5.3 as-is.... to be honest, I just refuse to accept \ as a namespace separator :) Maybe we'll just put this into a branch for now?

@avinash
avinash commented Jan 27, 2012

Hi Zuk,

Yeah. That's the best solution. I suppose there are still a lot of people around who do not need to always have PSR-0 compliant libraries :-)

@zuk
Educoder member
zuk commented Jan 27, 2012

Alright I'll put it in a branch for now and merge in any future changes from master. Once things stabilize a bit (are both the PSR-0 and Zend module formats still in contention?) we'll PSR-0-ify master.

@pasinter

fyi, here is what I've added in autoload.php to register Pest to autoload in Symfony2:

$loader->registerPrefixes(array(
    'Pest'            => __DIR__.'/../vendor/pest',
));
@avinash
avinash commented Feb 20, 2012

Thanks @pasinter. I should have mentioned that :-)

@jrschumacher

Are you creating a PSR-0 branch? Could you also add Composer compatibility (composer.json) to that branch?

@nbransby
nbransby commented Jan 2, 2013

Im looking for composer support too. Related question: how do you use composer with a project such as pest which does not have a composer.json?

@jrschumacher
@nbransby
nbransby commented Jan 4, 2013

Thanks jrschumacher, I didn't see this option whilst browsing the docs

@zuk
Educoder member
zuk commented May 17, 2013

Guys, really sorry about not paying enough attention to this. Would anyone be interested in taking over Pest maintenance? Would be great to see Symfony2-compliant branch, plus there's a big queue of pull requests that need to be looked at.... I created a ticket (#39) to open discussion about this.

@djsipe
djsipe commented Jun 5, 2013

Just to follow up on the composer question... to get Pest to work as it is today you have to use the "classmap" autoload feature which will extract the locations of each class in the library and tie it into the Composer autoloader.
http://getcomposer.org/doc/04-schema.md#classmap

Something like this (the path may be slightly off):

{
    "autoload": {
        "classmap": ["vendor/pest"]
    }
}
@djsipe
djsipe commented Jun 14, 2013

Just in case anyone missed it, PEST is now officially Composer compatible and listed on Packagist.

@zuk zuk closed this Oct 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.