Hi everybody!
I working on console import of goods from xml and i want to use system processors. But there is a strange error, when i try to do it.
Here is my connection:
define('MODX_API_MODE', true);
require dirname(dirname(__FILE__)).'/index.php';
$modx->getService('error','error.modError');
$modx->setLogLevel(modX::LOG_LEVEL_INFO);
$modx->setLogTarget(XPDO_CLI_MODE ? 'ECHO' : 'HTML');
$response = $modx->runProcessor('security/login', array('username' => 'admin', 'password' => 'xxx'));
if ($response->isError()) {
$modx->log(modX::LOG_LEVEL_ERROR, $response->getMessage());
return;
}
$modx->initialize('mgr');
And now i can work with xPDO and do some other cool things as MODX admin. But, when i try to create new resource thought the system processor - i have unknown error.
$response = $modx->runProcessor('resource/create', array(
'pagetitle' => $subcat
,'parent' => $cat_id
,'template' => $categories_tpl[0]
,'isfolder' => 1
,'published' => 1
));
if ($response->isError()) {
$modx->log(modX::LOG_LEVEL_ERROR, $response->getMessage());
return;
}
else {
print_r($response->response);
}
Error is:
[2012-09-05 12:24:49] (ERROR @ /core/import.php)
, i.e.
it is empty unknown error.
The same code (without connection, of course) works perfectly when it in snippet and runs from frontend.
Can you help me?
[ed. note: bezumkin2 last edited this post 11 years, 7 months ago.]