markwatkinson / luminous

Accurate and powerful syntax highlighting library
http://luminous.asgaard.co.uk
GNU Lesser General Public License v2.1
50 stars 5 forks source link

License and PSR compilant #24

Closed nakp closed 11 years ago

nakp commented 11 years ago

I got to this library searching for a redcarpet equivalent for PHP, and I think would be more appropriate to use LGPL instead of GPL license, and would be great to have it available with composer (and PSR-0 compilant at least), think about RoR and redcarpet integration, most frameworks and libraries are available at packagist, SmartyPHP, Swiftmailer, Twig, Laravel, Doctrine and Textile just to name a few

Btw, using dev branches would be better idea than suggesting not to clone the repo, so people will add or fix stuff to the stable version instead of the last "testing" version.

Thanks for such a great library

markwatkinson commented 11 years ago

Thanks for the feedback. Roughly in order:

LGPL vs GPL: I've been considering this for a while, so I'm going to say... probably yes.

Composer: This would be good, agreed.

PSR-0: I'm not really familiar with this (I'm not a professional php dev). I'm not sure I understand the spec - should Luminous be PSR-0 compliant internally, or does only the main entry point (luminous.php) need to be externally loadable via the SplClassLoader class? I can't see the benefit to the former. I can see the benefit to the latter. Also, Luminous doesn't use any namespaces itself for php 5.2 compatibility - does this make any difference? I might be willing to drop this requirement...

As for dev branches: the advice to not clone the repository is aimed at people who just want to put Luminous in their project and start using it, rather than those who intend to modify it (who should of course fork). I should perhaps make this clearer. I was using dev branches for 0.7 and thought I had it release-ready/stable and merged it back into master, but then realised I'd broken something. I think master is now basically release ready for 0.7. But I haven't looked at it for a while.

On Fri, Jan 11, 2013 at 1:50 AM, Tomas notifications@github.com wrote:

I got to this library searching for a redcarpet equivalent for PHP, and I think would be more appropriate to use LGPL instead of GPL license, and would be great to have it available with composer (and PSR-0 compilant at least), think about RoR and redcarpet integration, most frameworks and libraries are available at packagist, SmartyPHP, Swiftmailer, Twig, Laravel, Doctrine and Textile just to name a few

Btw, using dev branches would be better idea than suggesting not to clone the repo, so people will add or fix stuff to the stable version instead of the last "testing" version.

Thanks for such a great library

— Reply to this email directly or view it on GitHubhttps://github.com/markwatkinson/luminous/issues/24.

nakp commented 11 years ago

Thank you for your quick reply :dancer:

PSR-0 is a standard for the file structure so is easier to integrate different libraries/components in your projects, It might need to reorganize the files only, and start using namespaces, means dropping support for PHP5.2 which has been deprecated for a while now.

You may want to take a look at https://github.com/fabpot/Twig and see how its organized

markwatkinson commented 11 years ago

A brief Googling suggests PHP 5.2 is still in common use[1][2], so I'd rather keep support for 5.2, for now at least.

Luminous is now on Packagist: https://packagist.org/packages/luminous/luminous, and as of 0.7.0 it's LGPL.

And it's psr-0 enough that you can use Composer's autoload:

<?php
require 'vendor/autoload.php';
echo luminous::highlight('c', 'printf("hello world")');  // works

But while I'm keeping the PHP 5.2 requirement it won't be PSR-0 internally, so I'll revisit that when 5.2 dies out.

[1] http://w3techs.com/technologies/details/pl-php/5/all [2] http://wordpress.org/about/stats/

nakp commented 11 years ago

I'm happy to see such a fast answer from you! Yeah, 5.2 is still widely used as PHP4 was a couple of years ago, maybe 'cause it's "feature frozen" just like latin is used to name in science, because it's a dead language and not open for changes :wink:

Again, thank you for such a great library and for taking that well my suggestions :smiley: I'm happy to see this library change to LGPL and being available with composer