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


PHP Requirements::unblock方法代码示例

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


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

示例1: testBlockedCombinedJavascript

 function testBlockedCombinedJavascript()
 {
     $combinedFilePath = Director::baseFolder() . '/' . 'RequirementsTest_bc.js';
     /* BLOCKED COMBINED FILES ARE NOT INCLUDED */
     $this->setupCombinedRequirements();
     Requirements::block('RequirementsTest_bc.js');
     Requirements::delete_combined_files('RequirementsTest_bc.js');
     clearstatcache();
     // needed to get accurate file_exists() results
     $html = Requirements::includeInHTML(false, self::$html_template);
     $this->assertFalse((bool) preg_match('/src=".*\\/RequirementsTest_bc\\.js/', $html), 'blocked combined files are not included ');
     Requirements::unblock('RequirementsTest_bc.js');
     /* BLOCKED UNCOMBINED FILES ARE NOT INCLUDED */
     // need to re-add requirements, as Requirements::process_combined_includes() alters the
     // original arrays grml...
     $this->setupCombinedRequirements();
     Requirements::block('sapphire/tests/forms/RequirementsTest_b.js');
     Requirements::delete_combined_files('RequirementsTest_bc.js');
     clearstatcache();
     // needed to get accurate file_exists() results
     $html = Requirements::includeInHTML(false, self::$html_template);
     $this->assertFalse(strpos(file_get_contents($combinedFilePath), "alert('b')") !== false, 'blocked uncombined files are not included');
     Requirements::unblock('RequirementsTest_b.js');
     /* A SINGLE FILE CAN'T BE INCLUDED IN TWO COMBINED FILES */
     $this->setupCombinedRequirements();
     clearstatcache();
     // needed to get accurate file_exists() results
     // This throws a notice-level error, so we prefix with @
     @Requirements::combine_files('RequirementsTest_ac.js', array('sapphire/tests/forms/RequirementsTest_a.js', 'sapphire/tests/forms/RequirementsTest_c.js'));
     $combinedFiles = Requirements::get_combine_files();
     $this->assertEquals(array_keys($combinedFiles), array('RequirementsTest_bc.js'), "A single file can't be included in two combined files");
     Requirements::delete_combined_files('RequirementsTest_bc.js');
 }
开发者ID:racontemoi,项目名称:shibuichi,代码行数:33,代码来源:RequirementsTest.php

示例2: process_requirements

 /**
  *	@return string the name of the called class
  */
 public static function process_requirements()
 {
     $class = get_called_class();
     $requirements = $class::get_requirements();
     foreach ($requirements['block'] as $file) {
         Requirements::block($file);
     }
     foreach ($requirements['unblock'] as $file) {
         Requirements::unblock($file);
     }
     return $class;
 }
开发者ID:helpfulrobot,项目名称:azt3k-abc-silverstripe,代码行数:15,代码来源:RequirementsHelper.php


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