當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Zend_Tool_Project_Profile::search方法代碼示例

本文整理匯總了PHP中Zend_Tool_Project_Profile::search方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Tool_Project_Profile::search方法的具體用法?PHP Zend_Tool_Project_Profile::search怎麽用?PHP Zend_Tool_Project_Profile::search使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Zend_Tool_Project_Profile的用法示例。


在下文中一共展示了Zend_Tool_Project_Profile::search方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: createResource

 /**
  * createResource()
  *
  * @param Zend_Tool_Project_Profile $profile
  * @param string $actionName
  * @param string $controllerName
  * @param string $moduleName
  * @return Zend_Tool_Project_Profile_Resource
  */
 public static function createResource(Zend_Tool_Project_Profile $profile, $actionName, $controllerName, $moduleName = null)
 {
     if (!is_string($actionName)) {
         //require_once 'Zend/Tool/Project/Provider/Exception.php';
         throw new Zend_Tool_Project_Provider_Exception('Zend_Tool_Project_Provider_View::createResource() expects \\"actionName\\" is the name of a controller resource to create.');
     }
     if (!is_string($controllerName)) {
         //require_once 'Zend/Tool/Project/Provider/Exception.php';
         throw new Zend_Tool_Project_Provider_Exception('Zend_Tool_Project_Provider_View::createResource() expects \\"controllerName\\" is the name of a controller resource to create.');
     }
     $profileSearchParams = array();
     if ($moduleName) {
         $profileSearchParams = array('modulesDirectory', 'moduleDirectory' => array('moduleName' => $moduleName));
         $noModuleSearch = null;
     } else {
         $noModuleSearch = array('modulesDirectory');
     }
     $profileSearchParams[] = 'viewsDirectory';
     $profileSearchParams[] = 'viewScriptsDirectory';
     if (($viewScriptsDirectory = $profile->search($profileSearchParams, $noModuleSearch)) === false) {
         //require_once 'Zend/Tool/Project/Provider/Exception.php';
         throw new Zend_Tool_Project_Provider_Exception('This project does not have a viewScriptsDirectory resource.');
     }
     $profileSearchParams['viewControllerScriptsDirectory'] = array('forControllerName' => $controllerName);
     // @todo check if below is failing b/c of above search params
     if (($viewControllerScriptsDirectory = $viewScriptsDirectory->search($profileSearchParams)) === false) {
         $viewControllerScriptsDirectory = $viewScriptsDirectory->createResource('viewControllerScriptsDirectory', array('forControllerName' => $controllerName));
     }
     $newViewScriptFile = $viewControllerScriptsDirectory->createResource('ViewScriptFile', array('forActionName' => $actionName));
     return $newViewScriptFile;
 }
開發者ID:schlypel,項目名稱:YiiBackboneBoilerplate,代碼行數:40,代碼來源:View.php

示例2: _connect

 /**
  *
  * @param Zend_Tool_Project_Profile $profile
  * @param type $adapter
  * @throws Zend_Tool_Project_Exception 
  */
 private function _connect(Zend_Tool_Project_Profile $profile, $adapter, $env = 'development')
 {
     $applicationConfigResource = $profile->search('ApplicationConfigFile');
     if ($env == null || $env == '') {
         $env = 'development';
     }
     if (!$applicationConfigResource) {
         throw new Zend_Tool_Project_Exception('A project with an application config file is required to use this provider.');
     }
     //$conn = 'testing';
     //$conn = 'development';
     $zf = $applicationConfigResource->getAsZendConfig($env);
     $this->_print('Conectado em ' . $env);
     #$zf = $applicationConfigResource->getAsZendConfig('testing');
     $_configDb = $zf->resources->multidb->{$adapter};
     if (!$_configDb) {
         throw new Zend_Tool_Project_Exception('Adapter not found in config application "resources.multidb.' . $adapter . '" .');
     }
     $configDb = array();
     $configDb['host'] = $_configDb->host;
     $configDb['username'] = $_configDb->username;
     $configDb['password'] = $_configDb->password;
     $configDb['dbname'] = $_configDb->dbname;
     $configDb['adapterNamespace'] = $_configDb->adapterNamespace;
     $configDb['options']['caseFolding'] = 1;
     $this->_dbAdapter = Zend_Db::factory($_configDb->adapter, $configDb);
 }
