public function install($id, $path = '') { $path = empty($path) ? $id : $path; $modulePath = ZOTOP_MODULES . DS . $id; $modulePath = path::clean($modulePath); $moduleFile = $modulePath . DS . 'module.php'; $module = @(include $moduleFile); $module['path'] = $path; $module['type'] = '1'; $module['url'] = $path; $module['status'] = 1; $module['order'] = $this->max() + 1; $module['installtime'] = time::now(); $module['updatetime'] = time::now(); if (is_array($module)) { $insert = $this->insert($module); if ($insert) { return $this->reload(); } } return false; }