-
Notifications
You must be signed in to change notification settings - Fork 5
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
disable require once call #2
base: master
Are you sure you want to change the base?
Conversation
Hi, sorry for not getting back to you. When removing require-statements from the code, this guide was followed. I'm guessing the reasoning for not stripping the require-statement for the autoloader, is that this guide assumes no autoloader is registered at that moment, while in our case we already have composer doing the autoloading for us. However, for the zend autoloader to work, I think the include-path must be set properly, so even if we would remove the require statement, the zend loader wouldn't work. Though, I'm guessing you could use Zend_Application without the loader, so it might still make sense to remove this require-statement. Following this reasoning, I'm agreeing with you, the require-statement probably does more harm than it does good. I will remove it, however I cannot simply accept pull requests as this repository is automatically updated from the official zf1 repository (so this pull-request would get overwritten on the next official release). I will update the scripts that removes the require statements, so that the next version will have the require statements removed. I hope this is sufficient! |
if you want to keep the |
would you mind publishing your scripts, i would make PR there (maybe not this one, maybe next one) |
The scripts are a bit messy, but I will see what I can do! |
Would it be easier to push a version of the code without the require statements in a different branch or tag? That way, those that want the requires gone can just use that instead. |
As suggested by @glensc, adding this to the
Note: the use of
Since this initiative is specific to the use of Composer, I would vote for stripping all |
@deadbeef84 ZF-1.12.12 has been released, which includes a fix for preventing warnings to be displayed. When will your scripts / CRON job run to incorporate this? Indeed, publishing these scripts might be a good idea to get some workload off your chest ;) |
2 week bump, the community would like to help you with maintaining this... |
i found i needed to disable these two lines in Zend_Application to prevent Zend autoloader kick in and do lots of damage:
http://stackoverflow.com/a/2080984 suggest to disable autoloader:
but that method invokes deprecation message:
imho the deprecation should be removed as 2.0.0 is different product |
as i looked Zend_Application and Zend_Autoloader classes, and there really is no way to disable the builtin loader without modifying the code, I made such fake class, which overrides constructor doing exactly the same as original class but without the two lines, and not calling parent constructor: class Fake_Zend_Application extends Zend_Application {
/**
* @inheritdoc
*/
public function __construct($environment, $options = null) {
$this->_environment = (string)$environment;
if (null !== $options) {
if (is_string($options)) {
$options = $this->_loadConfig($options);
} elseif ($options instanceof Zend_Config) {
$options = $options->toArray();
} elseif (!is_array($options)) {
throw new Zend_Application_Exception(
'Invalid options provided; must be location of config file,'
. ' a config object, or an array'
);
}
$this->setOptions($options);
}
}
}
$application = new Fake_Zend_Application('myapp', require __DIR__ . '/application/configs/config.php'); the same conclusions are in this stackoverflow thread as well |
1184f1d
to
6f5979e
Compare
nice catch @glensc. @deadbeef84, any way to get the newest ZF1 versions in this GitHub Organization, or should it be marked as abandoned? It really helped us to determine which packages of ZF1 our applications depend an, so a migration path could be set. Some way we can help? |
@deadbeef84 2 week bump... |
@deadbeef84 little bit off-topic, but since I don't know where to ask it otherwise, will the recent version updates in https://github.com/bombayworks/zendframework1 to also bubble down to the separate packages in https://github.com/zf1 ? |
@deadbeef84, would you consider bump the isolated ZF1 components to 1.12.16? |
@deadbeef84 ping! |
@deadbeef84, would you consider bump the isolated ZF1 components in this GitHub organisation to the release you just tagged 1.12.18? PS, would it be an idea to share the build script somewhere in a dedicated repository in this GitHub organisation so others can have a look and maybe contribute? |
@deadbeef84 and do not be shamed how ugly your scripts are, community is there to help and improve them! i had idea that i will redo the scripts from scratch based on description, but never got around of actually doing that :( |
1.12.20 got released meanwhile |
rebased this branch against current master ( |
@glensc @deadbeef84 it seems @unhawkable has forked this project and got a working build / separation process running, see https://github.com/zf1s, maybe the efforts can be combined and keep it an up-to-date approach centrally at https://github.com/zf1 ?? |
@deadbeef84 said on May 15, 2018
seems the current maintained version seems to be @zf1s |
however, @zf1s doesn't solve problem described, i've started to maintain own fork: |
@glensc if you submitted a PR to https://github.com/zf1s/zend-application I would be more than glad to merge it... |
as zend classes are not in include path, any require once call will cause fatal error
wtf. @falkenhawk any ideas how your release notes commit appeared to this pull request? and as the edit is also off, I must have pushed myself? |
as zend classes are not in include path, any require once call will cause fatal error.
and enabling Zend autoloader causes it to load things from include path (which may be outside
vendor/
dir)