I am trying to use xPDO outside MODX. I use the following php code, which connects to my DB (successfully) and tries to generate xPDO classes. Everything runs just fine, except in $target directory, instead of real php classes, php files with the following content are crated.
[+class-header+]
[+class-declaration+]
[+class-traits+][+class-constants+][+class-properties+][+class-methods+][+class-close-declaration+][+class-footer+]
require __DIR__ . '/vendor/autoload.php';
$xpdo = \xPDO\xPDO::getInstance('aMySQLDatabase', [
\xPDO\xPDO::OPT_CACHE_PATH => __DIR__ . '/../cache/',
\xPDO\xPDO::OPT_HYDRATE_FIELDS => true,
\xPDO\xPDO::OPT_HYDRATE_RELATED_OBJECTS => true,
\xPDO\xPDO::OPT_HYDRATE_ADHOC_FIELDS => true,
\xPDO\xPDO::OPT_CONNECTIONS => [
[
'dsn' => 'mysql:host=myserver.com;dbname=myDB_name;port=3306;charset=utf8',
'username' => 'username',
'password' => '********',
'options' => [
\xPDO\xPDO::OPT_CONN_MUTABLE => true,
],
'driverOptions' => [],
],
],
]);
echo $o = ($xpdo->connect()) ? 'Connected' : 'Not Connected';
$manager= $xpdo->getManager();
$generator= $manager->getGenerator();
$schema = './vendor/schema/expharm.mysql.schema.xml';
$target = './vendor/model/';
$generator->parseSchema($schema,$target);
Is there a way, hwo can I force
$generator->parseSchema($schema,$target);
not to use MODX features? Or is there any workaround? I will be grateful for any advice.
Quant.