2014-11-04 3 views

답변

0

설명 된대로 MODx 개체를 http://rtfm.modx.com/revolution/2.x/developing-in-modx/other-development-resources/loading-modx-externally에로드 한 다음 modX->runProcessor을 사용하여 '컨텍스트/작성'프로세서를 실행합니다.

<?php 
require_once '/absolute/path/to/modx/config.core.php'; 
require_once MODX_CORE_PATH.'model/modx/modx.class.php'; 
$modx = new modX(); 
$modx->initialize('web'); 
$modx->getService('error','error.modError', '', ''); 
$modx->runProcessor('context/create', array(
    'key' => 'newcontext', 
    'name' => 'New Context', 
    'description' => 'No description.' 
)); 

단위 테스트에 감사드립니다. https://github.com/modxcms/revolution/blob/cd690b16c303823697562c89efb1a8b2045bc429/_build/test/Tests/Processors/Context/ContextTest.php#L80-L83