Skip to content
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

Rewrite autoloader so we have all rules defined in separate class #4

Merged
merged 8 commits into from
Apr 1, 2019
Merged

Rewrite autoloader so we have all rules defined in separate class #4

merged 8 commits into from
Apr 1, 2019

Conversation

michalbundyra
Copy link
Member

@michalbundyra michalbundyra commented Mar 27, 2019

The class with defined rules now is reusable and we can use it also on rewriting the libraries

We need to think what we can do with functions, and somehow I think it will be better to create these alias in repositories where we have defined functions.

We would need define list of all possible function defined in libraries and then just call new function using call_user_func_array and func_get_args.

UPDATE: As discussed, we will try to handle functions separately on rewriting packages, as these are only in the following pacakges:

  • zend-diactoros
  • zend-stragitility
  • zend-container-config-test

The class with defined rules now is reusable and we can use it
also on rewriting the libraries

We need to think what we can do with functions,
and somehow I think it will be better to create these alias
in repositories where we have defined functions.

We would need define list of all possible function defined in
libraries and then just call new function using `call_user_func_array`
and `func_get_args`.
We should handle it separetely on rewriting packages
src/Autoloader.php Outdated Show resolved Hide resolved
src/Autoloader.php Show resolved Hide resolved
src/RewriteRules.php Outdated Show resolved Hide resolved
We are using namespace segments instead of looping of the whole array
of the namespaces to rewrite. Because of that we are able to quit after
1 or 2 checks, otherwise - if we use normal loop - in the worst case
scenario - we need to have 12 checks.
@weierophinney weierophinney merged commit 8e0bd72 into laminas:master Apr 1, 2019
weierophinney added a commit that referenced this pull request Apr 1, 2019
@michalbundyra michalbundyra deleted the rewrite-autoloader branch April 1, 2019 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants