Example #1
0
function listDir($dir)
{
    global $words;
    if (is_dir($dir)) {
        if ($handle = opendir($dir)) {
            while ($file = readdir($handle)) {
                if ($file != '.' && $file != '..') {
                    if (is_dir($dir . DIRECTORY_SEPARATOR . $file)) {
                        listDir($dir . DIRECTORY_SEPARATOR . $file);
                    } else {
                        //$r = file_get_contents($dir.DIRECTORY_SEPARATOR.$file);
                        //$words += (str_word_count(showtextintags($r)));
                        $fl = fopen($dir . DIRECTORY_SEPARATOR . $file, 'r');
                        $i = 0;
                        while (!feof($fl)) {
                            fgets($fl);
                            $i++;
                        }
                        fclose($fl);
                        $words += $i - 72;
                    }
                }
            }
        }
        closedir($handle);
    } else {
        echo 'Fetal folder!';
    }
}
Example #2
0
function runJavaTests($clientRoot)
{
    global $config;
    $jdkPath = $config['java']['jdk_path'];
    $externalJars = listDir("{$clientRoot}/lib");
    if (!is_dir("{$clientRoot}/bin")) {
        mkdir("{$clientRoot}/bin");
    }
    chdir("{$clientRoot}/bin");
    // compile the client library
    executeCommand("{$jdkPath}javac.exe", "-d . -sourcepath ../src -cp " . implode(';', addPrefix($externalJars, '../lib/')) . " ../src/com/kaltura/client/test/KalturaTestSuite.java");
    // pack the client library
    executeCommand("{$jdkPath}jar.exe", "cvf kalturaClient.jar .");
    // run the tests
    copy("{$clientRoot}/src/DemoImage.jpg", "{$clientRoot}/bin/DemoImage.jpg");
    copy("{$clientRoot}/src/DemoVideo.flv", "{$clientRoot}/bin/DemoVideo.flv");
    copy("{$clientRoot}/src/test.properties", "{$clientRoot}/bin/test.properties");
    $log4jConfig = fixSlashes("{$clientRoot}/src/log4j/log4j.properties");
    if ($log4jConfig[1] == ':') {
        $log4jConfig = substr($log4jConfig, 2);
    }
    $log4jParam = "-Dlog4j.configuration=file://{$log4jConfig}";
    $jarList = "bin/kalturaClient.jar;" . implode(';', addPrefix($externalJars, 'lib/'));
    chdir($clientRoot);
    executeCommand("{$jdkPath}java.exe", "-cp {$jarList} {$log4jParam} org.junit.runner.JUnitCore com.kaltura.client.test.KalturaTestSuite");
}
function listDir($dir){
   if(is_dir($dir)){
     if ($dh = opendir($dir)) {
        while (($file= readdir($dh)) !== false){
		
       if((is_dir($dir."/".$file)) && $file!="." && $file!="..")
       {
	    if(is_writable($dir."/".$file)&&is_readable($dir."/".$file))
		{
		echo "<b><font color='red'>文件名:</font></b>".$dir.$file."<font color='red'> 可写</font><font color='Blue'> 可读</font>"."<br><hr>";
		}else{
		if(is_writable($dir."/".$file))
		{
              echo "<b><font color='red'>文件名:</font></b>".$dir.$file."<font color='red'> 可写</font>"."<br><hr>";
		}else
		{
	      echo "<b><font color='red'>文件名:</font></b>".$dir.$file."<font color='red'> 可读</font><font color='Blue'> 不可写</font>"."<br><hr>";
		}
		}
		
		listDir($dir."/".$file."/");
       }
     
       }
        }
closedir($dh);

     }
 
   }
Example #4
0
/**
 * @param $dir
 */
