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


PHP dir::clean_path方法代码示例

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


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

示例1: HTMLTestManager

	function &getTestCaseList($directory)
	{
		if(!file_exists($directory))
			return '';

		$directory = dir :: 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,代码行数:20,代码来源:test_manager.php

示例2:

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

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

示例3: 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(dir :: 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

示例4: find_subitems

 function find_subitems($dir, $types = 'dfl', $exclude_regex = '', $add_path = true, $include_hidden = false)
 {
     $dir = dir::clean_path($dir);
     $dir = dir::chop($dir);
     $items = array();
     $separator = dir::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,代码来源:dir.class.php

示例5: path

 function path($names, $include_end_separator = false, $type = DIR_SEPARATOR_UNIX)
 {
     $separator = dir::separator($type);
     $path = implode($separator, $names);
     $path = dir::clean_path($path, $type);
     $has_end_separator = strlen($path) > 0 && $path[strlen($path) - 1] == $separator;
     if ($include_end_separator && !$has_end_separator) {
         $path .= $separator;
     } elseif (!$include_end_separator && $has_end_separator) {
         $path = substr($path, 0, strlen($path) - 1);
     }
     return $path;
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:13,代码来源:dir.class.php


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