[BUG] Unable To Find External Dependencies on Case-Sensitive Systems - #2499
Closed
Fenikkusu wants to merge 5 commits into
Closed
[BUG] Unable To Find External Dependencies on Case-Sensitive Systems#2499Fenikkusu wants to merge 5 commits into
Fenikkusu wants to merge 5 commits into
Conversation
Contributor
Author
|
Context From Claude Code |
Contributor
Author
|
I'm tired, and it's far past my bedtime. I will get the PR cleaned up tomorrow. I couldn't find (quickly) where the automated test for Compile is, so if someone wants to point me in the right direction, I'll get that handled too (I feel like I've asked that before...) |
…kwards Compatability)
…kwards Compatability)
…kwards Compatability)
Fenikkusu
force-pushed
the
hotfix/external-classes
branch
from
May 16, 2026 21:25
bb67fbf to
247378e
Compare
|
3 tasks
Member
|
Closing in favour of #2556 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Hello!
In raising this pull request, I confirm the following:
Many of my Zephir Projects extend or leverage Phalcon. I recently made a change to a project where I extended Phalcon\Support\Collection. I found, though, that if I called the "get" method, I was getting the error
called with a wrong number of parameters, the method has: 2, passed: 1I loaded up Claude and started digging into the issue, and finally determined that this was the result of a combination of two bugs. The first bug (that this PR attempts to fix) is that when Zephir tries to load a class from
external-dependenciesin the config.json, it calls strtolower on the path. The issue is that on case-sensitive file systems, this check fails for Phalcon files because the raw files are capitalized. IE: The classPhalcon\Support\Collectionwas "mapping" to/opt/cphalcon/phalcon/support/collection.zep, which doesn't exist because the actual path was/opt/cphalcon/phalcon/Support/Collection.zep.The second bug, which I'm not fixing at this time, but may still be required, is that it falls back to Reflection when it cannot find the class. In this case, Zephir uses the
issetmethod inMethod::getNumberOfRequiredParameters. The issue is that if the default value is null, as is the case inCollection::get,issetreturns false.This PR fixes the first issue, which should make the second issue a moot point. I have confirmed that after applying this fix, my project started to compile as expected. It is done in such a way as to allow backwards compatibility.