function listDir($dir)
{
    echo $dir . PHP_EOL;
    if (is_dir($dir)) {
        $sub_dirs = scandir($dir);
        foreach ($sub_dirs as $sub_dir) {
            if ($sub_dir == '.' || $sub_dir == '..') {
                continue;
            }
            listDir($dir . DIRECTORY_SEPARATOR . $sub_dir);
        }
    }
}
Example #5
0
function listDir($dir)
{
    $dir .= substr($dir, -1) == D_S ? '' : D_S;
    $dirInfo = array();
    foreach (glob($dir . '*') as $v) {
        if (is_dir($v)) {
            $dirInfo = array_merge($dirInfo, listDir($v));
        } else {
            $dirInfo[] = $v;
        }
    }
    return $dirInfo;
}
Example #6
0
File: load.php Project: reZo/Tiger
 public function parse()
 {
     $list = split(' ', $expression);
     foreach ($list as $value) {
         if ($value[0] == '~') {
             $exclude[] = substr($value, 1, strlen($value)) . '.php';
         } else {
             if ($value[0] == '*') {
                 $include[] = listDir($this->path);
             }
         }
     }
 }
Example #7
0
function listPath($path)
{
    global $config;
    $path = fixPath($path);
    $path = rtrim($path, '/');
    if (accessLevel($path) < 1) {
        return array('type' => 'nope', 'path' => $path);
    }
    if (is_dir($config['files'] . $path)) {
        return listDir($path);
    }
    if (is_file($config['files'] . $path)) {
        return listFile($path);
    }
    return list404();
}
function listDir($root, $path, $phar)
{
    //print 'Entering ' . $root . $path . PHP_EOL;
    $it = new DirectoryIterator($root . $path);
    foreach ($it as $fileinfo) {
        $filename = $fileinfo->getFilename();
        if ($fileinfo->isDot() || stristr($filename, 'Test.php') || stristr($filename, '.git') || stristr($filename, '.gitignore') || stristr($filename, 'manual_tests') || stristr($filename, 'tests') || stristr($filename, 'Call-Logs') || stristr($filename, 'Json') || stristr($filename, 'Csv') || stristr($filename, 'Recordings') || stristr($filename, '_cache') || stristr($filename, 'dist') || stristr($filename, 'build') || stristr($filename, 'docs')) {
            continue;
        } elseif ($fileinfo->isDir()) {
            listDir($root, $path . '/' . $filename, $phar);
        } else {
            $key = ($path ? $path . '/' : '') . $filename;
            $phar[$key] = file_get_contents($root . $path . '/' . $fileinfo->getFilename());
            //print '  ' . $key . ' -> ' . $path . '/' . $filename . PHP_EOL;
        }
    }
}
function listDir($path, $phar)
{
    $relPath = str_replace('/lib', '', $path);
    $it = new DirectoryIterator(__DIR__ . $path);
    foreach ($it as $fileinfo) {
        $filename = $fileinfo->getFilename();
        if ($fileinfo->isDot() || stristr($filename, 'Test.php')) {
            continue;
        } elseif ($fileinfo->isDir()) {
            listDir($path . '/' . $filename, $phar);
        } else {
            $key = ($relPath ? $relPath . '/' : '') . $filename;
            $phar[$key] = file_get_contents(__DIR__ . $path . '/' . $fileinfo->getFilename());
            //print $key . ' -> ' . $path . '/' . $filename . PHP_EOL;
        }
    }
}
Example #10
0
/**
 * 遍历一个文件夹下的所有文件和子文件夹
 */
