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


PHP Setup::DALConfiguration方法代码示例

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


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

示例1: __construct

 /**
  * The constructor for this repository
  * Accepts the fully qulaified type of the IContentDataContext implemting
  * data context for this repository
  *
  * @param string $dataContext
  */
 public function __construct($dataContext = null)
 {
     if (!isset($dataContext)) {
         $dataContext = \Swiftriver\Core\Setup::DALConfiguration()->DataContextType;
     }
     $classType = (string) $dataContext;
     $this->dataContext = new $classType();
 }
开发者ID:surflightroy,项目名称:SwiftriverCore,代码行数:15,代码来源:ContentRepository.php

示例2: __construct

 /**
  * The constructor for this repository
  * Accepts the fully qulaified type of the IAPIKeyDataContext implemting
  * data context for this repository
  *
  * @param string $dataContext
  */
 public function __construct($dataContext = null)
 {
     //if the data context is null ten set it to the one in config
     if (!isset($dataContext)) {
         $dataContext = \Swiftriver\Core\Setup::DALConfiguration()->DataContextType;
     }
     $classType = (string) $dataContext;
     $this->dataContext = new $classType();
 }
开发者ID:ushahidi,项目名称:Swiftriver-2011,代码行数:16,代码来源:APIKeyRepository.php

示例3: RunGenericQuery

 /**
  * This function should allow calling classes to run basic sql select
  * statements and switch the implmentation based on the data content
  * type.
  * 
  * @param string $sql
  * @return array["results","errors"]
  */
 public function RunGenericQuery($sql)
 {
     $dataContext = \Swiftriver\Core\Setup::DALConfiguration()->DataContextType;
     switch ($dataContext) {
         case "\\Swiftriver\\Core\\Modules\\DataContext\\MySql_V2\\DataContext":
             $db = \Swiftriver\Core\Modules\DataContext\MySql_V2\DataContext::PDOConnection();
             $statement = $db->prepare($sql);
             $result = $statement->execute();
             return $result == false ? array("results" => array(), "errors" => $statement->errorInfo()) : array("results" => $statement->fetchAll(), "errors" => null);
     }
 }
开发者ID:ushahidi,项目名称:Swiftriver-2011,代码行数:19,代码来源:GenericQueryRepository.php

示例4: RunAnalyticsRequest

 /**
  * Function that takes in an instance of the AnalyticsRequest object
  * and attempts to match this to an instance of the IAnalyticsProvider
  * interface.
  *
  * @param AnalyticsRequest $request
  * @return AnalyticsRequest
  */
 public function RunAnalyticsRequest($request)
 {
     $logger = \Swiftriver\Core\Setup::GetLogger();
     $logger->log("Core::Analytics::AnalyticsEngine::__construct [Method invoked]", \PEAR_LOG_DEBUG);
     if ($request == null) {
         $logger->log("Core::Analytics::AnalyticsEngine::__construct [The request parameter was null]", \PEAR_LOG_DEBUG);
         $logger->log("Core::Analytics::AnalyticsEngine::__construct [Method finished]", \PEAR_LOG_DEBUG);
         return $request;
     }
     $dataContextType = \Swiftriver\Core\Setup::DALConfiguration()->DataContextType;
     $request->DataContextType = $dataContextType;
     $providerType = $request->RequestType;
     $logger->log("Core::Analytics::AnalyticsEngine::__construct [START: Looking for matching provider]", \PEAR_LOG_DEBUG);
     foreach ($this->analyticsProviders as $analyticsProvider) {
         if ($providerType != $analyticsProvider->ProviderType()) {
             continue;
         }
         try {
             $logger->log("Core::Analytics::AnalyticsEngine::__construct [START: Running provider]", \PEAR_LOG_DEBUG);
             $return = $analyticsProvider->ProvideAnalytics($request);
             $logger->log("Core::Analytics::AnalyticsEngine::__construct [END: Running provider]", \PEAR_LOG_DEBUG);
             $logger->log("Core::Analytics::AnalyticsEngine::__construct [Method finished]", \PEAR_LOG_DEBUG);
             return $return;
         } catch (\Exception $e) {
             $logger->log("Core::Analytics::AnalyticsEngine::__construct [An exception was thrown]", \PEAR_LOG_ERR);
             $logger->log("Core::Analytics::AnalyticsEngine::__construct [{$e}]", \PEAR_LOG_ERR);
             $logger->log("Core::Analytics::AnalyticsEngine::__construct [Method finished]", \PEAR_LOG_DEBUG);
             return $request;
         }
     }
     $logger->log("Core::Analytics::AnalyticsEngine::__construct [END: Looking for matching provider - No Provider found for {$providerType}]", \PEAR_LOG_ERR);
     $logger->log("Core::Analytics::AnalyticsEngine::__construct [Method finished]", \PEAR_LOG_DEBUG);
     return $request;
 }
开发者ID:unthinkingly,项目名称:Swiftriver,代码行数:42,代码来源:AnalyticsEngine.php


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