Best Phoronix-test-suite code snippet using module_info
Module.php
Source:Module.php
...82 ini_set('memory_limit', '1024M');83 if ($name == '') $this->error('模åä¸åå¨ï¼');84 if ($name == 'admin' || $name == 'user') $this->error('ç¦æ¢æä½ç³»ç»æ ¸å¿æ¨¡åï¼');85 // 模åé
置信æ¯86 $module_info = ModuleModel::getInfoFromFile($name);87 if ($confirm == 0) {88 $need_module = [];89 $need_plugin = [];90 $table_check = [];91 // æ£æ¥æ¨¡åä¾èµ92 if (isset($module_info['need_module']) && !empty($module_info['need_module'])) {93 $need_module = $this->checkDependence('module', $module_info['need_module']);94 }95 // æ£æ¥æ件ä¾èµ96 if (isset($module_info['need_plugin']) && !empty($module_info['need_plugin'])) {97 $need_plugin = $this->checkDependence('plugin', $module_info['need_plugin']);98 }99 // æ£æ¥æ°æ®è¡¨100 if (isset($module_info['tables']) && !empty($module_info['tables'])) {101 foreach ($module_info['tables'] as $table) {102 if (Db::query("SHOW TABLES LIKE '" . config('database.prefix') . "{$table}'")) {103 $table_check[] = [104 'table' => config('database.prefix') . "{$table}",105 'result' => '<span class="text-danger">åå¨åå</span>'106 ];107 } else {108 $table_check[] = [109 'table' => config('database.prefix') . "{$table}",110 'result' => '<i class="fa fa-check text-success"></i>'111 ];112 }113 }114 }115 $this->assign('need_module', $need_module);116 $this->assign('need_plugin', $need_plugin);117 $this->assign('table_check', $table_check);118 $this->assign('name', $name);119 $this->assign('page_title', 'å®è£
模åï¼' . $name);120 return $this->fetch();121 }122 // æ§è¡å®è£
æ件123 $install_file = realpath(Env::get('app_path') . $name . '/install.php');124 if (file_exists($install_file)) {125 @include($install_file);126 }127 // æ§è¡å®è£
模åsqlæ件128 $sql_file = realpath(Env::get('app_path') . $name . '/sql/install.sql');129 if (file_exists($sql_file)) {130 if (isset($module_info['database_prefix']) && !empty($module_info['database_prefix'])) {131 $sql_statement = Sql::getSqlFromFile($sql_file, false, [$module_info['database_prefix'] => config('database.prefix')]);132 } else {133 $sql_statement = Sql::getSqlFromFile($sql_file);134 }135 if (!empty($sql_statement)) {136 foreach ($sql_statement as $value) {137 try {138 Db::execute($value);139 } catch (\Exception $e) {140 $this->error('导å
¥SQL失败ï¼è¯·æ£æ¥install.sqlçè¯å¥æ¯å¦æ£ç¡®');141 }142 }143 }144 }145 // æ·»å èå146 $menus = ModuleModel::getMenusFromFile($name);147 if (is_array($menus) && !empty($menus)) {148 if (false === $this->addMenus($menus, $name)) {149 $this->error('èåæ·»å 失败ï¼è¯·éæ°å®è£
');150 }151 }152 // æ£æ¥æ¯å¦æ模å设置信æ¯153 if (isset($module_info['config']) && !empty($module_info['config'])) {154 $module_info['config'] = json_encode(parse_config($module_info['config']));155 }156 // æ£æ¥æ¯å¦æ模åææé
ç½®157 if (isset($module_info['access']) && !empty($module_info['access'])) {158 $module_info['access'] = json_encode($module_info['access']);159 }160 // æ£æ¥æ¯å¦æè¡ä¸ºè§å161 if (isset($module_info['action']) && !empty($module_info['action'])) {162 $ActionModel = new ActionModel;163 if (!$ActionModel->saveAll($module_info['action'])) {164 MenuModel::where('module', $name)->delete();165 $this->error('è¡ä¸ºæ·»å 失败ï¼è¯·éæ°å®è£
');166 }167 }168 // å°æ¨¡åä¿¡æ¯åå
¥æ°æ®åº169 $ModuleModel = new ModuleModel($module_info);170 $allowField = ['name', 'title', 'icon', 'description', 'author', 'author_url', 'config', 'access', 'version', 'identifier', 'status'];171 if ($ModuleModel->allowField($allowField)->save()) {172 // å¤å¶éæèµæºç®å½173 File::copy_dir(Env::get('app_path') . $name . '/public', Env::get('root_path') . 'public');174 // å é¤éæèµæºç®å½175 File::del_dir(Env::get('app_path') . $name . '/public');176 cache('modules', null);177 cache('module_all', null);178 // è®°å½è¡ä¸º179 action_log('module_install', 'admin_module', 0, UID, $module_info['title']);180 $this->success('模åå®è£
æå', 'index');181 } else {182 MenuModel::where('module', $name)->delete();183 $this->error('模åå®è£
失败');184 }185 }186 /**187 * å¸è½½æ¨¡å188 * @param string $name 模åå189 * @param int $confirm æ¯å¦ç¡®è®¤190 * @return mixed191 * @throws \think\Exception192 * @throws \think\exception\PDOException193 */194 public function uninstall($name = '', $confirm = 0)195 {196 if ($name == '') $this->error('模åä¸åå¨ï¼');197 if ($name == 'admin') $this->error('ç¦æ¢æä½ç³»ç»æ¨¡åï¼');198 // 模åé
置信æ¯199 $module_info = ModuleModel::getInfoFromFile($name);200 if ($confirm == 0) {201 $this->assign('name', $name);202 $this->assign('page_title', 'å¸è½½æ¨¡åï¼' . $name);203 return $this->fetch();204 }205 // æ§è¡å¸è½½æ件206 $uninstall_file = realpath(Env::get('app_path') . $name . '/uninstall.php');207 if (file_exists($uninstall_file)) {208 @include($uninstall_file);209 }210 // æ§è¡å¸è½½æ¨¡åsqlæ件211 $clear = $this->request->get('clear');212 if ($clear == 1) {213 $sql_file = realpath(Env::get('app_path') . $name . '/sql/uninstall.sql');214 if (file_exists($sql_file)) {215 if (isset($module_info['database_prefix']) && !empty($module_info['database_prefix'])) {216 $sql_statement = Sql::getSqlFromFile($sql_file, false, [$module_info['database_prefix'] => config('database.prefix')]);217 } else {218 $sql_statement = Sql::getSqlFromFile($sql_file);219 }220 if (!empty($sql_statement)) {221 foreach ($sql_statement as $sql) {222 try {223 Db::execute($sql);224 } catch (\Exception $e) {225 $this->error('å¸è½½å¤±è´¥ï¼è¯·æ£æ¥uninstall.sqlçè¯å¥æ¯å¦æ£ç¡®');226 }227 }228 }229 }230 }231 // å é¤èå232 if (false === MenuModel::where('module', $name)->delete()) {233 $this->error('èåå é¤å¤±è´¥ï¼è¯·éæ°å¸è½½');234 }235 // å é¤ææä¿¡æ¯236 if (false === Db::name('admin_access')->where('module', $name)->delete()) {237 $this->error('å é¤ææä¿¡æ¯å¤±è´¥ï¼è¯·éæ°å¸è½½');238 }239 // å é¤è¡ä¸ºè§å240 if (false === Db::name('admin_action')->where('module', $name)->delete()) {241 $this->error('å é¤è¡ä¸ºä¿¡æ¯å¤±è´¥ï¼è¯·éæ°å¸è½½');242 }243 // å é¤æ¨¡åä¿¡æ¯244 if (ModuleModel::where('name', $name)->delete()) {245 // å¤å¶éæèµæºç®å½246 File::copy_dir(Env::get('root_path') . 'public/static/' . $name, Env::get('app_path') . $name . '/public/static/' . $name);247 // å é¤éæèµæºç®å½248 File::del_dir(Env::get('root_path') . 'public/static/' . $name);249 cache('modules', null);250 cache('module_all', null);251 // è®°å½è¡ä¸º252 action_log('module_uninstall', 'admin_module', 0, UID, $module_info['title']);253 $this->success('模åå¸è½½æå', 'index');254 } else {255 $this->error('模åå¸è½½å¤±è´¥');256 }257 }258 /**259 * æ´æ°æ¨¡åé
ç½®260 * @param string $name 模åå261 */262 public function update($name = '')263 {264 $name == '' && $this->error('缺å°æ¨¡ååï¼');265 $Module = ModuleModel::get(['name' => $name]);266 !$Module && $this->error('模åä¸åå¨ï¼ææªå®è£
');267 // 模åé
置信æ¯268 $module_info = ModuleModel::getInfoFromFile($name);269 unset($module_info['name']);270 // æ£æ¥æ¯å¦æ模å设置信æ¯271 if (isset($module_info['config']) && !empty($module_info['config'])) {272 $module_info['config'] = json_encode(parse_config($module_info['config']));273 } else {274 $module_info['config'] = '';275 }276 // æ£æ¥æ¯å¦æ模åææé
ç½®277 if (isset($module_info['access']) && !empty($module_info['access'])) {278 $module_info['access'] = json_encode($module_info['access']);279 } else {280 $module_info['access'] = '';281 }282 // æ´æ°æ¨¡åä¿¡æ¯283 if (false !== $Module->save($module_info)) {284 $this->success('模åé
ç½®æ´æ°æå');285 } else {286 $this->error('模åé
ç½®æ´æ°å¤±è´¥ï¼è¯·éè¯');287 }288 }289 /**290 * 导åºæ¨¡å291 * @param string $name 模åå292 * @throws \think\db\exception\DataNotFoundException293 * @throws \think\db\exception\ModelNotFoundException294 * @throws \think\exception\DbException295 */296 public function export($name = '')297 {298 if ($name == '') $this->error('缺å°æ¨¡åå');299 $export_data = $this->request->get('export_data', '');300 if ($export_data == '') {301 $this->assign('page_title', '导åºæ¨¡åï¼' . $name);302 return $this->fetch();303 }304 // 模å导åºç®å½305 $module_dir = Env::get('root_path') . 'export/module/' . $name;306 // å é¤æ§ç导åºæ°æ®307 if (is_dir($module_dir)) {308 File::del_dir($module_dir);309 }310 // å¤å¶æ¨¡åç®å½å°å¯¼åºç®å½311 File::copy_dir(Env::get('app_path') . $name, $module_dir);312 // å¤å¶éæèµæºç®å½313 File::copy_dir(Env::get('root_path') . 'public/static/' . $name, $module_dir . '/public/static/' . $name);314 // 模åæ¬å°é
置信æ¯315 $module_info = ModuleModel::getInfoFromFile($name);316 // æ£æ¥æ¯å¦æ模å设置信æ¯317 if (isset($module_info['config'])) {318 $db_config = ModuleModel::where('name', $name)->value('config');319 $db_config = json_decode($db_config, true);320 // è·åææ°ç模å设置信æ¯321 $module_info['config'] = set_config_value($module_info['config'], $db_config);322 }323 // æ£æ¥æ¯å¦æ模åè¡ä¸ºä¿¡æ¯324 $action = Db::name('admin_action')->where('module', $name)->field('module,name,title,remark,rule,log,status')->select();325 if ($action) {326 $module_info['action'] = $action;327 }328 // 表åç¼329 $module_info['database_prefix'] = config('database.prefix');330 // çæé
ç½®æ件331 if (false === $this->buildInfoFile($module_info, $name)) {332 $this->error('模åé
ç½®æ件å建失败ï¼è¯·éæ°å¯¼åº');333 }334 // è·å模åèå并导åº335 $fields = 'id,pid,title,icon,url_type,url_value,url_target,online_hide,sort,status';336 $menus = MenuModel::getMenusByGroup($name, $fields);337 if (false === $this->buildMenuFile($menus, $name)) {338 $this->error('模åèåæ件å建失败ï¼è¯·éæ°å¯¼åº');339 }340 // 导åºæ°æ®åºè¡¨341 if (isset($module_info['tables']) && !empty($module_info['tables'])) {342 if (!is_dir($module_dir . '/sql')) {343 mkdir($module_dir . '/sql', 644, true);344 }345 if (!Database::export($module_info['tables'], $module_dir . '/sql/install.sql', config('database.prefix'), $export_data)) {346 $this->error('æ°æ®åºæ件å建失败ï¼è¯·éæ°å¯¼åº');347 }348 if (!Database::exportUninstall($module_info['tables'], $module_dir . '/sql/uninstall.sql', config('database.prefix'))) {349 $this->error('æ°æ®åºæ件å建失败ï¼è¯·éæ°å¯¼åº');350 }351 }352 // è®°å½è¡ä¸º353 action_log('module_export', 'admin_module', 0, UID, $module_info['title']);354 // æå
ä¸è½½355 $archive = new PHPZip;356 return $archive->ZipAndDownload($module_dir, $name);357 }358 /**359 * å建模åèåæ件360 * @param array $menus èå361 * @param string $name 模åå362 * @return int363 */364 private function buildMenuFile($menus = [], $name = '')365 {366 $menus = Tree::toLayer($menus);367 // ç¾åæ°ç»æ ¼å¼...
so_sociallogin.php
Source:so_sociallogin.php
...178 179 $data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=module', true);180 181 if (isset($this->request->get['module_id']) && ($this->request->server['REQUEST_METHOD'] != 'POST')) {182 // $module_info = $this->model_setting_module->getModule($this->request->get['module_id']);183 $module_info = $this->model_setting_setting->getSetting('so_sociallogin');184 }185 else186 $module_info = $this->model_setting_setting->getSetting('so_sociallogin');187 188 $params = isset($this->request->post['so_sociallogin']) ? $this->request->post['so_sociallogin'] : array();189 if (isset($params['so_sociallogin_name'])) {190 $data['name'] = $params['so_sociallogin_name'];191 } elseif (!empty($module_info)) {192 $data['name'] = isset($module_info['so_sociallogin_name']) ? $module_info['so_sociallogin_name'] : '';193 } else {194 $data['name'] = '';195 }196 if (isset($params['so_sociallogin_button'])) {197 $data['button_social'] = $params['so_sociallogin_button'];198 } elseif (!empty($module_info)) {199 $data['button_social'] = isset($module_info['so_sociallogin_button']) ? $module_info['so_sociallogin_button'] : '';200 } else {201 $data['button_social'] = '';202 }203 if (isset($params['so_sociallogin_popuplogin'])) {204 $data['popuplogin'] = $params['so_sociallogin_popuplogin'];205 } elseif (!empty($module_info)) {206 $data['popuplogin'] = isset($module_info['so_sociallogin_popuplogin']) ? $module_info['so_sociallogin_popuplogin'] : '';207 } else {208 $data['popuplogin'] = '';209 }210 if (isset($params['so_sociallogin_fbtitle'])) {211 $data['fbtitle'] = $params['so_sociallogin_fbtitle'];212 } elseif (!empty($module_info)) {213 $data['fbtitle'] = isset($module_info['so_sociallogin_fbtitle']) ? $module_info['so_sociallogin_fbtitle'] : '';214 } else {215 $data['fbtitle'] = '';216 }217 218 if (isset($params['so_sociallogin_twittertitle'])) {219 $data['twittertitle'] = $params['so_sociallogin_twittertitle'];220 } elseif (!empty($module_info)) {221 $data['twittertitle'] = isset($module_info['so_sociallogin_twittertitle']) ? $module_info['so_sociallogin_twittertitle'] : '';222 } else {223 $data['twittertitle'] = '';224 }225 226 if (isset($params['so_sociallogin_googletitle'])) {227 $data['googletitle'] = $params['so_sociallogin_googletitle'];228 } elseif (!empty($module_info)) {229 $data['googletitle'] = isset($module_info['so_sociallogin_googletitle']) ? $module_info['so_sociallogin_googletitle'] : '';230 } else {231 $data['googletitle'] = '';232 }233 234 if (isset($params['so_sociallogin_linkedintitle'])) {235 $data['linkedintitle'] = $params['so_sociallogin_linkedintitle'];236 } elseif (!empty($module_info)) {237 $data['linkedintitle'] = isset($module_info['so_sociallogin_linkedintitle']) ? $module_info['so_sociallogin_linkedintitle'] : '';238 } else {239 $data['linkedintitle'] = '';240 }241 242 243 if (isset($params['so_sociallogin_width'])) {244 $data['width'] = $params['so_sociallogin_width'];245 } elseif (!empty($module_info)) {246 $data['width'] = isset($module_info['so_sociallogin_width']) ? $module_info['so_sociallogin_width'] : '';247 } else {248 $data['width'] = '100';249 }250 251 if (isset($params['so_sociallogin_height'])) {252 $data['height'] = $params['so_sociallogin_height'];253 } elseif (!empty($module_info)) {254 $data['height'] = isset($module_info['so_sociallogin_height']) ? $module_info['so_sociallogin_height'] : '';255 } else {256 $data['height'] = '100';257 }258 259 if (isset($params['so_sociallogin_enable'])) {260 $data['status'] = $params['so_sociallogin_enable'];261 } elseif (!empty($module_info)) {262 $data['status'] = isset($module_info['so_sociallogin_enable']) ? $module_info['so_sociallogin_enable'] : '';263 } else {264 $data['status'] = 0;265 }266 267 if (isset($params['so_sociallogin_fbstatus'])) {268 $data['fbstatus'] = $params['so_sociallogin_fbstatus'];269 } elseif (!empty($module_info)) {270 $data['fbstatus'] = isset($module_info['so_sociallogin_fbstatus']) ? $module_info['so_sociallogin_fbstatus'] : '';271 } else {272 $data['fbstatus'] = '';273 }274 275 if (isset($params['so_sociallogin_twitstatus'])) {276 $data['twitstatus'] = $params['so_sociallogin_twitstatus'];277 } elseif (!empty($module_info)) {278 $data['twitstatus'] = isset($module_info['so_sociallogin_twitstatus']) ? $module_info['so_sociallogin_twitstatus'] : '';279 } else {280 $data['twitstatus'] = '';281 }282 283 if (isset($params['so_sociallogin_googlestatus'])) {284 $data['googlestatus'] = $params['so_sociallogin_googlestatus'];285 } elseif (!empty($module_info)) {286 $data['googlestatus'] = isset($module_info['so_sociallogin_googlestatus']) ? $module_info['so_sociallogin_googlestatus'] : '';287 } else {288 $data['googlestatus'] = '';289 }290 291 if (isset($params['so_sociallogin_linkstatus'])) {292 $data['linkstatus'] = $params['so_sociallogin_linkstatus'];293 } elseif (!empty($module_info)) {294 $data['linkstatus'] = isset($module_info['so_sociallogin_linkstatus']) ? $module_info['so_sociallogin_linkstatus'] : '';295 } else {296 $data['linkstatus'] = '';297 }298 299 if (isset($params['so_sociallogin_fbimage'])) {300 $data['fbimage'] = $params['so_sociallogin_fbimage'];301 } elseif (!empty($module_info)) {302 $data['fbimage'] = isset($module_info['so_sociallogin_fbimage']) ? $module_info['so_sociallogin_fbimage'] : '';303 } else {304 $data['fbimage'] = '';305 }306 307 308 if (isset($params['so_sociallogin_twitimage'])) {309 $data['twitimage'] = $params['so_sociallogin_twitimage'];310 } elseif (!empty($module_info)) {311 $data['twitimage'] = isset($module_info['so_sociallogin_twitimage']) ? $module_info['so_sociallogin_twitimage'] : '';312 } else {313 $data['twitimage'] = '';314 }315 316 317 if (isset($params['so_sociallogin_googleimage'])) {318 $data['googleimage'] = $params['so_sociallogin_googleimage'];319 } elseif (!empty($module_info)) {320 $data['googleimage'] = isset($module_info['so_sociallogin_googleimage']) ? $module_info['so_sociallogin_googleimage'] : '';321 } else {322 $data['googleimage'] = '';323 }324 325 if (isset($params['so_sociallogin_linkdinimage'])) {326 $data['linkdinimage'] = $params['so_sociallogin_linkdinimage'];327 } elseif (!empty($module_info)) {328 $data['linkdinimage'] = isset($module_info['so_sociallogin_linkdinimage']) ? $module_info['so_sociallogin_linkdinimage'] : '';329 } else {330 $data['linkdinimage'] = '';331 }332 333 if (isset($params['so_sociallogin_fbapikey'])) {334 $data['fbapikey'] = $params['so_sociallogin_fbapikey'];335 } elseif (!empty($module_info)) {336 $data['fbapikey'] = isset($module_info['so_sociallogin_fbapikey']) ? $module_info['so_sociallogin_fbapikey'] : '';337 } else {338 $data['fbapikey'] = '';339 }340 341 if (isset($params['so_sociallogin_fbsecretapi'])) {342 $data['fbsecretapi'] = $params['so_sociallogin_fbsecretapi'];343 } elseif (!empty($module_info)) {344 $data['fbsecretapi'] = isset($module_info['so_sociallogin_fbsecretapi']) ? $module_info['so_sociallogin_fbsecretapi'] : '';345 } else {346 $data['fbsecretapi'] = '';347 }348 349 if (isset($params['so_sociallogin_twitapikey'])) {350 $data['twitapikey'] = $params['so_sociallogin_twitapikey'];351 } elseif (!empty($module_info)) {352 $data['twitapikey'] = isset($module_info['so_sociallogin_twitapikey']) ? $module_info['so_sociallogin_twitapikey'] : '';353 } else {354 $data['twitapikey'] = '';355 }356 357 if (isset($params['so_sociallogin_twitsecretapi'])) {358 $data['twitsecretapi'] = $params['so_sociallogin_twitsecretapi'];359 } elseif (!empty($module_info)) {360 $data['twitsecretapi'] = isset($module_info['so_sociallogin_twitsecretapi']) ? $module_info['so_sociallogin_twitsecretapi'] : '';361 } else {362 $data['twitsecretapi'] = '';363 }364 365 if (isset($params['so_sociallogin_googleapikey'])) {366 $data['googleapikey'] = $params['so_sociallogin_googleapikey'];367 } elseif (!empty($module_info)) {368 $data['googleapikey'] = isset($module_info['so_sociallogin_googleapikey']) ? $module_info['so_sociallogin_googleapikey'] : '';369 } else {370 $data['googleapikey'] = '';371 }372 373 if (isset($params['so_sociallogin_googlesecretapi'])) {374 $data['googlesecretapi'] = $params['so_sociallogin_googlesecretapi'];375 } elseif (!empty($module_info)) {376 $data['googlesecretapi'] = isset($module_info['so_sociallogin_googlesecretapi']) ? $module_info['so_sociallogin_googlesecretapi'] : '';377 } else {378 $data['googlesecretapi'] = '';379 }380 if (isset($params['so_sociallogin_linkdinapikey'])) {381 $data['linkdinapikey'] = $params['so_sociallogin_linkdinapikey'];382 } elseif (!empty($module_info)) {383 $data['linkdinapikey'] = isset($module_info['so_sociallogin_linkdinapikey']) ? $module_info['so_sociallogin_linkdinapikey'] : '';384 } else {385 $data['linkdinapikey'] = '';386 }387 388 if (isset($params['so_sociallogin_linkdinsecretapi'])) {389 $data['linkdinsecretapi'] = $params['so_sociallogin_linkdinsecretapi'];390 } elseif (!empty($module_info)) {391 $data['linkdinsecretapi'] = isset($module_info['so_sociallogin_linkdinsecretapi']) ? $module_info['so_sociallogin_linkdinsecretapi'] : '';392 } else {393 $data['linkdinsecretapi'] = '';394 }395 396 397 $this->load->model('tool/image');398 if (isset($params['so_sociallogin_fbimage']) && is_file(DIR_IMAGE . $params['so_sociallogin_fbimage'])) {399 $data['fbthumb'] = $this->model_tool_image->resize($params['so_sociallogin_fbimage'], 100, 100);400 } elseif (!empty($module_info) && is_file(DIR_IMAGE . $module_info['so_sociallogin_fbimage'])) {401 $data['fbthumb'] = $this->model_tool_image->resize($module_info['so_sociallogin_fbimage'], 100, 100);402 } else {403 $data['fbthumb'] = $this->model_tool_image->resize('no_image.png', 100, 100);404 }405 406 if (isset($params['so_sociallogin_twitimage']) && is_file(DIR_IMAGE . $params['so_sociallogin_twitimage'])) {407 $data['twiterthumb'] = $this->model_tool_image->resize($params['so_sociallogin_twitimage'], 100, 100);408 } elseif (!empty($module_info) && is_file(DIR_IMAGE . $module_info['so_sociallogin_twitimage'])) {409 $data['twiterthumb'] = $this->model_tool_image->resize($module_info['so_sociallogin_twitimage'], 100, 100);410 } else {411 $data['twiterthumb'] = $this->model_tool_image->resize('no_image.png', 100, 100);412 }413 414 if (isset($params['so_sociallogin_googleimage']) && is_file(DIR_IMAGE . $params['so_sociallogin_googleimage'])) {415 $data['googlethumb'] = $this->model_tool_image->resize($params['so_sociallogin_googleimage'], 100, 100);416 } elseif (!empty($module_info) && is_file(DIR_IMAGE . $module_info['so_sociallogin_googleimage'])) {417 $data['googlethumb'] = $this->model_tool_image->resize($module_info['so_sociallogin_googleimage'], 100, 100);418 } else {419 $data['googlethumb'] = $this->model_tool_image->resize('no_image.png', 100, 100);420 }421 if (isset($params['so_sociallogin_linkdinimage']) && is_file(DIR_IMAGE . $params['so_sociallogin_linkdinimage'])) {422 $data['linkdinthumb'] = $this->model_tool_image->resize($params['so_sociallogin_linkdinimage'], 100, 100);423 } elseif (!empty($module_info) && is_file(DIR_IMAGE . $module_info['so_sociallogin_linkdinimage'])) {424 $data['linkdinthumb'] = $this->model_tool_image->resize($module_info['so_sociallogin_linkdinimage'], 100, 100);425 } else {426 $data['linkdinthumb'] = $this->model_tool_image->resize('no_image.png', 100, 100);427 }428 $data['placeholder'] = $this->model_tool_image->resize('no_image.png', 100, 100);429 430 431 $data['header'] = $this->load->controller('common/header');432 $data['column_left'] = $this->load->controller('common/column_left');433 $data['footer'] = $this->load->controller('common/footer');434 $this->response->setOutput($this->load->view('extension/module/so_sociallogin', $data));435 }436 protected function validate() {437 if (!$this->user->hasPermission('modify', 'extension/module/so_sociallogin')) {438 $this->error['warning'] = $this->language->get('error_permission');...
module_info
Using AI Code Generation
1require_once('pts-core/pts-core.php');2$module = new pts_module_info('module_name');3echo $module->get_module_name();4echo $module->get_module_version();5echo $module->get_module_description();6echo $module->get_module_author();7echo $module->get_module_type();
module_info
Using AI Code Generation
1require_once('pts-core/pts-core.php');2$module_info = new module_info();3$module_info->module_name = 'Phoronix Test Suite';4$module_info->module_version = '2.0.0';5$module_info->module_author = 'Michael Larabel';6$module_info->module_description = 'Phoronix Test Suite is an open-source automated testing and benchmarking platform.';7$module_info->module_license = 'GPLv3';8$module_info->module_type = 'Benchmark';9$module_info->module_is_downloadable = false;10$module_info->module_is_installable = true;11$module_info->module_install_path = 'phoronix-test-suite';12$module_info->module_install_with_sudo = false;13$module_info->module_install_command = 'sudo ./install-sh';14$module_info->module_install_file_path = 'install-sh';15$module_info->module_install_append_command = 'sudo apt-get install -f';16$module_info->module_uninstall_command = 'sudo apt-get remove phoronix-test-suite';17$module_info->module_run_command = 'phoronix-test-suite';18$module_info->module_run_as_root = false;19$module_info->module_test_file_path = 'phoronix-test-suite';20$module_info->module_test_command = 'phoronix-test-suite';21require_once('pts-core/pts-core.php');22$module_info = new module_info();23$module_info->module_name = 'Phoronix Test Suite';24$module_info->module_version = '2.0.0';25$module_info->module_author = 'Michael Larabel';26$module_info->module_description = 'Phoronix Test Suite is an open-source automated testing and benchmarking platform.';27$module_info->module_license = 'GPLv3';
module_info
Using AI Code Generation
1require_once('pts-core.php');2$module = new module_info();3$module->module_name = "test";4$module->module_version = "1.0";5$module->module_author = "test";6$module->module_description = "test";7$module->module_type = "test";8$module->module_license = "GPL";9$module->module_identifier = "test";10$module->module_url = "test";11$module->module_install_path = "test";12$module->module_install_time = "test";13$module->module_update_time = "test";14$module->module_update_version = "test";15$module->module_update_path = "test";16$module->module_update_identifier = "test";17$module->module_update_url = "test";18$module->module_update_description = "test";19$module->module_update_license = "test";20$module->module_update_author = "test";21$module->module_update_install_path = "test";22$module->module_update_install_time = "test";23$module->module_update_install_identifier = "test";24$module->module_update_install_url = "test";25$module->module_update_install_description = "test";26$module->module_update_install_license = "test";27$module->module_update_install_author = "test";28$module->module_update_install_install_path = "test";29$module->module_update_install_install_time = "test";30$module->module_update_install_install_identifier = "test";31$module->module_update_install_install_url = "test";32$module->module_update_install_install_description = "test";33$module->module_update_install_install_license = "test";34$module->module_update_install_install_author = "test";35$module->module_update_install_install_install_path = "test";36$module->module_update_install_install_install_time = "test";37$module->module_update_install_install_install_identifier = "test";38$module->module_update_install_install_install_url = "test";39$module->module_update_install_install_install_description = "test";40$module->module_update_install_install_install_license = "test";41$module->module_update_install_install_install_author = "test";42$module->module_update_install_install_install_install_path = "test";43$module->module_update_install_install_install_install_time = "test";44$module->module_update_install_install_install_install_identifier = "test";45$module->module_update_install_install_install_install_url = "test";
module_info
Using AI Code Generation
1require_once('pts-core.php');2$module_info = new module_info();3$module_info->display_module_info('2');4require_once('pts-core.php');5$module_info = new module_info();6$module_info->display_module_info('3');7require_once('pts-core.php');8$module_info = new module_info();9$module_info->display_module_info('4');10require_once('pts-core.php');11$module_info = new module_info();12$module_info->display_module_info('5');13require_once('pts-core.php');14$module_info = new module_info();15$module_info->display_module_info('6');16require_once('pts-core.php');17$module_info = new module_info();18$module_info->display_module_info('7');19require_once('pts-core.php');20$module_info = new module_info();21$module_info->display_module_info('8');22require_once('pts-core.php');23$module_info = new module_info();24$module_info->display_module_info('9');25require_once('pts-core.php');26$module_info = new module_info();27$module_info->display_module_info('10');28require_once('pts-core.php');29$module_info = new module_info();30$module_info->display_module_info('11');31require_once('pts-core.php');32$module_info = new module_info();33$module_info->display_module_info('12');
module_info
Using AI Code Generation
1require_once('pts-core.php');2$module = new module_info();3$module->load_module('pts-core');4echo $module->module_name;5echo $module->module_version;6echo $module->module_description;7echo $module->module_author;8echo $module->module_license;9echo $module->module_url;10echo $module->module_test_profile;11echo $module->module_test_profile_version;12echo $module->module_test_profile_description;13echo $module->module_test_profile_license;14echo $module->module_test_profile_url;15echo $module->module_test_profile_phoromatic;16echo $module->module_test_profile_result_scale;17echo $module->module_test_profile_result_proportion;18echo $module->module_test_profile_display_format;19echo $module->module_test_profile_result_precision;20echo $module->module_test_profile_result_identifier;21echo $module->module_test_profile_result_merge;22echo $module->module_test_profile_installation;23echo $module->module_test_profile_installation_size;24echo $module->module_test_profile_installation_md5;25echo $module->module_test_profile_installation_sha1;26echo $module->module_test_profile_installation_sha256;27echo $module->module_test_profile_installation_sha512;28echo $module->module_test_profile_installation_filesize;29echo $module->module_test_profile_installation_filesize_bytes;30echo $module->module_test_profile_installation_filesize_human_readable;31echo $module->module_test_profile_installation_filesize_human_readable_long;32echo $module->module_test_profile_installation_filesize_human_readable_long_with_bytes;33echo $module->module_test_profile_installation_filesize_human_readable_short;34echo $module->module_test_profile_installation_filesize_human_readable_short_with_bytes;35echo $module->module_test_profile_installation_filesize_human_readable_short_with_bytes_and_parenthesis;36echo $module->module_test_profile_installation_filesize_human_readable_short_with_parenthesis;37echo $module->module_test_profile_installation_filesize_human_readable_with_bytes;38echo $module->module_test_profile_installation_filesize_human_readable_with_parenthesis;39echo $module->module_test_profile_installation_filesize_human_readable_with_parenthesis_bytes;40echo $module->module_test_profile_installation_filesize_human_readable_with_parenthesis_bytes_long;41echo $module->module_test_profile_installation_filesize_human_readable_with_parenthesis_bytes_short;
module_info
Using AI Code Generation
1$module_info = new module_info();2$module_name = $module_info->get_module_name();3$module_version = $module_info->get_module_version();4$module_description = $module_info->get_module_description();5$module_author = $module_info->get_module_author();6$module_website = $module_info->get_module_website();7$module_license = $module_info->get_module_license();8$module_dependency = $module_info->get_module_dependency();9$module_optional_dependency = $module_info->get_module_optional_dependency();10$module_installed_size = $module_info->get_module_installed_size();11$module_maintainer = $module_info->get_module_maintainer();12$module_section = $module_info->get_module_section();13$module_installed_size = $module_info->get_module_installed_size();14$module_installed_size = $module_info->get_module_installed_size();15$module_installed_size = $module_info->get_module_installed_size();16$module_installed_size = $module_info->get_module_installed_size();17$module_info = new module_info();18$module_name = $module_info->get_module_name();19$module_version = $module_info->get_module_version();20$module_description = $module_info->get_module_description();21$module_author = $module_info->get_module_author();22$module_website = $module_info->get_module_website();23$module_license = $module_info->get_module_license();24$module_dependency = $module_info->get_module_dependency();25$module_optional_dependency = $module_info->get_module_optional_dependency();26$module_installed_size = $module_info->get_module_installed_size();
module_info
Using AI Code Generation
1include('module_info.php');2$module = new module_info();3$module->set_module_name("test");4$module->set_module_version("1.0");5$module->set_module_author("test");6$module->set_module_description("test");7$module->set_module_license("test");8$module->set_module_url("test");9echo $module->get_module_info();10include('module_info.php');11$module = new module_info();12$module->set_module_name("test");13$module->set_module_version("1.0");14$module->set_module_author("test");15$module->set_module_description("test");16$module->set_module_license("test");17$module->set_module_url("test");18echo $module->get_module_info();19include('module_info.php');20$module = new module_info();21$module->set_module_name("test");22$module->set_module_version("1.0");23$module->set_module_author("test");24$module->set_module_description("test");25$module->set_module_license("test");26$module->set_module_url("test");27echo $module->get_module_info();28include('module_info.php');29$module = new module_info();30$module->set_module_name("test");31$module->set_module_version("1.0");32$module->set_module_author("test");33$module->set_module_description("test");34$module->set_module_license("test");35$module->set_module_url("test");36echo $module->get_module_info();37include('module_info.php');38$module = new module_info();39$module->set_module_name("test");40$module->set_module_version("1.0");41$module->set_module_author("test");42$module->set_module_description("test");43$module->set_module_license("test");44$module->set_module_url("test");45echo $module->get_module_info();
module_info
Using AI Code Generation
1require_once('pts-core/pts-core.php');2$module = new pts_module_info('2.php', '2');3echo $module->get_module_info('name');4echo $module->get_module_info('description');5echo $module->get_module_info('author');6echo $module->get_module_info('version');7echo $module->get_module_info('license');8echo $module->get_module_info('website');9echo $module->get_module_info('tags');10echo $module->get_module_info('type');11echo $module->get_module_info('status');12echo $module->get_module_info('dependencies');13echo $module->get_module_info('supported_platforms');14echo $module->get_module_info('supported_os');15echo $module->get_module_info('supported_arch');16echo $module->get_module_info('supported_phoronix_version');17echo $module->get_module_info('supported_php_version');18echo $module->get_module_info('supported_db_version');19echo $module->get_module_info('supported_phoronix_version');20echo $module->get_module_info('supported_php_version');21echo $module->get_module_info('supported_db_version');22echo $module->get_module_info('supported_phoronix_version');23echo $module->get_module_info('supported_php_version');24echo $module->get_module_info('supported_db_version');25echo $module->get_module_info('supported_phoronix_version');26echo $module->get_module_info('supported_php_version');27echo $module->get_module_info('supported_db_version');28echo $module->get_module_info('supported_phoronix_version');29echo $module->get_module_info('supported_php_version');30echo $module->get_module_info('supported_db_version');31echo $module->get_module_info('supported_phoronix_version');32echo $module->get_module_info('supported_php_version');33echo $module->get_module_info('supported_db_version');34echo $module->get_module_info('supported_phoronix_version');35echo $module->get_module_info('supported_php_version');36echo $module->get_module_info('supported_db_version');37echo $module->get_module_info('supported_phoronix_version');38echo $module->get_module_info('supported_php_version');39echo $module->get_module_info('supported_db_version');40echo $module->get_module_info('supported_phoronix_version');41echo $module->get_module_info('supported_php_version');42echo $module->get_module_info('supported_db_version
module_info
Using AI Code Generation
1$module = new module_info();2$mod = $module->get_name();3echo $mod;4$module = new module_info();5$mod = $module->get_name();6echo $mod;7$module = new module_info();8$mod = $module->get_name();9echo $mod;10$module = new module_info();11$mod = $module->get_name();12echo $mod;13$module = new module_info();14$mod = $module->get_name();15echo $mod;16$module = new module_info();17$mod = $module->get_name();18echo $mod;19$module = new module_info();20$mod = $module->get_name();21echo $mod;22$module = new module_info();23$mod = $module->get_name();24echo $mod;25$module = new module_info();26$mod = $module->get_name();27echo $mod;28$module = new module_info();29$mod = $module->get_name();30echo $mod;
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Trigger Selenium automation tests on a cloud-based Grid of 3000+ real browsers and operating systems.
Test now for FreeGet 100 minutes of automation test minutes FREE!!