Ejemplo n.º 1
0
 protected static function TraceTabulation()
 {
     $tab = self::getTime(DateTime::now()) . " Trace : ";
     $txt = "";
     for ($i = 0; $i < Strings::lenght($tab); $i++) {
         $txt .= " ";
     }
     return $txt . " ";
 }
Ejemplo n.º 2
0
 /**
  * Get the dynamic paramteres from route string
  */
 protected static function dynamic($route)
 {
     $parms = array();
     $param = "";
     $open = false;
     //
     for ($i = 0; $i < Strings::lenght($route); $i++) {
         if ($open && $route[$i] != "}") {
             $param .= $route[$i];
         }
         //
         if ($route[$i] == "{" && !$open) {
             $open = true;
         } elseif ($route[$i] == "}" && $open) {
             $open = !true;
             $parms[] = $param;
             $param = "";
         }
     }
     //
     return $parms;
 }
Ejemplo n.º 3
0
 /**
  * Set classes aliases
  */
 public static function setAlias($alias)
 {
     $shortcuts = $alias["shortcuts"];
     foreach ($shortcuts as $alias => $target) {
         $target = Strings::replace($target, "/", "\\");
         Alias::set($target, $alias);
     }
 }
Ejemplo n.º 4
0
 /**
  * get the id key of the model from his name
  *
  * @param $table : string name of the model
  */
 protected function idKey($table)
 {
     return Strings::toLower($table) . "_id";
 }
Ejemplo n.º 5
0
 /**
  * splite commande string with '@'
  */
 protected static function spliteStringCallback($string)
 {
     $data = Strings::splite($string, "@");
     return array('controller' => $data[0], 'methode' => $data[1]);
 }
Ejemplo n.º 6
0
 /**
  * Set classes aliases
  */
 public static function setAlias($alias)
 {
     if (self::isConfigKeyExist($alias, "shortcuts")) {
         $shortcuts = self::$config[$alias]["shortcuts"];
         //
         foreach ($shortcuts as $alias => $target) {
             $target = Strings::replace($target, "/", "\\");
             Alias::set($target, $alias);
         }
     }
 }
Ejemplo n.º 7
0
 /**
  * get the name of option
  */
 protected function getOptionalKeyValue($opt)
 {
     $data = Strings::splite($opt, "=");
     return $data[0];
 }