public static function getAllMethods(GWF_Module $module) { $back = array(); $name = $module->getName(); $path = GWF_CORE_PATH . "module/{$name}/method"; if (!Common::isDir($path)) { return array(); } if (false === ($dir = scandir($path))) { GWF3::logDie('Cannot access ' . $path . ' in ' . __METHOD__ . ' line ' . __LINE__); } foreach ($dir as $file) { # starts with . if ($file[0] === '.' || false === Common::endsWith($file, '.php')) { continue; } $path2 = $path . '/' . $file; if (Common::isFile($path2)) { if (false === ($method = $module->getMethod(substr($file, 0, -4)))) { GWF3::logDie('NO METHOD for ' . $file); } $back[] = $method; } } return $back; }
private function onDefaults() { $_POST['reinstall'] = true; $_POST['modulename'] = $this->mod->getName(); $this->module->execute('Install'); }