mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-08-15 19:34:47 -04:00
Switch from stdClass to arrays for global data.
This commit is contained in:
@@ -18,27 +18,26 @@
|
||||
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
class View extends View_Core {
|
||||
static $global_data;
|
||||
static $global_data = array();
|
||||
|
||||
/**
|
||||
* Reimplement Kohana 2.3's View::set_global() functionality.
|
||||
*/
|
||||
public function set_global($key, $value) {
|
||||
View::$global_data->$key = $value;
|
||||
View::$global_data[$key] = $value;
|
||||
$this->$key = $value;
|
||||
}
|
||||
|
||||
public function __isset($key) {
|
||||
if (isset(View::$global_data->$key)) {
|
||||
if (array_key_exists($key, View::$global_data)) {
|
||||
return true;
|
||||
}
|
||||
return parent::__isset($key);
|
||||
}
|
||||
|
||||
public function &__get($key) {
|
||||
Kohana_Log::add("error",print_r("__get($key)",1));
|
||||
if (isset(View::$global_data->$key)) {
|
||||
return View::$global_data->$key;
|
||||
if (array_key_exists($key, View::$global_data)) {
|
||||
return View::$global_data[$key];
|
||||
}
|
||||
return parent::__get($key);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user