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


PHP CApi::GetModuleManager方法代码示例

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


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

示例1: __construct

 /**
  * @return void
  */
 protected function __construct()
 {
     $this->oModuleManager = \CApi::GetModuleManager();
     //		\MailSo\Config::$FixIconvByMbstring = false;
     \MailSo\Config::$SystemLogger = \CApi::MailSoLogger();
     \MailSo\Config::$PreferStartTlsIfAutoDetect = !!\CApi::GetConf('labs.prefer-starttls', true);
 }
开发者ID:afterlogic,项目名称:aurora-core,代码行数:10,代码来源:Service.php

示例2: Login

 public static function Login($sUserName, $sPassword)
 {
     $mResult = false;
     $aArguments = array('Login' => $sUserName, 'Password' => $sPassword, 'SignMe' => false);
     \CApi::GetModuleManager()->broadcastEvent('Dav', 'Login', $aArguments, $mResult);
     if (isset($mResult['id'])) {
         $oManagerApi = \CApi::GetSystemManager('eav', 'db');
         $oEntity = $oManagerApi->getEntityById((int) $mResult['id']);
         $mResult = $oEntity->sUUID;
     } else {
         $mResult = false;
     }
     return $mResult;
 }
开发者ID:afterlogic,项目名称:dav,代码行数:14,代码来源:Backend.php

示例3: Init

 public static function Init($bGrantAdminPrivileges = false)
 {
     include_once self::LibrariesPath() . 'autoload.php';
     if ($bGrantAdminPrivileges) {
         \CApi::$aUserSession['UserId'] = -1;
         \CApi::$aUserSession['AuthToken'] = '';
     }
     CApi::$aI18N = null;
     CApi::$aClientI18N = array();
     CApi::$aSecretWords = array();
     CApi::$bUseDbLog = false;
     if (!is_object(CApi::$oManager)) {
         CApi::IncArray(array('functions', 'constants', 'enum', 'exception', 'utils', 'crypt', 'container', 'eav', 'manager', 'module', 'response', 'xml', 'utils.get', 'utils.post', 'utils.session', 'http', 'db.storage', 'user-session'));
         $sSalt = '';
         $sSaltFile = CApi::DataPath() . '/salt.php';
         if (!@file_exists($sSaltFile)) {
             $sSaltDesc = '<?php #' . md5(microtime(true) . rand(1000, 9999)) . md5(microtime(true) . rand(1000, 9999));
             @file_put_contents($sSaltFile, $sSaltDesc);
         } else {
             $sSalt = '$2y$07$' . md5(file_get_contents($sSaltFile)) . '$';
         }
         CApi::$sSalt = $sSalt;
         CApi::$aConfig = (include CApi::RootPath() . 'config.php');
         $sSettingsFile = CApi::DataPath() . '/settings/config.php';
         if (@file_exists($sSettingsFile)) {
             $aAppConfig = (include $sSettingsFile);
             if (is_array($aAppConfig)) {
                 CApi::$aConfig = array_merge(CApi::$aConfig, $aAppConfig);
             }
         }
         $sHost = \MailSo\Base\Http::SingletonInstance()->GetHost();
         if (0 < \strlen($sHost)) {
             $sDomainSettingsFile = CApi::DataPath() . '/settings/' . $sHost . '.config.php';
             if (@file_exists($sDomainSettingsFile)) {
                 $aDomainAppConfig = (include $sDomainSettingsFile);
                 if (is_array($aDomainAppConfig)) {
                     CApi::$aConfig = array_merge(CApi::$aConfig, $aDomainAppConfig);
                 }
             }
         }
         CApi::$oManager = new CApiGlobalManager();
         CApi::$bIsValid = CApi::validateApi();
         CApi::GetModuleManager();
         CApi::$oManager->PrepareStorageMap();
         CApi::$aModuleDecorators = array();
     }
 }
开发者ID:afterlogic,项目名称:aurora-core,代码行数:47,代码来源:api.php

示例4: isDavSupported

 /**
  * @return bool
  */
 public function isDavSupported()
 {
     return $this->isNotLite() && !!CApi::GetModuleManager()->ModuleExists('Dav');
 }
开发者ID:afterlogic,项目名称:aurora-core,代码行数:7,代码来源:manager.php

