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

PHP getDirectory函数代码示例

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

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



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

示例1: getDirectory

function getDirectory($path = '.', $ignore = '', $regexp_ignore = array())
{
    //echo $path."\n";
    $dirTree = array();
    $dirTreeTemp = array();
    $ignore[] = '.';
    $ignore[] = '..';
    $dh = @opendir($path);
    while (false !== ($file = readdir($dh))) {
        if (!in_array($file, $ignore)) {
            if (!is_dir("{$path}/{$file}")) {
                $reIgnore = 0;
                //for($i=0;$i<count($regexp_ignore);$i++){
                if (preg_match($regexp_ignore[0], $file)) {
                    $reIgnore = 1;
                    //print "$regexp_ignore[0],$path ,$file - ".(string)preg_match($regexp_ignore[0], $file)."\n";
                }
                //}
                if ($reIgnore == 0) {
                    $dirTree["{$path}"][] = $file;
                }
            } else {
                $dirTreeTemp = getDirectory("{$path}/{$file}", $ignore, $regexp_ignore);
                if (is_array($dirTreeTemp)) {
                    $dirTree = array_merge($dirTree, $dirTreeTemp);
                }
            }
        }
    }
    closedir($dh);
    return $dirTree;
}
开发者ID:mamogmx,项目名称:praticaweb-alghero,代码行数:32,代码来源:import.stampe_concessioni.php


示例2: getDirectory

function getDirectory($path = '.', $level = 0)
{
    $ignore = array('cgi-bin', '.', '..');
    // Directories to ignore when listing output. Many hosts
    // will deny PHP access to the cgi-bin.
    $dh = @opendir($path);
    // Open the directory to the handle $dh
    while (false !== ($file = readdir($dh))) {
        // Loop through the directory
        if (!in_array($file, $ignore)) {
            // Check that this file is not to be ignored
            if (is_dir("{$path}/{$file}")) {
                // Its a directory, so we need to keep reading down...
                getDirectory("{$path}/{$file}", $level + 1);
                // Re-call this same function but on a new directory.
                // this is what makes function recursive.
            } else {
                $tpath = $path;
                $tpath .= '/' . $file;
                print '<option data-img-src="' . $tpath . '" value="' . $tpath . '">' . $file . '</option>';
            }
        }
    }
    closedir($dh);
    // Close the directory handle
}
开发者ID:xJMV,项目名称:PrepInventory,代码行数:26,代码来源:management_categories_add.php


示例3: DeleteHTMLReports

 static function DeleteHTMLReports()
 {
     global $CONFIG;
     if (!empty($CONFIG["gl_st_ders"]) && is_numeric($CONFIG["gl_st_derd"])) {
         foreach (array(STATISTIC_PERIOD_TYPE_MONTH, STATISTIC_PERIOD_TYPE_YEAR, STATISTIC_PERIOD_TYPE_DAY) as $type) {
             $files = getDirectory(PATH_STATS . $type, "");
             foreach ($files as $file) {
                 $mtime = @filemtime(PATH_STATS . $type . "/" . $file);
                 if (!empty($mtime) && $mtime < time() - 86400 * $CONFIG["gl_st_derd"]) {
                     @unlink(PATH_STATS . $type . "/" . $file);
                 }
             }
         }
         $tables = array(DATABASE_STATS_AGGS_GOALS, DATABASE_STATS_AGGS_PAGES_ENTRANCE, DATABASE_STATS_AGGS_PAGES_EXIT, DATABASE_STATS_AGGS_CRAWLERS, DATABASE_STATS_AGGS_DOMAINS, DATABASE_STATS_AGGS_BROWSERS, DATABASE_STATS_AGGS_RESOLUTIONS, DATABASE_STATS_AGGS_COUNTRIES, DATABASE_STATS_AGGS_VISITS, DATABASE_STATS_AGGS_SYSTEMS, DATABASE_STATS_AGGS_LANGUAGES, DATABASE_STATS_AGGS_CITIES, DATABASE_STATS_AGGS_REGIONS, DATABASE_STATS_AGGS_ISPS, DATABASE_STATS_AGGS_QUERIES, DATABASE_STATS_AGGS_PAGES, DATABASE_STATS_AGGS_REFERRERS, DATABASE_STATS_AGGS_AVAILABILITIES, DATABASE_STATS_AGGS_DURATIONS, DATABASE_STATS_AGGS_CHATS, DATABASE_STATS_AGGS_SEARCH_ENGINES, DATABASE_STATS_AGGS_VISITORS);
         $result = queryDB(true, "SELECT * FROM `" . DB_PREFIX . DATABASE_STATS_AGGS . "` WHERE `year`<" . date("Y") . " AND `aggregated`=1 AND `time`<" . (time() - 86400 * $CONFIG["gl_st_derd"]) . " LIMIT 1;");
         if ($result) {
             if ($row = mysql_fetch_array($result, MYSQL_BOTH)) {
                 foreach ($tables as $table) {
                     queryDB(true, "DELETE FROM `" . DB_PREFIX . $table . "` WHERE `year`<" . date("Y") . " AND day=" . $row["day"] . " AND month=" . $row["month"] . " AND year=" . $row["year"]);
                 }
                 queryDB(true, "DELETE FROM `" . DB_PREFIX . DATABASE_STATS_AGGS . "` WHERE `year`<" . date("Y") . " AND `aggregated`=1 AND day=" . $row["day"] . " AND month=" . $row["month"] . " AND year=" . $row["year"] . " LIMIT 1;");
             }
         }
     }
 }
开发者ID:beardon,项目名称:stillwaterlife-web,代码行数:25,代码来源:objects.stats.inc.php


示例4: getDirectory

function getDirectory($path = '.', $level = 0)
{
    $ignore = array('cgi-bin', '.', '..');
    // Directories to ignore when listing output. Many hosts
    // will deny PHP access to the cgi-bin.
    $dh = @opendir($path);
    // Open the directory to the handle $dh
    while (false !== ($file = readdir($dh))) {
        // Loop through the directory
        if (!in_array($file, $ignore)) {
            // Check that this file is not to be ignored
            str_repeat(' ', $level * 4);
            // Just to add spacing to the list, to better
            // show the directory tree.
            if (is_dir("{$path}/{$file}")) {
                // Its a directory, so we need to keep reading down...
                echo "{$path}/{$file};";
                getDirectory("{$path}/{$file}", $level + 1);
                // Re-call this same function but on a new directory.
                // this is what makes function recursive.
            } else {
                echo "{$path}/{$file};";
                // Just print out the filename
            }
        }
    }
    closedir($dh);
    // Close the directory handle
}
开发者ID:rogermelich,项目名称:consultesLdap,代码行数:29,代码来源:uploadPhotos.php


示例5: runTestAutoLoader

function runTestAutoLoader($autoLoader = null)
{
    $directory = getDirectory();
    $mwVendorPath = $directory . '/../../vendor/autoload.php';
    $localVendorPath = $directory . '/../vendor/autoload.php';
    if (is_readable($localVendorPath)) {
        $autoLoader = registerAutoloaderPath('local', $localVendorPath);
    } elseif (is_readable($mwVendorPath)) {
        $autoLoader = registerAutoloaderPath('MediaWiki', $mwVendorPath);
    }
    if (!$autoLoader instanceof \Composer\Autoload\ClassLoader) {
        return false;
    }
    return true;
}
开发者ID:paladox,项目名称:mediawiki-skins-chameleon,代码行数:15,代码来源:bootstrap.php


示例6: getDirectory

function getDirectory($path = '.', $level = 0)
{
    $ignore = array('cgi-bin', '.', '..');
    // Directories to ignore when listing output. Many hosts
    // will deny PHP access to the cgi-bin.
    $dh = @opendir($path);
    // Open the directory to the handle $dh
    while (false !== ($file = readdir($dh))) {
        // Loop through the directory
        if (!in_array($file, $ignore)) {
            // Check that this file is not to be ignored
            $spaces = str_repeat('&nbsp;', $level * 4);
            // Just to add spacing to the list, to better
            // show the directory tree.
            if (is_dir("{$path}/{$file}")) {
                // Its a directory, so we need to keep reading down...
                echo "<hr>";
                echo " Gallery Name:<strong>{$spaces} {$file}</strong><br />";
                echo "<hr>";
                getDirectory("{$path}/{$file}", $level + 1);
                // Re-call this same function but on a new directory.
                // this is what makes function recursive.
            } else {
                $filetype = filetype("{$path}/{$file}");
                $filesize = filesize("{$path}/{$file}");
                /* echo "$spaces $file<br />"; 
                                 echo "$spaces $filetype<br />"; 
                                  echo "$spaces $filesize<br />"; 
                
                                  echo"<br>";
                                  echo"<br>"*/
                $ext = pathinfo($file, PATHINFO_EXTENSION);
                echo "{$file}<br />Type: {$ext}<br />Size: {$filesize} kb<br />";
                echo "<br>";
                // Just print out the filename
                //echo  filetype("$path/$file");
                //echo filesize("$path/$file");
            }
        }
    }
    closedir($dh);
    // Close the directory handle
}
开发者ID:ahmedfawad,项目名称:lab5,代码行数:43,代码来源:start.php


示例7: getDirectory

function getDirectory($path = '.')
{
    echo '<ul>';
    $ignore = array('.svn', '.', '..', 'support', 'gc_tc.html');
    $dh = @opendir($path);
    while (false !== ($file = readdir($dh))) {
        if (!in_array($file, $ignore)) {
            if (is_dir("{$path}/{$file}")) {
                echo "<li><button>" . htmlspecialchars($file) . "</button>";
                getDirectory("{$path}/{$file}");
            } else {
                if (preg_match('/\\.html?$/', $file) && !preg_match("/^\\d\\d\\d-/", $file)) {
                    echo "<li><a href=\"" . htmlspecialchars("{$path}/{$file}") . "\">" . htmlspecialchars($file) . "</a> <samp></samp>";
                }
            }
        }
    }
    closedir($dh);
    echo '</ul>';
}
开发者ID:rafikaa,项目名称:presto-testo,代码行数:20,代码来源:runner.php


