private function collect_local_data()
{
$data = array();
$data['php_version'] = phpversion();
$data['mw_version'] = MW_VERSION;
$data['mw_update_check_site'] = $this->app->url_manager->site();
$t = site_templates();
$data['templates'] = $t;
$t = $this->app->modules->get('ui=any&no_limit=true');
$modules = array();
$data['module_templates'] = array();
if (is_array($t)) {
foreach ($t as $value) {
if (isset($value['module']) and isset($value['version'])) {
$mod = array('module' => $value['module'], 'version' => $value['version']);
$modules[] = $mod;
$module_templates = $this->app->modules->templates($value['module']);
$mod_tpls = array();
if (is_array($module_templates)) {
foreach ($module_templates as $key1 => $value1) {
if (isset($value1['filename'])) {
$options = array();
if ($this->skip_cache) {
$options['no_cache'] = 1;
}
$options['for_modules'] = 1;
$options['filename'] = $value1['filename'];
$module_templates_for_this = $this->app->layouts_manager->scan($options);
if (isset($module_templates_for_this[0]) and is_array($module_templates_for_this[0])) {
$mod_tpls[$key1] = $module_templates_for_this[0];
}
}
}
if (!empty($mod_tpls)) {
$data['module_templates'][$value['module']] = $mod_tpls;
}
}
}
}
}
$data['modules'] = $modules;
if ($this->skip_cache) {
$t = $this->app->modules->scan_for_elements('skip_cache=1');
} else {
$t = $this->app->modules->scan_for_elements();
}
$elements = array();
if (is_array($t)) {
foreach ($t as $value) {
if (isset($value['module']) and isset($value['version'])) {
$mod = array('module' => $value['module'], 'version' => $value['version']);
$elements[] = $mod;
}
}
}
$data['elements'] = $elements;
return $data;
}