<?xml version="1.0" encoding="utf-8"?> <install type="component" version="1.5.0" method="upgrade"> <name>snippets</name> <version>1.0</version> <creationDate>2008 11 27</creationDate> <author>Vernet Loïc</author> <authorEmail>cocoil@yahoo.fr</authorEmail> <authorUrl>http://www.strangebuzz.com</authorUrl> <copyright>(C) 2008 - 2009 COil</copyright> <license>COil</license> <description>Great component</description> <administration> <menu img="templates/myadmintemplate/images/menu/comments.png">My component</menu> </administration> <install /> <uninstall /> </install>
// Delete external tables from plugin schema (already defined in another schema (main or other plugin)) if (DCMC_EXTERNAL_TABLE) { foreach (explode(',', DCMC_EXTERNAL_TABLES) as $external_table) { $reg_exp = '/(<table name="'. $external_table. ')(((.)*(\s)*)*?)(<\/table>)/'; $xmlstr = preg_replace($reg_exp, '', $xmlstr); } }
You will need the original package.xml, it can be usefull for package maintainers to provide source of their package as i did for my PHP_Debug pkg
// file function showSource($dir, $file) { $path = $dir. $file; print('<div>'); print('<h1>'. $path. '</h1>'); highlight_file($path); print('</div>'. "\n"); } // Dir function parseDir($dir, $parent) { $path = $parent. ($dir['name'] != '/' ? $dir['name']. '/' : ''); foreach($dir->file as $file) { if (in_array($file['role'], array('test', 'php'))) { showSource($path, $file['name']); } } foreach($dir->dir as $child) { parseDir($child, $path); } return; } $package = simplexml_load_file('package.xml'); $dir = ''; parseDir($package->contents->dir, $dir);
logs
8078.6 KB