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


PHP Zend_Tool_Project_Profile::loadFromData方法代码示例

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


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

示例1: create

 /**
  * create()
  *
  * @param string $path
  */
 public function create($path)
 {
     if ($path == null) {
         $path = getcwd();
     } else {
         $path = trim($path);
         if (!file_exists($path)) {
             $created = mkdir($path);
             if (!$created) {
                 require_once 'Zend/Tool/Framework/Client/Exception.php';
                 throw new Zend_Tool_Framework_Client_Exception('Could not create requested project directory \'' . $path . '\'');
             }
         }
         $path = str_replace('\\', '/', realpath($path));
     }
     $profile = $this->_loadProfile(self::NO_PROFILE_RETURN_FALSE, $path);
     if ($profile !== false) {
         require_once 'Zend/Tool/Framework/Client/Exception.php';
         throw new Zend_Tool_Framework_Client_Exception('A project already exists here');
     }
     $newProfile = new Zend_Tool_Project_Profile(array('projectDirectory' => $path, 'profileData' => $this->_getDefaultProfile()));
     $newProfile->loadFromData();
     $this->_registry->getResponse()->appendContent('Creating project at ' . $path);
     foreach ($newProfile->getIterator() as $resource) {
         $resource->create();
     }
 }
开发者ID:noriotakei,项目名称:suraimu,代码行数:32,代码来源:Project.php

示例2: 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

示例3: create

 /**
  * create()
  *
  * @param string $path
  * @param string $nameOfProfile shortName=n
  * @param string $fileOfProfile shortName=f
  */
 public function create($path, $nameOfProfile = null, $fileOfProfile = null)
 {
     if ($path == null) {
         $path = getcwd();
     } else {
         $path = trim($path);
         if (!file_exists($path)) {
             $created = mkdir($path);
             if (!$created) {
                 require_once 'Zend/Tool/Framework/Client/Exception.php';
                 throw new Zend_Tool_Framework_Client_Exception('Could not create requested project directory \'' . $path . '\'');
             }
         }
         $path = str_replace('\\', '/', realpath($path));
     }
     $profile = $this->_loadProfile(self::NO_PROFILE_RETURN_FALSE, $path);
     if ($profile !== false) {
         require_once 'Zend/Tool/Framework/Client/Exception.php';
         throw new Zend_Tool_Framework_Client_Exception('A project already exists here');
     }
     $profileData = null;
     if ($fileOfProfile != null && file_exists($fileOfProfile)) {
         $profileData = file_get_contents($fileOfProfile);
     }
     $storage = $this->_registry->getStorage();
     if ($profileData == '' && $nameOfProfile != null && $storage->isEnabled()) {
         $profileData = $storage->get('project/profiles/' . $nameOfProfile . '.xml');
     }
     if ($profileData == '') {
         $profileData = $this->_getDefaultProfile();
     }
     $newProfile = new Zend_Tool_Project_Profile(array('projectDirectory' => $path, 'profileData' => $profileData));
     $newProfile->loadFromData();
     $response = $this->_registry->getResponse();
     $response->appendContent('Creating project at ' . $path);
     $response->appendContent('Note: ', array('separator' => false, 'color' => 'yellow'));
     $response->appendContent('This command created a web project, ' . 'for more information setting up your VHOST, please see docs/README');
     if (!Zend_Tool_Project_Provider_Test::isPHPUnitAvailable()) {
         $response->appendContent('Testing Note: ', array('separator' => false, 'color' => 'yellow'));
         $response->appendContent('PHPUnit was not found in your include_path, therefore no testing actions will be created.');
     }
     foreach ($newProfile->getIterator() as $resource) {
         $resource->create();
     }
 }
开发者ID:sepano,项目名称:open-social-media-monitoring,代码行数:52,代码来源:Project.php

示例4: testProfileThrowsExceptionOnLoadFromData

 /**
  *
  * @expectedException Zend_Tool_Project_Exception
  */
 public function testProfileThrowsExceptionOnLoadFromData()
 {
     $profile = new Zend_Tool_Project_Profile();
     // missing data from attributes should throw exception here
     $profile->loadFromData();
 }
开发者ID:omusico,项目名称:logica,代码行数:10,代码来源:ProfileTest.php


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