示例#1
0
 public static function generate($module, $lib = NULL)
 {
     Libs::detect();
     $installed = Libs::getInstalled();
     $class_list = array();
     $generated = 0;
     foreach ($installed as $i) {
         $gen_root = DOC_ROOT . '/vendor/' . $i . '/src/Empathy/ELib/Gen';
         if (file_exists($gen_root)) {
             $files = glob($gen_root . '/*.php');
             foreach ($files as $f) {
                 $matches = array();
                 preg_match('/Gen\\/(.+)\\.php$/', $f, $matches);
                 $class_list[] = 'Empathy\\ELib\\Gen\\' . $matches[1];
             }
         }
     }
     foreach ($class_list as $c) {
         $tmp = new $c();
         if ($tmp->getModule() == $module) {
             if ($tmp->write()) {
                 $generated++;
             }
         }
     }
     return $generated;
 }
示例#2
0
 public function __construct($boot)
 {
     parent::__construct($boot);
     CurrentUser::detectUser($this);
     $this->elib_tpl_dirs = Util\Libs::detect();
     if (sizeof($this->elib_tpl_dirs) > 1) {
         $this->assign('elibtpl_arr', $this->elib_tpl_dirs);
     } else {
         $this->assign('elibtpl', $this->elib_tpl_dirs[0]);
     }
     if (Util\Libs::getStoreActive()) {
         CurrentUser::detectUser($this, true);
     }
 }