示例8: getDirectory

function getDirectory($path = '.')
{
    echo '<ul>';
    $ignore = array('non-automated', 'Watir', 'support', 'invalid', 'bugs', 'reftest');
    $files = @scandir($path);
    if ($files) {
        natcasesort($files);
        foreach ($files as $file) {
            if ($file[0] !== '.' && !in_array($file, $ignore)) {
                if (is_dir("{$path}/{$file}")) {
                    echo "<li><button>" . htmlspecialchars($file) . "</button>";
                    getDirectory("{$path}/{$file}");
                } else {
                    if (preg_match('/\\.html?$/', $file) && !preg_match("/^\\d\\d\\d-/", $file)) {
                        echo "<li><a href=\"" . htmlspecialchars("{$path}/{$file}") . "\">" . htmlspecialchars($file) . "</a> <samp></samp>";
                    }
                }
            }
        }
    }
    echo '</ul>';
}
开发者ID:rafikaa,项目名称:presto-testo,代码行数:22,代码来源:runner.php


示例9: getConfig

function getConfig()
{
    global $CONFIG;
    loadConfig();
    $skeys = array("gl_db_host", "gl_db_user", "gl_db_pass", "gl_db_name");
    $xml = "<gl_c h=\"" . base64_encode(substr(md5file(FILE_CONFIG), 0, 5)) . "\">\r\n";
    foreach ($CONFIG as $key => $val) {
        if (is_array($val)) {
            $xml .= "<conf key=\"" . base64_encode($key) . "\">\r\n";
            foreach ($val as $skey => $sval) {
                $xml .= "<sub key=\"" . base64_encode($skey) . "\">" . base64_encode($sval) . "</sub>\r\n";
            }
            $xml .= "</conf>\r\n";
        } else {
            if (!in_array($key, $skeys) || SERVERSETUP) {
                $xml .= "<conf value=\"" . base64_encode($val) . "\" key=\"" . base64_encode($key) . "\" />\r\n";
            } else {
                $xml .= "<conf value=\"" . base64_encode("") . "\" key=\"" . base64_encode($key) . "\" />\r\n";
            }
        }
    }
    if (SERVERSETUP) {
        $xml .= "<translations>\r\n";
        $files = getDirectory("./_language", "index", true);
        foreach ($files as $translation) {
            $lang = str_replace(".php", "", str_replace("lang", "", $translation));
            $xml .= "<language key=\"" . base64_encode($lang) . "\" />\r\n";
        }
        $xml .= "</translations>\r\n";
        if (@file_exists(FILE_CARRIERLOGO)) {
            $xml .= "<carrier_logo content=\"" . fileToBase64(FILE_CARRIERLOGO) . "\" />\r\n";
        }
        if (@file_exists(FILE_CARRIERHEADER)) {
            $xml .= "<carrier_header content=\"" . fileToBase64(FILE_CARRIERHEADER) . "\" />\r\n";
        }
        if (@file_exists(FILE_INVITATIONLOGO)) {
            $xml .= "<invitation_logo content=\"" . fileToBase64(FILE_INVITATIONLOGO) . "\" />\r\n";
        }
    }
    $xml .= "<php_cfg_vars post_max_size=\"" . base64_encode(cfgFileSizeToBytes(!isnull(@get_cfg_var("post_max_size")) ? get_cfg_var("post_max_size") : MAX_POST_SIZE_SAFE_MODE)) . "\" upload_max_filesize=\"" . base64_encode(cfgFileSizeToBytes(!isnull(@get_cfg_var("upload_max_filesize")) ? get_cfg_var("upload_max_filesize") : MAX_UPLOAD_SIZE_SAFE_MODE)) . "\" />\r\n";
    $xml .= "</gl_c>\r\n";
    return $xml;
}
开发者ID:beardon,项目名称:stillwaterlife-web,代码行数:43,代码来源:functions.internal.inc.php


示例10: buildTracking

