-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[FrameworkBundle] Feature/class map generator command [#2407, #2471] #3394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FrameworkBundle] Feature/class map generator command [#2407, #2471] #3394
Conversation
this is a Symfony2 CLI command that uses the ClassMapGenerator |
Ah sorry, this is the command. Looked at it too fast |
Do I understand it correctly that this one allows generating autoloader classmaps for various third-party deps without proper autoloaders? |
yes .. thats the idea |
Very cool! |
@lsmith77 I wonder if we can work more methods on the ClassMapper class in order to include also files that do not contain classes but functions, I have seen that occurring on say zetacomponents. If this generator not only generates a class map but a class map and the set_include_path to include these functions files that would rock? @stof? |
@cordoval functions are not autoloadable. So this would be totally useless: you have to require the file before using the function, you cannot ask an autoloader to do the job. And |
I don't think @cordoval was implying that they would be autoloadable .. just that it could collect all files that contain functions and put requires for these files into a single file, to make it easier to manually load all functions of a lib. |
the class map generator is not about putting files together but about creating a class map for the autoloader |
I don't think that such a command is really useful as you probably want files from more than one directory (and probably exclude some files from these directories). I think it would be much better to write a cookbook in the documentation explaining how to take advantage of the new map generator instead (see symfony/symfony-docs#1134). |
it could be a micro command, as this can be fed with a specific folder so to group things, then the cookbook |
I volunteer for the cookbook though i don't have a super realistic case yet |
Adds a command for Map Class Generator
#2407
quote @lsmith77 :
"it appears we do not have tools to generate a class map to be used in the map class loader. maybe we should even provide a command. then again maybe this should be handled by https://github.com/sensio/SensioDistributionBundle/tree/master/Resources/bin ?"