Posted by fubhy on May 6, 2012 at 10:54am
3 followers
| Project: | Libraries API |
| Version: | 7.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (duplicate) |
Issue Summary
@see title.
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| libraries-external.patch | 691 bytes | Idle | PASSED: [[SimpleTest]]: [MySQL] 135 pass(es). | View details | Re-test |
Comments
#1
There are more places in the code where file_exists() is called on external pathes.
#2
+++ b/libraries.module@@ -456,7 +456,7 @@ function libraries_detect($name) {
- if ($library['library path'] === FALSE || !file_exists($library['library path'])) {
+ if ($library['library path'] === FALSE || (!url_is_external($library['library path']) && !file_exists($library['library path']))) {
This begs the question of whether we should rename 'library path' into 'uri' ?
+++ b/libraries.module@@ -727,8 +727,9 @@ function libraries_get_version($library, $options) {
+ $external = url_is_external($library['library path']);
+ $file = (!$external ? DRUPAL_ROOT . '/' : '') . $library['library path'] . '/' . $options['file'];
+ if (empty($options['file']) || (!$external && !file_exists($file))) {
That's veeery compact ;)
Let's use a less sparse control structure:
$file = ...;if (!$external = url_is_external(...)) {
$file = DRUPAL_ROOT . '/' . $file;
}
+++ b/libraries.module@@ -727,8 +727,9 @@ function libraries_get_version($library, $options) {
$file = fopen($file, 'r');
All of that being said, I wonder why the file_exists() does not work?
The fopen() works, but the file_exists() does not?
Sounds strange to me.
#3
Sorry for letting this sit so long before closing this down, but this is definitely duplicate of #864376: Loading of external libraries. You can see from the patches there, that I followed a similar path.