本文整理汇总了PHP中modX::runProcessor方法的典型用法代码示例。如果您正苦于以下问题:PHP modX::runProcessor方法的具体用法?PHP modX::runProcessor怎么用?PHP modX::runProcessor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类modX
的用法示例。
在下文中一共展示了modX::runProcessor方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dbSave
public function dbSave()
{
if (!$this->hook->hasErrors()) {
// exclude fields from database save
$this->excludeFields();
$formDataResponse = $this->modx->runProcessor('mgr/formz/form/data/create', array('form_id' => $this->config->formid), array('processors_path' => $this->config->processorPath));
if ($formDataResponse->isError()) {
$this->modx->log(modX::LOG_LEVEL_ERROR, 'An error occurred while trying to save the Form: ' . $formDataResponse->getMessage());
}
$formData = $formDataResponse->getObject();
// Save Fields
foreach ($this->config->data as $field => $value) {
if (is_array($value)) {
switch ($this->formArray[$field]['type']) {
case 'select':
case 'radio':
$value = implode('', $value);
break;
}
}
$formDataFieldResponse = $this->modx->runProcessor('mgr/formz/field/data/create', array('data_id' => $formData['id'], 'label' => $this->formArray[$field]['label'], 'value' => serialize($value)), array('processors_path' => $this->config->processorPath));
if ($formDataFieldResponse->isError()) {
$this->modx->log(modX::LOG_LEVEL_ERROR, 'An error occurred while trying to save the Form: ' . $formDataFieldResponse->getMessage());
}
}
}
return true;
}
示例2: runProcessor
/**
* Shorthand for the call of processor
*
* @access public
*
* @param string $action Path to processor
* @param array $data Data to be transmitted to the processor
*
* @return mixed The result of the processor
*/
public function runProcessor($action = '', $data = array())
{
if (empty($action)) {
return false;
}
return $this->modx->runProcessor($action, $data, array('processors_path' => $this->config['processorsPath']));
}
示例3: runProcessor
/**
* @param string $action
* @param array $scriptProperties
* @param array $options
*
* @return array
*/
public function runProcessor($action = '', $scriptProperties = array(), $options = array())
{
$this->pdoTools->debugParserMethod('runProcessor', $action, $scriptProperties);
/** @var modProcessorResponse $response */
$response = $this->modx->runProcessor($action, $scriptProperties, $options);
$this->pdoTools->debugParserMethod('runProcessor', $action, $scriptProperties);
return array('success' => !$response->isError(), 'message' => $response->getMessage(), 'response' => $response->getResponse(), 'errors' => $response->getFieldErrors());
}
示例4: fileRemove
/**
* Delete or restore uploaded file
*
* @param $id
*
* @return array|string
*/
public function fileRemove($id)
{
if (!$this->authenticated) {
return $this->error('ms2galleryform_err_access_denied');
}
/** @var modProcessorResponse $response */
$response = $this->modx->runProcessor('web/gallery/remove', array('id' => $id), array('processors_path' => $this->config['corePath'] . 'processors/'));
if ($response->isError()) {
return $this->error($response->getMessage());
}
return $this->success();
}
示例5: explode
$signature = $builder->getSignature();
if (defined('PKG_AUTO_INSTALL') && PKG_AUTO_INSTALL) {
$sig = explode('-', $signature);
$versionSignature = explode('.', $sig[1]);
/* @var modTransportPackage $package */
if (!($package = $modx->getObject('transport.modTransportPackage', array('signature' => $signature)))) {
$package = $modx->newObject('transport.modTransportPackage');
$package->set('signature', $signature);
$package->fromArray(array('created' => date('Y-m-d h:i:s'), 'updated' => null, 'state' => 1, 'workspace' => 1, 'provider' => 0, 'source' => $signature . '.transport.zip', 'package_name' => $sig[0], 'version_major' => $versionSignature[0], 'version_minor' => !empty($versionSignature[1]) ? $versionSignature[1] : 0, 'version_patch' => !empty($versionSignature[2]) ? $versionSignature[2] : 0));
if (!empty($sig[2])) {
$r = preg_split('/([0-9]+)/', $sig[2], -1, PREG_SPLIT_DELIM_CAPTURE);
if (is_array($r) && !empty($r)) {
$package->set('release', $r[0]);
$package->set('release_index', isset($r[1]) ? $r[1] : '0');
} else {
$package->set('release', $sig[2]);
}
}
$package->save();
}
if ($package->install()) {
$modx->runProcessor('system/clearcache');
}
}
if (!empty($_GET['download'])) {
echo '<script>document.location.href = "/core/packages/' . $signature . '.transport.zip' . '";</script>';
}
$modx->log(modX::LOG_LEVEL_INFO, "\n<br />Execution time: {$totalTime}\n");
if (!XPDO_CLI_MODE) {
echo '</pre>';
}
示例6: runProcessor
/**
* @param string $action
* @param array $scriptProperties
* @param array $options
*/
public function runProcessor($action = '', $scriptProperties = array(), $options = array())
{
$this->debugParser('runProcessor', $action, $scriptProperties);
$this->modx->runProcessor($action, $scriptProperties, $options);
$this->debugParser('runProcessor', $action, $scriptProperties);
}
示例7: runProcessor
public function runProcessor($action = '', $scriptProperties = array(), $location = '')
{
$path = $this->getOption('processorsPath');
return $this->modx->runProcessor($action, $scriptProperties, array('processors_path' => $path, 'location' => $location));
}
示例8: get_filter_categories
exit;
}
$modx = new modX();
$modx->initialize('web');
$modx->getRequest();
$modx->request->loadErrorHandler();
function get_filter_categories()
{
global $modx;
$modelpath = $modx->config['core_path'] . 'components/tag_manager2/model/';
$modx->addPackage('tag_manager2', $modelpath);
$f_categories = array();
$c = $modx->newQuery("tagManager");
$c->select(array('id', 'category'));
$c->groupby('category');
if ($c->prepare() && $c->stmt->execute()) {
while ($row = $c->stmt->fetch(PDO::FETCH_ASSOC)) {
array_push($f_categories, $row['category']);
}
}
return $f_categories;
}
$f_categories = get_filter_categories();
foreach ($f_categories as $f_category) {
$response = $modx->runProcessor('updatefilters', array('parent_id' => $f_category, 'clear_cache' => false), array('processors_path' => $modx->config['core_path'] . 'components/tag_manager2/processors/mgr/'));
if ($response->isError()) {
echo $response->getMessage();
exit;
}
}
echo 'OK';
示例9: runProcessor
/**
* @param $action
* @param array $data
*
* @return mixed
*/
public function runProcessor($action, array $data)
{
$this->modx->error->reset();
return $this->modx->runProcessor($action, $data, array('processors_path' => $this->config['processorsPath']));
}