当前位置: 首页>>代码示例>>PHP>>正文


PHP modX::runProcessor方法代码示例

本文整理汇总了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;
 }
开发者ID:Jako,项目名称:formz,代码行数:28,代码来源:formzhooks.class.php

示例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']));
 }
开发者ID:bendasvadim,项目名称:modx-uploadify,代码行数:17,代码来源:uploadify.class.php

示例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());
 }
开发者ID:Jako,项目名称:pdoTools,代码行数:15,代码来源:_micromodx.php

示例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();
 }
开发者ID:bendasvadim,项目名称:ms2GalleryForm,代码行数:19,代码来源:ms2galleryform.class.php

示例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>';
}
开发者ID:Homchenkokostya,项目名称:simpleUpdater,代码行数:31,代码来源:build.transport.php

示例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);
 }
开发者ID:suasti,项目名称:pdoTools,代码行数:11,代码来源:_micromodx.php

示例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));
 }
开发者ID:pixelfanatiker,项目名称:Git-Package-Management,代码行数:5,代码来源:gitpackagemanagement.class.php

示例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';
开发者ID:MobiTeam,项目名称:mirfoto,代码行数:31,代码来源:cron_updatefilters.php

示例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']));
 }
开发者ID:bezumkin,项目名称:MODX-SMF,代码行数:11,代码来源:modx_smf.class.php


注:本文中的modX::runProcessor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。