function scan_directory_recursively($directory, $filter = FALSE) { global $extensions_list; echo "Scan: " . $directory . "\n"; $handle = @opendir($directory); if ($handle === false) { return; } while (false !== ($file = readdir($handle))) { if ($file == '.' || $file == '..') { continue; } $path = $directory . '/' . $file; $type = filetype($path); if ($type == 'dir') { scan_directory_recursively($path); } if ($type == 'file') { $extension = pathinfo($path, PATHINFO_EXTENSION); if (!in_array($extension, $extensions_list)) { continue; } if (filesize($path) > MAX_SIZE_TO_SCAN) { continue; } $hash = _hash_($path); $ok = insert_into_whitelist(pack("H*", $hash)); if (LOG) { _log_(($ok ? "new" : "dup") . " {$hash}|{$path}"); } } } closedir($handle); }
public function index() { $data = ['text' => "tolga"]; $cache = new cache(); $cache->cacheStart(); _log_("heder.txt"); self::view('home/index', $data); $cache->cacheEnd(); }
public function index($name = '') { $data = ['text' => $name]; $cache = new cache(); $cache->app_url = "core"; $cache->caching = false; $cache->cacheStart(); _log_("heder.txt"); $this->view('home/index', $data); $cache->cacheEnd(); }