-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
[TASK] Allow to load guides.xml
when in composer mode
#817
base: main
Are you sure you want to change the base?
[TASK] Allow to load guides.xml
when in composer mode
#817
Conversation
When building a PHAR, or using this project as a composer dependency, the `vendor/bin/guides` binary could not be called due to a PHP error. This is because the file `guides.xml` is referenced via `vendor/../guides.xml`. That works in the root of the main `render-guides` repository, but not in a composer environment. There the correct location is `vendor/t3docs/render-guides/guides.xml`. This PR adds a check to resolve that file in case the first try returns FALSE for the realpath() lookup. Generally this lookup code is a bit spaghetti-ish and we should properly refactor this. For the time being, a hotfix like this would allow me to continue on using `render-guides` as a dependency in referring projects.
Some issues remain with render-guides, made a PR for that: phpDocumentor/guides#817
@garvinhicking I just merged #824, does this solve your issue as well? the error might be gone, but I think you have a more specific use case for typo3, when the tool is installed via composer? |
No, doesnt fix mine because I need the fallback without ../ just like in this PR. Maybe you could look at it again, it doesn't do so much more than the one you merged apart from one more directory check... |
Ah, now I see the problem - I need to reference the guides.xml of a specific composer packe, but it's one that uses "guides" but it isn't guides itself. So we'd probably need another configuration directive to specify the projectConfig file. Can I override that later on in the workflow, or do you have a suggestion how to specify the file without needing a patch so individual like mine? |
Maybe we should solve this in some way in the typo3 project, let's see if that's possible someway. |
The script tries to load the
|
Let me try to rephrase the problems I have. The TYPO3 When checking out the core-level example:
project-level:
Both files need to be loaded (not just one). If I read the code right, the first one is $projectConfig, and the second one is $localConfig in the If I now create a package that uses the To get this all running, what we need is to be able to influence BOTh the $projectConfig AND $localConfig. The current So in the end I would need the ability to specify:
Currently that first one is the one I need to "map" to I hope this explanation is better understandable now. |
When building a PHAR, or using this project as a composer dependency, the
vendor/bin/guides
binary could not be called due to a PHP error.This is because the file
guides.xml
is referenced viavendor/../guides.xml
. That works in the root of the mainrender-guides
repository, but not in a composer environment.There the correct location is
vendor/t3docs/render-guides/guides.xml
.This PR adds a check to resolve that file in case the first try returns FALSE for the realpath() lookup.
Generally this lookup code is a bit spaghetti-ish and we should properly refactor this. For the time being, a hotfix like this would allow me to continue on using
render-guides
as a dependency in referring projects.