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; }
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; }
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; }
/** * Starts the Intact Web Shop * @param array $ini - Passes through all Intact Config settings */ function start($ini) { //Config data $config = Core_Framework_Singleton::config(); $config->attach($ini); $this->config = $config; $this->clean_globals(); $this->set_page(); $this->get_action(); $this->set_view(); }
public function __construct() { $this->_layout = Core_Framework_Singleton::config()->ini['web_shop']['layout']; $this->session = Core_Framework_Singleton::auth()->session; }
/** * 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']); }