@see title.
There are more places in the code where file_exists() is called on external pathes.
+++ 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.
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.
Comments
Comment #1
fubhy commentedThere are more places in the code where file_exists() is called on external pathes.
Comment #2
sunThis begs the question of whether we should rename 'library path' into 'uri' ?
That's veeery compact ;)
Let's use a less sparse control structure:
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.
Comment #3
tstoecklerSorry 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.