19 $oDB->addIndex(
"modules",
"idx_site_mid", array(
"site_srl",
"mid"),
true);
20 $oDB->addIndex(
'sites',
'unique_domain',array(
'domain'),
true);
34 $url_info = parse_url($domain);
35 $domain = $url_info[
'host'].( (!empty($url_info[
'port'])&&$url_info[
'port']!=80)?
':'.$url_info[
'port']:
'').$url_info[
'path'];
41 $site_args->default_language = $db_info->lang_type;
58 $version_update_id = implode(
'.', array(__CLASS__,
__XE_VERSION__,
'updated'));
62 if(!$oDB->isIndexExists(
"module_part_config",
"idx_module_part_config"))
return true;
64 if(!$oDB->isIndexExists(
'modules',
"idx_site_mid"))
return true;
66 if($oDB->isColumnExists(
'modules',
'grants'))
return true;
68 if(!$oDB->isColumnExists(
'sites',
'default_language'))
return true;
72 if($oDB->isColumnExists(
"documents",
"extra_vars".$i))
return true;
75 $args =
new stdClass();
81 if($oDB->isIndexExists(
'sites',
'idx_domain'))
return true;
82 if(!$oDB->isIndexExists(
'sites',
'unique_domain'))
return true;
84 if(!$oDB->isColumnExists(
"modules",
"use_mobile"))
return true;
85 if(!$oDB->isColumnExists(
"modules",
"mlayout_srl"))
return true;
86 if(!$oDB->isColumnExists(
"modules",
"mcontent"))
return true;
87 if(!$oDB->isColumnExists(
"modules",
"mskin"))
return true;
90 if(!$oDB->isColumnExists(
"modules",
"is_skin_fix"))
return true;
92 if(!$oDB->isColumnExists(
"module_config",
"site_srl"))
return true;
100 $skin_path = explode(
'.', $item->skin);
101 if(count($skin_path) != 2)
continue;
102 if(is_dir(sprintf(
_XE_PATH_ .
'themes/%s/modules/%s', $skin_path[0], $skin_path[1])))
return true;
109 if(!$oDB->isColumnExists(
"modules",
"is_mskin_fix"))
return true;
111 if(!$oDB->isIndexExists(
"module_part_config",
"unique_module_part_config"))
return true;
115 if(!$moduleConfig->isUpdateFixedValue)
return true;
120 if(!is_dir(
'./files/ruleset'))
return true;
133 $version_update_id = implode(
'.', array(__CLASS__,
__XE_VERSION__,
'updated'));
137 if(!$oDB->isIndexExists(
"module_part_config",
"idx_module_part_config"))
145 if(!in_array(
$module, array(
'point',
'trackback',
'layout',
'rss',
'file',
'comment',
'editor')))
continue;
153 unset($config->module_point);
161 unset($config->module_config);
171 $tmp = $config->header_script;
172 if(is_array($tmp) && count($tmp))
174 foreach($tmp as $k => $v)
176 if(!$v && !trim($v))
continue;
194 $oDB->addIndex(
"module_part_config",
"idx_module_part_config", array(
"module",
"module_srl"));
197 if(!$oDB->isIndexExists(
'modules',
"idx_site_mid"))
199 $oDB->dropIndex(
"modules",
"unique_mid",
true);
200 $oDB->addColumn(
'modules',
'site_srl',
'number',11,0,
true);
201 $oDB->addIndex(
"modules",
"idx_site_mid", array(
"site_srl",
"mid"),
true);
204 if(!$oDB->isTableExists(
'document_extra_vars')) $oDB->createTableByXmlFile(
'./modules/document/schemas/document_extra_vars.xml');
206 if(!$oDB->isTableExists(
'document_extra_keys')) $oDB->createTableByXmlFile(
'./modules/document/schemas/document_extra_keys.xml');
208 if($oDB->isColumnExists(
'modules',
'grants'))
223 $grants = unserialize($module_info->grants);
226 $skin_vars = unserialize($module_info->skin_vars);
229 $admin_id = trim($module_info->admin_id);
230 if($admin_id && $admin_id !=
'Array')
232 $admin_ids = explode(
',',$admin_id);
235 foreach($admin_ids as $admin_id)
242 $extra_vars = unserialize($module_info->extra_vars);
243 $document_extra_keys = null;
255 if($module_info->module ==
'planet')
257 if(!$document_extra_keys || !is_array($document_extra_keys)) $document_extra_keys = array();
258 $planet_extra_keys->name =
'postscript';
259 $planet_extra_keys->type =
'text';
260 $planet_extra_keys->is_required =
'N';
261 $planet_extra_keys->search =
'N';
262 $planet_extra_keys->default =
'';
263 $planet_extra_keys->desc =
'';
264 $document_extra_keys[20] = $planet_extra_keys;
267 if(count($document_extra_keys))
269 foreach($document_extra_keys as $var_idx => $val)
271 $oDocumentController->insertDocumentExtraKey(
$module_srl, $var_idx, $val->name, $val->type, $val->is_required, $val->search, $val->default, $val->desc,
'extra_vars'.$var_idx);
280 $total_pages = (int) (($total_count - 1) / $per_page) + 1;
284 $doc_args->list_count = $per_page;
285 $doc_args->sort_index =
'list_order';
286 $doc_args->order_type =
'asc';
288 for($doc_args->page = 1; $doc_args->page <= $total_pages; $doc_args->page++)
294 foreach (
$output->data as $document)
296 if(!$document)
continue;
297 foreach ($document as $key => $var)
299 if (strpos($key,
'extra_vars') !== 0 || !trim($var) || $var ==
'N;')
continue;
300 $var_idx = str_replace(
'extra_vars',
'',$key);
309 $module_info->grant = null;
310 $module_info->extra_vars = null;
311 $module_info->skin_vars = null;
312 $module_info->admin_id = null;
316 if($oCacheHandler->isSupport())
318 $oCacheHandler->invalidateGroupKey(
'site_and_module');
323 $oDB->dropColumn(
'modules',
'grants');
324 $oDB->dropColumn(
'modules',
'admin_id');
325 $oDB->dropColumn(
'modules',
'skin_vars');
326 $oDB->dropColumn(
'modules',
'extra_vars');
329 if(!$oDB->isColumnExists(
'sites',
'default_language'))
331 $oDB->addColumn(
'sites',
'default_language',
'varchar',255,0,
false);
334 for($i=1;$i<=20;$i++)
336 if(!$oDB->isColumnExists(
"documents",
"extra_vars".$i))
continue;
337 $oDB->dropColumn(
'documents',
'extra_vars'.$i);
341 $args =
new stdClass;
347 $mid_output = $oDB->executeQuery(
'module.getDefaultMidInfo',
$args);
350 $url_info = parse_url($domain);
351 $domain = $url_info[
'host'].( (!empty($url_info[
'port'])&&$url_info[
'port']!=80)?
':'.$url_info[
'port']:
'').$url_info[
'path'];
353 $site_args->index_module_srl = $mid_output->data->module_srl;
355 $site_args->default_language = $db_info->lang_type;
361 if($oDB->isIndexExists(
'sites',
'idx_domain'))
363 $oDB->dropIndex(
'sites',
'idx_domain');
365 if(!$oDB->isIndexExists(
'sites',
'unique_domain'))
368 $oDB->addIndex(
'sites',
'unique_domain',array(
'domain'),
true);
371 if(!$oDB->isColumnExists(
"modules",
"use_mobile"))
373 $oDB->addColumn(
'modules',
'use_mobile',
'char',1,
'N');
375 if(!$oDB->isColumnExists(
"modules",
"mlayout_srl"))
377 $oDB->addColumn(
'modules',
'mlayout_srl',
'number',11, 0);
379 if(!$oDB->isColumnExists(
"modules",
"mcontent"))
381 $oDB->addColumn(
'modules',
'mcontent',
'bigtext');
383 if(!$oDB->isColumnExists(
"modules",
"mskin"))
385 $oDB->addColumn(
'modules',
'mskin',
'varchar',250);
387 if(!$oDB->isColumnExists(
"modules",
"is_skin_fix"))
389 $oDB->addColumn(
'modules',
'is_skin_fix',
'char', 1,
'N');
392 if(!$oDB->isColumnExists(
"module_config",
"site_srl"))
394 $oDB->addColumn(
'module_config',
'site_srl',
'number', 11, 0,
true);
401 foreach(
$output->data as $item)
403 $skin_path = explode(
'.', $item->skin);
404 if(count($skin_path) != 2)
continue;
405 if(is_dir(sprintf(
_XE_PATH_ .
'themes/%s/modules/%s', $skin_path[0], $skin_path[1])))
408 $args->skin = $item->skin;
409 $args->new_skin = implode(
'|@|', $skin_path);
416 if(!$oDB->isColumnExists(
"modules",
"is_mskin_fix"))
418 $oDB->addColumn(
'modules',
'is_mskin_fix',
'char', 1,
'N');
424 if(!$moduleConfig->isUpdateFixedValue)
430 if(!$moduleConfig) $moduleConfig =
new stdClass;
431 $moduleConfig->isUpdateFixedValue = TRUE;
435 if(!$oDB->isIndexExists(
"module_part_config",
"unique_module_part_config"))
437 $oDB->addIndex(
"module_part_config",
"unique_module_part_config", array(
"module",
"module_srl"), TRUE);
452 foreach(
$output->data as $data)
454 if($data->count == 1)
continue;
455 $domain = $data->domain;
456 $args =
new stdClass;
457 $args->domain = $domain;
460 foreach($output2->data as $site)
468 $args =
new stdClass;
469 $args->domain = $domain;
470 $args->site_srl = $site->site_srl;
recompileCache()
Re-generate the cache file.
getController($module_name)
& getInstance($target= 'object', $info=null, $always_use_file=false)
foreach($sitemap as $id=> &$val) $extra_vars
moduleUpdate()
Execute update.
checkUpdate()
a method to check if successfully installed
updateForUniqueSiteDomain()
$module_srl
integer value to represent a run-time instance of Module (XE Module)
$module_info
an object containing the module information
getInstance($db_type=NULL)
executeQueryArray($query_id, $args=NULL, $arg_columns=NULL)
moduleInstall()
Implement if additional tasks are necessary when installing.
executeQuery($query_id, $args=NULL, $arg_columns=NULL)
$module
Class name of Xe Module that is identified by mid.
high class of the module module