Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
base system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
8 Mar 2012 at 21:38 UTC
Updated:
29 Jul 2014 at 20:28 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
amateescu commentedLet's see if we can get some green with the first one :)
Comment #2
amateescu commentedComment #4
cweagansThe classloader can't find the PEAR Archive class. I'm not sure how that works though, so I wasn't able to dig much further than that. I tried to manually manually run the test case that was failing. This is the PHP error that I got:
"PHP Fatal error: Class 'PEAR\\Archive_Tar\\Archive_Tar' not found in /Users/cweagans/Sites/d8.dev/core/lib/Drupal/Component/Archiver/Tar.php on line 28, referer: http://d8.dev/admin/reports/updates/install"
Comment #5
amateescu commentedHm, seems that our class loader only likes Symfony code.
I tried adding:
to
$loader->registerNamespacesin _drupal_bootstrap_configuration() without any luck, so I'm moving the Archive_Tar class under the Drupal\Component\Archiver umbrella because it's already altered and doesn't really belong to vendor anyway.Comment #7
cweagans#5: archiver-psr0-5.patch queued for re-testing.
Comment #8
Crell commentedThe Archive_Tar class is 3rd party code, not Drupal code. Also, it is not PSR-0, because it's not PHP 5.3. So...
I'm thinking that file should get moved to /core/vendor/PEAR/Archive_Tar.php, and referenced as a Prefix with the class loader, not as a namespace.
Comment #9
catchThat sounds right, the Symfony autoloader supports PEAR classes, so we can still use it, just not the same as everything else.
Comment #10
amateescu commentedAh, so I was trying one level too deep in #1 (/core/vendor/PEAR/Archive_Tar/Archive_Tar.php instead of /core/vendor/PEAR/Archive_Tar.php). I'll take another crack at it then.
Comment #12
amateescu commentedMuch better now.
Comment #13
Crell commentedMinor nit:
array is a base datatype, so should be lower-cased, I think. There was some issue about it somewhere... :-)
Also, it's awesome to see that this code can end up in Component. However, Components are not supposed to have any external dependencies. This code has a dependency on the PEAR Archive_Tar class. :-( Not sure what we want to do there, as I'd hate to move it to Drupal\Core but...
Comment #14
berdirComponents can depend on other components, right? So why not on a 3rd party component?
Anyway, here is a quick re-roll with the Array fixed and also fixed conflicts in system.info.
Comment #15
catchYeah I agree with Berdir, the idea of a Component is it's something that could be used independently of core, so having dependencies isn't the issue, it's having dependencies on application-level Drupal code that would be.
Comment #16
Crell commentedOK, if we include a README.txt file in the Component/Archiver directory stating the dependency with a link to where to get the file, that's good enough for me.
The current Component readme file says that there can be no external dependencies other than other Components, but I'm willing to be a little bit flexible with that on things like this.
Comment #17
catchI had a feeling that system.tar.inc might be forked, and it is: #486558: Add Archive Tar to Drupal.
Comment #18
amateescu commentedYes it is. And there's even an issue to upgrade it: #1414508: update system.tar.inc to latest Archive_Tar (Pear).
Comment #19
catchSo if it's forked, can we legitimately put it in a PEAR directory? Seems more like it should go in Drupal\Component with the rest of the code (and we could possibly look to see if the updated version might be possible un-forkable again).
Comment #20
amateescu commented@catch, placing it in Drupal\Component was my initial thought as well in #5 but Crell disagreed in #8.
As for un-forking it, I don't think it's possible because the latest version of that class still extends PEAR.
Comment #21
Crell commentedI hadn't realized that it was forked. Given that, yes, just put it in the Component and document that it's forked. If we are able to convert it to the unforked version later, that can go back in the PEAR directory.
Comment #22
amateescu commentedHere we go :)
Comment #23
amateescu commentedRerolled because the mail conversion patch got in first. This is the last one from system.module!
Comment #24
Crell commentedI think that was the only issue, so going out on a limb...
Comment #25
cweagansSeconded.
Comment #26
dries commentedI agree with our view on dependencies. Sounds like everyone is on board, including catch. Reviewed the patch and committed it to 8.x. Thanks all!