Ejemplo n.º 1
0
 public static function __callStatic($name, $args)
 {
     if (count($args) == 1 && is_string($args[0]) || count($args) == 2 && is_string($args[0]) && is_array($args[1])) {
         foreach (CONFIG::get("sql") as $value) {
             if (CONFIG::has_attribute($value, "database_alias", true) && CONFIG::has_attribute($value, "model", true)) {
                 $alias = $value["@attributes"]["database_alias"];
                 $model = $value["@attributes"]["model"];
                 $modelname = $args[0];
                 $params = [];
                 if (isset($args[1])) {
                     $params = $args[1];
                 }
                 if ($name == $alias && $modelname == $model) {
                     foreach ($value as $subkey => $subvalue) {
                         if (self::startswith(strtolower($subkey), "select:")) {
                             $handler = new self($alias, CONFIG::content($subvalue), $params);
                             return $handler;
                         }
                     }
                 }
             }
         }
     }
     return null;
 }
Ejemplo n.º 2
0
 public static function init()
 {
     NISE::$rootpath = dirname(__FILE__);
     SESSION::init();
     CONFIG::load();
     CONFIG::apply();
     PROJECT::launch();
     OUTPUT::render();
 }
Ejemplo n.º 3
0
 public static function template($type)
 {
     foreach (CONFIG::get("template") as $value) {
         if (CONFIG::has_attribute($value, "type", true) && strtoupper($value["@attributes"]["type"]) == strtoupper($type)) {
             self::translate($value["@attributes"]["type"], $value);
         }
     }
 }
Ejemplo n.º 4
0
 public static function get_target(&$value)
 {
     $target = [];
     if (\Nise\CONFIG::has_attribute($value, "target", true)) {
         $target = strtoupper($value["@attributes"]["target"]);
         unset($value["@attributes"]["target"]);
         if (preg_match('/\\|/', $target)) {
             $target = explode("|", str_replace("STANDARD", "HTML", $target));
         } else {
             $target = [str_replace("STANDARD", "HTML", $target)];
         }
     } else {
         $target = ["HTML"];
     }
     return $target;
 }