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


PHP fs::clean_path方法代码示例

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


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

示例1: array

 function &_getRecursiveFileList($directory, $file_test_function)
 {
     if (!is_dir($directory)) {
         return array();
     }
     $dh = opendir($directory);
     $file_list = array();
     while ($file = readdir($dh)) {
         $file_path = $directory . '/' . $file;
         if (0 === strpos($file, '.')) {
             continue;
         }
         if (is_dir($file_path)) {
             $file_list = array_merge($file_list, $this->_getRecursiveFileList($file_path, $file_test_function));
         }
         if ($file_test_function[0]->{$file_test_function}[1]($file)) {
             $file_list[] = fs::clean_path($file_path);
         }
     }
     closedir($dh);
     return $file_list;
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:22,代码来源:test_finder.class.php

示例2: chop

 function find_subitems($dir, $types = 'dfl', $exclude_regex = '', $add_path = true, $include_hidden = false)
 {
 	$dir = fs :: clean_path($dir);
 	$dir = fs :: chop($dir);
 	    	
   $items = array();
   
   $separator = fs :: separator();
   
   if ($handle = opendir($dir))
   {
     while(($element = readdir($handle)) !== false)
     {
       if ($element == '.' || $element == '..')
       	continue;
       if (!$include_hidden && $element[0] == '.')
       	continue;
       if ($exclude_regex && preg_match($exclude_regex, $element))
       	continue;
       if (is_dir($dir . $separator . $element) && strpos($types, 'd') === false)
       	continue;
       if (is_link($dir . $separator . $element) && strpos($types, 'l') === false)
       	continue;
       if (is_file( $dir . $separator . $element ) && strpos($types, 'f') === false)
       	continue;
       	
       if ($add_path)
       {
         if (is_string($add_path))
         	$items[] = $add_path . $separator . $element;
         else
         	$items[] = $dir . $separator . $element;
       }
       else
       	$items[] = $element;
     }
     closedir($handle);
   }
   return $items;
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:40,代码来源:fs.class.php

示例3:

  function test_recursive_find()
  {
  	$this->_create_file_system();
  	 
  	$res = fs :: recursive_find(TEST_DIR_ABSOLUTE_PATH . '/tmp/', 'test\d_1');
	sort($res);

  	$this->assertEqual(
  		$res, 
  		array(
  			fs :: clean_path(TEST_DIR_ABSOLUTE_PATH . '/tmp/test1_1'),
  			fs :: clean_path(TEST_DIR_ABSOLUTE_PATH . '/tmp/wow/hey/test3_1'),
  			fs :: clean_path(TEST_DIR_ABSOLUTE_PATH . '/tmp/wow/test2_1'),
  		)
  	);
  	
  	$this->_remove_file_system();
  }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:18,代码来源:fs_test.class.php

示例4: ActiveXObject

  function _generate_debug_editor_link_html(&$code, $file_path)
  {
    if(!defined('WS_SCRIPT_WRITTEN'))
    {
      if(defined('TEMPLATE_EDITOR_PATH'))
        $editor_path = TEMPLATE_EDITOR_PATH;
      else
        $editor_path = 'notepad.exe %s';

      $code->write_html("	<SCRIPT LANGUAGE='JScript'>
                          function run_template_editor(path)
                          {
                            WS = new ActiveXObject('WScript.shell');
                            if(!WS) return;
                            editor = '{$editor_path}';
                            re = /%s/i;
                            editor = editor.replace(re, path);
                            WS.exec(editor);
                          }
                          </SCRIPT>");

      define('WS_SCRIPT_WRITTEN', true);
    }

    $file_path = addslashes(fs :: clean_path($file_path));
    $code->write_html("<a href='#'><img onclick='run_template_editor(this.title)' class='debug-info-img' src='/shared/images/i.gif' alt='i' title='{$file_path}' border='0'></a>");
  }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:27,代码来源:compiler_component.class.php

示例5: test_flush

 function test_flush()
 {
     $this->_write_simple_cache('f_test1', $content1 = 'test-content1');
     $this->_write_simple_cache('f_test2', $content2 = 'test-content2');
     $this->_write_simple_cache('not_page_file', $content3 = 'test-content3');
     $cache_manager =& new full_page_cache_manager();
     $cache_manager->flush();
     $files = fs::find_subitems(PAGE_CACHE_DIR);
     $this->assertEqual(sizeof($files), 1);
     $file = reset($files);
     $this->assertEqual(fs::clean_path($file), fs::clean_path(PAGE_CACHE_DIR . fs::separator() . 'not_page_file'));
     $this->_clean_simple_cache('not_page_file');
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:13,代码来源:full_page_cache_manager_test.class.php

示例6: ActiveXObject

	function _generate_debug_editor_link_html(& $code, $file_path)
	{
		if(!defined('WS_SCRIPT_WRITTEN'))
		{

			$code->write_html('	<SCRIPT LANGUAGE="JScript">
													function run_template_editor(path)
													{
														WS = new ActiveXObject("WScript.shell");
														WS.exec("uedit32.exe " + path);
													}
													</SCRIPT>');
		
			define('WS_SCRIPT_WRITTEN', true);
		}
		
		$file_path = addslashes(fs :: clean_path($file_path));
		$code->write_html("<a href='#'><img onclick='run_template_editor(\"{$file_path}\");' src='/shared/images/i.gif' alt='{$file_path}'></a>");
	}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:19,代码来源:compiler_component.class.php

示例7: addslashes

	function _generate_debug_editor_link_html(& $code, $file_path)
	{
//		if(!defined('WS_SCRIPT_WRITTEN'))
//		{
//
//			$code->write_html('	<SCRIPT LANGUAGE="JScript">
//													function run_template_editor(path)
//													{
//														WS = new ActiveXObject("WScript.shell");
//														WS.exec("uedit32.exe " + path);
//													}
//													</SCRIPT>');
//		
//			define('WS_SCRIPT_WRITTEN', true);
//		}
		
		$file_path = addslashes(fs :: clean_path($file_path));
		$code->write_html("<a href='#'><img class='debug-info-img' src='/shared/images/i.gif' alt='{$file_path}' title='{$file_path}' border='0'></a>");
	}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:19,代码来源:compiler_component.class.php

示例8: _set_file_name

 /**
  * Make a file name (with path)
  * 
  * @param string $id cache id
  * @param string $group name of the group
  * @access private 
  */
 function _set_file_name($id, $group)
 {
     if ($this->_file_name_protection) {
         $this->_file = fs::clean_path($this->_cache_dir . '/cache_' . md5($group) . '_' . md5($id));
     } else {
         $this->_file = fs::clean_path($this->_cache_dir . '/cache_' . $group . '_' . $id);
     }
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:15,代码来源:cache_lite.class.php

示例9: HTMLTestManager

 function &getTestCaseList($directory)
 {
     if (!file_exists($directory)) {
         return '';
     }
     $directory = fs::clean_path($directory);
     $manager =& new HTMLTestManager();
     $testcases =& $manager->_getTestFileList($directory);
     if (1 > count($testcases)) {
         return "<p>No test cases set up!</p>";
     }
     $buffer = "<p>Available test cases:</p>\n<ul>";
     foreach ($testcases as $testcase_file => $testcase) {
         $buffer .= "<li><a href='" . $manager->getBaseURL() . "?case=" . urlencode($testcase_file) . "'>" . $testcase . "</a></li>\n";
     }
     return $buffer . "</ul>\n";
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:17,代码来源:test_manager.php


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