本文整理汇总了PHP中getdir函数的典型用法代码示例。如果您正苦于以下问题:PHP getdir函数的具体用法?PHP getdir怎么用?PHP getdir使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getdir函数的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getmovies
/** returns all movies and corresponding thumbs
* $from and $to specify start/end time
*
* $ret[$moviefilename]=array($thumbfilename1,$thumbfilename2....)
*/
function getmovies($stream, $from = 0, $to = 0, $maxthumbs = 0)
{
$thumbscount = 0;
$movies = getdir("streams/{$stream}");
//sorteer
rsort($movies);
foreach ($movies as $movie) {
if (is_file("{$movie}")) {
$timestamp = movie2timestamp($movie);
if ($from && $timestamp < $from) {
continue;
}
if ($to && $timestamp > $to) {
continue;
}
//get thumbs
$thumbs = getthumbs($movie);
if ($thumbs) {
$ret[$movie] = $thumbs;
$thumbscount += count($thumbs);
}
//kappen als we genoeg hebben
if ($maxthumbs && $thumbscount >= $maxthumbs) {
break;
}
}
}
return $ret;
}
开发者ID:switchUA,项目名称:stuff,代码行数:34,代码来源:streams.php
示例2: module_setup
function module_setup()
{
global $SMARTY, $DB, $USERPANEL, $layout, $LMS;
$layout['pagetitle'] = trans('Userpanel Configuration');
$SMARTY->assign('page_header', ConfigHelper::getConfig('userpanel.page_header', ''));
$SMARTY->assign('company_logo', ConfigHelper::getConfig('userpanel.company_logo', ''));
$SMARTY->assign('stylelist', getdir(USERPANEL_DIR . DIRECTORY_SEPARATOR . 'style', '^[a-z0-9]*$'));
$SMARTY->assign('style', ConfigHelper::getConfig('userpanel.style', 'default'));
$SMARTY->assign('hint', ConfigHelper::getConfig('userpanel.hint', 'modern'));
$SMARTY->assign('hide_nodes_modules', ConfigHelper::getConfig('userpanel.hide_nodes_modules', 0));
$SMARTY->assign('reminder_mail_sender', ConfigHelper::getConfig('userpanel.reminder_mail_sender', ''));
$SMARTY->assign('reminder_mail_subject', ConfigHelper::getConfig('userpanel.reminder_mail_subject', trans('credential reminder')));
$SMARTY->assign('reminder_mail_body', ConfigHelper::getConfig('userpanel.reminder_mail_body', "ID: %id\nPIN: %pin"));
$SMARTY->assign('reminder_sms_body', ConfigHelper::getConfig('userpanel.reminder_sms_body', "ID: %id, PIN: %pin"));
$SMARTY->assign('auth_type', ConfigHelper::getConfig('userpanel.auth_type', 1));
$SMARTY->assign('force_ssl', ConfigHelper::getConfig('userpanel.force_ssl', ConfigHelper::getConfig('phpui.force_ssl', 1)));
$enabled_modules = ConfigHelper::getConfig('userpanel.enabled_modules', null, true);
if (is_null($enabled_modules)) {
$enabled_modules = array();
if (!empty($USERPANEL->MODULES)) {
foreach ($USERPANEL->MODULES as $module) {
$enabled_modules[] = $module['module'];
}
}
$DB->Execute("INSERT INTO uiconfig (section, var, value) VALUES (?, ?, ?)", array('userpanel', 'enabled_modules', implode(',', $enabled_modules)));
} else {
$enabled_modules = explode(',', $enabled_modules);
}
$SMARTY->assign('enabled_modules', $enabled_modules);
$SMARTY->assign('total', sizeof($USERPANEL->MODULES));
$SMARTY->display('file:' . USERPANEL_DIR . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . 'setup.html');
}
开发者ID:prezeskk,项目名称:lms,代码行数:32,代码来源:setup_functions.php
示例3: GetDocumentTemplates
function GetDocumentTemplates($rights, $type = NULL)
{
$docengines = array();
if (!$type) {
$types = $rights;
} elseif (in_array($type, $rights)) {
$types = array($type);
} else {
return NULL;
}
if ($dirs = getdir(DOC_DIR . '/templates', '^[a-z0-9_-]+$')) {
foreach ($dirs as $dir) {
$infofile = DOC_DIR . '/templates/' . $dir . '/info.php';
if (file_exists($infofile)) {
unset($engine);
include $infofile;
if (isset($engine['type'])) {
if (!is_array($engine['type'])) {
$engine['type'] = array($engine['type']);
}
$intersect = array_intersect($engine['type'], $types);
if (!empty($intersect)) {
$docengines[$dir] = $engine;
}
} else {
$docengines[$dir] = $engine;
}
}
}
}
if (!empty($docengines)) {
ksort($docengines);
}
return $docengines;
}
开发者ID:oswida,项目名称:lms,代码行数:35,代码来源:document.inc.php
示例4: module_setup
function module_setup()
{
global $SMARTY, $DB, $USERPANEL, $layout, $LMS;
$layout['pagetitle'] = trans('Userpanel Configuration');
$SMARTY->assign('stylelist', getdir(USERPANEL_DIR . '/style', '^[a-z0-9]*$'));
$SMARTY->assign('style', isset($LMS->CONFIG['userpanel']['style']) ? $LMS->CONFIG['userpanel']['style'] : 'default');
$SMARTY->assign('hint', isset($LMS->CONFIG['userpanel']['hint']) ? $LMS->CONFIG['userpanel']['hint'] : 'modern');
$SMARTY->assign('hide_nodes_modules', isset($LMS->CONFIG['userpanel']['hide_nodes_modules']) ? $LMS->CONFIG['userpanel']['hide_nodes_modules'] : 0);
$SMARTY->assign('total', sizeof($USERPANEL->MODULES));
$SMARTY->display(USERPANEL_DIR . '/templates/setup.html');
}
开发者ID:repcio,项目名称:lms,代码行数:11,代码来源:setup_functions.php
示例5: __construct
/**
* Loads plugins
*
* @throws Exception Throws exception if plugin not found
*/
public function __construct()
{
$dirs = getdir(PLUGINS_DIR, '^[0-9a-zA-Z]+$');
if (empty($dirs)) {
return;
}
asort($dirs);
$plugins_config = ConfigHelper::getConfig('phpui.plugins');
$plugins_tuples = empty($plugins_config) ? array() : preg_split('/[;,\\s\\t\\n]+/', $plugins_config, -1, PREG_SPLIT_NO_EMPTY);
$plugin_priorities = array();
foreach ($plugins_tuples as $idx => $plugin_tuple) {
$plugin_props = explode(':', $plugin_tuple);
$plugin_priorities[$plugin_props[0]] = count($plugin_props) == 2 ? intval($plugin_props[1]) : SubjectInterface::LAST_PRIORITY;
$plugins_tuples[$idx] = $plugin_props[0];
}
foreach ($dirs as $plugin_name) {
if (class_exists($plugin_name)) {
$plugin_name::loadLocales();
$plugin_info = array('name' => $plugin_name, 'enabled' => false, 'new_style' => true, 'dbcurrschversion' => null, 'dbschversion' => defined($plugin_name . '::PLUGIN_DBVERSION') ? constant($plugin_name . '::PLUGIN_DBVERSION') : null, 'fullname' => defined($plugin_name . '::PLUGIN_NAME') ? trans(constant($plugin_name . '::PLUGIN_NAME')) : null, 'description' => defined($plugin_name . '::PLUGIN_DESCRIPTION') ? trans(constant($plugin_name . '::PLUGIN_DESCRIPTION')) : null, 'author' => defined($plugin_name . '::PLUGIN_AUTHOR') ? constant($plugin_name . '::PLUGIN_AUTHOR') : null);
if (array_key_exists($plugin_name, $plugin_priorities)) {
$plugin = new $plugin_name();
if (!$plugin instanceof LMSPlugin) {
throw new Exception("Plugin object must be instance of LMSPlugin class");
}
$plugin_info = array_merge($plugin_info, array('enabled' => true, 'priority' => $plugin_priorities[$plugin_name], 'dbcurrschversion' => $plugin->getDbSchemaVersion()));
$this->registerObserver($plugin, $plugin_info['priority']);
}
$this->new_style_plugins[$plugin_name] = $plugin_info;
} else {
writesyslog("Unknown plugin {$plugin_name} at position {$position}", LOG_ERR);
continue;
}
}
$files = getdir(LIB_DIR . DIRECTORY_SEPARATOR . 'plugins', '^[0-9a-zA-Z_\\-]+\\.php$');
if (empty($files)) {
return;
}
asort($files);
$old_plugins = array_diff($plugins_tuples, array_keys($this->new_style_plugins));
foreach ($files as $plugin_name) {
if (!is_readable(LIB_DIR . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . $plugin_name)) {
continue;
}
$plugin_name = str_replace('.php', '', $plugin_name);
$plugin_info = array('name' => $plugin_name, 'enabled' => false, 'new_style' => false);
if (array_key_exists($plugin_name, $plugin_priorities)) {
$plugin_info['enabled'] = true;
}
$this->old_style_plugins[$plugin_name] = $plugin_info;
}
}
开发者ID:itav,项目名称:lms,代码行数:56,代码来源:LMSPluginManager.php
示例6: module_setup
function module_setup()
{
global $SMARTY, $DB, $USERPANEL, $layout, $LMS;
$layout['pagetitle'] = trans('Userpanel Configuration');
$SMARTY->assign('stylelist', getdir(USERPANEL_DIR . '/style', '^[a-z0-9]*$'));
$SMARTY->assign('style', ConfigHelper::getConfig('userpanel.style', 'default'));
$SMARTY->assign('hint', ConfigHelper::getConfig('userpanel.hint', 'modern'));
$SMARTY->assign('hide_nodes_modules', ConfigHelper::getConfig('userpanel.hide_nodes_modules', 0));
$SMARTY->assign('reminder_mail_sender', ConfigHelper::getConfig('userpanel.reminder_mail_sender', ''));
$SMARTY->assign('reminder_mail_subject', ConfigHelper::getConfig('userpanel.reminder_mail_subject', trans('credential reminder')));
$SMARTY->assign('reminder_mail_body', ConfigHelper::getConfig('userpanel.reminder_mail_body', "ID: %id\nPIN: %pin"));
$SMARTY->assign('reminder_sms_body', ConfigHelper::getConfig('userpanel.reminder_sms_body', "ID: %id, PIN: %pin"));
$SMARTY->assign('total', sizeof($USERPANEL->MODULES));
$SMARTY->display(USERPANEL_DIR . '/templates/setup.html');
}
开发者ID:oswida,项目名称:lms,代码行数:15,代码来源:setup_functions.php
示例7: getmovies
/** returns all movies and corresponding thumbs
* $from and $to specify start/end time
*
* $ret[$moviefilename]=array($thumbfilename1,$thumbfilename2....)
*/
function getmovies($stream, $from = 0, $to = 0)
{
$movies = getdir("streams/{$stream}");
foreach ($movies as $movie) {
if (is_file("{$movie}")) {
$timestamp = movie2timestamp($movie);
if ($from && $timestamp < $from) {
continue;
}
if ($to && $timestamp > $to) {
continue;
}
//get thumbs
$thumbs = getdir("{$movie}.thumbs");
asort($thumbs);
$thumbs = array_reverse($thumbs);
$ret[$movie] = $thumbs;
}
}
//sorteer
ksort($ret);
return array_reverse($ret);
}
开发者ID:switchUA,项目名称:stuff,代码行数:28,代码来源:streams2.php
示例8: while
if ($handle = @opendir($pwd)) {
while (($file = readdir($handle)) !== FALSE) {
if (preg_match('/' . $pattern . '/', $file)) {
$files[] = $file;
}
}
closedir($handle);
}
return $files;
}
if ($dbversion = $DB->GetOne('SELECT keyvalue FROM dbinfo WHERE keytype = ?', array('dbversion'))) {
if (DBVERSION > $dbversion) {
set_time_limit(0);
$lastupgrade = $dbversion;
$_dbtype = $CONFIG['database']['type'] == 'mysqli' ? 'mysql' : $CONFIG['database']['type'];
$upgradelist = getdir(LIB_DIR . '/upgradedb/', '^' . $_dbtype . '.[0-9]{10}.php$');
if (sizeof($upgradelist)) {
foreach ($upgradelist as $upgrade) {
$upgradeversion = preg_replace('/^' . $_dbtype . '\\.([0-9]{10})\\.php$/', '\\1', $upgrade);
if ($upgradeversion > $dbversion && $upgradeversion <= DBVERSION) {
$pendingupgrades[] = $upgradeversion;
}
}
}
if (sizeof($pendingupgrades)) {
sort($pendingupgrades);
foreach ($pendingupgrades as $upgrade) {
include LIB_DIR . '/upgradedb/' . $_dbtype . '.' . $upgrade . '.php';
if (!sizeof($DB->errors)) {
$lastupgrade = $upgrade;
} else {
开发者ID:repcio,项目名称:lms,代码行数:31,代码来源:upgradedb.php
示例9: getdir
function getdir($directory, $config)
{
if ($dir = opendir($directory)) {
while ($file = readdir($dir)) {
if ($file != "." && $file != ".." && $file[0] != '.' && $file != "help") {
if (GetServerLanguageFile($config) == $file) {
echo "<option value='" . $file . "' SELECTED>" . $file . "</option>";
} else {
echo "<option value='" . $file . "'>" . $file . "</option>";
}
}
}
closedir($dir);
}
}
getdir('../includes/languages', $config);
?>
</select>
</td>
</tr>
<tr>
<td class='row2' colspan='2'><input type='submit' value='<?php
echo GetStringFromStringTable("IDS_ADMIN_LANGUAGE_BTN_INSTALL", $config);
?>
' name='cmdChange' class='mainoption'></td>
</tr>
</table>
</form>
开发者ID:robertohernando,项目名称:phpchess,代码行数:30,代码来源:cell_admin_cfg_language.php
示例10: array
if (!$rights) {
$SMARTY->display('noaccess.html');
die;
}
if (!isset($document['numberplanid'])) {
$document['numberplanid'] = $DB->GetOne('SELECT id FROM numberplans WHERE doctype<0 AND isdefault=1 LIMIT 1');
}
$numberplans = array();
if ($templist = $LMS->GetNumberPlans()) {
foreach ($templist as $item) {
if ($item['doctype'] < 0) {
$numberplans[] = $item;
}
}
}
if ($dirs = getdir(DOC_DIR . '/templates', '^[a-z0-9_-]+$')) {
foreach ($dirs as $dir) {
$infofile = DOC_DIR . '/templates/' . $dir . '/info.php';
if (file_exists($infofile)) {
unset($engine);
include $infofile;
$docengines[] = $engine;
}
}
}
if ($docengines) {
asort($docengines);
}
$SMARTY->assign('networks', $LMS->GetNetworks());
$SMARTY->assign('customergroups', $LMS->CustomergroupGetAll());
$SMARTY->assign('error', $error);
开发者ID:repcio,项目名称:lms,代码行数:31,代码来源:documentgen.php
示例11: getdir
function getdir($dir, $dirsOnly = false, $recurse = array())
{
if (!$dir) {
$dir = DSEP;
}
$entries = getDirEntries($dir, $dirsOnly);
if (!count($entries)) {
return array();
}
$dirents = array();
foreach ($entries as $path => $type) {
if ($type == 'folder' && count($recurse) && strcasecmp($recurse[0], vbox_basename($path)) == 0) {
$entry = folder_entry($path, false, true);
$entry['children'] = getdir($dir . DSEP . array_shift($recurse), $dirsOnly, $recurse);
array_push($dirents, $entry);
} else {
// Push folder on to stack
if ($type == 'folder') {
array_push($dirents, folder_entry($path));
// Push file on to stack
} else {
$ext = strtolower(preg_replace('/^.*\\./', '', $file));
if (count($allowed) && !$allowed['.' . $ext]) {
continue;
}
array_push($dirents, file_entry($path));
}
}
}
return $dirents;
}
开发者ID:ngpitt,项目名称:phpvirtualbox,代码行数:31,代码来源:jqueryFileTree.php
示例12: getdir
function getdir($repertoire, $famille, $id)
{
$famille .= $id . "-";
$tab_dir['famille'] = $famille;
$tab_dir['nom_repertoire'] = $repertoire;
$tab_dir['liste_repertoires'] = array();
$tab_dir['liste_fichiers'] = array();
$id = 1;
$current_dir = opendir($repertoire);
while ($entryname = readdir($current_dir)) {
if (is_dir("{$repertoire}/{$entryname}") and ($entryname != "." and $entryname != "..")) {
$tab_dir['liste_repertoires'][] = getdir("{$repertoire}/{$entryname}", $famille, $id);
$id++;
} elseif ($entryname != "." and $entryname != "..") {
$extension = substr(strrchr($entryname, "."), 1);
$ext = "";
if (file_exists('../img/' . $extension . '.ico')) {
$ext = "ico";
}
if (file_exists('../img/' . $extension . '.gif')) {
$ext = "gif";
}
if ($ext == "") {
$extension = "default";
$ext = "gif";
}
$fichier['nom_fichier'] = $entryname;
$fichier['type_fichier'] = $extension . "." . $ext;
$fichier['taille_fichier'] = file_size($repertoire . "/" . $entryname);
$fichier['date_fichier'] = gmdate("d/m/Y H:i:s", filemtime($repertoire . "/" . $entryname));
$tab_dir['liste_fichiers'][] = $fichier;
}
}
closedir($current_dir);
return $tab_dir;
}
开发者ID:xVirusproj3ct,项目名称:site_web_phf,代码行数:36,代码来源:lib.inc.php
示例13: UpgradeDb
public function UpgradeDb($dbver = DBVERSION, $pluginclass = null, $libdir = null, $docdir = null)
{
$lastupgrade = null;
if ($this->GetOne('SELECT keyvalue FROM dbinfo WHERE keytype = ?', array('dbversion' . (is_null($pluginclass) ? '' : '_' . $pluginclass)))) {
if ($dbver > $dbversion) {
set_time_limit(0);
$lastupgrade = $dbversion;
if (is_null($libdir)) {
$libdir = LIB_DIR;
}
$pendingupgrades = array();
$upgradelist = getdir($libdir . DIRECTORY_SEPARATOR . 'upgradedb' . DIRECTORY_SEPARATOR . $this->_dbtype . '\\.[0-9]{10}\\.php$');
if (!empty($upgradelist)) {
foreach ($upgradelist as $upgrade) {
$upgradeversion = preg_replace('/^' . $this->_dbtype . '\\.([0-9]{10})\\.php$/', '\\1', $upgrade);
if ($upgradeversion > $dbversion && $upgradeversion <= $dbver) {
$pendingupgrades[] = $upgradeversion;
}
}
}
if (!empty($pendingupgrades)) {
sort($pendingupgrades);
foreach ($pendingupgrades as $upgrade) {
include $libdir . DIRECTORY_SEPARATOR . 'upgradedb' . DIRECTORY_SEPARATOR . $this->_dbtype . '.' . $upgrade . '.php';
if (!empty($this->errors)) {
$lastupgrade = $upgrade;
} else {
break;
}
}
}
}
} else {
// save current errors
$err_tmp = $this->errors;
$this->errors = array();
if (is_null($pluginclass)) {
// check if dbinfo table exists (call by name)
$dbinfo = $this->GetOne('SELECT COUNT(*) FROM information_schema.tables WHERE table_name = ?', array('dbinfo'));
// check if any tables exists in this database
$tables = $this->GetOne('SELECT COUNT(*) FROM information_schema.tables WHERE table_schema NOT IN (?, ?)', array('information_schema', 'pg_catalog'));
} else {
$dbinfo = $this->GetOne('SELECT keyvalue FROM dbinfo WHERE keytype = ?', array('dbinfo_' . $pluginclass));
$tables = 0;
}
// if there are no tables we can install lms database
if ($dbinfo == 0 && $tables == 0 && empty($this->errors)) {
// detect database type and select schema dump file to load
$schema = '';
if ($this->_dbtype == LMSDB::POSTGRESQL) {
$schema = 'lms.pgsql';
} elseif ($this->_dbtype == LMSDB::MYSQL || $this->_dbtype == LMSDB::MYSQLI) {
$schema = 'lms.mysql';
} else {
die('Could not determine database type!');
}
if (is_null($docdir)) {
$docdir = SYS_DIR . DIRECTORY_SEPARATOR . 'doc';
}
if (!($sql = file_get_contents($docdir . DIRECTORY_SEPARATOR . $schema))) {
die('Could not open database schema file ' . $docdir . DIRECTORY_SEPARATOR . $schema);
}
if (!$this->MultiExecute($sql)) {
// execute
die('Could not load database schema!');
}
} else {
// database might be installed so don't miss any error
$this->errors = array_merge($err_tmp, $this->errors);
}
}
return isset($lastupgrade) ? $lastupgrade : $dbver;
}
开发者ID:askipl,项目名称:lms,代码行数:73,代码来源:LMSDB_common.class.php
示例14: while
if ($dir = opendir($directory)) {
while ($file = readdir($dir)) {
if ($file != "." && $file != ".." && $file[0] != '.' && $file != "0mobileimages") {
if (is_dir($directory . "/" . $file)) {
if ($SkinName == $file) {
echo "<option value='" . $file . "' selected>" . $file . "</option>";
} else {
echo "<option value='" . $file . "'>" . $file . "</option>";
}
}
}
}
closedir($dir);
}
}
getdir('../skins', $SkinName);
?>
</select>
</td>
</tr>
<tr>
<td class='row2' colspan='2'><input type='submit' value='<?php
echo GetStringFromStringTable("IDS_ADMIN_SKINS_BTN_1", $config);
?>
' name='cmdChange' class='mainoption'></td>
</tr>
</table>
</form>
开发者ID:robertohernando,项目名称:phpchess,代码行数:30,代码来源:cell_admin_cfg_skins.php
示例15: deldir
function deldir()
{
global $dd, $tm;
$fullpath = $tm . "/" . $dd;
echo "<TABLE CELLPADDING=0 CELLSPACING=0 bgcolor=#0066CC BORDER=1 width=300 align=center bordercolor=#808080 bordercolorlight=black bordercolordark=white><tr><td><center><font color='#FFFFCC' face='Tahoma' size = 2>Директория удалена.</font></center></td></tr></table>";
rmdir($fullpath);
chdir($tm);
getdir();
readdirdata($tm);
}
开发者ID:Theov,项目名称:webshells,代码行数:10,代码来源:NFM+1.8.php
示例16: grade
function grade($query)
{
global $compiledir, $datadir;
$i = $query['grade'];
$memorylimit = $query['memorylimit'] * 1024;
getdir($query);
createlink($i, $query);
$data = dataset($query['pname'], $i);
$tmp['noindata'] = $tmp['noansdata'] = 0;
$tmp['input'] = file_get_contents($data['input']);
$tmp['timeout'] = false;
$tmp['runerr'] = false;
$tmp['noreport'] = false;
if ($query['language'] == 3) {
$cpcmd = "mv output/{$query['pname']}{$i}.out {$query['pname']}.out";
//if(file_exists("{$query['pname']}.out"))
// exec("rm {$query['pname']}.out");
exec($cpcmd);
exec("ls output/{$query['pname']}*.out > tmpp");
} else {
$execute = "(ulimit -v {$memorylimit}; ./{$query['pname']})";
$descriptorspec = array(0 => array("pipe", "r"), 1 => array("pipe", "w"), 2 => array("pipe", "w"));
$process = proc_open($execute, $descriptorspec, $pipes);
$status = proc_get_status($process);
$pid = $status['pid'] + 2;
exec("ps v -C {$query['pname']}", $mem);
sscanf($mem[1], "%ld%s%s%s%s%ld%ld", &$ar[1], &$ar[2], &$ar[3], &$ar[4], &$ar[5], &$ar[6], &$ar[7]);
fwrite($pipes[0], "1");
fclose($pipes[0]);
$tmp['memory'] = $memory = $ar[7];
$time_start = getmicrotime();
setrunning(1);
for (;;) {
$status = proc_get_status($process);
if (!$status['running']) {
break;
}
$time_now = getmicrotime();
$tmp['rtime'] = ($time_now - $time_start) * 950;
if ($tmp['rtime'] > $query['timelimit']) {
proc_terminate($process);
//posix_kill($pid,1);
exec("killall {$query['pname']}");
$tmp['timeout'] = true;
break;
}
}
setrunning(-1);
$tmp['exitcode'] = $status['exitcode'];
if ($tmp['exitcode'] == 137) {
$tmp['memoryout'] = true;
}
if ($tmp['exitcode'] != 0) {
$tmp['runerr'] = true;
}
}
if (!file_exists("{$query['pname']}.out")) {
$tmp['noreport'] = true;
} else {
$inn = $data['input'];
$ansn = $data['answer'];
$outn = "{$query['pname']}.out";
if ($query['plugin'] == 0 || $query['plugin'] == 3) {
$tmp['score'] = plugin($query['pname'], $inn, $outn, $ansn);
} else {
$fin = fopen($inn, "r");
$fans = fopen($ansn, "r");
$fout = fopen($outn, "r");
$tmp['score'] = standard_compare($fans, $fout);
fclose($fin);
fclose($fout);
fclose($fans);
}
}
if (!file_exists($data['input'])) {
$tmp['noindata'] = 1;
}
if (!file_exists($data['answer'])) {
$tmp['noansdata'] = 1;
}
if ($tmp['timeout'] == true || $tmp['runerr'] == true || $tmp['noindata'] + $tmp['noansdata']) {
$tmp['score'] = 0;
}
if ($tmp['score'] < 1.0) {
$fians = $data['answer'];
$fiout = "{$query['pname']}.out";
$fistr = "diff -b -U0 {$fiout} {$fians}";
exec($fistr . " > tmp", $diff);
$tmp['diff'] = file_get_contents("tmp");
}
proc_close($process);
destroylink($i, $query);
if (file_exists("{$query['pname']}.out")) {
rename("{$query['pname']}.out", "{$query['pname']}{$i}.out");
}
echo array_encode($tmp);
}
开发者ID:Zhi2014,项目名称:cogs,代码行数:97,代码来源:grade.php
示例17: foreach
<html lang="en_US">
<head>
<meta charset="utf-8">
<link href="/img/favicon.png" rel="shortcut icon">
<title>NovuForum</title>
<!-- GLOBAL CSS -->
<link href="/css/global.css" rel="stylesheet">
<?php
if ($URL_SPLIT[0] == "admin") {
?>
<link href="/css/bootstrap.css" rel="stylesheet">
<?php
}
if (isset($theme)) {
if (dir_exists("themes/{$theme}/") && dir_exists("themes/{$theme}/css/")) {
foreach (getdir("themes/{$theme}/css/") as $value) {
?>
<link rel="stylesheet" type="text/css" href="/themes/<?php
echo $theme;
?>
/css/<?php
echo $value;
?>
">
<?php
}
}
}
?>
<!-- <?php
echo $PAGE;
开发者ID:NovuForum,项目名称:NovuForum,代码行数:31,代码来源:index.php
示例18: Fichiers_Consulter
function Fichiers_Consulter($data_in = array())
{
Lib_myLog("action: " . $data_in['action']);
foreach ($GLOBALS['tab_globals'] as $global) {
global ${$global};
}
Lib_myLog("IN: ", $data_in);
Lib_myLog("FILE: ", __FILE__);
$continue = true;
$racinedusite = $GLOBALS['racinedusite'];
//root directory, set to "." for same or ".." for a lower level
$data_out['racinedusite'] = $racinedusite;
if (!is_dir($racinedusite)) {
/*=============s*/
Lib_myLog("Erreur d'ouverture du repertoire");
$data_out['message_ko'] = $MSG[$lang]['%%Action_ErreurRepertoire%%'];
$continue = false;
}
if ($continue) {
/*=============s*/
Lib_myLog("Nettoyage des fichiers temporaires");
$current_dir = opendir("temp/");
while ($entryname = readdir($current_dir)) {
// Check dates, files older than 20 minutes are thrown away
if (!is_dir("temp/{$entryname}") and ($entryname != "." and $entryname != "..") and filectime("temp/{$entryname}") < time() - 1200) {
unlink("temp/{$entryname}");
}
}
closedir($current_dir);
/*=============s*/
Lib_myLog("Recuperation de l'arborescence");
$data_out['liste_repertoires'] = getdir($racinedusite, '', 1);
clearstatcache();
}
$data_out['action'] = "Fichiers_Consulter";
$data_out['page'] = 'Fichiers_Consulter.php';
}
开发者ID:xVirusproj3ct,项目名称:site_web_phf,代码行数:37,代码来源:actions_systeme.php
注:本文中的getdir函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论