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


PHP Phprojekt_Loader::tryToLoadLibClass方法代码示例

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


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

示例1: getModelObject

 /**
  * Gets the core class model of the module.
  *
  * @return Phprojekt_Model_Interface An instance of Phprojekt_Model_Interface.
  */
 public function getModelObject()
 {
     static $moduleName = null;
     if (is_null($moduleName)) {
         $moduleName = ucfirst($this->getRequest()->getControllerName());
         $moduleName = "Phprojekt_" . $moduleName . "_" . $moduleName;
     }
     if (Phprojekt_Loader::tryToLoadLibClass($moduleName)) {
         $db = Phprojekt::getInstance()->getDb();
         return new $moduleName($db);
     } else {
         throw new Exception('No model object could be found');
     }
 }
开发者ID:RainyBlueSky,项目名称:PHProjekt,代码行数:19,代码来源:IndexController.php

示例2: getModelObject

 /**
  * Gets the core class model of the module or the default one.
  *
  * @return Phprojekt_Model_Interface An instance of Phprojekt_Model_Interface.
  */
 public function getModelObject()
 {
     static $object = null;
     if (null === $object) {
         $moduleName = ucfirst($this->getRequest()->getControllerName());
         $moduleName = "Phprojekt_" . $moduleName . "_" . $moduleName;
         if (Phprojekt_Loader::tryToLoadLibClass($moduleName)) {
             $db = Phprojekt::getInstance()->getDb();
             $object = new $moduleName($db);
         } else {
             $object = null;
         }
         if (null === $object) {
             $object = Phprojekt_Loader::getModel('Default', 'Default');
         }
     }
     return $object;
 }
开发者ID:penSecIT,项目名称:PHProjekt,代码行数:23,代码来源:IndexController.php

示例3: _saveUser

 /**
  * This function is used only for integration purposes and should only
  * be called when integrating the user data!
  *
  **/
 private static function _saveUser($params)
 {
     $moduleName = "Phprojekt_User_User";
     if (Phprojekt_Loader::tryToLoadLibClass($moduleName)) {
         // Temporarily login as admin user
         // This is only to get rights to add user
         // Ugly hack but PHProjekt backend has not thought of this situation
         $authNamespace = new Zend_Session_Namespace('Phprojekt_Auth-login');
         $authNamespace->userId = 1;
         $authNamespace->admin = true;
         $exc = null;
         try {
             $db = Phprojekt::getInstance()->getDb();
             $model = new $moduleName($db);
             if ($params['id'] > 0) {
                 $model = $model->find($params['id']);
             }
             Default_Helpers_Save::save($model, $params);
             $setting = new Phprojekt_Setting();
             $setting->setModule('User');
             $setting->setSettings($params, $model->id);
         } catch (Exception $e) {
             $exc = $e;
         }
         // Set user not logged in
         unset($authNamespace->userId);
         unset($authNamespace->admin);
         if ($exc instanceof Exception) {
             // Throw exception if user creation failed
             throw $exc;
         }
         return true;
     }
     return false;
 }
开发者ID:RainyBlueSky,项目名称:PHProjekt,代码行数:40,代码来源:Auth.php


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