~ubuntu-branches/ubuntu/raring/extplorer/raring-proposed

« back to all changes in this revision

Viewing changes to install.extplorer.php

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Goirand
  • Date: 2010-07-05 19:53:12 UTC
  • Revision ID: james.westby@ubuntu.com-20100705195312-i92s1udelus7gl52
Tags: upstream-2.1.0b6+dfsg
ImportĀ upstreamĀ versionĀ 2.1.0b6+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
// ensure this file is being included by a parent file
 
3
if( !defined( '_JEXEC' ) && !defined( '_VALID_MOS' ) ) die( 'Restricted access' );
 
4
/**
 
5
* @version $Id: install.extplorer.php 116 2009-01-15 20:39:58Z soeren $
 
6
* @package eXtplorer
 
7
* @copyright (C) 2005-2008 Soeren
 
8
* @license GNU / GPL
 
9
* @author soeren
 
10
* eXtplorer is Free Software
 
11
*/
 
12
function com_install(){
 
13
        global $database;
 
14
        
 
15
        if( is_callable( array( 'JFactory', 'getDBO' ))) {
 
16
                $database = JFactory::getDBO();
 
17
        }
 
18
        $mypath = dirname(__FILE__);
 
19
        require_once($mypath . "/include/functions.php");
 
20
        require_once($mypath . "/libraries/Archive/archive.php");
 
21
        
 
22
        ext_RaiseMemoryLimit( '50M' );
 
23
        error_reporting( E_ALL ^ E_NOTICE );
 
24
        
 
25
        $archive_name = $mypath.'/scripts.tar.gz';
 
26
        $extract_dir = $mypath.'/';
 
27
        
 
28
        $result = extArchive::extract( $archive_name, $extract_dir );
 
29
        if( !PEAR::isError( $result )) {
 
30
                unlink( $archive_name );
 
31
        } else {
 
32
                echo '<pre style="color:white; font-weight:bold; background-color:red;">Error!
 
33
                '.$result->getMessage().'
 
34
                </pre>';
 
35
        }
 
36
        $database->setQuery( "SELECT id FROM #__components WHERE admin_menu_link = 'option=com_extplorer'" );
 
37
        $id = $database->loadResult();
 
38
 
 
39
        //add new admin menu images
 
40
        $database->setQuery( "UPDATE #__components SET admin_menu_img = '../administrator/components/com_extplorer/images/joomla_x_icon.png', admin_menu_link = 'option=com_extplorer' WHERE id=$id");
 
41
        $database->query();
 
42
}
 
43
?>
 
 
b'\\ No newline at end of file'