開發者ID:rtsantos,項目名稱:mais,代碼行數:33,代碼來源:CrudTProvider.php

示例3: _storeProfile

 /**
  * _storeProfile()
  *
  * This method will store the profile into its proper location
  *
  */
 protected function _storeProfile()
 {
     $projectProfileFile = $this->_loadedProfile->search('ProjectProfileFile');
     $name = $projectProfileFile->getContext()->getPath();
     $this->_registry->getResponse()->appendContent('Updating project profile \'' . $name . '\'');
     $projectProfileFile->getContext()->save();
 }
開發者ID:fredcido,項目名稱:cenbrap,代碼行數:13,代碼來源:Abstract.php

示例4: _getModulesDirectoryPath

 /**
  * Method returns path to modules directory
  *
  * @param  Zend_Tool_Project_Profile $profile
  * @return string
  */
 protected static function _getModulesDirectoryPath(Zend_Tool_Project_Profile $profile)
 {
     $modulesDirectory = $profile->search(array('modulesDirectory'));
     if (!$modulesDirectory instanceof Zend_Tool_Project_Profile_Resource) {
         throw new Zend_Tool_Project_Provider_Exception("Modules resource undefined.");
     }
     return $modulesDirectory->getPath();
 }
開發者ID:shahmaulik,項目名稱:zfcore,代碼行數:14,代碼來源:Abstract.php

示例5: _getModelsDirectoryResource

 /**
  * _getModelsDirectoryResource()
  *
  * @param Zend_Tool_Project_Profile $profile
  * @param string $moduleName
  * @return Zend_Tool_Project_Profile_Resource
  */
 protected static function _getModelsDirectoryResource(Zend_Tool_Project_Profile $profile, $moduleName = null)
 {
     $profileSearchParams = array();
     if ($moduleName != null && is_string($moduleName)) {
         $profileSearchParams = array('modulesDirectory', 'moduleDirectory' => array('moduleName' => $moduleName));
     }
     $profileSearchParams[] = 'modelsDirectory';
     return $profile->search($profileSearchParams);
 }
開發者ID:rdallasgray,項目名稱:zf,代碼行數:16,代碼來源:Model.php

示例6: _getControllerFileResource

 /**
  * _getControllerFileResource()
  *
  * @param Zend_Tool_Project_Profile $profile
  * @param string $controllerName
  * @param string $moduleName
  * @return Zend_Tool_Project_Profile_Resource
  */
 protected static function _getControllerFileResource(Zend_Tool_Project_Profile $profile, $controllerName, $moduleName = null)
 {
     $profileSearchParams = array();
     if ($moduleName != null && is_string($moduleName)) {
         $profileSearchParams = array('modulesDirectory', 'moduleDirectory' => array('moduleName' => $moduleName));
     }
     $profileSearchParams[] = 'controllersDirectory';
     $profileSearchParams['zfsControllerFile'] = array('controllerName' => $controllerName);
     return $profile->search($profileSearchParams);
 }
開發者ID:omusico,項目名稱:logica,代碼行數:18,代碼來源:ZfsAction.php

示例7: hasResource

 public static function hasResource(Zend_Tool_Project_Profile $profile, $dbTableName, $moduleName = null)
 {
     $profileSearchParams = array();
     if ($moduleName != null && is_string($moduleName)) {
         $profileSearchParams = array('modulesDirectory', 'moduleDirectory' => array('moduleName' => $moduleName));
     }
     $profileSearchParams[] = 'modelsDirectory';
     $modelsDirectory = $profile->search($profileSearchParams);
     if (!$modelsDirectory instanceof Zend_Tool_Project_Profile_Resource || !($dbTableDirectory = $modelsDirectory->search('DbTableDirectory'))) {
         return false;
     }
     $dbTableFile = $dbTableDirectory->search(array('DbTableFile' => array('dbTableName' => $dbTableName)));
     return $dbTableFile instanceof Zend_Tool_Project_Profile_Resource ? true : false;
 }
開發者ID:modulexcite,項目名稱:zfopenid,代碼行數:14,代碼來源:DbTable.php

示例8: testProfileCanDelete

 public function testProfileCanDelete()
 {
     $this->_standardProfileFromData->loadFromData();
     foreach ($this->_standardProfileFromData->getIterator() as $resource) {
         $resource->getContext()->create();
     }
     $this->assertTrue(file_exists($this->_projectDirectory . 'public/index.php'));
     $publicIndexFile = $this->_standardProfileFromData->search('publicIndexFile');
     $publicIndexFile->getContext()->delete();
     $this->assertFalse(file_exists($this->_projectDirectory . 'public/index.php'));
     $appConfigFile = $this->_standardProfileFromData->search('applicationConfigFile');
     $appConfigFile->getContext()->delete();
     $configsDirectory = $this->_standardProfileFromData->search('configsDirectory');
     $configsDirectory->getContext()->delete();
     $this->assertFalse(file_exists($this->_projectDirectory . 'application/configs'));
 }
開發者ID:rafalwrzeszcz,項目名稱:zf2,代碼行數:16,代碼來源:ProfileTest.php

示例9: createResource

 public static function createResource(Zend_Tool_Project_Profile $profile, $layoutName = 'layout')
 {
     $applicationDirectory = $profile->search('applicationDirectory');
     $layoutDirectory = $applicationDirectory->search('layoutsDirectory');
     if ($layoutDirectory == false) {
         $layoutDirectory = $applicationDirectory->createResource('layoutsDirectory');
     }
     $layoutScriptsDirectory = $layoutDirectory->search('layoutScriptsDirectory');
     if ($layoutScriptsDirectory == false) {
         $layoutScriptsDirectory = $layoutDirectory->createResource('layoutScriptsDirectory');
     }
     $layoutScriptFile = $layoutScriptsDirectory->search('layoutScriptFile', array('layoutName' => 'layout'));
     if ($layoutScriptFile == false) {
         $layoutScriptFile = $layoutScriptsDirectory->createResource('layoutScriptFile', array('layoutName' => 'layout'));
     }
     return $layoutScriptFile;
 }
開發者ID:anunay,項目名稱:stentors,代碼行數:17,代碼來源:Layout.php

示例10: connect

 /**
  *
  * @param Zend_Tool_Project_Profile $profile
  * @param type $adapter
  * @throws Zend_Tool_Project_Exception 
  */
 private function connect(Zend_Tool_Project_Profile $profile, $adapter)
 {
     $applicationConfigResource = $profile->search('ApplicationConfigFile');
     if (!$applicationConfigResource) {
         throw new Zend_Tool_Project_Exception('A project with an application config file is required to use this provider.');
     }
     $zf = $applicationConfigResource->getAsZendConfig();
     $_configDb = $zf->resources->multidb->{$adapter};
     if (!$_configDb) {
         throw new Zend_Tool_Project_Exception('Adapter not found in config application "resources.multidb.' . $adapter . '" .');
     }
     $configDb = array();
     $configDb['host'] = $_configDb->host;
     $configDb['username'] = $_configDb->username;
     $configDb['password'] = $_configDb->password;
     $configDb['dbname'] = $_configDb->dbname;
     $this->_dbAdapter = Zend_Db::factory($_configDb->adapter, $configDb);
 }
開發者ID:rtsantos,項目名稱:mais,代碼行數:24,代碼來源:FormTProvider.php

示例11: hasResource

 public static function hasResource(Zend_Tool_Project_Profile $profile, $controllerName, $actionNameOrSimpleName, $moduleName = 'backoffice')
 {
     if ($moduleName == '' || $controllerName == '' || $actionNameOrSimpleName == '') {
         require_once 'Zend/Tool/Project/Provider/Exception.php';
         throw new Zend_Tool_Project_Provider_Exception('ModuleName and/or ControllerName and/or ActionName are empty.');
     }
     $profileSearchParams = array('modulesDirectory', 'moduleDirectory' => array('moduleName' => $moduleName), 'viewsDirectory', 'viewScriptsDirectory');
     if (($viewScriptsDirectory = $profile->search($profileSearchParams)) === false) {
         require_once 'Zend/Tool/Project/Provider/Exception.php';
         throw new Zend_Tool_Project_Provider_Exception('This project does not have a viewScriptsDirectory resource.');
     }
     $profileSearchParams['viewControllerScriptsDirectory'] = array('forControllerName' => $controllerName);
     //@FIXME Search returns false even on existance of search params.
     if (($viewControllerScriptsDirectory = $viewScriptsDirectory->search($profileSearchParams)) === false) {
         return false;
     }
     $profileSearchParams['zfsViewScriptFile'] = array('forActionName' => $actionNameOrSimpleName);
     return $viewControllerScriptsDirectory->search($profileSearchParams) instanceof Zend_Tool_Project_Profile_Resource;
 }