function buildTracking()
{
    global $VISITOR, $CONFIG, $DATASETS;
    $VISITOR = array();
    $outdatedVisitors = array();
    $itarray = array_keys($DATASETS);
    foreach ($itarray as $file) {
        $dataset = $DATASETS[$file];
        if (strpos($file, PATH_DATA_EXTERNAL) !== false && substr($file, 0, strlen(PATH_DATA_EXTERNAL)) == PATH_DATA_EXTERNAL) {
            $userid = substr(str_replace(PATH_DATA_EXTERNAL, "", $file), 0, USER_ID_LENGTH);
            $browsers = getDirectory(PATH_DATA_EXTERNAL . $userid . "/b/", ".");
            if (count($browsers) > 0) {
                foreach ($browsers as $browserid) {
                    $browser = new ExternalBrowser($browserid, $userid);
                    $chat = new ExternalChat($userid, $browserid);
                    if (!isset($VISITOR[$userid])) {
                        $VISITOR[$userid] = new UserExternal($userid);
                    }
                    if (($bStime = getDataSetTime($browser->SessionFile)) != -1) {
                        if ($bStime < time() - $CONFIG["timeout_track"]) {
                            $browser->Destroy();
                            continue;
                        }
                        $VISITOR[$userid]->Browsers[$browserid] = $browser;
                    } else {
                        if (($cStime = getDataSetTime($chat->SessionFile)) != -1) {
                            $chat->Load();
                            if ($cStime < time() - $CONFIG["timeout_clients"]) {
                                $chat->Destroy();
                                continue;
                            }
                            if (isnull($chat->FirstActive)) {
                                $chat->FirstActive = time();
                            }
                            $chat->History[0] = array($chat->FirstActive, LIVEZILLA_URL . FILE_CHAT, $chat->Code, true);
                            $VISITOR[$userid]->Browsers[$browserid] = $chat;
                        } else {
                            $browser->Destroy();
                            $chat->Destroy();
                        }
                    }
                }
            } else {
                $outdatedVisitors[] = $userid;
            }
        }
    }
    foreach ($outdatedVisitors as $folder) {
        deleteDirectory(PATH_DATA_EXTERNAL . $folder);
    }
}
开发者ID:afzet,项目名称:cake-cart,代码行数:51,代码来源:functions.global.inc.php


示例11: getFile

/**
 *		getFile
 *
 *			Returns the information for the file specified by parameter fullPath.
 *			If the designated file is a directory the directory content is returned
 *			as the children of the file.
 *
 *	@param	filePath				File path string
 *	@param	rootDir					Root directory
 *	@param	args						HTTP QUERY-STRING arguments decoded.
 *	@param	status					Receives the final result (200, 204 or 404).
 *
 *	@return		An array of 1 FILE_INFO object or NULL in case no match was found.
 **/
function getFile($filePath, $rootDir, $args, &$status)
{
    if (file_exists($filePath)) {
        $files = array();
        $uri = parsePath($filePath, $rootDir);
        $fileInfo = fileToStruct($uri->dirPath, $rootDir, $uri->filename, $args);
        if (!fileFilter($fileInfo, $args)) {
            if (property_exists($fileInfo, "directory")) {
                $fileInfo->children = getDirectory($filePath, $rootDir, $args, $status);
                $fileInfo->_EX = true;
            }
            // Don't give out details about the root directory.
            if ($filePath === $rootDir) {
                $fileInfo->name = ".";
                $fileInfo->size = 0;
            }
            $files[] = $fileInfo;
        }
        $status = $files ? HTTP_V_OK : HTTP_V_NO_CONTENT;
        return $files;
    }
    $status = HTTP_V_NOT_FOUND;
    return null;
}
开发者ID:anselmoarruda,项目名称:js,代码行数:38,代码来源:cbtreeFileStore.php


示例12: playAllMusic

function playAllMusic($directory)
{
    mountNetworkShare($directory);
    $files = getDirectory($directory);
    if ($fp = fopen('/tmp/runmono.jsp', 'w')) {
        while (list(, $file) = each($files['files'])) {
            if ($file['icon'] == 'audio') {
                fwrite($fp, $file['name'] . "|0|0|file://" . $file['path'] . "|\n");
            }
        }
        fclose($fp);
    }
    $file = '/tmp/runmono.jsp';
    $options = "pod='2,,'";
    if ($fp = fopen('/tmp/runmono.html', 'w')) {
        fwrite($fp, "<body bgcolor=black link=black onloadset='go'>");
        fwrite($fp, "<a onfocusload name='go' href='file://{$file}' {$options}></a>");
        fwrite($fp, "<a href='http://127.0.0.1:8883/start.cgi?list' tvid='home'></a>");
        fwrite($fp, "<a href='http://127.0.0.1:8883/start.cgi?list' tvid='source'></a>");
        fwrite($fp, "<br><font size='6' color='#ffffff'><b>Press Return on your remote to go back to your previous location</b></font>");
        fclose($fp);
    }
    exec("echo 212 > /tmp/irkey");
    exec("sleep 2");
    exec("killall amp_test");
    exec("killall mono");
    exec("killall pod");
    exec("echo /tmp/runmono.html > /tmp/gaya_bc");
}
开发者ID:KasaiDot,项目名称:MediatankController,代码行数:29,代码来源:index.php


示例13: getConfig

