/**
  * Singleton of DB
  * @return Core_Intact_SOAP 
  */
 public static function intact()
 {
     if (!isset(self::$Intact)) {
         self::$Intact = new Core_Intact_SOAP();
     }
     return self::$Intact;
 }
Example #2
0
 static function flood_code()
 {
     $secret = Core_Framework_Singleton::config()->ini['web_shop']['secret'];
     $time = time();
     $check = Core_Helper_Encrypt::hash($secret . '-' . $time);
     return $check . '-' . $time;
 }
Example #3
0
 public static function cachedReturn($file, $folder = false, $vars = false)
 {
     if (!$folder) {
         $page = md5($_SERVER['REQUEST_URI']);
     } else {
         $page = $folder;
     }
     $dir = ACCOUNT_DIR . 'cache/' . $page;
     $cachefile = $dir . '/' . md5($file) . '.php';
     $path = "view/_partials/" . $file . '.php';
     //Cache the file if it dosen't exist
     if (!file_exists($cachefile) || Core_Framework_Singleton::config()->ini['web_shop']['disablecache'] == 'yes') {
         //if (true) {
         //Make sure the folder exists
         if (!is_dir($dir)) {
             mkdir($dir, 0755, true);
         }
         if (file_exists(ACCOUNT_DIR . $file)) {
             $store = (include ACCOUNT_DIR . $path);
         } else {
             $store = (include CORE_DIR . $path);
         }
         $output = serialize($store);
         $handle = fopen($cachefile, 'w');
         fwrite($handle, $output);
         fclose($handle);
     } else {
         $store = file_get_contents($cachefile);
         $store = unserialize($store);
     }
     return $store;
 }
Example #4
0
 public function __construct()
 {
     $config = Core_Framework_Singleton::config()->ini['database'];
     $connection = mysql_connect($config['server'], $config['username'], $config['password']);
     mysql_select_db($config['database'], $connection);
     $this->connection = $connection;
     return $connection;
 }
Example #5
0
 public static function set_flood()
 {
     Core_Framework_Singleton::view()->flood_code = Core_Intact_Action::flood_code();
 }
Example #6
0
 /**
  * Redirect to the 404 page
  * Page URL taken from config file
  * To be called statically 
  */
 public static function error404()
 {
     $config = Core_Framework_Singleton::config()->ini;
     Core_Framework_Helper::redirect($config['cross_site']['error404']);
 }
Example #7
0
 public function connect()
 {
     $this->conn = Core_Framework_Singleton::db()->connection;
 }
Example #8
0
 /**
  * Gets the current view including layout template
  */
 function set_view()
 {
     Core_Framework_Singleton::view()->renderView($this->page_dir);
 }