• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP extract_dir函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中extract_dir函数的典型用法代码示例。如果您正苦于以下问题:PHP extract_dir函数的具体用法?PHP extract_dir怎么用?PHP extract_dir使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: iif

		if(parent) {
			parent.document.getElementById("framedir").value = '<?php 
    echo iif($dotdotdir, $dir);
    ?>
';
		}

	</script>
	<table class="border" border="0" cellspacing="0" cellpadding="4" align="center" style="width: 230px;">
		<tr>
			<td>
			  <?php 
    if ($dotdotdir) {
        ?>
					<a href="admin.php?action=cms&job=doc_select_image&dir=<?php 
        echo extract_dir($dir);
        ?>
"><img src="<?php 
        echo $tpl->img('filetypes/folder');
        ?>
" alt="" border="0" />&nbsp;<em><?php 
        echo $lang->phrase('admin_wysiwyg_prev_dir');
        ?>
</em></a><br>
					<?php 
    }
    $i = -1;
    foreach ($dirs as $i => $dirname) {
        ?>
					<a href="admin.php?action=cms&job=doc_select_image&dir=<?php 
        echo urlencode($dirname);
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:cms.php


示例2: setdir

 function setdir($dirId)
 {
     global $config;
     if ($dirId < 1) {
         $dirId = $config['langdir'];
     }
     $dir = "language/{$dirId}";
     if (@is_dir($dir) == false) {
         $dir = "{$config['fpath']}/language/{$dirId}";
         if (@is_dir($dir) == false) {
             $dir = extract_dir(dirname(__FILE__));
             $dir = "{$dir}/language/{$dirId}";
         }
     }
     $dir = realpath($dir);
     if (file_exists($dir)) {
         $this->dirid = $dirId;
         $this->dir = $dir;
         return true;
     } else {
         return false;
     }
 }
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:23,代码来源:class.language.php


示例3: foot

  <tr>
   <td class="ubox" colspan="2" align="center"><input type="submit" name="Submit" value="<?php 
    echo $lang->phrase('admin_explorer_form_extract');
    ?>
"></td>
  </tr>
 </table>
</form>
	<?php 
    echo foot();
} elseif ($job == "extract2") {
    echo head();
    $file = $gpc->get('path', none);
    $dir = $gpc->get('to', none);
    set_chmod($dir, 0777, CHMOD_EX);
    $redirect = 'admin.php?action=explorer&path=' . urlencode(extract_dir($file, false));
    if (!preg_match('#\\.(tar\\.gz|tar|gz|zip)$#is', $file, $ext)) {
        error($redirect, $lang->phrase('admin_explorer_archive_is_not_supported'));
    }
    if (isset($ext[1])) {
        $extension = $ext[1];
        if ($extension == 'zip') {
            include 'classes/class.zip.php';
            $archive = new PclZip($file);
            if ($archive->extract(PCLZIP_OPT_PATH, $dir) == 0) {
                error($redirect, $archive->errorInfo(true));
            }
        } elseif ($extension == 'tar.gz') {
            gzAbortNotLoaded();
            $temp = gzTempfile($file);
            $temp = realpath($temp);
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:explorer.php


示例4: showContent

 function showContent($print = true)
 {
     global $lang;
     $dir_list = $file_list = $subdir_size_list = array();
     $total_dir_size = 0;
     if (($dir_handle = opendir($this->path)) === false) {
         error('admin.php?action=explorer', $lang->phrase('admin_explorer_could_not_open_dir') . realpath($this->path));
     }
     while (($file = @readdir($dir_handle)) !== false) {
         if ($file == '.' || $file == '..') {
             continue;
         }
         if (is_dir($this->path . $file)) {
             $dir_list[] = $file;
             if ($this->show_subfolders_size) {
                 $stack = array($this->path . $file . '/');
                 $size = 0;
                 while (count($stack) > 0) {
                     $subdir = array_shift($stack);
                     $subdir_handle = @opendir($subdir);
                     while (($subdir_file = @readdir($subdir_handle)) !== false) {
                         if ($subdir_file == '.' || $subdir_file == '..') {
                             continue;
                         }
                         if ($this->show_subfolders_size) {
                             if (is_dir($subdir . $subdir_file)) {
                                 array_push($stack, $subdir . $subdir_file . '/');
                             }
                         }
                         $size += @filesize($subdir . $subdir_file);
                     }
                     @closedir($subdir_handle);
                 }
                 $subdir_size_list[$file] = $size;
                 $total_dir_size += $size;
             }
         } else {
             $file_list[] = $file;
             $total_dir_size += @filesize($this->path . $file);
         }
     }
     @closedir($dir_handle);
     natcasesort($dir_list);
     natcasesort($file_list);
     $total_files = count($dir_list) + count($file_list);
     $total_size = $this->formatSize($total_dir_size);
     $print_spacer = count($file_list) > 0 && count($dir_list) > 0 ? true : false;
     $page_link = $this->realPath(dirname($this->script_file) . '/' . $this->path);
     $rp = realpath($this->path);
     $root = extract_dir($this->root);
     $rp = str_replace($root, '', $rp);
     $heading_path = $this->realPath($rp);
     $heading_path_parts = explode("/", $heading_path);
     $levels = count($heading_path_parts) - 2;
     for ($heading_path = ""; $levels > -1; $levels--) {
         for ($i = 0, $path = ""; $i < $levels; $i++) {
             $path .= "../";
         }
         $link = '&amp;path=' . urlencode($this->realPath($this->path . $path));
         $heading_path .= '<a href="' . $this->script_file . $link . '">' . array_shift($heading_path_parts) . '</a>' . DIRECTORY_SEPARATOR;
     }
     $newdir = $this->script_file . '&amp;path=' . urlencode(str_replace('/\\', '/', $this->path));
     $newdir_html = '<span style="float: right;"><a class="button" href="' . $newdir . '&job=newdir">' . $lang->phrase('admin_explorer_create_new_directory') . '</a></span>';
     $html = '	   <table cellpadding="4" cellspacing="0" class="border">';
     $html .= "\n" . '		 <tr>';
     $html .= "\n" . '		   <td class="obox"><span style="float: right;"><a class="button" href="admin.php?action=explorer&amp;job=all_chmod">' . $lang->phrase('admin_explorer_check_chmod') . '</a></span>' . iif(count($dir_list) == 0, $newdir_html) . $lang->phrase('admin_explorer_filemanager') . '</td>';
     $html .= "\n" . '		 </tr>';
     $html .= "\n" . '		 <tr>';
     $html .= "\n" . '		   <td class="ubox">' . $lang->phrase('admin_explorer_directory_x') . extract_dir($this->root) . $heading_path . '</td>';
     $html .= "\n" . '		 </tr>';
     $html .= "\n" . '	   </table><br />';
     $html .= "\n" . '	   <table cellpadding="4" cellspacing="0" class="border">';
     if (count($dir_list) > 0) {
         $html .= "\n" . '		 <tr>';
         $html .= "\n" . '		   <td class="obox" colspan="5">' . $newdir_html . $lang->phrase('admin_explorer_directories') . '</td>';
         $html .= "\n" . '		 </tr>';
         $html .= "\n" . '		 <tr>';
         $html .= "\n" . '		   <td class="ubox" width="30%">' . $lang->phrase('admin_explorer_directory') . '</td>';
         $html .= "\n" . '		   <td class="ubox" width="9%">' . $lang->phrase('admin_explorer_size') . '</td>';
         $html .= "\n" . '		   <td class="ubox" width="20%">' . $lang->phrase('admin_explorer_created_on') . '</td>';
         $html .= "\n" . '		   <td class="ubox" width="8%">' . $lang->phrase('admin_explorer_chmod') . '</td>';
         $html .= "\n" . '		   <td class="ubox" width="33%">' . $lang->phrase('admin_explorer_action') . '</td>';
         $html .= "\n" . '		 </tr>';
     }
     while (($dir = array_shift($dir_list)) !== NULL) {
         $path_url = '&amp;path=' . urlencode(str_replace('/\\', '/', $this->path) . $dir . '/');
         $link = $this->script_file . $path_url;
         $size = $this->show_subfolders_size ? $this->formatSize($subdir_size_list[$dir]) : "&nbsp;";
         $chmod = get_chmod($this->path . $dir);
         $icon = $this->icons('directory');
         $html .= "\n" . '		 <tr>';
         $html .= "\n" . '		   <td class="mbox">';
         $html .= "\n" . '			 <a href="' . $link . '" target="Main">' . $icon . $dir . '</a>';
         $html .= "\n" . '		   </td>';
         $html .= "\n" . '		   <td class="mbox" align="right">';
         $html .= "\n" . '			 ' . $size;
         $html .= "\n" . '		   </td>';
         $html .= "\n" . '		   <td class="mbox">';
         $html .= "\n" . '			 ' . gmdate("d.m.y, H:i", times(filectime($this->path . $dir)));
         $html .= "\n" . '		   </td>';
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:101,代码来源:class.servernavigator.php


示例5: INI

 $settings = $tempdir . 'design.ini';
 $myini = new INI();
 $myini->write($settings, $info);
 require_once 'classes/class.zip.php';
 $archive = new PclZip($tempdir . $file);
 $v_list = $archive->create($settings, PCLZIP_OPT_REMOVE_PATH, $tempdir);
 if ($v_list == 0) {
     $error = true;
 } else {
     foreach ($dirs as $dir) {
         $archive = new PclZip($tempdir . $file);
         if (!empty($dir['func']) && viscacha_function_exists($dir['func'])) {
             $list = $dir['func']($dir['dir']);
             $v_list = $archive->add($list, PCLZIP_OPT_REMOVE_PATH, $dir['dir'], PCLZIP_OPT_ADD_PATH, extract_dir($dir['dir'], false));
         } else {
             $v_list = $archive->add($dir['dir'], PCLZIP_OPT_REMOVE_PATH, $dir['dir'], PCLZIP_OPT_ADD_PATH, extract_dir($dir['dir'], false));
         }
         if ($v_list == 0) {
             $error = true;
             break;
         }
     }
 }
 if ($error) {
     echo head();
     unset($archive);
     $filesystem->unlink($tempdir . $file);
     $filesystem->unlink($settings);
     error('admin.php?action=designs&job=export&id=' . $id, $archive->errorInfo(true));
 } else {
     viscacha_header('Content-Type: application/zip');
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:designs.php


示例6: define

* Magpie mailing list:
* [email protected]
*
*/
// Setup MAGPIE_DIR for use on hosts that don't include
// the current path in include_path.
// with thanks to rajiv and smarty
if (!defined('DIR_SEP')) {
    define('DIR_SEP', DIRECTORY_SEPARATOR);
}
if (!defined('MAGPIE_DIR')) {
    define('MAGPIE_DIR', dirname(__FILE__) . DIR_SEP);
}
require_once MAGPIE_DIR . 'rss_parse.inc.php';
require_once MAGPIE_DIR . 'rss_cache.inc.php';
require_once extract_dir(MAGPIE_DIR) . 'class.snoopy.php';
$grabrss = $scache->load('grabrss');
$grabrss_cache = $grabrss->get();
/* 
 * CONSTANTS - redefine these in your script to change the
 * behaviour of fetch_rss() currently, most options effect the cache
 *
 * MAGPIE_CACHE_ON - Should Magpie cache parsed RSS objects? 
 * For me a built in cache was essential to creating a "PHP-like" 
 * feel to Magpie, see rss_cache.inc for rationale
 *
 *
 * MAGPIE_CACHE_DIR - Where should Magpie cache parsed RSS objects?
 * This should be a location that the webserver can write to.   If this 
 * directory does not already exist Mapie will try to be smart and create 
 * it.  This will often fail for permissions reasons.
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:rss_fetch.inc.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP extract_exif_comment函数代码示例发布时间:2022-05-15
下一篇:
PHP extractManifest函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap