<?php /** * @version $Id: admin.installer.php 1010 2011-01-26 15:26:17Z mirjam $ * @package Joomla * @subpackage Installer * @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. * @license GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * See COPYRIGHT.php for copyright notices and details. */ // no direct access defined('_JEXEC') or die('Restricted access'); require_once rsgOptions_installer_path . '/helpers/template.php'; require_once rsgOptions_installer_path . '/controller.php'; $controller = new InstallerController(array('default_task' => 'installform', 'model_path' => rsgOptions_installer_path . '/models', 'view_path' => rsgOptions_installer_path . '/views')); $controller->set('task_type', JRequest::getCmd('type')); $controller->execute(JRequest::getCmd('task')); $controller->redirect();
/** * @version $Id: installer.php 103 2009-06-21 19:21:18Z happynoodleboy $ * @package JCE * @copyright Copyright (C) 2009 Ryan Demmer. All rights reserved. * @license GNU/GPL * This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. */ // no direct access defined('_JEXEC') or die('Restricted access'); /* * Make sure the user is authorized to view this page */ $ext = JRequest::getWord('type'); $subMenus = array('Plugins' => 'plugin', 'Languages' => 'language', 'Plugin Extensions' => 'extension'); JSubMenuHelper::addEntry(JText::_('Control Panel'), '#" onclick="javascript:document.adminForm.type.value=\'\';document.adminForm.task.value=\'\';submitbutton(\'\');'); JSubMenuHelper::addEntry(JText::_('Install'), '#" onclick="javascript:document.adminForm.type.value=\'install\';document.adminForm.task.value=\'\';submitbutton(\'\');', !in_array($ext, $subMenus)); foreach ($subMenus as $name => $extension) { JSubMenuHelper::addEntry(JText::_($name), '#" onclick="javascript:document.adminForm.type.value=\'' . $extension . '\';submitbutton(\'manage\');', $extension == $ext); } require_once JPATH_COMPONENT . DS . 'installer' . DS . 'controller.php'; $controller = new InstallerController(array('default_task' => 'installform', 'base_path' => JPATH_COMPONENT . DS . 'installer')); $task = JRequest::getWord('task'); if ($task == 'install') { $task = 'doInstall'; } $controller->execute($task); $controller->redirect();
public function testRepairProcess() { self::time(__METHOD__); $config = Config::getInstance(); //repair process gets kicked off when at least 1 whole TU table is missing from the DB // drop one table $dao = new InstallerMySQLDAO(); $q = "DROP TABLE " . $config->getValue('table_prefix') . "encoded_locations"; PDODAO::$PDO->exec($q); $controller = new InstallerController(true); $result = $controller->go(); $this->assertPattern("/Looks like at least some of ThinkUp\\'s database tables already exist./", $result); $_GET["step"] = "repair"; $_GET["m"] = "db"; $_SERVER['REQUEST_URI'] = '/'; $config->setValue('repair', true); $controller = new InstallerController(true); $result = $controller->go(); $this->assertPattern("/Check your existing ThinkUp tables. If some tables are missing or need repair, " . "ThinkUp will attempt to create or repair them./", $result); $_POST["repair"] = "yespls"; $controller = new InstallerController(true); $result = $controller->go(); $this->assertPattern("/Created table " . $config->getValue('table_prefix') . "encoded_locations/", $result); }
/** * * ThinkUp/webapp/install/index.php * * Copyright (c) 2009-2012 Gina Trapani * * LICENSE: * * This file is part of ThinkUp (http://thinkupapp.com). * * ThinkUp is free software: you can redistribute it and/or modify it under the terms of the GNU General Public * License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any * later version. * * ThinkUp is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with ThinkUp. If not, see * <http://www.gnu.org/licenses/>. * * * @author Gina Trapani <ginatrapani[at]gmail[dot]com> * @license http://www.gnu.org/licenses/gpl.html * @copyright 2009-2012 Gina Trapani, Dwi Widiastuti */ chdir(".."); require_once 'init.php'; $controller = new InstallerController(); echo $controller->go();
* @version $Id: admin.installer.php 14401 2010-01-26 14:10:00Z louis $ * @package Joomla * @subpackage Installer * @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved. * @license GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * See COPYRIGHT.php for copyright notices and details. */ // no direct access defined('_JEXEC') or die('Restricted access'); /* * Make sure the user is authorized to view this page */ $user =& JFactory::getUser(); if (!$user->authorize('com_installer', 'installer')) { $mainframe->redirect('index.php', JText::_('ALERTNOTAUTH')); } $ext = JRequest::getWord('type'); $subMenus = array('Components' => 'components', 'Modules' => 'modules', 'Plugins' => 'plugins', 'Languages' => 'languages', 'Templates' => 'templates'); JSubMenuHelper::addEntry(JText::_('Install'), '#" onclick="javascript:document.adminForm.type.value=\'\';submitbutton(\'installer\');', !in_array($ext, $subMenus)); foreach ($subMenus as $name => $extension) { JSubMenuHelper::addEntry(JText::_($name), '#" onclick="javascript:document.adminForm.type.value=\'' . $extension . '\';submitbutton(\'manage\');', $extension == $ext); } require_once JPATH_COMPONENT . DS . 'controller.php'; $controller = new InstallerController(array('default_task' => 'installform')); //die(JRequest::getCmd('task')); $controller->execute(JRequest::getCmd('task')); $controller->redirect();
public function __construct($mode = null) { $GLOBALS['ms'] =& $this; try { $config = new ConfigController(); } catch (\Exception $e) { $this->raiseError('Failed to load ConfigController!', true); return false; } $GLOBALS['config'] =& $config; try { $requirements = new RequirementsController(); } catch (\Exception $e) { $this->raiseError('Failed to load RequirementsController!', true); return false; } if (!$requirements->check()) { $this->raiseError('Not all requirements are met - please check on your own!', true); return false; } unset($requirements); try { $db = new DatabaseController(); } catch (\Exception $e) { $this->raiseError('Failed to load DatabaseController!', true); return false; } $GLOBALS['db'] =& $db; if (!$this->isCmdline()) { try { $router = new HttpRouterController(); } catch (\Exception $e) { $this->raiseError('Failed to load HttpRouterController!', true); return false; } $GLOBALS['router'] =& $router; $GLOBALS['query'] = $router->getQuery(); global $query; } if (isset($query) && isset($query->view) && $query->view == "install") { $mode = "install"; } if ($mode != "install" && $this->checkUpgrade()) { return false; } if (isset($mode) and $mode == "install") { try { $installer = new InstallerController(); } catch (\Exception $e) { $this->raiseError('Failed to load InstallerController!'); return false; } if (!$installer->setup()) { exit(1); } unset($installer); exit(0); } try { $session = new SessionController(); } catch (\Exception $e) { $this->raiseError('Failed to load SessionController!', true); return false; } $GLOBALS['session'] =& $session; return true; }
/** * Entry point for Finder CLI script * * @return void * * @since 2.5 */ public function execute() { // import library dependencies //jimport('joomla.application.component.helper'); //$installer = JComponentHelper::getComponent('com_installer'); require_once JPATH_ADMINISTRATOR . '/components/com_installer/controller.php'; //jimport('joomla.application.component.installer'); // fool the system into thinking we are running as JSite with Finder as the active component JFactory::getApplication('site'); $_SERVER['HTTP_HOST'] = 'domain.com'; define('JPATH_COMPONENT_ADMINISTRATOR', JPATH_ADMINISTRATOR . '/components/com_installer'); define('JPATH_COMPONENT', JPATH_BASE . '/administrator/components/com_installer'); // Disable caching. $config = JFactory::getConfig(); $config->set('caching', 0); $config->set('cache_handler', 'file'); // Import the installer plugins. JPluginHelper::importPlugin('installer'); $updater = new InstallerController(); // APS. Fix DB echo "\nFixing database...\n"; $model = $updater->getModel('database'); $model->fix(); echo "Done\n"; }