public static function ObjectToArray($object) { if (is_object($object)) { return (array) $object; } else { error::newError("HATA : {$object} bir obje değil"); } }
public static function makro($name, $return) { if (is_callable($return)) { self::$functions[$name] = Closure::bind($return, null, get_class()); } else { error::newError("{$name} e atadığınız fonksiyon çağrılabilir bir fonksiyon değildir"); } }
public static function __callStatic($name, $params) { $type = self::$typeStatic; if ($type != 'Sqlite') { if (method_exists($type, $name)) { return call_user_func_array(array(self::$dbStatic, $name), $params); } else { error::newError(" {$name} adlı bir method {$type} tipinde bulunamadı"); } } else { } }
public static function ipBlocker($status = false) { global $db; $ip = self::getIp(); if ($status) { $kontrol = $pdo->query("SELECT ipAdress From IpBlock where ipAdress= '{$ip}' ")->rowCount(); if ($kontrol) { error::newError("Ip Adresiniz engellenmiştir"); die; } } }
public static function check($path, $app = true) { if ($app) { $path = $appPath . $path; } if (file_exists($path)) { if (is_dir($path)) { return true; } else { return false; } } else { error::newError("{$path} dosyası bulunamadı"); return false; } }
public static function init($cacheFile = "Stoge/Cache") { if (!file_exists($cacheFile)) { mkdir($cacheFile, 0777); } if (extension_loaded('memcache')) { self::$_cache = new Memcache(); self::$_cache->connect('127.0.0.1', 11211); } else { if (is_writeable($cacheFile)) { self::$_cache = new ozsaCACHE($cacheFile); } else { error::newError("{$cacheFile} yazılabilir bir dosya değil"); } } }
public function includePlugins() { global $db; $dondur = $db->query("SELECT mainFileName,pluginName FROM plugins WHERE status = '1'"); if ($dondur->rowCount()) { $cek = $dondur->fetch(PDO::FETCH_OBJ); $name = $cek->mainFileName; $pluginName = $cek->pluginName; $file = $this->pluginsFolder . $name; if (file_exists($file)) { include $file; } else { error::newError("{$pluginName} eklentisi için {$file} Bulunamadı"); return false; } } }
public static function get($url, $query = false, $options = false) { $r = self::init($url, HttpRequest::METH_GET); if ($options) { $r->setOptions($options); } if ($query) { $r->addQueryData($query); } try { $r->send(); if ($r->getResponseCode() == 200) { return $r->getResponseBody(); } } catch (HttpException $ex) { error::newError(" Static (Request) Sınıfından {$ex} hatası döndü"); return $ex; } }
public static function deleteSessionPhp($name) { if (isset($_SESSION[$name])) { unset($_SESSION[$name]); } else { error::newError(" {$name} diye bir session bulunamadı "); } }