+--------------------------------------------------------------------+
| CiviCRM version 4.6 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
* Temporarily change a global variable.
* We don't have a container or dependency-injection, so use singleton instead
*
* @var object
- * @static
*/
private static $_singleton = NULL;
private $backups = array();
/**
- * Get or set the single instance of CRM_Utils_GlobalStack
+ * Get or set the single instance of CRM_Utils_GlobalStack.
*
* @return CRM_Utils_GlobalStack
*/
}
/**
- * @param array $new the new, incoming frame
- * @return array frame
+ * @param array $new
+ * The new, incoming frame.
+ * @return array
+ * frame
*/
public function createBackup($new) {
$frame = array();
foreach ($values as $key => $value) {
$frame[$globalKey][$key] = CRM_Utils_Array::value($key, $GLOBALS[$globalKey]);
}
- } else {
+ }
+ else {
$frame[$globalKey] = CRM_Utils_Array::value($globalKey, $GLOBALS);
}
}
foreach ($values as $key => $value) {
$GLOBALS[$globalKey][$key] = $value;
}
- } else {
+ }
+ else {
$GLOBALS[$globalKey] = $values;
}
}
}
+
}