示例5: CallMethod

 /**
  * 
  * @param string $sMethod
  * @param array $aArguments
  * @param boolean $bWebApi
  * @return mixed
  */
 public function CallMethod($sMethod, $aArguments = array(), $bWebApi = false)
 {
     $mResult = false;
     try {
         if (method_exists($this, $sMethod) && !($bWebApi && $this->isCallbackMethod($sMethod))) {
             if ($bWebApi && !isset($aArguments['UserId'])) {
                 $aArguments['UserId'] = \CApi::getAuthenticatedUserId();
             }
             // prepare arguments for before event
             $aMethodArgs = $this->prepareMethodArguments($sMethod, $aArguments, $bWebApi);
             $bEventResult = $this->broadcastEvent($sMethod . \AApiModule::$Delimiter . 'before', $aArguments, $mResult);
             // prepare arguments for main action after event
             $aMethodArgs = $this->prepareMethodArguments($sMethod, $aArguments, $bWebApi);
             if (!$bEventResult) {
                 try {
                     $mMethodResult = call_user_func_array(array($this, $sMethod), $aMethodArgs);
                     if (is_array($mMethodResult) && is_array($mResult)) {
                         $mResult = array_merge($mMethodResult, $mResult);
                     } else {
                         if ($mMethodResult !== null) {
                             $mResult = $mMethodResult;
                         }
                     }
                 } catch (\Exception $oException) {
                     \CApi::GetModuleManager()->AddResult($this->GetName(), $sMethod, $mResult, $oException->getCode());
                     if (!$oException instanceof \System\Exceptions\AuroraApiException) {
                         throw new \System\Exceptions\AuroraApiException($oException->getCode(), $oException, $oException->getMessage());
                     } else {
                         throw $oException;
                     }
                 }
             }
             $this->broadcastEvent($sMethod . \AApiModule::$Delimiter . 'after', $aArguments, $mResult);
             \CApi::GetModuleManager()->AddResult($this->GetName(), $sMethod, $mResult);
         }
     } catch (\Exception $oException) {
         if (!$oException instanceof \System\Exceptions\AuroraApiException) {
             throw new \System\Exceptions\AuroraApiException($oException->getCode(), $oException, $oException->getMessage());
         } else {
             throw $oException;
         }
     }
     return $mResult;
 }
开发者ID:afterlogic,项目名称:aurora-core,代码行数:51,代码来源:module.php

示例6: compileTemplates

 /**
  * @return string
  */
 public function compileTemplates()
 {
     $sHash = \CApi::GetModuleManager()->Hash();
     $sCacheFileName = '';
     if (CApi::GetConf('labs.cache.templates', $this->bCache)) {
         $sCacheFileName = 'templates-' . md5(CApi::Version() . $sHash) . '.cache';
         $sCacheFullFileName = \CApi::DataPath() . '/cache/' . $sCacheFileName;
         if (file_exists($sCacheFullFileName)) {
             return file_get_contents($sCacheFullFileName);
         }
     }
     $sResult = '';
     $sPath = CApi::WebMailPath() . 'modules';
     $aFolderItems = scandir($sPath);
     foreach ($aFolderItems as $sItemName) {
         if ($sItemName === '.' or $sItemName === '..') {
             continue;
         }
         $sDirName = $sPath . '/' . $sItemName . '/templates';
         $iDirNameLen = strlen($sDirName);
         if (is_dir($sDirName)) {
             $aList = $this->folderFiles($sDirName, '.html');
             foreach ($aList as $sFileName) {
                 $sName = '';
                 $iPos = strpos($sFileName, $sDirName);
                 if ($iPos === 0) {
                     $sName = substr($sFileName, $iDirNameLen + 1);
                 } else {
                     $sName = '@errorName' . md5(rand(10000, 20000));
                 }
                 $sTemplateID = $sItemName . '_' . preg_replace('/[^a-zA-Z0-9_]/', '', str_replace(array('/', '\\'), '_', substr($sName, 0, -5)));
                 $sTemplateHtml = file_get_contents($sFileName);
                 $sTemplateHtml = \CApi::GetModuleManager()->ParseTemplate($sTemplateID, $sTemplateHtml);
                 $sTemplateHtml = preg_replace('/\\{%INCLUDE-START\\/[a-zA-Z\\-_]+\\/INCLUDE-END%\\}/', '', $sTemplateHtml);
                 $sTemplateHtml = str_replace('%ModuleName%', $sItemName, $sTemplateHtml);
                 $sTemplateHtml = str_replace('%MODULENAME%', strtoupper($sItemName), $sTemplateHtml);
                 $sTemplateHtml = preg_replace('/<script([^>]*)>/', '&lt;script$1&gt;', $sTemplateHtml);
                 $sTemplateHtml = preg_replace('/<\\/script>/', '&lt;/script&gt;', $sTemplateHtml);
                 $sResult .= '<script id="' . $sTemplateID . '" type="text/html">' . preg_replace('/[\\r\\n\\t]+/', ' ', $sTemplateHtml) . '</script>';
             }
         }
     }
     $sResult = trim($sResult);
     if (CApi::GetConf('labs.cache.templates', $this->bCache)) {
         if (!is_dir(dirname($sCacheFullFileName))) {
             mkdir(dirname($sCacheFullFileName), 0777, true);
         }
         $sResult = '<!-- ' . $sCacheFileName . ' -->' . $sResult;
         file_put_contents($sCacheFullFileName, $sResult);
     }
     return $sResult;
 }
开发者ID:afterlogic,项目名称:aurora-core,代码行数:55,代码来源:manager.php


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