Skip to content

Commit 3576793

Browse files
author
Marius Cramer
committed
Removed necessity to call $app->uses
1 parent 79bd207 commit 3576793

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

interface/lib/app.inc.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,16 @@ class app {
4848
private $_wb;
4949
private $_loaded_classes = array();
5050
private $_conf;
51+
52+
public $loaded_plugins = array();
5153

5254
public function __construct() {
5355
global $conf;
5456

5557
if (isset($_REQUEST['GLOBALS']) || isset($_FILES['GLOBALS']) || isset($_REQUEST['s']) || isset($_REQUEST['s_old']) || isset($_REQUEST['conf'])) {
5658
die('Internal Error: var override attempt detected');
5759
}
58-
60+
5961
$this->_conf = $conf;
6062
if($this->_conf['start_db'] == true) {
6163
$this->load('db_'.$this->_conf['db_type']);
@@ -110,6 +112,14 @@ public function __construct() {
110112
$this->uses('auth,plugin');
111113
}
112114

115+
public function __get($prop) {
116+
if(property_exists($this, $prop)) return $this->{$prop};
117+
118+
$this->uses($prop);
119+
if(property_exists($this, $prop)) return $this->{$prop};
120+
else return null;
121+
}
122+
113123
public function __destruct() {
114124
session_write_close();
115125
}
@@ -120,7 +130,7 @@ public function uses($classes) {
120130
foreach($cl as $classname) {
121131
$classname = trim($classname);
122132
//* Class is not loaded so load it
123-
if(!array_key_exists($classname, $this->_loaded_classes)) {
133+
if(!array_key_exists($classname, $this->_loaded_classes) && is_file(ISPC_CLASS_PATH."/$classname.inc.php")) {
124134
include_once ISPC_CLASS_PATH."/$classname.inc.php";
125135
$this->$classname = new $classname();
126136
$this->_loaded_classes[$classname] = true;

0 commit comments

Comments
 (0)