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

Make library usable as is without shim #666

Merged
merged 2 commits into from
Aug 13, 2021
Merged

Make library usable as is without shim #666

merged 2 commits into from
Aug 13, 2021

Conversation

patrickkusebauch
Copy link
Collaborator

Installing vias shim is great and all, but there are reasons why one might now want to do so. From the top of my head:

  • Not wanting to wait for a release. You might pin to a commit instead and get new features before a tagged release
  • It is a strong precursor for writing extensions to the package.

@@ -9,7 +9,9 @@
}

(static function (): void {
require_once __DIR__.'/vendor/autoload.php';
if (\file_exists($autoload = __DIR__.'/vendor/autoload.php')) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To also support install as a global installed dependency there should be more paths taken into account, see https://github.com/sabre-io/dav/blob/c1afdc77a95efea6ee40c03c45f57c3c0c80ec22/bin/sabredav.php#L28

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see what you mean, but this is already taken into the account. First of all, we do not have a deprac/bin/deptrac, but only "deptrac/deptrac".

This is the difference that would make it so we have to go "up" one less directory (one less ../).

If you take that into the account, then the path on line 12 is the same as in sabredev:29 and line 18 is the same as sabredev:30.

  • Why are they immediately called anonymous functions in deptrac? No idea.
  • Why are they separate? Again, no idea.

Anyways this code works and is internally consistent. The only "improvement" I could see is that we could check if exactly one autoloader is found and if not, throw an error. But that is out of scope IMHO.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the deptrac package directly is mainly a convenience feature for people working on it. Most people should still use the shim or phar. With that in mind, I think we don't have to make any more adjustments for now.

@dbrumann dbrumann merged commit c3afb71 into qossmic:main Aug 13, 2021
@patrickkusebauch patrickkusebauch deleted the feature/remove_extra_autoload branch August 13, 2021 12:40
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.

None yet

3 participants