PHP Library for generating All-In-One install packages (*.zip) with multiple extensions for Joomla! CMS
- Package: vikijel/joomla-extensions-packager
- Source: Packagist, GitHub
- Author: Viktor Jelínek (VikiJel), [email protected]
- License: The MIT License (MIT)
- Copyright: (c) 2016 Viktor Jelínek
- Website: http://www.joomla-extensions-packager.org
- Packs given extensions, languages, scriptfile etc. together with auto-generated install xml manifest into a ZIP archive ready for installation into Joomla! CMS
- Created install packages are:
- Compatible with Joomla! 2.5 and newer (Xml manifest has
<extension>
root element) - Native extension installation packages of type 'package'
- Compatible with Joomla! 2.5 and newer (Xml manifest has
- PHP 5.6 or newer
- For more info about PHP versions compatibility see PHPUnit results at Travis
Run this command inside your project directory (Your project dir is later referred to as repository
):
composer require vikijel/joomla-extensions-packager
You need to have Composer installed for above command to work
- If you are using Composer in your project, the
vendor/autoload.php
should be already required in your project repository
= your project directory (where you rancomposer require
)
require_once '/path/to/repository/vendor/autoload.php';
- Source: examples/usage_basic.php
use VikiJel\JoomlaExtensionsPackager\Package;
try
{
$path = Package::create('Something All-In-One')
->addExtension('com_test', '../tests/data/some_file.zip')
->addExtension('mod_test', '../tests/data/some_file.zip', 'module', 'site')
->addExtension('plg_system_test', '../tests/data/some_file.zip', 'plugin', null, 'system')
->pack();
echo 'Path to created package is ' . $path;
//Outputs: Path to created package is: /path/to/repository/out/pkg_something_all_in_one-1.0.0.zip
}
catch (Exception $e)
{
die('Failed to create package, error: ' . $e->getMessage());
}
- Source: examples/usage_advanced.php
- More information can be found directly inside Package class and other classes in form of php-doc comments
use VikiJel\JoomlaExtensionsPackager\Package;
use VikiJel\JoomlaExtensionsPackager\Extension;
try
{
$path = Package::create('Something Else All-in-one')
->setAuthor('Your Name', '[email protected]', 'http://your.domain.example.com')
->setVersion('1.2.3')
->setDescription('This is something else...')
->setLicense('GPL')
->setCreationDate('2016-05-21')
->setMinJoomlaVersion('2.5')
->setUrl('http://url.com')
->setScriptfile('../tests/data/some_file.php')
->addExtension('com_test', '../tests/data/some_file.zip')
->addExtension('mod_test', '../tests/data/some_file.zip', 'module', 'site')
->addExtensionInstance(
Extension::create('plg_system_test', '../tests/data/some_file.zip')
->setType('plugin')
->setGroup('system')
)
->addExtension('tpl_test', '../tests/data/some_file.zip', 'template', 'admin')
->addExtension('lib_test', '../tests/data/some_file.zip', 'library')
->addExtension('lng_test', '../tests/data/some_file.zip', 'language', 'site')
->addExtensionInstance(
Extension::create('file_test', '../tests/data/some_file.zip', 'file')
)
->addLanguage('../tests/data/some_file.ini', 'cs-CZ')
->addUpdateServer('http://updates1.example.com', 'My update server 1')
->addUpdateServer('http://updates2.example.com', 'My update server 2', 'collection', 2)
->pack('../out/custom', 'pkg_overridden_name.zip');
echo 'Path to created package is ' . $path;
//Outputs: Path to created package is /path/to/repository/out/custom/pkg_overridden_name.zip
}
catch (Exception $e)
{
die('Failed to create package, error: ' . $e->getMessage());
}
This library is not affiliated with or endorsed by the Joomla! Project or Open Source Matters. The Joomla!® name and logo is used under a limited license granted by Open Source Matters, the trademark holder in the United States and other countries.