protected static function TraceTabulation() { $tab = self::getTime(DateTime::now()) . " Trace : "; $txt = ""; for ($i = 0; $i < Strings::lenght($tab); $i++) { $txt .= " "; } return $txt . " "; }
public static function create($name) { $time = Time::now(); if (empty($name)) { $name = $time; } // $Root = Process::root; if (!file_exists($Root . "app/links/" . $name . ".php")) { $myfile = fopen($Root . "app/links/" . $name . ".php", "w"); $txt = self::set($name); fwrite($myfile, $txt); fclose($myfile); // return true; } else { return false; } }
public function edit() { $sql = "update " . $this->DBtable . " set "; // $data = $this->getData(); unset($data["primaryKey"]); // Beta 27/05/2016 // $i = 0; // foreach ($data as $key => $value) { if ($i == 0) { $sql .= "{$key}='{$value}'"; } else { $sql .= ",{$key}='{$value}'"; } $i++; } if ($this->isMaj) { if ($i == 0) { $sql .= "edited_at='" . Time::now() . "'"; } else { $sql .= ",edited_at='" . Time::now() . "'"; } } // $key = $this->getPKvalue(); $sql .= " where " . $this->primaryKey . "='" . $key . "'"; // //return $data; return Database::exec($sql); }
/** * Time */ function now() { return DateTime::now(); }