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


PHP Action::process方法代码示例

本文整理汇总了PHP中Action::process方法的典型用法代码示例。如果您正苦于以下问题:PHP Action::process方法的具体用法?PHP Action::process怎么用?PHP Action::process使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Action的用法示例。


在下文中一共展示了Action::process方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: process

 /**
  * Execute a single Action. The Action's <method>Action::onInit</method> will be called,
  * then its <class>AccessController</class> will be queried if the action can be executed,
  * and, if allowed, its <method>Action::process</method> will be called. If the action cannot
  * be executed in the current environment, then an <class>AccessDeniedException</class>
  * will be thrown
  * @param  Action $action  the action to execute
  * @throws  AccessDeniedException  if the action cannot be executed
  */
 static function process(Action $action) {
   $action->onInit();
   $ac = $action->getAccessController();
   if(is_null($ac) || ($ac->isAccessible())) {
     $action->process();
   } else {
     throw new AccessDeniedException('Action access controller (' . get_class($ac) . ') forbids this action', 0, $action);
   }
 }
开发者ID:BackupTheBerlios,项目名称:freeform-frmwrk,代码行数:18,代码来源:ActionController.php5

示例2: process

 public function process()
 {
     parent::process();
     if (!$this->overwriteTarget && file_exists($this->target)) {
         throw new ActionException($this, "{$this->target} exists; use --overwriteTarget to Pull anyway");
     }
     try {
         $pulled = copy($this->source, $this->target);
         if (!$pulled) {
             throw new ActionException($this, "copy failed");
         }
         $this->request->log("Successfully pulled {$this->source} to {$this->target}");
     } catch (\Exception $e) {
         throw new ActionException($this, "Error pulling {$this->source} to {$this->target}", $e);
     }
 }
开发者ID:exside,项目名称:teleport,代码行数:16,代码来源:Pull.php

示例3: process

 /**
  * Process this action.
  *
  * @throws \Teleport\Action\ActionException If an error is encountered processing this Action.
  * @return void
  */
 public function process()
 {
     parent::process();
     try {
         if (!array_key_exists('config_key', $this->request->args())) {
             $this->config_key = 'config';
         }
         if (!array_key_exists('code', $this->request->args())) {
             $this->code = str_replace(array('-', '.'), array('_', '_'), $this->name);
         }
         $profile = new \stdClass();
         $profile->properties = new \stdClass();
         $profile->properties->modx = new \stdClass();
         $profile->properties->modx->core_path = $this->core_path;
         $profile->properties->modx->config_key = $this->config_key;
         $this->getMODX($profile);
         $profile = array('name' => $this->name, 'code' => $this->code, 'properties' => array('modx' => array('core_path' => $this->core_path, 'config_key' => $this->config_key, 'context_mgr_path' => $this->modx->getOption('manager_path', null, MODX_MANAGER_PATH), 'context_mgr_url' => $this->modx->getOption('manager_url', null, MODX_MANAGER_URL), 'context_connectors_path' => $this->modx->getOption('connectors_path', null, MODX_CONNECTORS_PATH), 'context_connectors_url' => $this->modx->getOption('connectors_url', null, MODX_CONNECTORS_URL), 'context_web_path' => $this->modx->getOption('base_path', null, MODX_BASE_PATH), 'context_web_url' => $this->modx->getOption('base_url', null, MODX_BASE_URL))));
         $profileFilename = TELEPORT_BASE_PATH . 'profile' . DIRECTORY_SEPARATOR . $this->code . '.profile.json';
         $written = $this->modx->getCacheManager()->writeFile($profileFilename, $this->modx->toJSON($profile));
         if ($written === false) {
             throw new ActionException($this, "Error writing profile {$profileFilename}");
         }
         $this->request->log("Successfully wrote profile to {$profileFilename}");
         if ($this->target && $this->push) {
             if (!$this->push($profileFilename, $this->target)) {
                 throw new ActionException($this, "Error pushing profile {$profileFilename} to {$this->target}");
             }
             $this->request->log("Successfully pushed profile {$profileFilename} to {$this->target}");
             $this->request->log("{$this->target}", false);
         } else {
             $this->request->log("{$profileFilename}", false);
         }
     } catch (\Exception $e) {
         throw new ActionException($this, "Error generating profile: " . $e->getMessage(), $e);
     }
 }
开发者ID:exside,项目名称:teleport,代码行数:42,代码来源:Profile.php

示例4: dirname

define('APP_TITLE', 'Neard');
define('APP_GITHUB_HOME', 'https://github.com/crazy-max/neard');
define('APP_GITHUB_ISSUES', 'https://github.com/crazy-max/neard/issues');
define('APP_AUTHOR_NAME', 'Cr@zy');
define('APP_AUTHOR_EMAIL', 'webmaster@crazyws.fr');
define('HOSTS_FILE', 'C:\\Windows\\System32\\drivers\\etc\\hosts');
define('CURRENT_APACHE_PORT', 80);
define('CURRENT_APACHE_SSL_PORT', 443);
define('CURRENT_APACHE_VERSION', '2.2.22');
define('CURRENT_PHP_VERSION', '5.3.13');
define('CURRENT_MYSQL_PORT', 3306);
define('CURRENT_MYSQL_VERSION', '5.5.24');
define('CURRENT_MARIADB_PORT', 3307);
define('CURRENT_MARIADB_VERSION', '5.5.34');
define('CURRENT_NODEJS_VERSION', '0.10.22');
define('CURRENT_FILEZILLA_PORT', 21);
define('CURRENT_FILEZILLA_SSL_PORT', 990);
define('CURRENT_FILEZILLA_VERSION', '0.9.46');
define('RETURN_TAB', '	');
// Bootstrap
require_once dirname(__FILE__) . '/classes/class.bootstrap.php';
$neardBs = new Bootstrap(dirname(__FILE__));
$neardBs->register();
// Process action
$neardAction = new Action();
$neardAction->process();
// Stop loading
if ($neardBs->isBootstrap()) {
    Util::stopLoading();
}
开发者ID:RobertoMalatesta,项目名称:neard,代码行数:30,代码来源:bootstrap.php


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