Пример #1
0
 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;
 }
Пример #2
0
 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;
 }
Пример #3
0
 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]);
 }