Exemplo n.º 1
0
 public static function ObjectToArray($object)
 {
     if (is_object($object)) {
         return (array) $object;
     } else {
         error::newError("HATA : {$object} bir obje değil");
     }
 }
Exemplo n.º 2
0
 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");
     }
 }
Exemplo n.º 3
0
 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 {
     }
 }
Exemplo n.º 4
0
 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;
         }
     }
 }
Exemplo n.º 5
0
 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;
     }
 }
Exemplo n.º 6
0
 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");
         }
     }
 }
Exemplo n.º 7
0
 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;
         }
     }
 }
Exemplo n.º 8
0
 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;
     }
 }
Exemplo n.º 9
0
 public static function deleteSessionPhp($name)
 {
     if (isset($_SESSION[$name])) {
         unset($_SESSION[$name]);
     } else {
         error::newError(" {$name} diye bir session bulunamadı ");
     }
 }