lime icon indicating copy to clipboard operation
lime copied to clipboard

Moved everything into namespace lime

Open AlgorithMan-de opened this issue 8 years ago • 11 comments

Lime declares a class named "Error". PHP also declares a class with that name since PHP 7. To solve the resulting "PHP Fatal error: Cannot declare class error, because the name is already in use", all Lime code was moved into namespace lime.

AlgorithMan-de avatar Dec 08 '16 10:12 AlgorithMan-de

Nitpick: would lime\ or Lime\ be better?

hikari-no-yume avatar Dec 11 '16 16:12 hikari-no-yume

(As a side note: I notice GitHub doesn't mark that commit as yours. Have you added its email address to your account?)

hikari-no-yume avatar Dec 11 '16 16:12 hikari-no-yume

On sourceforge it's LIME... wondering why sourceforge is still the main repo though?

AlgorithMan-de avatar Dec 12 '16 12:12 AlgorithMan-de

github probably didn't mark the commit as mine because I used an SSH key that has "E-Mail address" viktor@viktor or so... that's a bit stupid on githubs side there...

AlgorithMan-de avatar Dec 12 '16 12:12 AlgorithMan-de

It hasn't cared about the SSH key for me, but maybe it does. Looking at the raw commit, your git author info is Viktor Engelmann <[email protected]>. Do you have that email on your GitHub account?

hikari-no-yume avatar Dec 12 '16 15:12 hikari-no-yume

no, I didn't - changed that :) thanks

AlgorithMan-de avatar Dec 12 '16 16:12 AlgorithMan-de

I would suggest implementing support for autoloader (PSR-4), because you probably want to use Lime as a library for a project and not as a standalone tool.

gene-sis avatar Dec 15 '16 21:12 gene-sis

Do I understand you correctly that you suggest naming the files & directories according to PSR-4, so that you don't have to explicitly include the files, because the file dirs & names can be deduced from the class name and can be loaded automatically? I personally don't mind loading the files explicitly, because you only need to include 2-3 files and I don't think you'll need to do that very often... I'd say you could make a separate issue for that.

AlgorithMan-de avatar Dec 16 '16 13:12 AlgorithMan-de

Using an autoloader you will only load the files you really need for the actual path of the script (e.g. if you need a class in just one if statement, which is only necessary every 4th page view) You don't have to manage all the files you may need for the actual file. You also don't have to care about file paths every time you want to include.

For a small project with Lime as it's sole library, there may only be 2 or 3 files but the number can grow with more dependencies. (I wouldn't necessarily use autoloader for the parts of Lime, which are only be used to build the parser class while development)

A further step could be to allow Lime to be included easily by a dependency management tool.

gene-sis avatar Dec 16 '16 20:12 gene-sis

Adding a composer.json and submitting to Packagist could be done.

hikari-no-yume avatar Dec 17 '16 17:12 hikari-no-yume

I wasn't sure about the activity of this repo, so I did this about a month ago, though it would be nice if this repo would get further improvements and would be usable via packagist.

gene-sis avatar Dec 29 '16 22:12 gene-sis