-
-
Save sebastian-marinescu/1ca0a2b29d490c9d7e97047a0bf05e79 to your computer and use it in GitHub Desktop.
Gitify config creation for MODX Commerce. Put file in /core/components/commerce/model/schema.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Commerce-Gitify-Parser | |
* Copyright 2017 by Sebastian G. Marinescu | |
*/ | |
$path = getcwd() . '/'; | |
$xml = file_get_contents($path . 'commerce.mysql.schema.xml'); | |
$root = new SimpleXMLElement($xml); | |
foreach($root->children() as $obj){ | |
$className = $obj['class']; | |
$tableName = $obj['table']; | |
if (empty($tableName)) { | |
continue; | |
} | |
echo $tableName . ':'; | |
echo "\n\t"; | |
echo 'class: ' . $className; | |
echo "\n\t"; | |
echo 'primary: id'; | |
echo "\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment