Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Make lessphp a Composer package #216

Closed
JanJakes opened this Issue · 10 comments
@JanJakes

Please make lessphp a Composer package (http://getcomposer.org/) and put it on http://packagist.org/.

@TomAdam

I second this, but really before this is done it needs to be made PSR-0 compliant. At the moment I am using the following repository definition:

"repositories": [
    {
        "type": "package",
        "package": {
            "name": "leafo/lessphp",
            "version": "0.3.3",
            "source": {
                "url": "https://github.com/leafo/lessphp.git",
                "type": "git",
                "reference": "v0.3.3"
            },
            "autoload": {
                "classmap": [ "./" ]
            }
        }
    }
]

Unfortunately this also adds all the tests to the autoloader, but its better than nothing.

@marcoraddatz

+1 :)

@xrstf

+1 :)

@damianb

-1 for pseudo-standard requirement 0 compliance. PEAR naming is dead, and namespacing was designed and intended to completely replace it and the hackish pseudo-namespacing that it used for autoloading; PSR-0 is an attempt to blend the two together to create something worse than ever before, both in terms of performance and straightforwardness. Having an underscore behave as a magic character when constructing a class's filepath only under specific conditions is bloody crazy talk and only mystifies design. Plus, it was created on a closed mailing list by a self-appointed "standards group" with very little public influence and input (and it shows).

There's some additional stuff on PSR-0's...lack of coherence here, I found: http://blog.ircmaxell.com/2011/11/on-psr-0-being-included-in-phps-core.html

A better solution is to use one that was provided in PHP-core from the very beginning, in PHP 5.3 - literal autoloading. Underscores map to underscores, namespace separators just map to directory separators, etc. Reference php manual, functions spl_autoload_extensions, get_include_path, set_include_path.

@Paulpro

+1

@joseym

+1

@leafo
Owner

Okay it's up, thanks @RobLoach

http://packagist.org/packages/leafo/lessphp

Not sure how to push the version tags from git to it though, maybe only new ones show up? (I set up the commit hook)

@leafo leafo closed this
@RobLoach

Thanks a lot for the help! You're correct, only new versions will show up as those are the only versions that'll have the composer.json meta-data file.

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.