ezpublish-legacy
ezpublish-legacy copied to clipboard
ezpgenerateautoloads.php with custom extension directory name
In ezp the default name for the extension folder is "extension". But you can configure a different name in site.ini.
The ezpgenerateautoloads.php is not able to handle a different name for that directory. It's hardcoded to "extension". This pull requests adds a new parameter to the script that allows to specify a custom directory name for the extension folder.
You may ask, why on earth would you rename the extension folder. Well, we're implementing an archive solution with 2 identical ezp installations. Just the content is different:
- for live content
- for archive content
We use apache proxy rules to split the traffic of one single domain to the live or archive install. In order to implement those rules we need unique names for the extension folders.
Hi Philipp,
looks like a good cleanup, but maybe I'm wrong but isn't extension folder hard coded several places? If so then I think I would have to say -0.1 and that the setting should be deprecated instead, to many settings anyway.
On a first look, ezp seems to work fine with a renamed extension folder. But I was just browsing the public site (no in-depth testing). I'm sure there are a few places with a hardcoded extension folder name.
Feel free to close the pull request. I do understand that you prefer not to support that setting (feature).
Anyways, in our client project we might still go for it and rename the extension folder. On top of your head, do you know any other locations where ezp has it as a hardcoded value?
I for one would absolutely plussone the pull request fixing all occurrences of a hardcoded /extension folder, at least as far as the eZ kernel is concerned. In fact I have been thinking about writing a few regexps to also detect its usage in community extensions, but never had the time to do so...
what is the use case for this?
The one that philipp mentioned?
Yes, I just mentioned the use case briefly. Basically, it will allow me to run 2 ezp instances at one single domain. With unique name for the extension folder and var folder, I'm able to setup apache proxy redirect rules to split the traffic to an live and an archive instance. Let me know if you'd like more details about it.
I quickly scanned the design, kernel and lib folder and I don't find a lot of instances of an hardcoded 'extension' folder name:
design: nothing
kernel:
- settings/edit.php 67
- settings/view.php 71,73
- private/classes/ezautoloadgenerator.php 887,1350
lib:
- eztemplate/classes/eztemplateblockfunction.php 34,35
Should be straight forward to add a dynamic extension folder name here. I'm guessing that we'll find more instances in the 'bin/php' directory and in ezp extensions (like ezfind, ezoe etc). Still, I don't think it's going to be a lot of code, we'd need to add.
It does not look like a huge change-set, as far as the kernel is concerned at least. Might be larger en somewhat more problematic for the standard extensions, I have not investigated I must confess.
I see this as a decent opportunity to harmonize the usage (or non-usage thereof), even if we prefer to deprecate at some point. What's more: Philipp has started the heavy-lifting, we can piggy-back a few more "clean-up" commits.
Cheers gentlemen.