Esempio n. 1
0
 public function getRequire($path)
 {
     if ($this->exists($path)) {
         return \Connector::need($path);
     } else {
         throw new FileNotFoundException($path);
     }
 }
Esempio n. 2
0
 public static function in($key)
 {
     $url = explode('.', $key);
     $k = "";
     $link = "";
     if (count($url) >= 3) {
         $j = 0;
         for ($i = 0; $i < count($url) - 2; $i++) {
             $link .= $url[$i] . "/";
             $j = $i;
         }
         $j++;
         $link .= $url[$j];
         $k = $url[$j + 1];
     } else {
         $link .= $url[0];
         $k = $url[1];
     }
     $files = \Connector::need(Application::$root . "app/links/{$link}.php");
     //
     return $files[$k];
 }
Esempio n. 3
0
 protected static function call($info, $modelname)
 {
     if ((new Filesystem())->exists(Application::$root . $info)) {
         \Connector::need(Application::$root . $info);
         if ($modelname) {
             \Connector::need(Application::$root . $modelname);
         }
     } else {
         throw new AutoloadFileNotFoundException(Application::$root . $file);
     }
 }
Esempio n. 4
0
 /**
  * View For Plugin
  */
 public static function import($_plg, $_value_, $_data_ = null)
 {
     if (!is_null($_data_)) {
         foreach ($_data_ as $_key_ => $_value2_) {
             ${$_key_} = $_value2_;
         }
     }
     //getFile
     $_name_ = str_replace('.', '/', $_value_);
     //
     $_link1_ = Plugins::getPath($_plg) . Plugins::getCore($_plg, "views") . '/' . $_name_ . '.php';
     $_link2_ = Plugins::getPath($_plg) . Plugins::getCore($_plg, "views") . '/' . $_name_ . '.tpl.php';
     //die($_link1_);
     //
     $_tpl_ = false;
     //
     if (file_exists($_link1_)) {
         $_link3_ = $_link1_;
         $_tpl_ = false;
     } else {
         if (file_exists($_link2_)) {
             $_link3_ = $_link2_;
             $_tpl_ = true;
         } else {
             throw new ViewNotFoundException($_name_);
         }
     }
     if ($_tpl_) {
         self::$showed = "tpl";
         Template::show($_link3_, $_data_);
     } else {
         self::$showed = "smpl";
         \Connector::need($_link3_);
     }
 }
Esempio n. 5
0
 protected static function call($info)
 {
     $file = $info["path"] . "/" . $info["autoload"]["file"];
     //
     if ((new Filesystem())->exists($file)) {
         \Connector::need($file);
     } else {
         throw new AutoloadFileNotFoundException($file);
     }
 }