Author: ralfbecker
New Revision: 29467
URL: http://www.egroupware.org/viewvc/egroupware?rev=29467&view=rev
Log:
some vfs test code
Added:
branches/1.6/filemanager/test.php (with props)
Added: branches/1.6/filemanager/test.php
URL: http://www.egroupware.org/viewvc/egroupware/branches/1.6/filemanager/test.php?rev=29467&view=auto
— branches/1.6/filemanager/test.php (added)
+++ branches/1.6/filemanager/test.php Tue Mar 9 15:02:31 2010
@@ -1,0 +1,98 @@
+<?php
+/**
-
- eGroupWare - Filemanager - test script
-
-
- @package filemanager
-
- @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
-
- @copyright © 2009 by Ralf Becker <RalfBecker-AT-outdoor-training.de>
-
- @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
-
- @version $Id: test.php 26927 2009-05-03 18:48:36Z ralfbecker $
- */
+$GLOBALS[‘egw_info’][‘flags’] = array(
- ‘currentapp’ => ‘filemanager’
+);
+include(’…/header.inc.php’);
+if (!($path = egw_session::appsession(‘test’,‘filemanger’)))
+{
- $path = ‘/home/’.$GLOBALS[‘egw_info’][‘user’][‘account_lid’];
+}
+if (isset($_REQUEST[‘path’])) $path = $_REQUEST[‘path’];
+echo html::form("Path: ".html::input(‘path’,$path,‘text’,‘size=“40”’).
- html::submit_button(’’,lang(‘Submit’))."\n",array(),’’,’’,’’,’’,‘GET’);
+if (isset($path) && !empty($path))
+{
- if ($path[0] != ‘/’)
- {
-
throw new egw_exception_wrong_userinput('Not an absolute path!'); - }
- egw_session::appsession(‘test’,‘filemanger’,$path);
- echo “
”;
- foreach(explode(’/’,$path) as $n => $part)
- {
-
$p .= ($p != '/' ? '/' : '').$part; -
echo ($n > 1 ? ' / ' : '').html::a_href($n ? $part : ' / ','/filemanager/test.php',array('path'=>$p)); - }
- echo “\n”;
- $is_dir = egw_vfs::is_dir($path);
- echo “
is_dir(’$path’)=”.array2string($is_dir)."
\n"; - $time = microtime(true);
- $stat = egw_vfs::stat($path);
- $time = number_format(1000*(microtime(true)-$time),1);
- if ($is_dir && ($d = egw_vfs::opendir($path)))
- {
-
$files = array(); -
while(($file = readdir($d))) -
{ -
if (egw_vfs::is_readable($fpath=egw_vfs::concat($path,$file))) -
{ -
$file = html::a_href($file,'/filemanager/test.php',array('path'=>$fpath)); -
} -
$files[] = $file; -
} -
closedir($d); -
echo ($files ? '<ol><li>'.implode("</li>\n<li>",$files).'</ol>' : '<p>Empty directory</p>')."\n"; - }
- echo "
stat(’$path’) took $time ms (mode = ".(isset($stat[‘mode’])?sprintf(’%o’,$stat[‘mode’]).’ = ‘.egw_vfs::int2mode($stat[‘mode’]):‘NULL’).’)’;
- if (is_array($stat))
- {
-
_debug_array($stat); - }
- else
- {
-
echo "<p>".array2string($stat)."</p>\n"; - }
- echo “
egw_vfs::is_readable(’$path’)=”.array2string(egw_vfs::is_readable($path))."
\n"; - echo “
egw_vfs::is_writable(’$path’)=”.array2string(egw_vfs::is_writable($path))."
\n"; - echo “
is_link(’$path’)=”.array2string(egw_vfs::is_link($path))."
\n"; - echo “
readlink(’$path’)=”.array2string(egw_vfs::readlink($path))."
\n"; - $time = microtime(true);
- $lstat = egw_vfs::lstat($path);
- $time = number_format(1000*(microtime(true)-$time),1);
- echo "
lstat(’$path’) took $time ms (mode = ".(isset($lstat[‘mode’])?sprintf(’%o’,$lstat[‘mode’]).’ = ‘.egw_vfs::int2mode($lstat[‘mode’]):‘NULL’).’)’;
- if (is_array($lstat))
- {
-
_debug_array($lstat); - }
- else
- {
-
echo "<p>".array2string($lstat)."</p>\n"; - }
- if (!$is_dir && $stat)
- {
-
echo "<p><b>egw_vfs::mime_content_type('$path')</b>=".array2string(egw_vfs::mime_content_type($path))."</p>\n"; -
echo "<p><b>filesize(egw_vfs::PREFIX.'$path')</b>=".array2string(filesize(egw_vfs::PREFIX.$path))."</p>\n"; -
echo "<p><b>bytes(file_get_contents(egw_vfs::PREFIX.'$path'))</b>=".array2string(bytes(file_get_contents(egw_vfs::PREFIX.$path)))."</p>\n"; - }
+}
+$GLOBALS[‘egw’]->common->egw_footer();
Propchange: branches/1.6/filemanager/test.php
svn:Id =
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
eGroupWare-cvs mailing list
eGroupWare-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs