Hi,
I wrote a script to update some settings on multiple instances of MIodX.
My script is on the same server and can access to the ModX core.
I can initialize ModX and receive correct information for some method/command like getting current user or the whole user list.
But the processor to update some settings return an error.
An idea?
My pseudo code:
require_once (INSTALLFOLDER.$install['folder'].'/config.core.php');
require_once (MODX_CORE_PATH.'model/modx/modx.class.php');
$modx = new modX();
$modx->initialize('mgr');
$modx->getService('error','error.modError', '', '');
if($modx)
{
$s= array( "key"=> "login_text",
"value"=> "Login with My Account",
"namespace"=>"shibboleth",
);
$processor = "system/settings/update";
$options = array();
$result = $modx->runProcessor($processor, $s, $options);
if (method_exists($result,"isError"))
{
if($result->isError())
{
echo "Unable to update ".$s['key'].": ".$s['value']."\n";
echo "Error: ".$result->getMessage();
} else {
echo 'all done';
}
}
}
Thank you