開發者ID:omusico,項目名稱:logica,代碼行數:19,代碼來源:ZfsView.php

示例12: createLibraryResource

 /**
  * createLibraryResource()
  *
  * @param Zend_Tool_Project_Profile $profile
  * @param string $libraryClassName
  * @return Zend_Tool_Project_Profile_Resource
  */
 public static function createLibraryResource(Zend_Tool_Project_Profile $profile, $libraryClassName)
 {
     $testLibraryDirectoryResource = $profile->search(array('TestsDirectory', 'TestLibraryDirectory'));
     $fsParts = explode('_', $libraryClassName);
     $currentDirectoryResource = $testLibraryDirectoryResource;
     while ($nameOrNamespacePart = array_shift($fsParts)) {
         if (count($fsParts) > 0) {
             if (($libraryDirectoryResource = $currentDirectoryResource->search(array('TestLibraryNamespaceDirectory' => array('namespaceName' => $nameOrNamespacePart)))) === false) {
                 $currentDirectoryResource = $currentDirectoryResource->createResource('TestLibraryNamespaceDirectory', array('namespaceName' => $nameOrNamespacePart));
             } else {
                 $currentDirectoryResource = $libraryDirectoryResource;
             }
         } else {
             if (($libraryFileResource = $currentDirectoryResource->search(array('TestLibraryFile' => array('forClassName' => $libraryClassName)))) === false) {
                 $libraryFileResource = $currentDirectoryResource->createResource('TestLibraryFile', array('forClassName' => $libraryClassName));
             }
         }
     }
     return $libraryFileResource;
 }
開發者ID:hjr3,項目名稱:zf2,代碼行數:27,代碼來源:Test.php

示例13: _getApplicationConfigResource

 protected function _getApplicationConfigResource(Zend_Tool_Project_Profile $profile)
 {
     $applicationConfigResource = $profile->search('ApplicationConfigFile');
     if (!$applicationConfigResource) {
         throw new Zend_Tool_Project_Exception('A project with an application config file is required to use this provider.');
     }
     return $applicationConfigResource;
 }
開發者ID:cljk,項目名稱:kimai,代碼行數:8,代碼來源:Layout.php

示例14: _getModelsDirectoryResource

 /**
  * _getModelsDirectoryResource()
  *
  * @param Zend_Tool_Project_Profile $profile
  * @return Zend_Tool_Project_Profile_Resource
  */
 protected static function _getModelsDirectoryResource(Zend_Tool_Project_Profile $profile)
 {
     $profileSearchParams = array('appLibraryDirectory', 'zfsModelDirectory');
     return $profile->search($profileSearchParams);
 }
開發者ID:omusico,項目名稱:logica,代碼行數:11,代碼來源:ZfsModel.php

示例15: _getFormsDirectoryResource

 /**
  * _getFormsDirectoryResource()
  *
  * @param Zend_Tool_Project_Profile $profile
  * @return Zend_Tool_Project_Profile_Resource
  */
 protected static function _getFormsDirectoryResource(Zend_Tool_Project_Profile $profile, $module)
 {
     $profileSearchParams = array('modulesDirectory', 'moduleDirectory' => array('moduleName' => $module), 'formsDirectory');
     return $profile->search($profileSearchParams);
 }
開發者ID:omusico,項目名稱:logica,代碼行數:11,代碼來源:ZfsForm.php


注:本文中的Zend_Tool_Project_Profile::search方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。