Beispiel #1
0
 protected static function TraceTabulation()
 {
     $tab = self::getTime(DateTime::now()) . " Trace : ";
     $txt = "";
     for ($i = 0; $i < Strings::lenght($tab); $i++) {
         $txt .= " ";
     }
     return $txt . " ";
 }
Beispiel #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;
 }
Beispiel #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);
     }
 }
 /**
  * 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";
 }
Beispiel #5
0
 /**
  * splite commande string with '@'
  */
 protected static function spliteStringCallback($string)
 {
     $data = Strings::splite($string, "@");
     return array('controller' => $data[0], 'methode' => $data[1]);
 }
Beispiel #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);
         }
     }
 }
Beispiel #7
0
 /**
  * get the name of option
  */
 protected function getOptionalKeyValue($opt)
 {
     $data = Strings::splite($opt, "=");
     return $data[0];
 }