Please, ¿Does anyone know, how can I activate the glob() function from the php.ini on the server?
thank you very much, and sorry for my english, is terrible

Code: Select all
<?php
////////////////////////////////////////////
// Opencart.com
// Farhad Sakhaei ~ parsmizban.com
// Mohammad Reza Mahmoudi ~ iropencart.com
///////////////////////////////////////////
function MRMs_glob($dir){
$files = array();
if(is_dir($dir)){
if($dh=opendir($dir)){
while(($file = readdir($dh)) !== false){
$files[]=$dir.$file;
}}
}
return $files;
}
/////////////////////////////////////////
final class Cache {
private $expire = 3600;
public function __construct() {
$files = MRMs_glob(DIR_CACHE . 'cache.*');
if ($files) {
foreach ($files as $file) {
$time = substr(strrchr($file, '.'), 1);
if ($time < time()) {
if (file_exists($file)) {
@unlink($file);
}
}
}
}
}
public function get($key) {
$files = MRMs_glob(DIR_CACHE . 'cache.' . $key . '.*');
if ($files) {
foreach ($files as $file) {
$cache = '';
$handle = fopen($file, 'r');
if ($handle) {
$cache = fread($handle, filesize($file));
fclose($handle);
}
return unserialize($cache);
}
}
}
public function set($key, $value) {
$this->delete($key);
$file = DIR_CACHE . 'cache.' . $key . '.' . (time() + $this->expire);
$handle = fopen($file, 'w');
fwrite($handle, serialize($value));
fclose($handle);
}
public function delete($key) {
$files = MRMs_glob(DIR_CACHE . 'cache.' . $key . '.*');
if ($files) {
foreach ($files as $file) {
if (file_exists($file)) {
@unlink($file);
clearstatcache();
}
}
}
}
}
?>
توسعه اپن کارت
طراحی نرم افزارهای مبتنی بر اپن کارت - امنیت/توسعه اختصاصی/خدمات سئو/ سیستم تیکت و فروش بلیط/مدیر سمینار و همایش
اتصال اپن کارت به نرم افزارهای انبار داری و انواع CRM و ERP و دستگاه پوز و پرینتر
https://www.imahmoudi.ir
https://www.opencart.com/index.php?rout ... @gmail.com
Users browsing this forum: No registered users and 78 guests