Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
feeds
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
drupal.org
feeds
Commits
10be1867
Commit
10be1867
authored
12 years ago
by
Chris Leppanen
Browse files
Options
Downloads
Patches
Plain Diff
Allow setting a variable for the library path.
parent
ec4eb09a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
feeds.module
+16
-1
16 additions, 1 deletion
feeds.module
with
16 additions
and
1 deletion
feeds.module
+
16
−
1
View file @
10be1867
...
...
@@ -952,18 +952,24 @@ function feeds_plugin($plugin, $id) {
function
feeds_include_library
(
$file
,
$library
)
{
static
$included
=
array
();
static
$ignore_deprecated
=
array
(
'simplepie'
);
if
(
!
isset
(
$included
[
$file
]))
{
// Disable deprecated warning for libraries known for throwing them
if
(
in_array
(
$library
,
$ignore_deprecated
))
{
$level
=
error_reporting
();
// We can safely use E_DEPRECATED since Drupal 7 requires PHP 5.3+
error_reporting
(
$level
&
~
E_DEPRECATED
);
error_reporting
(
$level
^
E_DEPRECATED
^
E_STRICT
);
}
// Try first whether libraries module is present and load the file from
// there. If this fails, require the library from the local path.
$library_dir
=
variable_get
(
'feeds_library_dir'
,
FALSE
);
if
(
module_exists
(
'libraries'
)
&&
file_exists
(
libraries_get_path
(
$library
)
.
"/
$file
"
))
{
require
libraries_get_path
(
$library
)
.
"/
$file
"
;
}
elseif
(
$library_dir
&&
file_exists
(
"
$library_dir
/
$library
/
$file
"
))
{
require
"
$library_dir
/
$library
/
$file
"
;
}
else
{
// @todo: Throws "Deprecated function: Assigning the return value of new
// by reference is deprecated."
...
...
@@ -988,12 +994,21 @@ function feeds_include_library($file, $library) {
* libraries module.
*/
function
feeds_library_exists
(
$file
,
$library
)
{
if
(
module_exists
(
'libraries'
)
&&
file_exists
(
libraries_get_path
(
$library
)
.
"/
$file
"
))
{
return
TRUE
;
}
elseif
(
file_exists
(
DRUPAL_ROOT
.
'/'
.
drupal_get_path
(
'module'
,
'feeds'
)
.
"/libraries/
$file
"
))
{
return
TRUE
;
}
elseif
(
$library_dir
=
variable_get
(
'feeds_library_dir'
,
FALSE
))
{
if
(
file_exists
(
"
$library_dir
/
$library
/
$file
"
))
{
return
TRUE
;
}
}
return
FALSE
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment