|
Revision 10691, 0.6 kB
(checked in by p_lindheimer, 1 year ago)
|
Merged revisions 10690 via svnmerge from
http://svn.freepbx.org/modules/branches/2.9
........
r10690 | p_lindheimer | 2010-12-10 09:31:57 -0800 (Fri, 10 Dec 2010) | 1 line
update publish.pl to do a sanity check on the module.xml systax and add check_xml.php function to do that check using the exact xml parser used by FreePBX
........
|
- Property svn:executable set to
*
|
| Line | |
|---|
| 1 |
#!/usr/bin/php -q |
|---|
| 2 |
<?php |
|---|
| 3 |
|
|---|
| 4 |
$module = trim($argv[1],'/'); |
|---|
| 5 |
|
|---|
| 6 |
if (! @include_once('xml2Array.class.php')) { |
|---|
| 7 |
exec("svn export http://www.freepbx.org/v2/svn/freepbx/trunk/amp_conf/htdocs/admin/libraries/xml2Array.class.php xml2Array.class.php",$exec_out,$ret); |
|---|
| 8 |
if ($ret != 0) die("Could not find xml2Array.class.php, got ret: $ret\n"); |
|---|
| 9 |
require_once('xml2Array.class.php'); |
|---|
| 10 |
} |
|---|
| 11 |
|
|---|
| 12 |
function die_freepbx($string) { |
|---|
| 13 |
echo "Error Parsing XML File:\n"; |
|---|
| 14 |
echo $string."\n"; |
|---|
| 15 |
exit(10); |
|---|
| 16 |
} |
|---|
| 17 |
|
|---|
| 18 |
$xml_data = file_get_contents("$module/module.xml"); |
|---|
| 19 |
$parser = new xml2ModuleArray($xml_data); |
|---|
| 20 |
$xmlarray = $parser->parseAdvanced($xml_data); |
|---|
| 21 |
exit; |
|---|