13 protected $all_data_sencillo;
18 private $config = array();
22 public function __construct()
24 $this->config(
'lib_folder',
'fw_libraries');
25 $this->config(
'mod_folder',
'fw_modules');
26 $this->config(
'lib_ignore',
'lib_identificator.php');
32 private function createStructure()
34 $this->lib=array(
"id"=>array(),
38 $this->all_data_sencillo=array(
"left"=>array(),
43 $this->files = scandir(
'./' . $this->config[
'lib_folder'] .
'/');
45 if(file_exists(
'./' . $this->config[
'mod_folder'] .
'/'))
47 $this->modules = scandir(
'./' . $this->config[
'mod_folder'] .
'/');
54 private function openFiles()
56 foreach($this->files as $value)
58 $test=(($value!=
'.')&&($value!=
'..')&&($value!=$this->config[
'lib_ignore'])&&($value!=
'examples')?
true:
false);
60 if(($value!=
'.')&&($value!=
'..')&&($value!=$this->config[
'lib_ignore'])&&($value!=
'examples'))
62 $this->lib[
'id'][]=$value;
66 foreach($this->lib[
'id'] as $value)
71 $NAME=explode(
".",$value);
72 $MOD_DESC=$NAME[0].
','.$NAME[1];
73 $this->lib[
'name'][]=$NAME[2];
74 $this->lib[
'function'][]=$MOD_DESC;
75 $this->lib[
'version'][]=$VERSION;
76 $this->lib[
'status'][]=
'OK:'.$value;
77 $this->lib[
'path'][]=
'./' . $this->config[
'lib_folder'] .
'/'.$value;
78 $this->lib[
'install'][]=
'../' . $this->config[
'lib_folder'] .
'/'.$value;
82 $this->lib[
'status']=array(
'ERROR:'.$value.
':'.$e);
90 private function openModules()
92 foreach($this->modules as $value)
94 $test=((file_exists(
'./' . $this->config[
'mod_folder'] .
'/'.$value.
'/'))&&($value!=
'.')&&($value!=
'..')&&($value!=$this->config[
'lib_ignore'])&&($value!=
'examples')?
true:
false);
96 if((file_exists(
'./' . $this->config[
'mod_folder'] .
'/'.$value.
'/'))&&($value!=
'.')&&($value!=
'..')&&($value!=$this->config[
'lib_ignore'])&&($value!=
'examples'))
98 $this->lib[
'id'][]=$value;
102 foreach($this->lib[
'id'] as $value)
106 $this->lib[
'name'][]=$value;
107 $this->lib[
'function'][]=
'custom_module';
108 $this->lib[
'status'][]=
'OK:'.$value;
109 $this->lib[
'path'][]=
'./' . $this->config[
'mod_folder'] .
'/'.$value.
'/info_'.$value.
'.php';
110 $this->lib[
'path'][]=
'./' . $this->config[
'mod_folder'] .
'/'.$value.
'/update_'.$value.
'.php';
111 $this->lib[
'path'][]=
'./' . $this->config[
'mod_folder'] .
'/'.$value.
'/install_'.$value.
'.php';
112 $this->lib[
'path'][]=
'./' . $this->config[
'mod_folder'] .
'/'.$value.
'/main_'.$value.
'.php';
113 $this->lib[
'path'][]=
'./' . $this->config[
'mod_folder'] .
'/'.$value.
'/'.$value.
'.php';
117 $this->lib[
'status'][]=
'ERROR:'.$value.
':'.$e;
128 $this->createStructure();
129 $this->files = array_diff(scandir(
'../' . $this->config[
'lib_folder'] .
'/'),$ignored);
139 public function config($key,$val)
141 unset($this->config[$key]);
142 if(empty($this->config[$key]))
144 $this->config[$key] = $val;
158 $this->createStructure();
169 return $this->all_data_sencillo;
187 return array_unique($this->lib[
'path']);
196 return array_unique($this->lib[
'install']);