function getConfig($xml = "")
{
    global $_CONFIG, $CONFIG, $INTERNAL;
    $skeys = array("gl_db_host", "gl_db_user", "gl_db_pass", "gl_db_name");
    $hashfile = FILE_CONFIG;
    $ms = base64_decode($_CONFIG["gl_lzst"]) == 1;
    $cindex = 0;
    $cfiles = getDirectory(PATH_CONFIG, "config.inc.php");
    foreach ($_CONFIG as $index => $server_val) {
        if (is_array($server_val)) {
            $xml .= "<conf key=\"" . base64_encode($index) . "\">\r\n";
            foreach ($server_val as $skey => $sval) {
                if (!is_array($sval)) {
                    $xml .= "<sub key=\"" . base64_encode($skey) . "\">" . $sval . "</sub>\r\n";
                }
            }
            $xml .= "</conf>\r\n";
        } else {
            if (!(is_int($index) && is_array($server_val))) {
                $xml .= "<conf value=\"" . $server_val . "\" key=\"" . base64_encode($index) . "\" />\r\n";
            }
        }
    }
    if (!empty($CONFIG["gl_root"])) {
        $cfiles = array_merge(array("config.inc.php"), $cfiles);
    }
    $rootBased = $CONFIG["gl_root"];
    foreach ($cfiles as $file) {
        if (substr($file, 0, 7) == "config." && strpos($file, ".inc.php") == strlen($file) - 8) {
            $chost = str_replace("inc.php", "", str_replace("config.", "", $file));
            $chost = strlen($chost) > 0 ? substr($chost, 0, strlen($chost) - 1) : $chost;
            if (!$ms || (empty($_GET["ws"]) && strtolower($_SERVER["HTTP_HOST"]) == strtolower($chost) || empty($chost) && strtolower($_SERVER["HTTP_HOST"]) == strtolower($CONFIG["gl_host"]) || !empty($_GET["ws"]) && base64_decode($_GET["ws"]) == $chost || !empty($rootBased) && SERVERSETUP && !MANAGEMENT || in_array($chost, $INTERNAL[CALLER_SYSTEM_ID]->WebsitesConfig) || in_array($chost, $INTERNAL[CALLER_SYSTEM_ID]->WebsitesUsers))) {
                if (!empty($chost) && file_exists(str_replace("config.inc", "config." . $chost . ".inc", FILE_CONFIG))) {
                    $hashfile = str_replace("config.inc", "config." . $chost . ".inc", FILE_CONFIG);
                    requireDynamic($hashfile, LIVEZILLA_PATH . "_config/");
                    loadConfig(false);
                    initDataProvider();
                }
                foreach ($_CONFIG as $index => $server_val) {
                    if (is_int($index) && is_array($server_val)) {
                        $xml .= "<site index=\"" . base64_encode($cindex) . "\">\r\n";
                        foreach ($server_val as $key => $site_val) {
                            if (is_array($site_val)) {
                                $xml .= "<conf key=\"" . base64_encode($key) . "\">\r\n";
                                foreach ($site_val as $skey => $sval) {
                                    $xml .= "<sub key=\"" . base64_encode($skey) . "\">" . $sval . "</sub>\r\n";
                                }
                                $xml .= "</conf>\r\n";
                            } else {
                                if (!in_array($key, $skeys) || SERVERSETUP) {
                                    $xml .= "<conf value=\"" . $site_val . "\" key=\"" . base64_encode($key) . "\" />\r\n";
                                } else {
                                    $xml .= "<conf value=\"" . base64_encode("") . "\" key=\"" . base64_encode($key) . "\" />\r\n";
                                }
                            }
                        }
                        $cindex++;
                        if ($CONFIG["gl_host"] == base64_decode($server_val["gl_host"])) {
                            $xml .= "<db_conf>\r\n";
                            if (!empty($CONFIG["db"]["cct"])) {
                                $xml .= "<cct>\r\n";
                                foreach ($CONFIG["db"]["cct"] as $cct) {
                                    $xml .= $cct->GetXML();
                                }
                                $xml .= "</cct>\r\n";
                            }
                            if (!empty($CONFIG["db"]["ccpp"])) {
                                $xml .= "<ccpp>\r\n";
                                foreach ($CONFIG["db"]["ccpp"] as $ccpp) {
                                    $xml .= $ccpp->GetXML();
                                }
                                $xml .= "</ccpp>\r\n";
                            }
                            if (!empty($CONFIG["db"]["gl_email"])) {
                                $xml .= "<gl_email>\r\n";
                                foreach ($CONFIG["db"]["gl_email"] as $mb) {
                                    $xml .= $mb->GetXML();
                                }
                                $xml .= "</gl_email>\r\n";
                            }
                            $xml .= "</db_conf>\r\n";
                        }
                        $xml .= "</site>\r\n";
                    }
                }
            }
        }
    }
    if (SERVERSETUP) {
        $xml .= "<translations>\r\n";
        $files = getDirectory("./_language", "index", true);
        foreach ($files as $translation) {
            if (strpos($translation, ".bak.") === false) {
                $lang = str_replace(".php", "", str_replace("lang", "", $translation));
                $parts = explode(".", $lang);
                if (ISSUBSITE && strpos($translation, SUBSITEHOST) !== false || !ISSUBSITE && substr_count($translation, ".") == 1) {
                    $xml .= "<language key=\"" . base64_encode($parts[0]) . "\" blocked=\"" . base64_encode(@filesize("./_language/" . $translation) == 0 ? 1 : "0") . "\" />\r\n";
                } else {
                    if (ISSUBSITE && strpos($translation, SUBSITEHOST) === false && !@file_exists(getLocalizationFileString($parts[0], false))) {
                        $xml .= "<language key=\"" . base64_encode($parts[0]) . "\" derived=\"" . base64_encode(1) . "\" />\r\n";
//.........这里部分代码省略.........
开发者ID:elderxavier,项目名称:SII9-CREATIVE-STUDIO,代码行数:101,代码来源:functions.internal.inc.php


示例14: getDirectory

    //	$arguments = array();
    //
    //	for ( $arg = reset( $args ); $arg !== false; $arg = next( $args ) ) {
    //
    //		//// FIXME: This check will fail if started from a different directory
    //		if ( $arg === basename( __FILE__ ) ) {
    //			continue;
    //		}
    //
    //		$arguments[] = $arg;
    //	}
    //
    //	return $arguments;
}
/**
 * @return string
 */
function getDirectory()
{
    $directory = $GLOBALS['argv'][0];
    if ($directory[0] !== DIRECTORY_SEPARATOR) {
        $directory = $_SERVER['PWD'] . DIRECTORY_SEPARATOR . $directory;
    }
    $directory = dirname($directory);
    return $directory;
}
$skinDirectory = dirname(getDirectory());
$config = isReadablePath("{$skinDirectory}/phpunit.xml.dist");
$mw = isReadablePath(dirname(dirname($skinDirectory)) . "/tests/phpunit/phpunit.php");
echo "php {$mw} -c {$config} " . implode(' ', addArguments($GLOBALS['argv']));
passthru("php {$mw} -c {$config} " . implode(' ', addArguments($GLOBALS['argv'])));
开发者ID:paladox,项目名称:mediawiki-skins-chameleon,代码行数:31,代码来源:mw-phpunit-runner.php


示例15: backupTool_settings

function backupTool_settings()
{
    // set upload limits if server permits //
    @ini_set('upload_max_filesize', '100M');
    @ini_set('post_max_size', '105M');
    @ini_set('memory_limit', '350M');
    @ini_set('max_execution_time', '300');
    // end of set //
    $backupList = array();
    // create backup dir if not present
    if (!file_exists(getSystemRoot(RAZOR_ADMIN_FILENAME) . RAZOR_BACKUP_DIR)) {
        mkdir(getSystemRoot(RAZOR_ADMIN_FILENAME) . RAZOR_BACKUP_DIR, 0755);
    }
    if (isset($_GET['backup']) && $_GET['backup']) {
        $fileName = str_replace(array(',', "'", '"', '?', '/', '*', '(', ')', '@', '!', '&', '=', '<', '>'), '', $_POST['backupname']);
        $errorMsg = backupTool_checkName($fileName);
        if (!$errorMsg) {
            // do backup //
            $tempfileArray = array();
            getDirectory($tempfileArray, getSystemRoot(RAZOR_ADMIN_FILENAME) . RAZOR_DATASTORE_DIR);
            $zipfilename = $fileName . '.zip';
            // form is posted, handle it
            $zipfile = new zipfile();
            // new stuff //
            foreach ($tempfileArray as $file) {
                $f_tmp = @fopen($file, 'r');
                if ($f_tmp) {
                    $dump_buffer = fread($f_tmp, filesize($file));
                    $tempFile = explode('../', $file);
                    $zipfile->addFile($dump_buffer, $tempFile[1]);
                    fclose($f_tmp);
                }
            }
            // new stuff //
            $dump_buffer = $zipfile->file();
            // write the file to disk //
            if (put2file(RAZOR_BACKUP_DIR . $zipfilename, $dump_buffer, strlen($dump_buffer))) {
                MsgBox(lt('Backup created'), 'greenbox');
            } else {
                MsgBox(lt('Error creating backup'), 'redbox');
            }
        } else {
            MsgBox($errorMsg, 'redbox');
        }
    }
    if (isset($_GET['restore']) && $_GET['restore'] && $_SESSION['adminType'] != 'user') {
        set_time_limit(60);
        // new - clean datastore first //
        $cleanfileArray = array();
        getDirectory($cleanfileArray, getSystemRoot(RAZOR_ADMIN_FILENAME) . RAZOR_DATASTORE_DIR);
        foreach ($cleanfileArray as $file) {
            if ($file != 'razor_data.txt') {
                // try using the delete function here so this works with ftp mode too //
                unlink($file);
                // try using the delete function here so this works with ftp mode too //
            }
        }
        $zip = new SimpleUnzip();
        $filename = getSystemRoot(RAZOR_ADMIN_FILENAME) . RAZOR_BACKUP_DIR . $_GET['restore'];
        $entries = $zip->ReadFile($filename);
        $restoreMess = '';
        $restoreOK = 'greenbox';
        foreach ($entries as $entry) {
            // check dir exists, if not create it //
            if ($entry->Path != '' && !file_exists('../' . $entry->Path)) {
                $splitPath = array();
                $splitPath = explode('/', $entry->Path);
                $checkPath = '..';
                foreach ($splitPath as $pathBit) {
                    $checkPath .= '/' . $pathBit;
                    if (!file_exists($checkPath)) {
                        mkdir($checkPath, 0755);
                    }
                }
            }
            // check end //
            if (put2file($entry->Path . '/' . $entry->Name, $entry->Data)) {
                $restoreMess .= lt('Restoring') . " {$entry->Name} <br />";
            } else {
                $restoreMess .= lt('error restoring') . " {$entry->Name} <br />";
                $restoreOK = 'redbox';
            }
        }
        MsgBox($restoreMess, $restoreOK);
    }
    if (isset($_GET['delete']) && $_GET['delete']) {
        deleteFile(RAZOR_BACKUP_DIR . $_GET['delete']);
    }
    if (isset($_GET['upload']) && $_GET['upload'] && isset($_POST['upload']) && $_SESSION['adminType'] != 'user') {
        $filename = basename($_FILES['file-upload']['name']);
        $stripFileName = explode('.', $filename);
        if (end($stripFileName) == 'zip') {
            $backupDir = getSystemRoot(RAZOR_ADMIN_FILENAME) . RAZOR_BACKUP_DIR;
            $backupFiles = readDirContents($backupDir);
            $counter = 0;
            while (in_array($filename, $backupFiles)) {
                $counter++;
                $filename = $stripFileName[0] . '(' . $counter . ')' . '.' . $stripFileName[1];
            }
            $result = uploadFile(RAZOR_BACKUP_DIR . $filename, $_FILES['file-upload']['tmp_name']);
//.........这里部分代码省略.........
开发者ID:roboshepherd,项目名称:FaruqsFewDays,代码行数:101,代码来源:admin_func.php


示例16: runBackups

/**
 * run backup for range of wikis
 */
function runBackups($from, $to, $full, $options)
{
    global $IP, $wgWikiaLocalSettingsPath, $wgWikiaAdminSettingsPath, $wgMaxShellTime, $wgMaxShellFileSize, $wgDumpsDisabledWikis;
    $range = array();
    /**
     * shortcut for full & current together
     */
    $both = isset($options["both"]);
    /**
     * store backup in another folder, not available for users
     */
    $hide = isset($options["hide"]);
    /**
     * store backup in the system tmp dir
     */
    $use_temp = isset($options['tmp']);
    /**
     * send backup to Amazon S3 and delete the local copy
     */
    $s3 = isset($options['s3']);
    /**
     * silly trick, if we have id defined we are defining $from & $to from it
     * if we have db param defined we first resolve which id is connected to this
     * database
     */
    if (isset($options["db"]) && is_string($options["db"])) {
        $city_id = WikiFactory::DBtoID($options["db"]);
        if ($city_id) {
            $from = $to = $city_id;
            $to++;
        }
    } elseif (isset($options["id"]) && is_numeric($options["id"])) {
        $from = $to = $options["id"];
        $to++;
    } elseif (isset($options["even"])) {
        $range[] = "city_id % 2 = 0";
        $range[] = "city_public = 1";
    } elseif (isset($options["odd"])) {
        $range[] = "city_id % 2 <> 0";
        $range[] = "city_public = 1";
    } else {
        /**
         * if all only for active
         */
        $range[] = "city_public = 1";
    }
    /**
     * exclude wikis with dumps disabled
     */
    if (!empty($wgDumpsDisabledWikis) && is_array($wgDumpsDisabledWikis)) {
        $range[] = 'city_id NOT IN (' . implode(',', $wgDumpsDisabledWikis) . ')';
    }
    /**
     * switch off limits for dumps
     */
    $wgMaxShellTime = 0;
    $wgMaxShellFileSize = 0;
    if ($from !== false && $to !== false) {
        $range[] = sprintf("city_id >= %d AND city_id < %d", $from, $to);
        Wikia::log(__METHOD__, "info", "Running from {$from} to {$to}", true, true);
    } else {
        Wikia::log(__METHOD__, "info", "Running for all wikis", true, true);
    }
    $dbw = Wikifactory::db(DB_MASTER);
    $sth = $dbw->select(array("city_list"), array("city_id", "city_dbname"), $range, __METHOD__, array("ORDER BY" => "city_id"));
    while ($row = $dbw->fetchObject($sth)) {
        /**
         * get cluster for this wiki
         */
        $cluster = WikiFactory::getVarValueByName("wgDBcluster", $row->city_id);
        $server = wfGetDB(DB_SLAVE, 'dumps', $row->city_dbname)->getProperty("mServer");
        /**
         * build command
         */
        $status = false;
        $basedir = getDirectory($row->city_dbname, $hide, $use_temp);
        if ($full || $both) {
            $path = sprintf("%s/%s_pages_full.xml.7z", $basedir, $row->city_dbname);
            $time = wfTime();
            Wikia::log(__METHOD__, "info", "{$row->city_id} {$row->city_dbname} {$path}", true, true);
            $cmd = array("SERVER_ID={$row->city_id}", "php", "{$IP}/maintenance/dumpBackup.php", "--conf {$wgWikiaLocalSettingsPath}", "--aconf {$wgWikiaAdminSettingsPath}", "--full", "--xml", "--quiet", "--server={$server}", "--output=" . DumpsOnDemand::DEFAULT_COMPRESSION_FORMAT . ":{$path}");
            wfShellExec(implode(" ", $cmd), $status);
            $time = Wikia::timeDuration(wfTime() - $time);
            Wikia::log(__METHOD__, "info", "{$row->city_id} {$row->city_dbname} status: {$status}, time: {$time}", true, true);
            if ($s3 && 0 == DumpsOnDemand::putToAmazonS3($path, !$hide, MimeMagic::singleton()->guessMimeType($path))) {
                unlink($path);
            }
        }
        if (!$full || $both) {
            $path = sprintf("%s/%s_pages_current.xml.7z", $basedir, $row->city_dbname);
            $time = wfTime();
            Wikia::log(__METHOD__, "info", "{$row->city_id} {$row->city_dbname} {$path}", true, true);
            $cmd = array("SERVER_ID={$row->city_id}", "php", "{$IP}/maintenance/dumpBackup.php", "--conf {$wgWikiaLocalSettingsPath}", "--aconf {$wgWikiaAdminSettingsPath}", "--current", "--xml", "--quiet", "--server={$server}", "--output=" . DumpsOnDemand::DEFAULT_COMPRESSION_FORMAT . ":{$path}");
            wfShellExec(implode(" ", $cmd), $status);
            $time = Wikia::timeDuration(wfTime() - $time);
            Wikia::log(__METHOD__, "info", "{$row->city_id} {$row->city_dbname} status: {$status}, time: {$time}", true, true);
            if ($s3 && 0 == DumpsOnDemand::putToAmazonS3($path, !$hide, MimeMagic::singleton()->guessMimeType($path))) {
//.........这里部分代码省略.........
开发者ID:Tjorriemorrie,项目名称:app,代码行数:101,代码来源:runBackups.php


示例17: setManagement

function setManagement()
{
    global $INTERNAL, $RESPONSE, $GROUPS;
    if (!DB_CONNECTION) {
        $res = testDataBase($CONFIG["gl_db_host"], $CONFIG["gl_db_user"], $CONFIG["gl_db_pass"], $CONFIG["gl_db_name"], $CONFIG["gl_db_prefix"]);
        if (!empty($res)) {
            $RESPONSE->SetValidationError(LOGIN_REPLY_DB, $res);
        }
        return;
    }
    if ($INTERNAL[CALLER_SYSTEM_ID]->Level == USER_LEVEL_ADMIN) {
        createFile(PATH_USERS . "internal.inc.php", base64_decode($_POST[POST_INTERN_FILE_INTERN]), true);
        createFile(PATH_GROUPS . "groups.inc.php", base64_decode($_POST[POST_INTERN_FILE_GROUPS]), true);
        getData(true, true, true, false);
        updatePredefinedMessages();
        if (isset($_POST[POST_INTERN_EDIT_USER])) {
            $combos = explode(";", $_POST[POST_INTERN_EDIT_USER]);
            for ($i = 0; $i < count($combos); $i++) {
                if (strpos($combos[$i], ",") !== false) {
                    $vals = explode(",", $combos[$i]);
                    if (strlen($vals[1]) > 0) {
                        $INTERNAL[$vals[0]]->ChangePassword($vals[1]);
                    }
                    $INTERNAL[$vals[0]]->SetPasswordChangeNeeded($vals[2] == 1);
                }
            }
        }
        $datafiles = getDirectory(PATH_USERS, ".htm", true);
        foreach ($datafiles as $datafile) {
            if (strpos($datafile, FILE_EXTENSION_PASSWORD) !== false || strpos($datafile, FILE_EXTENSION_CHANGE_PASSWORD) !== false) {
                $parts = explode(".", $datafile);
                if (!isset($INTERNAL[$parts[0]])) {
                    @unlink(PATH_USERS . $datafile);
                }
            }
        }
        setIdle(0);
        $RESPONSE->SetStandardResponse(1, "");
    }
}
开发者ID:beardon,项目名称:stillwaterlife-web,代码行数:40,代码来源:functions.internal.man.inc.php


示例18: importButtons

function importButtons($_folder, $_prefix, $_connection)
{
    try {
        administrationLog("importButtons", serialize($_POST), CALLER_SYSTEM_ID);
        $buttons = getDirectory($_folder, ".php", tru 

鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP getDirectorySize函数代码示例发布时间:2022-05-15
下一篇:
PHP getDirSize函数代码示例发布时间: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