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


PHP sfEvent::getParameters方法代码示例

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


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

示例1: configureDoctrineConnection

 public function configureDoctrineConnection(sfEvent $event)
 {
     $parameters = $event->getParameters();
     if ('doctrine2' === $parameters['connection']->getName()) {
         $parameters['connection']->setAttribute(Doctrine_Core::ATTR_VALIDATE, false);
     }
 }
开发者ID:Phennim,项目名称:symfony1,代码行数:7,代码来源:ProjectConfiguration.class.php

示例2: configureDoctrineConnection

 public function configureDoctrineConnection(sfEvent $event)
 {
     $parameters = $event->getParameters();
     $con = $parameters['connection'];
     /* @var $con Doctrine_Connection */
     $con->setAttribute(Doctrine_Core::ATTR_QUERY_CACHE, new Doctrine_Cache_Array());
     $con->setAttribute(Doctrine_Core::ATTR_QUERY_CACHE_LIFESPAN, 3600);
 }
开发者ID:uniteddiversity,项目名称:policat,代码行数:8,代码来源:frontendConfiguration.class.php

示例3: applicationLog

 function applicationLog(sfEvent $event)
 {
     $subject = $event->getSubject();
     if ($subject instanceof sfPropelLogger) {
         $parameters = $event->getParameters();
         $logMessage = $parameters[0];
         $this->queries[] = $logMessage;
     } else {
         if ($subject instanceof sfResponse) {
             $parameters = $event->getParameters();
             $logMessage = $parameters[0];
             if (preg_match('/^Send content/s', $logMessage, $match)) {
                 $this->sendLogs();
             }
         }
     }
 }
开发者ID:cbsistem,项目名称:appflower_engine,代码行数:17,代码来源:FirePHPQueryLogger.class.php

示例4: loadBackendTheme

 public static function loadBackendTheme(sfEvent $event)
 {
   $parameters = $event->getParameters();
   $action = $event->getSubject()->getAction($parameters['module'], $parameters['action']);
   if ($action->isSecure())
   {
     $action->loadTheme(sfConfig::get('app_sfSimpleBlog_admin_theme', 'backend_theme'));
   }
 }
开发者ID:nibsirahsieu,项目名称:sfSimpleBlog15Plugin,代码行数:9,代码来源:sfSimpleBlog15PluginConfiguration.class.php

示例5: configure

 protected function configure(sfEvent $event)
 {
     $this->name = $event->getName();
     $this->subject = $event->getSubject();
     $this->arguments = $event->getParameters();
     if (!$this->isEnabledForCurrentProject()) {
         return false;
     }
     return true;
 }
开发者ID:ratibus,项目名称:Crew,代码行数:10,代码来源:BaseNotifier.class.php

示例6: listen

 public function listen(sfEvent $event)
 {
     $logger = Logger::getLogger('recruitment.recruitmentmailer');
     $logger->debug('Email event triggered.');
     $eventData = $event->getParameters();
     $emailType = 'recruitment.apply';
     $recipientRole = array('hiring_manager', 'candidate');
     $performerRole = null;
     $this->getEmailService()->sendEmailNotifications($emailType, $recipientRole, $eventData, strtolower($performerRole));
 }
开发者ID:EFForg,项目名称:lemonhrm,代码行数:10,代码来源:RecruitmentMailer.php

示例7: passoff

 public function passoff(sfEvent $event)
 {
     $params = $event->getParameters();
     $string = call_user_func_array('sprintf', $params);
     if ($this->section) {
         $string = $this->formatter->formatSection($this->section, $string, $this->size);
     } else {
         $string = $this->formatter->format($string);
     }
     $this->target->notify(new sfEvent($event->getSubject(), $this->targetName, array($string)));
 }
开发者ID:rande,项目名称:sfSolrPlugin,代码行数:11,代码来源:sfLuceneEventConnectorLogger.class.php

示例8: listenToMethodNotFound

 public function listenToMethodNotFound(sfEvent $event)
 {
     $parameters = $event->getParameters();
     if ($parameters['method'] == 'defineCombinedAssets') {
         $this->loaded_assets = count($parameters['arguments']) > 0 ? $parameters['arguments'][0] : array();
         $event->setProcessed(true);
     }
     if ($parameters['method'] == 'getCombinedAssets') {
         $event->setReturnValue($this->loaded_assets);
         $event->setProcessed(true);
     }
 }
开发者ID:rande,项目名称:swCombinePlugin,代码行数:12,代码来源:swCombinePluginConfiguration.class.php

示例9: listenToLogEvent

 public function listenToLogEvent(sfEvent $event)
 {
     $priority = isset($event['priority']) ? $event['priority'] : self::INFO;
     $subject = $event->getSubject();
     $subject = is_object($subject) ? get_class($subject) : (is_string($subject) ? $subject : 'main');
     foreach ($event->getParameters() as $key => $message) {
         if ('priority' === $key) {
             continue;
         }
         $this->log(sprintf('{%s} %s', $subject, $message), $priority);
         //$this->log(sprintf('%s', $message), $priority);
     }
 }
开发者ID:ketheriel,项目名称:ETVA,代码行数:13,代码来源:EtvaEventLogger.class.php

示例10: writeLoginHistory

 public static function writeLoginHistory(sfEvent $event)
 {
     $sessionUser = $event->getSubject();
     $params = $event->getParameters();
     if (true === $params['authenticated']) {
         $userId = $sessionUser->getGuardUser()->id;
         $sessionUser->setAttribute('user_id', $userId, 'sfDoctrineGuardLoginHistoryPlugin');
         self::createHistoryEntry('login', $userId);
     } else {
         $userId = $sessionUser->getAttributeHolder()->remove('user_id', null, 'sfDoctrineGuardLoginHistoryPlugin');
         self::createHistoryEntry('logout', $userId);
     }
 }