function listDir($dir = '.')
{
    if ($handle = opendir($dir)) {
        while (false !== ($file = readdir($handle))) {
            if ($file == '.' || $file == '..') {
                continue;
            }
            if (is_dir($sub_dir = realpath($dir . '/' . $file))) {
                echo 'FILE in PATH:' . $dir . ':' . $file . '<br>';
                listDir($sub_dir);
            } else {
                echo 'FILE:' . $file . '<br>';
            }
        }
        closedir($handle);
    }
}
Example #11
0
function listDir($dir)
{
    if (is_dir($dir)) {
        if ($dh = opendir($dir)) {
            while (($file = readdir($dh)) !== false) {
                if (is_dir($dir . "/" . $file) && $file != "." && $file != "..") {
                    echo "<b><font color='red'>文件名:</font></b>", $file, "<br><hr>";
                    listDir($dir . "/" . $file . "/");
                } else {
                    if ($file != "." && $file != "..") {
                        echo $file . "<br>";
                    }
                }
            }
            closedir($dh);
        }
    }
}
Example #12
0
function replaceInFolder($path, $includeSuffixes, $excludeSuffixes, $search, $replace, $fileNameSearch = null, $fileNameReplace = null)
{
    $fileList = listDir($path);
    foreach ($fileList as $curFile) {
        $curPath = "{$path}/{$curFile}";
        if (is_dir($curPath)) {
            replaceInFolder($curPath, $includeSuffixes, $excludeSuffixes, $search, $replace, $fileNameSearch, $fileNameReplace);
        } else {
            if ($includeSuffixes && !endsWith($curPath, $includeSuffixes)) {
                continue;
            }
            if ($excludeSuffixes && endsWith($curPath, $excludeSuffixes)) {
                continue;
            }
            replaceInFile($curPath, $search, $replace, $fileNameSearch, $fileNameReplace);
        }
    }
}
Example #13
0
function listDir($dir, $level, $arr, $arr_ass)
{
    if (is_dir($dir)) {
        if ($dh = opendir($dir)) {
            while ($file = readdir($dh)) {
                if (is_dir($dir . "/" . $file) && $file != "." && $file != "..") {
                    listDir($dir . "/" . $file, $level, $arr, $arr_ass);
                } elseif ((string) $file[strlen($file) - 1] == "p" && (string) $file[strlen($file) - 2] == "h" && $file != "ws_finder.php") {
                    $result = checkFile($dir . "/" . $file, $level, $arr, $arr_ass);
                    if ($result != "safe") {
                        echo "<h2>发现威胁</h2>";
                        echo "<br/>" . "<code>" . $dir . "/" . $file . "可能是" . $result . "<br/></code><hr/>";
                    }
                } else {
                    continue;
                }
            }
        }
    }
}
Example #14
0
function listDir($dir)
{
    if ($dh = opendir($dir)) {
        while (($file = readdir($dh)) !== false) {
            if ($file != '.' && $file != '..') {
                if (filetype($dir . $file) == 'dir') {
                    echo '<br><b data-url="' . $dir . $file . '"> #' . $file . '</b> <a class="new-file">Novo arquivo</a><br>';
                    echo '<div class="sub">';
                    listDir($dir . $file . '/');
                    echo '</div>';
                } else {
                    if (filetype($dir . $file) == 'file') {
                        echo '<span class="file" data-url="' . $dir . $file . '">' . $file . '</span><a class="file-link link-rename">Renomear</a><a class="file-link link-delete">Excluir</a><br>';
                    } else {
                        echo '<br>error<br>';
                    }
                }
            }
        }
        closedir($dh);
    }
}
Example #15
0
function listDir($dir, $level, $array)
{
    if ($level <= 0) {
        return;
    }
    if (is_dir($dir)) {
        if ($dh = opendir($dir)) {
            while (($file = readdir($dh)) !== false) {
                $_array = array();
                if ($file != "." && $file != "..") {
                    if (is_dir($dir . "/" . $file)) {
                        $_array = array_fill(0, 1, $file);
                        $_array = listDir($dir . "/" . $file . "/", $level - 1, $_array);
                    } else {
                        array_push($_array, $file);
                    }
                    array_push($array, $_array);
                }
            }
            closedir($dh);
        }
    }
    return $array;
}
Example #16
0
function get_unasigned_disks() {
  $disks = array();
  $paths = listDir("/dev/disk/by-id");
  natsort($paths);
  $unraid_flash = realpath("/dev/disk/by-label/UNRAID");
  $unraid_disks = array();
  foreach (parse_ini_string(shell_exec("/root/mdcmd status 2>/dev/null")) as $k => $v) {
    if (strpos($k, "rdevName") !== FALSE && strlen($v)) {
      $unraid_disks[] = realpath("/dev/$v");
    }
  }
  // foreach ($unraid_disks as $k) {$o .= "  $k\n";}; debug("UNRAID DISKS:\n$o");
  $unraid_cache = array();
  foreach (parse_ini_file("/boot/config/disk.cfg") as $k => $v) {
    if (strpos($k, "cacheId") !== FALSE && strlen($v)) {
      foreach ( preg_grep("#".$v."$#i", $paths) as $c) $unraid_cache[] = realpath($c);
    }
  }
  // foreach ($unraid_cache as $k) {$g .= "  $k\n";}; debug("UNRAID CACHE:\n$g");
  foreach ($paths as $d) {
    $path = realpath($d);
    if (preg_match("#^(.(?!wwn|part))*$#", $d)) {
      if (! in_array($path, $unraid_disks) && ! in_array($path, $unraid_cache) && strpos($unraid_flash, $path) === FALSE) {
        if (in_array($path, array_map(function($ar){return $ar['device'];},$disks)) ) continue;
        $m = array_values(preg_grep("#$d.*-part\d+#", $paths));
        natsort($m);
        $disks[$d] = array("device"=>$path,"type"=>"ata","partitions"=>$m);
        // debug("Unassigned disk: $d");
      } else {
        // debug("Discarded: => $d ($path)");
        continue;
      }
    } 
  }
  return $disks;
}
Example #17
0
Action: resetservices
Action: readconfig;
';
    } else {
        $myreplacemenu .= '[switchApache' . $oneApacheVersion . ']
Action: run; FileName: "' . $c_phpExe . '";Parameters: "msg.php 2";WorkingDir: "' . $c_installDir . '/scripts"; Flags: waituntilterminated
';
    }
}
$myreplace .= 'Type: separator;
Type: item; Caption: "Get more..."; Action: run; FileName: "' . $c_navigator . '"; Parameters: "http://www.wampserver.com/addons_apache.php";
';
$tpl = str_replace($myPattern, $myreplace . $myreplacemenu, $tpl);
// ************************
// versions de MySQL
$mysqlVersionList = listDir($c_mysqlVersionDir, 'checkMysqlConf');
$myPattern = ';WAMPMYSQLVERSIONSTART';
$myreplace = $myPattern . "\n";
$myreplacemenu = '';
foreach ($mysqlVersionList as $oneMysql) {
    $oneMysqlVersion = str_ireplace('mysql', '', $oneMysql);
    if (isset($mysqlConf)) {
        $mysqlConf = NULL;
    }
    include $c_mysqlVersionDir . '/mysql' . $oneMysqlVersion . '/' . $wampBinConfFiles;
    if ($oneMysqlVersion === $wampConf['mysqlVersion']) {
        $myreplace .= 'Type: item; Caption: "' . $oneMysqlVersion . '"; Action: multi; Actions:switchMysql' . $oneMysqlVersion . '; Glyph: 13
';
    } else {
        $myreplace .= 'Type: item; Caption: "' . $oneMysqlVersion . '"; Action: multi; Actions:switchMysql' . $oneMysqlVersion . '
';
Example #18
0
    } elseif ($mysqlServer[$oneMysqlVersion] == -1) {
        $myreplace .= 'Type: item; Caption: "' . $oneMysqlVersion . '"; Action: multi; Actions:switchMysql' . $oneMysqlVersion . '; Glyph: 19
';
        $myreplacemenu .= '[switchMysql' . $oneMysqlVersion . ']
Action: run; FileName: "' . $c_phpExe . '";Parameters: "msg.php 13 ' . base64_encode($myIniFile) . ' ' . base64_encode($c_mysqlService) . '";WorkingDir: "' . $c_installDir . '/scripts"; Flags: waituntilterminated
';
    }
}
/*$myreplace .= 'Type: separator;
Type: item; Caption: "Get more..."; Action: run; FileName: "'.$c_navigator.'"; Parameters: "http://www.wampserver.com/addons_mysql.php";
';
*/
$tpl = str_replace($myPattern, $myreplace . $myreplacemenu, $tpl);
// ************************
// versions de MariaDB
$mariadbVersionList = listDir($c_mariadbVersionDir, 'checkMariadbConf');
$myPattern = ';WAMPMARIADBVERSIONSTART';
$myreplace = $myPattern . "\n";
$myreplacemenu = '';
foreach ($mariadbVersionList as $oneMariadb) {
    $oneMariadbVersion = str_ireplace('mariadb', '', $oneMariadb);
    unset($mariadbConf);
    include $c_mariadbVersionDir . '/mariadb' . $oneMariadbVersion . '/' . $wampBinConfFiles;
    //[modif oto] - Check name of the group [wamp...] under '# The MariaDB server' in my.ini file
    //    must be the name of the mariadb service.
    $myIniFile = $c_mariadbVersionDir . '/mariadb' . $oneMariadbVersion . '/' . $mariadbConf['mariadbConfFile'];
    $myIniContents = file_get_contents($myIniFile);
    if (strpos($myIniContents, "[" . $c_mariadbService . "]") === false) {
        $myIniContents = preg_replace("/^\\[wamp.*\\]\$/m", "[" . $c_mariadbService . "]", $myIniContents, 1, $count);
        if (!is_null($myIniContents) && $count == 1) {
            $fp = fopen($myIniFile, 'w');
Example #19
0
</HEAD>

<BODY>

<div id="header">
<?php 
include "header.php";
?>
</div>

<!-- Content goes here -->
<div id="index_content">
<?php 
include_once "markdown.php";
include_once "crawler.php";
$lala = listDir();
echo $lala;
//$my_text = arquivoo
//$my_html = Markdown($my_text);
//echo $my_html;
?>

</div>
<!-- Content ends here -->

<div id="footer">
<?php 
include "footer.php";
?>
</div>
Example #20
0
function listDir($dir)
{
    if (is_dir($dir)) {
        if ($dh = opendir($dir)) {
            while (($file = readdir($dh)) !== false) {
                if (is_dir($dir . "/" . $file) && $file != "." && $file != "..") {
                    if (date("Y-m-d", filemtime($dir . "/" . $file)) > "2016-01-12") {
                        echo "<b><font color='red'>文件名:</font></b>", $dir, "/", $file, "更新时间", date("Y-m-d", filemtime($dir . "/" . $file)), "<br><hr><br>\n\r";
                    }
                    listDir($dir . "/" . $file . "/");
                } else {
                    if ($file != "." && $file != "..") {
                        if (date("Y-m-d", filemtime($dir . "/" . $file)) > "2016-01-12") {
                            echo $dir, "/", $file . "更新时间", date("Y-m-d", filemtime($dir . "/" . $file)), "<br>\n\r";
                        }
                    }
                }
            }
            closedir($dh);
        }
    }
}
function make_mount_button($device)
{
    global $paths, $Preclear;
    $button = "<span style='width:auto;text-align:right;'><button type='button' device='{$device[device]}' class='array' context='%s' role='%s' %s><i class='%s'></i>  %s</button></span>";
    if (isset($device['partitions'])) {
        $mounted = in_array(TRUE, array_map(function ($ar) {
            return is_mounted($ar['device']);
        }, $device['partitions']));
        $disable = count(array_filter($device['partitions'], function ($p) {
            if (!empty($p['fstype']) && $p['fstype'] != "precleared") {
                return TRUE;
            }
        })) ? "" : "disabled";
        $format = isset($device['partitions']) && !count($device['partitions']) || $device['partitions'][0]['fstype'] == "precleared" ? true : false;
        $context = "disk";
    } else {
        $mounted = is_mounted($device['device']);
        $disable = !empty($device['fstype']) && $device['fstype'] != "precleared" ? "" : "disabled";
        $format = isset($device['fstype']) && empty($device['fstype']) || $device['fstype'] == "precleared" ? true : false;
        $context = "partition";
    }
    $is_mounting = array_values(preg_grep("@/mounting_" . basename($device['device']) . "@i", listDir(dirname($paths['mounting']))))[0];
    $is_mounting = time() - filemtime($is_mounting) < 300 ? TRUE : FALSE;
    $is_unmounting = array_values(preg_grep("@/unmounting_" . basename($device['device']) . "@i", listDir(dirname($paths['mounting']))))[0];
    $is_unmounting = time() - filemtime($is_unmounting) < 300 ? TRUE : FALSE;
    $dev = basename($device['device']);
    $preclearing = $Preclear ? $Preclear->isRunning(basename($device['device'])) : false;
    if ($device['size'] == 0) {
        $button = sprintf($button, $context, 'mount', 'disabled', 'glyphicon glyphicon-erase', 'Insert');
    } elseif ($format) {
        $disable = get_config("Config", "destructive_mode") == "enabled" ? "" : "disabled";
        $disable = $preclearing ? "disabled" : $disable;
        $button = sprintf($button, $context, 'format', $disable, 'glyphicon glyphicon-erase', 'Format');
    } elseif ($is_mounting) {
        $button = sprintf($button, $context, 'umount', 'disabled', 'fa fa-circle-o-notch fa-spin', 'Mounting...');
    } elseif ($is_unmounting) {
        $button = sprintf($button, $context, 'mount', 'disabled', 'fa fa-circle-o-notch fa-spin', 'Unmounting...');
    } elseif ($mounted) {
        $button = sprintf($button, $context, 'umount', '', 'glyphicon glyphicon-export', 'Unmount');
    } else {
        $disable = $preclearing ? "disabled" : $disable;
        $button = sprintf($button, $context, 'mount', $disable, 'glyphicon glyphicon-import', 'Mount');
    }
    return $button;
}
Example #22
0
    exit;
} elseif (isset($_GET['tail'])) {
    $file = $_GET['tail'];
    $tail = `tail -10000 {$file} 2> /dev/null`;
    echo $tail;
    exit;
} elseif (isset($_GET['report'])) {
    $file = $_GET['report'];
    header("HTTP/1.1 200 OK");
    header("Content-type: text/html");
    echo file_get_contents($file);
    exit;
}
@($builds = listDir("builds"));
@($samples = listDir("samples"));
@($reports = listDir("out/test/html"));
?>

<html>
	<head>
		<style type="text/css">
			body, html, table, form {
				font-size: 12px;
				font-family: sans-serif;
				padding: 0;
				margin: 0;
			}
			th {
				text-align: left;
			}
		 	pre {
Example #23
0
/**
 * Get current folder id
 * 
 * @param string $path
 * 
 * @return integer
 */
function getId($path)
{
    $absolutePath = $_SERVER['DOCUMENT_ROOT'] . $path;
    //Number of directories
    $nd = count(glob("{$absolutePath}/*", GLOB_ONLYDIR));
    //Id of the session
    if (!isset($_SESSION['id'])) {
        if ($nd >= 1) {
            $allDirs = listDir($absolutePath);
            $highestDir = max($allDirs);
            $id = $highestDir + 1;
        } else {
            $id = 1;
        }
        $_SESSION['id'] = $id;
    } else {
        $id = $_SESSION['id'];
    }
    return $id;
}
Example #24
0
$tasks['notebook'] = "Add entry to lab notebook";
setProgress($tasks, 'jiffiloop');
// updates the progress display if running as a background job
//$newModel = createModel($modelID."H");
//$outname = $newModel['pdb'];
//if(!file_exists($outpath)) mkdir($outpath, 0777); // shouldn't ever happen, but might...
$kinpath = $kinDir . '/' . $modelID . '.kin';
$pdbPrefix = $pdbDir . '/' . $modelID;
runJiffiloop($pdb, $pdbPrefix, $fragfiller_args);
//reduceNoBuild($pdb, $outpath);
setProgress($tasks, 'notebook');
//$kinout = $_SESSION['dataDir'].'/'.MP_DIR_MODELS.'/'.$kinpath;
//$kinurl = $_SESSION['dataURL'].'/'.MP_DIR_MODELS.'/'.$kinpath;
// have to scan MP_DIR_MODELS directory for all outputted loop files.
$gapCount = 0;
$pdbFiles = listDir($pdbDir);
$pdbEntries = "<p>You can now use the following links to download multi-model PDB files for each filled gap.</p>\n";
foreach ($pdbFiles as $pdbName) {
    //echo "For $pdbName\n";
    if (preg_match("/" . $modelID . ".*\\.[0-9]*-[0-9]*\\.pdb/", $pdbName)) {
        //echo "Found $pdbName\n";
        $filledPdbFile = $_SESSION['dataDir'] . '/' . MP_DIR_MODELS . '/' . $pdbName;
        $pdburl = $_SESSION['dataURL'] . '/' . MP_DIR_MODELS . '/' . $pdbName;
        $pdbEntries .= "<p>File <a href='{$pdburl}'>{$pdbName}</a> (" . formatFilesize(filesize($filledPdbFile)) . ").</p>\n";
        $gapCount += 1;
    } else {
        if (preg_match("/.kin/", $pdbName)) {
            // because JiffiLoop puts all output files in one directory, this moves the output kin to the kin directory.
            //echo "kin file name: ".$pdbName."\n";
            $origKinFile = $_SESSION['dataDir'] . '/' . MP_DIR_MODELS . '/' . $pdbName;
            $newKinFile = $kinDir . '/' . $pdbName;
Example #25
0
$url = $_REQUEST['url'];
$file = basename($url);
// Start the page: produces <HTML>, <HEAD>, <BODY> tags
echo mpPageHeader("KiNG - {$file}");
############################################################################
?>
<center>
<applet id="king_applet" code="king/Kinglet.class" archive="king.jar" <?php 
echo $size;
?>
>
<param name="mode" value="flat">
<?php 
echo "    <param name='kinSource' value='{$url}'>\n";
// For kinemage load/save:
$kinfiles = implode(' ', listDir($_SESSION['dataDir'] . '/' . MP_DIR_KINS));
echo "    <param name='kinfileList' value='{$kinfiles}'>\n";
echo "    <param name='kinfileBase' value='{$_SESSION['dataURL']}/" . MP_DIR_KINS . "'>\n";
echo "    <param name='kinfileSaveHandler' value='save_kinemage.php?{$_SESSION['sessTag']}'>\n";
// For supporting electron density maps:
if (is_array($_SESSION['edmaps'])) {
    foreach ($_SESSION['edmaps'] as $edmap) {
        if (isset($ed_param)) {
            $ed_param .= " " . MP_DIR_EDMAPS . "/" . $edmap;
        } else {
            $ed_param = MP_DIR_EDMAPS . "/" . $edmap;
        }
    }
    if (isset($ed_param)) {
        echo "    <param name='edmapBase' value='{$_SESSION['dataURL']}'>\n";
        echo "    <param name='edmapList' value='{$ed_param}'>\n";
<?php

require_once 'list-dir.php';
$build = isset($argv[1]) ? $argv[1] : "latest";
$samples = listDir("samples");
$resultFile = $argv[2];
foreach ($samples as $sample) {
    $fileMd = json_decode(`export LD_LIBRARY_PATH=\`pwd\`/builds/{$build}/usr/local/lib; ./opj-md samples/{$sample}`, true);
    for ($res = 0; $res < $fileMd["num_res"]; $res++) {
        echo "echo \"Decoding full image {$sample} with opj_decompress at reduction {$res}\"\n";
        echo "./time_opj_decode_cmd.sh {$build} {$sample} {$res} >> {$resultFile}\n";
        echo "echo \"Decoding full image {$sample} with kdu_expand at reduction {$res}\"\n";
        echo "./time_kdu_decode_cmd.sh {$sample} {$res} >> {$resultFile}\n";
    }
    $nTiles = $fileMd["tw"] * $fileMd["th"];
    for ($res = 0; $res < $fileMd["num_res"]; $res++) {
        echo "echo \"Decoding tiles in parallel for {$sample} with opj_decompress at reduction {$res}\"\n";
        echo "ts=\$(date +%s%N)\n";
        for ($i = 0; $i < $nTiles; $i++) {
            echo "./time_opj_decode_cmd.sh {$build} {$sample} {$res} {$i} >> {$resultFile} &\n";
        }
        echo "wait\n";
        echo "tt=\$(((\$(date +%s%N) - \$ts)/1000000))\n";
        echo "echo \"opj;{$build};{$sample};{$res};full-async;\$tt\" >> {$resultFile}\n";
        echo "echo \"Decoding tiles in parallel for {$sample} with kdu_expand at reduction {$res}\"\n";
        echo "ts=\$(date +%s%N)\n";
        for ($tx = 0; $tx < $fileMd["tw"]; $tx++) {
            for ($ty = 0; $ty < $fileMd["th"]; $ty++) {
                $leftPerc = bcdiv($tx * $fileMd["tdx"], $fileMd["x1"], 30);
                $wPerc = bcdiv($fileMd["tdx"], $fileMd["x1"], 30);
                $topPerc = bcdiv($ty * $fileMd["tdy"], $fileMd["y1"], 30);
Example #27
0
                      if($file!="." && $file!=".."){
                          $fidObj=$fileobj->getFidByPath($dir.'/'.$file);
                          $fid=$fidObj['fid'];
                          $groupNameID=$fileobj->getFileGroup($fid);
                          $groupName=$group->getGroupNameByGpid($groupNameID['group']);
                          echo "<li ref=\"$dir"."$file\" onclick=\"loadPDF(this)\"><span>$file</span></li>";
                      }
                  }
              }
              closedir($dh);
          }
      }*/
}
//开始运行
echo "<ul id='listview'>";
listDir($file, $allFile, $group, $allGroupName, "../source/b0a5e1f0-d63f-11e4-9a8c-00163e002b11");
echo "</ul>";
?>
<script type="text/javascript">
    function loadPDF(obj){
        var dir=$(obj).attr('ref');
        console.log(dir);
        var a = $("<a href='"+dir+"#viewer.action=download' target='_blank'>viewerjs</a>)").get(0);
        var e = document.createEvent('MouseEvents');
        e.initEvent('click', true, true);
        a.dispatchEvent(e);
    }

	$(document).ready(function(){ 
		$("#listview").attr("class","treeview-gray");
			$("#listview").treeview({
Example #28
0
/**
* 获取所有插件列表,未定义插件名称的插件将不予获取
* 插件目录:/plugins
* 仅识别 插件目录/插件/插件.php 目录结构的插件
* @param bool true为获取完整信息,false为获取标识符列表
* @return array 插件信息
*/
function getPlugins($full = true)
{
    $path = SYSTEM_ROOT . '/plugins/';
    $res = listDir($path);
    $r = array();
    foreach ($res as $x) {
        if (is_dir($path . $x) && file_exists($path . $x . '/' . $x . '.php')) {
            if ($full) {
                $r[] = getPluginInfo($x);
            } else {
                $r[] = $x;
            }
        }
    }
    return $r;
}
Example #29
0
<?php

require_once "../common/list.php";
$arr = listDir("../data/upload", 1, array());
echo json_encode($arr);
Example #30
0
             $message['stateservices'] .= " is NOT started\n\n";
         }
     }
     echo $message['stateservices'];
 } elseif ($msgId == "compilerversions") {
     echo "It may take a while ...";
     $phpCompiler = array();
     $apacheCompiler = array();
     $apacheVersion = array();
     $phpApacheDll = array();
     $phpErrorMsg = array();
     require_once 'config.inc.php';
     require_once 'wampserver.lib.php';
     $message['compilerversions'] = "Compiler Visual C++ versions used:\n\n";
     $apacheVersionList = listDir($c_apacheVersionDir, 'checkApacheConf');
     $phpVersionList = listDir($c_phpVersionDir, 'checkPhpConf');
     // Apache versions
     foreach ($apacheVersionList as $oneApache) {
         $oneApacheVersion = str_ireplace('apache', '', $oneApache);
         $pos = strrpos($oneApacheVersion, '.');
         $apacheVersion[] = substr($oneApacheVersion, 0, $pos);
         $command = 'start /b /wait ' . $c_apacheVersionDir . '/apache' . $oneApacheVersion . '/' . $wampConf['apacheExeDir'] . '/' . $wampConf['apacheExeFile'] . ' -v | find "built"';
         $output = exec($command, $result);
         $apacheCompiler[$oneApacheVersion] = $output;
         echo ".";
     }
     // PHP versions
     foreach ($phpVersionList as $onePhp) {
         $onePhpVersion = str_ireplace('php', '', $onePhp);
         $command = 'start /b /wait ' . $c_phpVersionDir . '/php' . $onePhpVersion . '/' . $wampConf['phpCliFile'] . ' -i | find "Compiler"';
         $output = exec($command, $result);