public static function getManifest() { // Create the plugin manifest $manifest = new \GreenCape\Manifest\PluginManifest(); // Meta data $manifest->setTarget('1.6')->setGroup('system')->setMethod('upgrade')->setName('System - Alpha')->setCreationDate('July 2008')->setAuthor('John Doe')->setAuthorEmail('*****@*****.**')->setAuthorUrl('http://www.example.org')->setCopyright(2008, 'Copyright Info', false)->setLicense('License Info')->setVersion('1.6.0')->setDescription('PLG_ALPHA_XML_DESCRIPTION'); // Installer hooks $manifest->setScriptFile('alpha.scriptfile.php'); // SQL files $install = new \GreenCape\Manifest\SqlSection(); $install->addFile('mysql', 'sql/install.mysql.utf8.sql', array('charset' => 'utf8')); $manifest->addSection('install', $install); $uninstall = new \GreenCape\Manifest\SqlSection(); $uninstall->addFile('mysql', 'sql/uninstall.mysql.utf8.sql', array('charset' => 'utf8')); $manifest->addSection('uninstall', $uninstall); $update = new \GreenCape\Manifest\SchemaSection(); $update->addFolder('mysql', 'sql/updates/mysql'); $manifest->addSection('update', $update); // Front-end files $files = new \GreenCape\Manifest\FileSection(); $files->addFile('alpha.php', array('plugin' => 'alpha'))->addFolder('sql')->addFolder('language'); $manifest->addSection('files', $files); // Front-end language (legacy 1.5 support) $language = new \GreenCape\Manifest\LanguageSection(); $language->setBase('language')->addFile('en-GB', 'admin/en-GB.plg_system_alpha.ini', array('client' => 'administrator'))->addFile('en-GB', 'site/en-GB.plg_system_alpha.ini', array('client' => 'site')); $manifest->addSection('languages', $language); return $manifest; }
public static function getManifest() { // Create the template manifest $manifest = new \GreenCape\Manifest\TemplateManifest(); // Meta data $manifest->setTarget('1.6')->setMethod('upgrade')->setName('simple_template')->setCreationDate('July 2008')->setAuthor('John Doe')->setAuthorEmail('*****@*****.**')->setAuthorUrl('http://www.example.org')->setCopyright(2008, 'Copyright Info', false)->setLicense('License Info')->setVersion('1.6.0')->setDescription('TPL_TPL_SIMPLE_XML_DESCRIPTION'); // Front-end files $files = new \GreenCape\Manifest\FileSection(); $files->addFile('index.php'); $manifest->addSection('files', $files); return $manifest; }
public static function getManifest() { // Create the library manifest $manifest = new \GreenCape\Manifest\LibraryManifest(); // Meta data $manifest->setTarget('3.1')->setMethod('install')->setName('Joomla! Platform')->setLibraryName('joomla')->setVersion('12.2')->setDescription('LIB_JOOMLA_XML_DESCRIPTION')->setCreationDate('January 2008')->setCopyright('2005 - 2013', 'Open Source Matters', false)->setLicense('http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL')->setAuthor('Joomla! Project')->setAuthorEmail('*****@*****.**')->setAuthorUrl('http://www.joomla.org')->setPackager('Joomla!')->setPackagerUrl('http://www.joomla.org'); // Front-end files $files = new \GreenCape\Manifest\FileSection(); $files->setBase('libraries')->setFileTag('file')->addFolder('compat')->addFolder('joomla')->addFolder('legacy')->addFile('import.legacy.php')->addFile('import.php')->addFile('loader.php')->addFile('platform.php'); $manifest->addSection('files', $files); return $manifest; }
/** * Issue #9: File manifest: fileset is not supported */ public function testAddFileset() { $this->manifest->setAuthor('Test')->setCreationDate('August 2014')->setCopyright('2014', 'Test', false); $section = new \GreenCape\Manifest\FilesetSection(); $files = new \GreenCape\Manifest\FileSection(); $files->setBase('dir')->addFile('foo.txt'); $section->addFileset($files); $this->manifest->addSection('fileset', $section); $expected = '<?xml version="1.0" encoding="UTF-8"?>'; $expected .= '<extension method="install" type="file" version="2.5">'; $expected .= '<author>Test</author>'; $expected .= '<creationDate>August 2014</creationDate>'; $expected .= '<copyright>(C) 2014 Test. All rights reserved.</copyright>'; $expected .= '<license>GNU General Public License version 2 or later; see LICENSE.txt</license>'; $expected .= '<fileset>'; $expected .= '<files folder="dir">'; $expected .= '<file>foo.txt</file>'; $expected .= '</files>'; $expected .= '</fileset>'; $expected .= '</extension>'; $this->assertXmlStringEqualsXmlString($expected, (string) $this->manifest); }
public static function getManifest() { // Create the file manifest $manifest = new \GreenCape\Manifest\FileManifest(); // Meta data $manifest->setTarget('3.1')->setMethod('upgrade')->setName('files_joomla')->setAuthor('Joomla! Project')->setAuthorEmail('*****@*****.**')->setAuthorUrl('www.joomla.org')->setCopyright('2005 - 2013', 'Open Source Matters', false)->setLicense('GNU General Public License version 2 or later; see LICENSE.txt')->setVersion('3.1.1')->setCreationDate('April 2013')->setDescription('FILES_JOOMLA_XML_DESCRIPTION'); // Installer hooks $manifest->setScriptFile('administrator/components/com_admin/script.php'); // SQL files $update = new \GreenCape\Manifest\SchemaSection(); $update->addFolder('mysql', 'administrator/components/com_admin/sql/updates/mysql')->addFolder('sqlsrv', 'administrator/components/com_admin/sql/updates/sqlsrv')->addFolder('sqlazure', 'administrator/components/com_admin/sql/updates/sqlazure')->addFolder('postgresql', 'administrator/components/com_admin/sql/updates/postgresql'); $manifest->addSection('update', $update); // Front-end files $files = new \GreenCape\Manifest\FileSection(); $files->addFolder('administrator')->addFolder('cache')->addFolder('cli')->addFolder('components')->addFolder('images')->addFolder('includes')->addFolder('language')->addFolder('layouts')->addFolder('libraries')->addFolder('logs')->addFolder('media')->addFolder('modules')->addFolder('plugins')->addFolder('templates')->addFolder('tmp')->addFile('htaccess.txt')->addFile('web.config.txt')->addFile('LICENSE.txt')->addFile('README.txt')->addFile('index.php'); $fileset = new \GreenCape\Manifest\FilesetSection(); $fileset->addFileset($files); $manifest->addSection('fileset', $fileset); // Extension Update Specification $server = new \GreenCape\Manifest\ServerSection(); $server->addServer('collection', null, 'http://update.joomla.org/core/list.xml')->addServer('collection', null, 'http://update.joomla.org/jed/list.xml'); $manifest->addSection('updateservers', $server); return $manifest; }
public function testAttributesDoNotFlowIntoSiblings() { $files = new \GreenCape\Manifest\FileSection(); $files->setBase('site'); $files->addFile('foo.php'); $files->addFolder('bar'); $this->manifest->addSection('files', $files); preg_match_all('~\\<(\\w+)[^>]*folder="site"~sm', (string) $this->manifest, $matches, PREG_SET_ORDER); $this->assertEquals(1, count($matches)); $this->assertEquals('files', $matches[0][1]); }
/** * Issue #9: File manifest: fileset is not supported */ public function testAddMultipleFileSections() { $files = new \GreenCape\Manifest\FileSection(); $files->setBase('dir')->addFile('foo.txt'); $this->section->addFileset($files); $files = new \GreenCape\Manifest\FileSection(); $files->setBase('another/dir')->addFile('bar.txt'); $this->section->addFileset($files); $xml = new \GreenCape\Xml\Converter(array('fileset' => $this->section->getStructure())); $expected = '<?xml version="1.0" encoding="UTF-8"?>'; $expected .= '<fileset>'; $expected .= '<files folder="dir">'; $expected .= '<file>foo.txt</file>'; $expected .= '</files>'; $expected .= '<files folder="another/dir">'; $expected .= '<file>bar.txt</file>'; $expected .= '</files>'; $expected .= '</fileset>'; $this->assertXmlStringEqualsXmlString($expected, (string) $xml); }
public static function getManifest() { // Create the component manifest $manifest = new \GreenCape\Manifest\ComponentManifest(); // Meta data $manifest->setTarget('1.6')->setMethod('upgrade')->setName('com_alpha')->setAuthor('John Doe')->setAuthorEmail('*****@*****.**')->setAuthorUrl('http://www.example.org')->setCopyright(2008, 'Copyright Info', false)->setLicense('License Info')->setVersion('1.0')->setCreationDate('March 2006'); // Installer hooks $manifest->setInstallFile('file.install.php')->setUninstallFile('file.uninstall.php')->setScriptFile('file.script.php'); // SQL files $install = new \GreenCape\Manifest\SqlSection(); $install->addFile('mysql', 'sql/install.mysql.utf8.sql', array('charset' => 'utf8')); $manifest->addSection('install', $install); $uninstall = new \GreenCape\Manifest\SqlSection(); $uninstall->addFile('mysql', 'sql/uninstall.mysql.utf8.sql', array('charset' => 'utf8', 'folder' => 'sql')); $manifest->addSection('uninstall', $uninstall); $update = new \GreenCape\Manifest\SchemaSection(); $update->addFolder('mysql', 'sql/updates/mysql')->addFolder('sqlsrv', 'sql/updates/sqlsrv'); $manifest->addSection('update', $update); // Front-end files $files = new \GreenCape\Manifest\FileSection(); $files->setBase('site')->addFile('alpha.php'); $manifest->addSection('files', $files); // Front-end language (legacy 1.5 support) $language = new \GreenCape\Manifest\LanguageSection(); $language->setBase('site')->addFile('en-GB', 'language/en-GB/en-GB.com_alpha.ini'); $manifest->addSection('languages', $language); // Media Files $media = new \GreenCape\Manifest\MediaSection(); $media->setDestination('com_alpha')->addFile('com_alpha.jpg'); $manifest->addSection('media', $media); // Backend files $menu = new \GreenCape\Manifest\MenuSection(); $menu->setLabel('Alpha')->setIcon('components/com_alpha/applications-internet-16.png')->addMenu('Installer', 'option=com_installer')->addMenu('Users', 'option=com_users'); $adminFiles = new \GreenCape\Manifest\FileSection(); $adminFiles->setBase('admin')->addFile('admin.alpha.php')->addFile('image.png')->addFile('applications-internet.png')->addFile('applications-internet-16.png')->addFolder('sql'); $adminLanguage = new \GreenCape\Manifest\LanguageSection(); $adminLanguage->setBase('admin/language')->addFile('en-GB', 'en-GB/en-GB.com_alpha.ini')->addFile('en-GB', 'en-GB/en-GB.com_alpha.sys.ini'); $admin = new \GreenCape\Manifest\AdminSection(); $admin->setMenu($menu)->setFiles($adminFiles)->setLanguage($adminLanguage); $manifest->addSection('administration', $admin); // Extension Update Specification $server = new \GreenCape\Manifest\ServerSection(); $server->addServer('extension', 'Extension Update Site', 'http://jsitepoint.com/update/components/com_alpha/extension.xml', 1)->addServer('collection', 'Collection Update Site', 'http://jsitepoint.com/update/update.xml', 2); $manifest->addSection('updateservers', $server); // Tables $tables = new \GreenCape\Manifest\TableSection(); $tables->addTable('#__alpha_install')->addTable('#__alpha_update', true); $manifest->addSection('tables', $tables); // Dependencies $dependencies = new \GreenCape\Manifest\DependencySection(); $dependencies->addDependency('platform', 'joomla', '=', '1.5'); $manifest->addSection('dependencies', $dependencies); return $manifest; }