开发者ID:jmiridis,项目名称:atcsf1,代码行数:13,代码来源:PluginUserLoginHistoryTable.class.php

示例11: listenToLogEvent

 /**
  * Listens to command.log events.
  *
  * @param sfEvent $event An sfEvent instance
  */
 public function listenToLogEvent(sfEvent $event)
 {
     $priority = isset($event['priority']) ? $event['priority'] : self::INFO;
     $prefix = '';
     if ('application.log' == $event->getName()) {
         $subject = $event->getSubject();
         $subject = is_object($subject) ? get_class($subject) : (is_string($subject) ? $subject : 'main');
         $prefix = '>> ' . $subject . ' ';
     }
     foreach ($event->getParameters() as $message) {
         $this->log(sprintf('%s%s', $prefix, $message), $priority);
     }
 }
开发者ID:habtom,项目名称:uas,代码行数:18,代码来源:sfCommandLogger.class.php

示例12: auditTransactionEventHandler

/**
 * Handle the events
 *
 * @param sfEvent $event The event being handled
 * @return bool TRUE if the audit trail for the transaction is saved sucessfully, FALSE otherwise
 */
function auditTransactionEventHandler($event)
{
    $audit_trail = new AuditTrail();
    $audit_trail->processPost($event->getParameters());
    try {
        $audit_trail->save();
    } catch (Exception $e) {
        $logger = Zend_Registry::get("logger");
        $logger->err($e->getMessage());
        return false;
    }
    return true;
}
开发者ID:7thZoneTechnology,项目名称:hrms-1,代码行数:19,代码来源:eventhandlerfunctions.php

示例13: listenToContextMethodNotFoundEvent

 public function listenToContextMethodNotFoundEvent(sfEvent $event)
 {
     $parameters = $event->getParameters();
     if ('getFacebook' != $parameters['method']) {
         return false;
     }
     if ($this->_facebook instanceof sfFacebook) {
         $event->setReturnValue($this->_facebook);
         return true;
     }
     $this->_facebook = new sfFacebook($this->dispatcher);
     $event->setReturnValue($this->_facebook);
     $this->dispatcher->notify(new sfEvent($this, 'facebook.configure'));
     return true;
 }
开发者ID:JoshuaEstes,项目名称:sfDoctrineFacebookPlugin,代码行数:15,代码来源:sfDoctrineFacebookPluginConfiguration.class.php

示例14: privmsg

 /**
  * Executed when a privmsg command comes in
  *
  * @param Event $event
  */
 public function privmsg(sfEvent $event)
 {
     /* @var $s pResponse */
     $s = $event->getSubject();
     $p = $this->getContainer()->getParameters();
     $request = $event->getParameters();
     if (preg_match('/^!say\\s/i', $s->getTrailing()) && in_array($s->getUsername(), $p['users.trusted'])) {
         $c = preg_replace('/^(!say\\s)/i', '', $s->getTrailing());
         $whatToSay = trim(strstr($c, ' '));
         $whereToSay = strstr($c, ' ', true);
         //            var_dump($c, $request, $whatToSay, $whereToSay);
         if ($whereToSay && $whatToSay) {
             $this->sendCommand(sprintf('PRIVMSG %s :%s', $whereToSay, $whatToSay));
         }
     }
 }
开发者ID:reliablesource,项目名称:PHilliP,代码行数:21,代码来源:phillipSay.php

示例15: listenToLogEvent

 /**
  * Обрабатывает событие из dispatcher
  */
 public function listenToLogEvent(sfEvent $event)
 {
     $subject = $event->getSubject();
     $parameters = $event->getParameters();
     try {
         $record = new myDoctrineLoggerEvent();
     } catch (Exception $e) {
         new sfDatabaseManager(ProjectConfiguration::getActive());
         $record = new myDoctrineLoggerEvent();
     }
     // Статус: fail, info, notice, warning
     if (isset($parameters['state'])) {
         $definition = Doctrine_Core::getTable('myDoctrineLoggerEvent')->getColumnDefinition('state');
         $states = $definition['values'];
         if (in_array($parameters['state'], $states)) {
             $record->setState($parameters['state']);
         }
     }
     // Идентификатор связанного объекта, если есть
     if (isset($parameters['object'])) {
         $record->setModelId((int) $parameters['object']);
     }
     // Идентификатор пользователя - инициатора события, если есть
     if (isset($parameters['user'])) {
         if (is_object($parameters['user']) && $parameters['user'] instanceof Doctrine_Record) {
             $parameters['user'] = $parameters['user']->getId();
         }
         $record->setUserId((int) $parameters['user']);
     }
     // Компонент приложения
     $record->setComponent(isset($parameters['component']) ? (string) $parameters['component'] : 'UNKNOWN');
     // Название события
     if (!isset($parameters['name'])) {
         throw new sfException('Необходимо назвать событие: заполнить параметр ["name"]');
     }
     $record->setLabel((string) $parameters['name']);
     // расшифровка результата
     if (!isset($parameters['description'])) {
         throw new sfException('Необходимо назвать событие: заполнить параметр ["description"]');
     }
     $record->setResult((string) $parameters['description']);
     // Данные события
     if (isset($parameters['env'])) {
         $record->setContext((string) $parameters['env']);
     }
     $record->save();
 }
开发者ID:EasyFinance,项目名称:myDoctrineLoggerPlugin,代码行数:50,代码来源:myDoctrineLogger.class.php


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