/** * Delete session that are older than the given time in secounds * * @param int $time * @return void */ public function gc($time) { foreach (\CCFile::ls(\CCStorage::path('sessions/*')) as $file) { if (filemtime($file) - (time() - $time) < 0) { if (!\CCFile::delete($file)) { throw new Exception("Manager_File::gc - cannot delete session file."); } } } }
/** * initialize the ship * * @return void */ public function wake() { if (!\ClanCats::in_development()) { return; } // get all controllers in the dev namespace foreach (\CCFile::ls(\CCPath::controllers('Dev::*Controller' . EXT)) as $path) { $name = \CCStr::cut(basename($path), 'Controller' . EXT); \CCRouter::on('dev/' . \CCStr::lower($name), 'Dev::' . $name); } }