/quanta/code/trunk/administrator/components/com_quanta/install/install.php
PHP | 155 lines | 24 code | 9 blank | 122 comment | 3 complexity | b9d5a749a8c3ca6e57caaba37bd67e61 MD5 | raw file
- <?php
- /**
- * @version $Id: install.php 377 2010-11-03 08:00:54Z eddieajau $
- * @package NewLifeInIT
- * @subpackage com_quanta
- * @copyright Copyright (C) 2009 New Life in IT Pty Ltd. All rights reserved.
- * @license GNU General Public License <http://www.gnu.org/copyleft/gpl.html>
- * @link http://www.theartofjoomla.com
- */
- // no direct access
- defined('_JEXEC') or die;
- // Load the component language file
- $language = JFactory::getLanguage();
- $language->load('com_stone', JPATH_ADMINISTRATOR.'/components/com_stone');
- // PHP 5 check
- if (version_compare(PHP_VERSION, '5.2.4', '<')) {
- $this->parent->abort(JText::_('J_USE_PHP5'));
- return false;
- }
- // Include dependancies.
- require_once dirname(__FILE__).'/helper.php';
- require_once dirname(dirname(__FILE__)).'/version.php';
- // Install the modules.
- $modules = PackageInstallerHelper::installModules($this);
- if ($modules === false) {
- return false;
- }
- // Install the plugins.
- $plugins = PackageInstallerHelper::installPlugins($this);
- if ($plugins === false) {
- return false;
- }
- // Fix the link bug.
- PackageInstallerHelper::fixLink('com_stone');
- // Perform upgrades.
- /*
- if (PackageInstallerHelper::componentExists('com_stone')) {
- // Perform the DB upgrades.
- $results = PackageInstallerHelper::upgrade(
- '<?xml version="1.0"?>
- <mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <database name="">
- <table_structure name="#__stone_burials">
- <field Field="Deceased_ID" Type="varchar(50)" Null="NO" Key="PRI" Extra="" />
- <field Field="Family_Name" Type="varchar(50)" Null="YES" Key="MUL" Extra="" />
- <field Field="Given_Names" Type="varchar(100)" Null="YES" Key="MUL" Extra="" />
- <field Field="Gender" Type="varchar(10)" Null="YES" Key="" Extra="" />
- <field Field="Age_at_Death" Type="tinyint(3) unsigned" Null="NO" Key="" Default="0" Extra="" />
- <field Field="Age_Type" Type="varchar(10)" Null="YES" Key="" Extra="" />
- <field Field="Date_of_Birth" Type="date" Null="YES" Key="MUL" Extra="" />
- <field Field="Date_of_Death" Type="date" Null="YES" Key="MUL" Extra="" />
- <field Field="NOK_Last_Name" Type="varchar(50)" Null="YES" Key="" Extra="" />
- <field Field="NOK_First_Names" Type="varchar(100)" Null="YES" Key="" Extra="" />
- <field Field="Date_of_Burial" Type="date" Null="YES" Key="MUL" Extra="" />
- <field Field="Funeral_Home" Type="varchar(50)" Null="YES" Key="" Extra="" />
- <field Field="Undertaker_Last_Name" Type="varchar(50)" Null="YES" Key="" Extra="" />
- <field Field="Undertaker_First_names" Type="varchar(100)" Null="YES" Key="" Extra="" />
- <field Field="Internment_ID" Type="varchar(50)" Null="YES" Key="MUL" Extra="" />
- <field Field="Internment_Sequence" Type="int(10) unsigned" Null="NO" Key="" Extra="" />
- <field Field="Reference_Number" Type="varchar(50)" Null="YES" Key="" Extra="" />
- <field Field="Cemetery" Type="varchar(100)" Null="YES" Key="MUL" Extra="" />
- <field Field="Site_ID" Type="varchar(50)" Null="YES" Key="" Extra="" />
- <field Field="Location" Type="varchar(100)" Null="YES" Key="" Extra="" />
- <field Field="Cause_of_Death" Type="varchar(255)" Null="YES" Key="" Extra="" />
- <field Field="Head_Stone" Type="varchar(50)" Null="YES" Key="" Extra="" />
- <field Field="Head_Stone_Type" Type="varchar(50)" Null="YES" Key="" Extra="" />
- <field Field="Religion" Type="varchar(50)" Null="YES" Key="MUL" Extra="" />
- <field Field="Minister_Of_Religion_Last_Name" Type="varchar(50)" Null="YES" Key="" Extra="" />
- <field Field="Minister_Of_Religion_First_Names" Type="varchar(100)" Null="YES" Key="" Extra="" />
- <field Field="DeceasedPerson_Modified" Type="datetime" Null="YES" Key="" Extra="" />
- <field Field="Expire_Modified" Type="datetime" Null="YES" Key="" Extra="" />
- <field Field="Next_of_Kins_Modified" Type="datetime" Null="YES" Key="" Extra="" />
- <field Field="NOK_Modified" Type="datetime" Null="YES" Key="" Extra="" />
- <field Field="Internments_Modified" Type="datetime" Null="YES" Key="" Extra="" />
- <field Field="FuneralService_Modified" Type="datetime" Null="YES" Key="" Extra="" />
- <field Field="FuneralHome_Modified" Type="datetime" Null="YES" Key="" Extra="" />
- <field Field="UnderTaker_Modified" Type="datetime" Null="YES" Key="" Extra="" />
- <field Field="Inter_2_Site_Modified" Type="datetime" Null="YES" Key="" Extra="" />
- <field Field="Sites_Modified" Type="datetime" Null="YES" Key="" Extra="" />
- <field Field="Markers_Modified" Type="datetime" Null="YES" Key="" Extra="" />
- <field Field="Officiating_Modified" Type="datetime" Null="YES" Key="" Extra="" />
- <field Field="Image_Path" Type="varchar(255)" Null="YES" Key="" Extra="" />
- <field Field="Image_File" Type="varchar(255)" Null="YES" Key="" Extra="" />
- <field Field="Service_Date" Type="date" Null="NO" Key="" Extra="" />
- <field Field="Service_Time" Type="time" Null="NO" Key="" Extra="" />
- <field Field="Maiden_Name" Type="varchar(100)" Null="YES" Key="MUL" Extra="" />
- <key Table="#__stone_burials" Non_unique="0" Key_name="PRIMARY" Seq_in_index="1" Column_name="Deceased_ID" Collation="A" Null="" Index_type="BTREE" Comment="" />
- <key Table="#__stone_burials" Non_unique="1" Key_name="idx_internment_id" Seq_in_index="1" Column_name="Internment_ID" Collation="A" Null="YES" Index_type="BTREE" Comment="" />
- <key Table="#__stone_burials" Non_unique="1" Key_name="idx_cemetery" Seq_in_index="1" Column_name="Cemetery" Collation="A" Null="YES" Index_type="BTREE" Comment="" />
- <key Table="#__stone_burials" Non_unique="1" Key_name="idx_Religion" Seq_in_index="1" Column_name="Religion" Collation="A" Null="YES" Index_type="BTREE" Comment="" />
- <key Table="#__stone_burials" Non_unique="1" Key_name="idx_maiden_name" Seq_in_index="1" Column_name="Maiden_Name" Collation="A" Null="YES" Index_type="BTREE" Comment="" />
- <key Table="#__stone_burials" Non_unique="1" Key_name="idx_family_name" Seq_in_index="1" Column_name="Family_Name" Collation="A" Null="YES" Index_type="BTREE" Comment="" />
- <key Table="#__stone_burials" Non_unique="1" Key_name="idx_given_names" Seq_in_index="1" Column_name="Given_Names" Collation="A" Null="YES" Index_type="BTREE" Comment="" />
- <key Table="#__stone_burials" Non_unique="1" Key_name="idx_date_of_birth" Seq_in_index="1" Column_name="Date_of_Birth" Collation="A" Null="YES" Index_type="BTREE" Comment="" />
- <key Table="#__stone_burials" Non_unique="1" Key_name="idx_date_of_death" Seq_in_index="1" Column_name="Date_of_Death" Collation="A" Null="YES" Index_type="BTREE" Comment="" />
- <key Table="#__stone_burials" Non_unique="1" Key_name="idx_date_of_burial" Seq_in_index="1" Column_name="Date_of_Burial" Collation="A" Null="YES" Index_type="BTREE" Comment="" />
- </table_structure>
- </database>
- </mysqldump>'
- );
- // Log the upgrade.
- jimport('joomla.error.log');
- $user = JFactory::getUser();
- $userId = $user->get('id');
- $log = JLog::getInstance('com_stone.install.log.php');
- $log->setOptions(
- array(
- 'format' => "{DATE}\t{TIME}\t{USER_ID}\t{COMMENT}"
- )
- );
- if (empty($results)) {
- $log->addEntry(
- array(
- 'user_id' => $userId,
- 'comment' => 'Stone '.QuantaVersion::VERSION.'.'.QuantaVersion::SUBVERSION.' '.QuantaVersion::STATUS.' upgraded with no schema changes.'
- )
- );
- }
- else {
- $log->addEntry(
- array(
- 'user_id' => $userId,
- 'comment' => 'Stone '.QuantaVersion::VERSION.'.'.QuantaVersion::SUBVERSION.' '.QuantaVersion::STATUS.' upgraded with schema changes.'
- )
- );
- foreach ($results as $result)
- {
- $log->addEntry(
- array(
- 'user_id' => $userId,
- 'comment' => $result
- )
- );
- }
- }
- }
- */
- // Display the results.
- PackageInstallerHelper::displayInstalled(
- $modules,
- $plugins,
- JText::sprintf('COM_QUANTA_INSTALLED', QuantaVersion::VERSION.'.'.QuantaVersion::SUBVERSION.' '.QuantaVersion::STATUS)
- );