PageRenderTime 24ms CodeModel.GetById 13ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 1ms

/package_J10/admin/install.package.php

http://jumi.googlecode.com/
PHP | 31 lines | 21 code | 6 blank | 4 comment | 2 complexity | a1f6063257e8686ab882a8c68af6dbe2 MD5 | raw file
 1<?php
 2defined("_VALID_MOS") or die("Restricted access");
 3
 4function com_install() {
 5    global $database, $mainframe;
 6
 7    require_once($mainframe->getPath('installer_class', 'module'));
 8    require_once($mainframe->getPath('installer_class', 'mambot'));
 9
10    // change default icon
11    $database->setQuery("UPDATE #__components set admin_menu_img = '../administrator/components/com_jumi/images/jumi.png' where admin_menu_link = 'option=com_jumi'");
12    $database->query();
13
14    //rename xml- files to xml to not conflict with component xml file when installing
15    rename($mainframe->getCfg('absolute_path').'/administrator/components/com_jumi/module/mod_jumi.xml-', $mainframe->getCfg('absolute_path').'/administrator/components/com_jumi/module/mod_jumi.xml');
16    rename($mainframe->getCfg('absolute_path').'/administrator/components/com_jumi/plugin/plugin_jumi.xml-', $mainframe->getCfg('absolute_path').'/administrator/components/com_jumi/plugin/plugin_jumi.xml');
17
18    // installing module
19    $module_installer = new mosInstallerModule;
20    if($module_installer->install(dirname(__FILE__).'/module'))
21        echo 'Module install success', '<br />';
22    else
23        echo 'Module install failed', '<br />';
24
25    // installing plugin
26    $plugin_installer = new mosInstallerMambot;
27    if($plugin_installer->install(dirname(__FILE__).'/plugin'))
28        echo 'Plugin install success', '<br />';
29    else
30        echo 'Plugin install failed', '<br />';
31}