public static function show($e) { ?> <div style="margin-bottom:10px;background:green;color:white"> <?php echo $e->getMessage(); ?> </div> <div style="margin-bottom:10px;background:green;color:white"> <?php echo $e->getPrevious(); ?> </div> <div style="margin-bottom:10px;background:green;color:white"> <?php echo $e->getCode(); ?> </div> <div style="margin-bottom:10px;background:green;color:white"> <?php echo $e->getFile(); ?> </div> <div style="margin-bottom:10px;background:green;color:white"> <?php echo $e->getLine(); ?> </div> <div style="margin-bottom:10px;background:green;color:white"> <?php Table::show($e->getTrace()); ?> </div> <?php }
function __construct($name) { $this->name = $name; // $columns = Database::read("select COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = '" . Config::get('database.database') . "' AND TABLE_NAME = '" . $name . "';"); // foreach ($columns as $key => $value) { Table::push($this->columns, $value['COLUMN_NAME']); } }
public static function join($array, $separator, $startIndex = 0, $count = -1) { $string = ""; // $end = $count == -1 ? Table::count($array) : $count; // for ($i = $startIndex; $i < $end; $i++) { if ($i == $end - 1) { $string .= $array[$i]; } else { echo $string .= $array[$i] . $separator; } } // return $string; }
protected static function diffResource($only, $except) { $all = array('index', 'show', 'add', 'insert', 'edit', 'update', 'delete'); // if (isset($except)) { $i = 0; foreach ($all as $value) { if (Table::contains($except, $value)) { unset($all[$i]); } $i++; } } // if (isset($only)) { foreach ($all as $key => $value) { $ext = false; foreach ($only as $value2) { if ($value == $value2) { $ext = true; break; } } if (!$ext) { unset($all[$key]); } } } return $all; }
public static function user() { if (self::check()) { if (Session::existe('auths')) { $user = new userM(Session::get("auths")[0]); // return $user; } else { if (Cookie::existe(Config::get('auth.rememeber_cookie'))) { $usr = new userM(); $user = Table::first($usr->get("rememberToken", Cookie::get(Config::get('auth.rememeber_cookie')))); // return $user; } } } else { return null; } }