linked-swissbib / vufind

A library resource discovery portal designed and developed for libraries by libraries
GNU General Public License v2.0
1 stars 2 forks source link

Correct usage of classmap_generator.php #8

Closed ltog closed 8 years ago

ltog commented 8 years ago

@guenterh : Could you reiterate on the correct usage of classmap_generator.php?

guenterh commented 8 years ago

@ltog Lukas, you should never call it by yourself! Classmap autoloaders are a Framework mechanism used by the framework in case they are configured. At the moment this is only the case for some specialized modules https://github.com/linked-swissbib/vufind/blob/vfsb/linked/module/Swissbib/Module.php#L39 Because we started to work with linked-swissbib later, this module uses the StandardAutoloader - which is still the default loading mechanism of VuFind. Some time ago I added classmaps because they are much faster.

My recommendation: In the phase of development, you could ignore the mechanism (because using them makes it a little bit more complicated)

Is this explanation sufficient?

Günter

ltog commented 8 years ago

@guenterh: Never calling it myself, that's surely an advice I can remember... :-)

However, I already added the file to Git: https://github.com/linked-swissbib/vufind/blob/vfsb/linked/module/LinkedSwissbib/src/autoload_classmap.php and even added an entry in .gitignore to NOT ignore this file: https://github.com/linked-swissbib/vufind/blob/fd67e997149abb8a091afa91b419c8d16a1ae28d/.gitignore#L17

How should we proceed? Will the code run smoothly (i.e. without further steps after pulling) if we delete both the file and the .gitignore entry?

guenterh commented 8 years ago

@ltog Yes delete it and the code should run without any ramifications - hopefully.... But only within the linked - swissbib module. Because for some other modules the Classmap autoloader is configured you shouldn't delete them otherwise you will be punished with an exception...

Another hint: classmap autoloader files are only used in production mode and not development https://github.com/linked-swissbib/vufind/blob/vfsb/linked/module/Swissbib/Module.php#L43 which means: because of the current setting: https://github.com/linked-swissbib/vufind/blob/vfsb/linked/local/httpd-swissbib.conf#L49 they are not used.

ltog commented 8 years ago

@guenterh : Ok, I will delete the file and the .gitignore entry...

Thanks for clearing things up.