Skip to content

Instantly share code, notes, and snippets.

@rvsjoen
Created November 2, 2011 19:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rvsjoen/1334623 to your computer and use it in GitHub Desktop.
Save rvsjoen/1334623 to your computer and use it in GitHub Desktop.
Automatic extension installation
<?php
define('_JEXEC', 1);
define('DS', DIRECTORY_SEPARATOR);
if (file_exists(dirname(__FILE__) . '/defines.php')) {
include_once dirname(__FILE__) . '/defines.php';
}
if (!defined('_JDEFINES')) {
define('JPATH_BASE', dirname(__FILE__));
require_once JPATH_BASE.'/includes/defines.php';
}
require_once JPATH_BASE.'/includes/framework.php';
jimport('joomla.installer.installer');
jimport('joomla.log.log');
jimport('joomla.plugin.helper');
jimport('joomla.application.component.helper');
jimport('joomla.environment.request');
jimport('joomla.application.application');
$installer = JInstaller::getInstance();
$basepath = '/home/username/extensions';
$packages = array(
'com_whatever',
'mod_whatever',
);
foreach($packages as $p)
$installer->install($basepath.$p);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment