summaryrefslogtreecommitdiff
path: root/modules/g2_import/helpers/g2_import.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-01-31 16:07:41 -0800
committerBharat Mediratta <bharat@menalto.com>2010-01-31 16:07:41 -0800
commitc050acf30a7351bf0ef5b8ee206704c073e881c7 (patch)
tree93db400f07fe706aa30dc19a59da8580f42f3af0 /modules/g2_import/helpers/g2_import.php
parentc6676dd455d070aaded25f048269eee07248100a (diff)
Fix lots of warnings that pop up when we're in E_STRICT mode. They're
mostly issues around uninitialized variables, calling non-static functions in a static context, calling Session functions directly instead of on its singleton, passing non-variables by reference, and subclasses not using the same interface as the parent class.
Diffstat (limited to 'modules/g2_import/helpers/g2_import.php')
-rw-r--r--modules/g2_import/helpers/g2_import.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php
index fa95e547..0fcc0539 100644
--- a/modules/g2_import/helpers/g2_import.php
+++ b/modules/g2_import/helpers/g2_import.php
@@ -24,6 +24,7 @@ class g2_import_Core {
public static $g2_base_url = null;
private static $current_g2_item = null;
+ private static $error_reporting = null;
static function is_configured() {
return module::get_var("g2_import", "embed_path");
@@ -931,6 +932,16 @@ class g2_import_Core {
"useAuthToken" => false));
return str_replace(self::$g2_base_url, "", $url);
}
+
+ static function lower_error_reporting() {
+ // Gallery 2 was not designed to run in E_STRICT mode and will barf out errors. So dial down
+ // the error reporting when we make G2 calls.
+ self::$error_reporting = error_reporting(error_reporting() & ~E_STRICT);
+ }
+
+ static function restore_error_reporting() {
+ error_reporting(self::$error_reporting);
+ }
}
/**