本文整理汇总了PHP中isWindows函数的典型用法代码示例。如果您正苦于以下问题:PHP isWindows函数的具体用法?PHP isWindows怎么用?PHP isWindows使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了isWindows函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: open
function open($mode = 'w')
{
if ($this->_dbh) {
return;
}
// already open.
$watchdog = $this->_timeout;
global $ErrorManager;
$this->_dba_open_error = false;
$ErrorManager->pushErrorHandler(new WikiMethodCb($this, '_dba_open_error_handler'));
// oops, you don't have DBA support.
if (!function_exists("dba_open")) {
echo "You don't seem to have DBA support compiled into PHP.";
}
// lock supported since 4.3.0:
if (check_php_version(4, 3, 0) and strlen($mode) == 1) {
// PHP 4.3.x Windows lock bug workaround: http://bugs.php.net/bug.php?id=23975
if (isWindows()) {
$mode .= "-";
// suppress locking, or
} elseif ($this->_handler != 'gdbm') {
// gdbm does it internally
$mode .= "d";
// else use internal locking
}
}
while (($dbh = dba_open($this->_file, $mode, $this->_handler)) < 1) {
if ($watchdog <= 0) {
break;
}
flush();
// "c" failed, try "w" instead.
if (substr($mode, 0, 1) == "c" and file_exists($this->_file)) {
$mode = "w";
}
// conflict: wait some random time to unlock (see ethernet)
$secs = 0.5 + (double) rand(1, 32767) / 32767;
sleep($secs);
$watchdog -= $secs;
if (strlen($mode) == 2) {
$mode = substr($mode, 0, -1);
}
}
$ErrorManager->popErrorHandler();
if (!$dbh) {
if ($error = $this->_dba_open_error) {
$error->errno = E_USER_ERROR;
$error->errstr .= "\nfile: " . $this->_file . "\nmode: " . $mode . "\nhandler: " . $this->_handler;
$ErrorManager->handleError($error);
} else {
trigger_error("dba_open failed", E_USER_ERROR);
}
}
$this->_dbh = $dbh;
return !empty($dbh);
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:56,代码来源:DbaDatabase.php
示例2: runCmd
function runCmd($command, $debug = false)
{
$nl = PHP_EOL;
if (isWindows() && strpos(phpversion(), "5.2") !== false) {
$command = "\"" . $command . "\"";
}
if ($debug) {
echo '-Running Command: ' . $nl . ' ' . $command . $nl;
}
$output = array();
$status = 1;
@exec($command, $output, $status);
if ($debug) {
echo '-Command Output: ' . $nl . ' ' . implode($nl . ' ', $output) . $nl;
}
return $output;
}
开发者ID:ehsanguru,项目名称:nnplus,代码行数:17,代码来源:util.php
示例3: serverload
function serverload($int = false)
{
if ($int == false) {
$unknown = '-';
} else {
$unknown = -1;
}
if (isWindows() == true) {
return $unknown;
}
if (@file_exists("/proc/loadavg")) {
$load = @file_get_contents("/proc/loadavg");
$serverload = explode(" ", $load);
$serverload[0] = round($serverload[0], 4);
}
if (viscacha_function_exists('sys_getloadavg')) {
$serverload = @sys_getloadavg();
}
if (empty($serverload[0]) && viscacha_function_exists('exec') == true) {
$load = @exec("uptime");
$load = preg_split("~load averages?: ~i", $load);
if (isset($load[1])) {
$serverload = explode(",", $load[1]);
}
}
if (isset($serverload[0])) {
$returnload = trim($serverload[0]);
}
if (empty($returnload)) {
$returnload = $unknown;
}
return $returnload;
}
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:33,代码来源:function.global.php
示例4: error_and_exit
function error_and_exit()
{
global $errors, $tikipath;
$PHP_CONFIG_FILE_PATH = PHP_CONFIG_FILE_PATH;
$httpd_conf = 'httpd.conf';
/*
ob_start();
phpinfo (INFO_MODULES);
if (preg_match('/Server Root<\/b><\/td><td\s+align="left">([^<]*)</', ob_get_contents(), $m)) {
$httpd_conf = $m[1] . '/' . $httpd_conf;
}
ob_end_clean();
*/
print "<html><body>\n<h2><IMG SRC=\"img/tiki/Tiki_WCG.png\" ALT=\"\" BORDER=0><br /\\>\n\t<font color='red'>Tiki Installer cannot proceed</font></h2>\n<pre>\n{$errors}";
if (!isWindows()) {
print "<br /><br />Your options:\n\n\n1- With FTP access:\n\ta) Change the permissions (chmod) of the directories to 777.\n\tb) Create any missing directories\n\tc) <a href='tiki-install.php'>Execute the Tiki installer again</a> (Once you have executed these commands, this message will disappear!)\n\nor\n\n2- With shell (SSH) access, you can run the command below.\n\n\ta) To run setup.sh, follow the instructions:\n\t\t\$ cd {$tikipath}\n\t\t\$ sh setup.sh\n\n\t\tThe script will offer you options depending on your server configuration.\n\n\tb) <a href='tiki-install.php'>Execute the Tiki installer again</a> (Once you have executed these commands, this message will disappear!)\n\n\n<hr>\nIf you have problems accessing a directory, check the open_basedir entry in\n{$PHP_CONFIG_FILE_PATH}/php.ini or {$httpd_conf}.\n\n<hr>\n\n<a href='http://doc.tiki.org/Installation' target='_blank'>Consult the tiki.org installation guide</a> if you need more help or <a href='http://tiki.org/tiki-forums.php' target='_blank'>visit the forums</a>\n\n";
}
print "</pre></body></html>";
exit;
}
开发者ID:hurcane,项目名称:tiki-azure,代码行数:22,代码来源:tiki-installer.php
示例5: _get_ini_separator
/**
* The system-dependent path-separator character. On UNIX systems,
* this character is ':'; on Win32 systems it is ';'.
* Fixme:
* On Mac it cannot be : because this is the seperator there!
*
* @access private
* @return string path_separator.
*/
function _get_ini_separator()
{
return isWindows() ? ';' : ':';
// return preg_match('/^Windows/', php_uname())
}
开发者ID:hugcoday,项目名称:wiki,代码行数:14,代码来源:FileFinder.php
示例6: glob
public function glob($pattern, $handle = null) {
$path = null;
$output = null;
if(isWindows() == true) {
$slash='\\';
}
else {
$slash='/';
}
$lastpos = strrpos($pattern, $slash);
if($lastpos !== false) {
$path = substr($pattern, 0, -$lastpos-1);
$pattern = substr($pattern, $lastpos);
}
else {
$path = getcwd();
}
if(is_array($handle) && !empty($handle)) {
while($dir = each($handle)) {
if($this->glob_pattern_match($pattern, $dir)) {
$output[] = $dir;
}
}
}
else {
$handle = @opendir($path);
if($handle === false) {
return false;
}
while($dir = readdir($handle)) {
if($this->glob_pattern_match($pattern, $dir)) {
$output[] = $dir;
}
}
closedir($handle);
}
if(is_array($output)) {
return $output;
}
else {
return false;
}
}
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:43,代码来源:class.FTPClient.php
示例7: define
* Administrative actions:
* [Watch] WatchPage - add a page, or delete watch handlers into the users
* pref[notifyPages] slot.
* My WatchList - view or edit list/regex of pref[notifyPages].
* EMailConfirm methods: send and verify
*
* Helper functions:
* getPageChangeEmails
* MailAdmin
* ? handle emailed confirmation links (EmailSignup, ModeratedPage)
*
* @package MailNotify
* @author Reini Urban
*/
if (!defined("MAILER_LOG")) {
if (isWindows()) {
define("MAILER_LOG", 'c:/wikimail.log');
} else {
define("MAILER_LOG", '/var/log/wikimail.log');
}
}
class MailNotify
{
function MailNotify($pagename)
{
$this->pagename = $pagename;
/* which page */
$this->emails = array();
/* to which addresses */
$this->userids = array();
/* corresponding array of displayed names,
开发者ID:hugcoday,项目名称:wiki,代码行数:31,代码来源:MailNotify.php
示例8: link
function link($link, $linktext = false)
{
global $WikiTheme;
list($moniker, $page) = explode(":", $link, 2);
if (!isset($this->_map[$moniker])) {
return HTML::span(array('class' => 'bad-interwiki'), $linktext ? $linktext : $link);
}
$url = $this->_map[$moniker];
// localize Upload:links for WIKIDUMP
if (!empty($WikiTheme->DUMP_MODE) and $moniker == 'Upload') {
global $request;
include_once "lib/config.php";
$url = getUploadFilePath();
// calculate to a relative local path to /uploads for pdf images.
$doc_root = $request->get("DOCUMENT_ROOT");
$ldir = NormalizeLocalFileName($url);
$wikiroot = NormalizeLocalFileName('');
if (isWindows()) {
$ldir = strtolower($ldir);
$doc_root = strtolower($doc_root);
$wikiroot = strtolower($wikiroot);
}
if (string_starts_with($ldir, $doc_root)) {
$link_prefix = substr($url, strlen($doc_root));
} elseif (string_starts_with($ldir, $wikiroot)) {
$link_prefix = NormalizeWebFileName(substr($url, strlen($wikiroot)));
}
}
// Urlencode page only if it's a query arg.
// FIXME: this is a somewhat broken heuristic.
if ($moniker == 'Upload') {
$page_enc = $page;
$page = rawurldecode($page);
} else {
$page_enc = strstr($url, '?') ? rawurlencode($page) : $page;
}
if (strstr($url, '%s')) {
$url = sprintf($url, $page_enc);
} else {
$url .= $page_enc;
}
$link = HTML::a(array('href' => $url));
if (!$linktext) {
$link->pushContent(PossiblyGlueIconToText('interwiki', "{$moniker}:"), HTML::span(array('class' => 'wikipage'), $page));
$link->setAttr('class', 'interwiki');
} else {
$link->pushContent(PossiblyGlueIconToText('interwiki', $linktext));
$link->setAttr('class', 'named-interwiki');
}
return $link;
}
开发者ID:hugcoday,项目名称:wiki,代码行数:51,代码来源:PageType.php
示例9: fixConfigIni
function fixConfigIni($match, $new)
{
$file = FindFile("config/config.ini");
$found = false;
if (is_writable($file)) {
$in = fopen($file, "rb");
$out = fopen($tmp = tempnam(FindFile("uploads"), "cfg"), "wb");
if (isWindows()) {
$tmp = str_replace("/", "\\", $tmp);
}
while ($s = fgets($in)) {
if (preg_match($match, $s)) {
$s = $new . (isWindows() ? "\r\n" : "\n");
$found = true;
}
fputs($out, $s);
}
fclose($in);
fclose($out);
if (!$found) {
echo " <b><font color=\"red\">", _("FAILED"), "</font></b>: ", sprintf(_("%s not found"), $match);
unlink($out);
} else {
@unlink("{$file}.bak");
@rename($file, "{$file}.bak");
if (rename($tmp, $file)) {
echo " <b>", _("FIXED"), "</b>";
} else {
echo " <b>", _("FAILED"), "</b>: ";
sprintf(_("couldn't move %s to %s"), $tmp, $file);
return false;
}
}
return $found;
} else {
echo " <b><font color=\"red\">", _("FAILED"), "</font></b>: ", sprintf(_("%s is not writable"), $file);
return false;
}
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:39,代码来源:upgrade.php
示例10: getUploadedFile
function getUploadedFile($postname)
{
global $HTTP_POST_FILES;
// Against php5 with !ini_get('register-long-arrays'). See Bug #1180115
if (empty($HTTP_POST_FILES) and !empty($_FILES)) {
$HTTP_POST_FILES =& $_FILES;
}
if (!isset($HTTP_POST_FILES[$postname])) {
return false;
}
$fileinfo =& $HTTP_POST_FILES[$postname];
if ($fileinfo['error']) {
// See https://sourceforge.net/forum/message.php?msg_id=3093651
$err = (int) $fileinfo['error'];
// errmsgs by Shilad Sen
switch ($err) {
case 1:
trigger_error(_("Upload error: file too big"), E_USER_WARNING);
break;
case 2:
trigger_error(_("Upload error: file too big"), E_USER_WARNING);
break;
case 3:
trigger_error(_("Upload error: file only partially recieved"), E_USER_WARNING);
break;
case 4:
trigger_error(_("Upload error: no file selected"), E_USER_WARNING);
break;
default:
trigger_error(_("Upload error: unknown error #") . $err, E_USER_WARNING);
}
return false;
}
// With windows/php 4.2.1 is_uploaded_file() always returns false.
// Be sure that upload_tmp_dir ends with a slash!
if (!is_uploaded_file($fileinfo['tmp_name'])) {
if (isWindows()) {
if (!($tmp_file = get_cfg_var('upload_tmp_dir'))) {
$tmp_file = dirname(tempnam('', ''));
}
$tmp_file .= '/' . basename($fileinfo['tmp_name']);
/* but ending slash in php.ini upload_tmp_dir is required. */
if (realpath(ereg_replace('/+', '/', $tmp_file)) != realpath($fileinfo['tmp_name'])) {
trigger_error(sprintf("Uploaded tmpfile illegal: %s != %s.", $tmp_file, $fileinfo['tmp_name']) . "\n" . "Probably illegal TEMP environment or upload_tmp_dir setting.", E_USER_ERROR);
return false;
} else {
/*
trigger_error(sprintf("Workaround for PHP/Windows is_uploaded_file() problem for %s.",
$fileinfo['tmp_name'])."\n".
"Probably illegal TEMP environment or upload_tmp_dir setting.",
E_USER_NOTICE);
*/
}
} else {
trigger_error(sprintf("Uploaded tmpfile %s not found.", $fileinfo['tmp_name']) . "\n" . " Probably illegal TEMP environment or upload_tmp_dir setting.", E_USER_WARNING);
}
}
return new Request_UploadedFile($fileinfo);
}
开发者ID:neymanna,项目名称:fusionforge,代码行数:59,代码来源:Request.php
示例11: ShellWhoAmI
function ShellWhoAmI()
{
// By virtue of this small change this function needs to be renamed.
//
if (isWindows()) {
// This will fail in IIS so run this from the command line.
echo "Is windows\n";
return $this->zzArraySafe($_SERVER, "USERNAME", "");
} else {
echo "Not windows\n";
return $this->ShellExec('whoami');
}
}
开发者ID:KlabsTechnology,项目名称:andro,代码行数:13,代码来源:androInstallBuild.php
示例12: setPath
function setPath()
{
$path = ini_get("include_path");
$base = substr(__FILE__, 0, strrpos(__FILE__, DIRECTORY_SEPARATOR));
$delimiter = ":";
if (isWindows()) {
$delimiter = ";";
}
/* add locations */
$path .= $delimiter . $base;
$path .= $delimiter . $base . DIRECTORY_SEPARATOR . "admin";
$path .= $delimiter . $base . DIRECTORY_SEPARATOR . "custom";
$path .= $delimiter . $base . DIRECTORY_SEPARATOR . "display";
$path .= $delimiter . $base . DIRECTORY_SEPARATOR . "display" . DIRECTORY_SEPARATOR . "templates";
$path .= $delimiter . $base . DIRECTORY_SEPARATOR . "language";
$path .= $delimiter . $base . DIRECTORY_SEPARATOR . "templates";
/* update path */
ini_set("include_path", $path);
}
开发者ID:nubissurveying,项目名称:nubis,代码行数:19,代码来源:functions.php
示例13: open
function open($mode = 'w')
{
if ($this->_dbh) {
return;
}
// already open.
$watchdog = $this->_timeout;
global $ErrorManager;
$this->_dba_open_error = false;
$ErrorManager->pushErrorHandler(new WikiMethodCb($this, '_dba_open_error_handler'));
// oops, you don't have DBA support.
if (!function_exists("dba_open")) {
echo "You don't seem to have DBA support compiled into PHP.";
}
if (READONLY) {
$mode = 'r';
}
if (strlen($mode) == 1) {
// PHP 4.3.x Windows lock bug workaround: http://bugs.php.net/bug.php?id=23975
if (isWindows()) {
$mode .= "-";
// suppress locking, or
} elseif ($this->_handler != 'gdbm') {
// gdbm does it internally
$mode .= "d";
// else use internal locking
}
}
while (($dbh = dba_open($this->_file, $mode, $this->_handler)) < 1) {
if ($watchdog <= 0) {
break;
}
// "c" failed, try "w" instead.
if ($mode == "w" and file_exists($this->_file) and (isWindows() or !is_writable($this->_file))) {
// try to continue with read-only
if (!defined("READONLY")) {
define("READONLY", true);
}
$GLOBALS['request']->_dbi->readonly = true;
$this->readonly = true;
$mode = "r";
}
if (substr($mode, 0, 1) == "c" and file_exists($this->_file) and !READONLY) {
$mode = "w";
}
// conflict: wait some random time to unlock (as with ethernet)
$secs = 0.5 + (double) rand(1, 32767) / 32767;
sleep($secs);
$watchdog -= $secs;
if (strlen($mode) == 2) {
$mode = substr($mode, 0, -1);
}
}
$ErrorManager->popErrorHandler();
if (!$dbh) {
if ($error = $this->_dba_open_error) {
$error->errno = E_USER_ERROR;
$error->errstr .= "\nfile: " . $this->_file . "\nmode: " . $mode . "\nhandler: " . $this->_handler;
// try to continue with read-only
if (!defined("READONLY")) {
define("READONLY", true);
}
$GLOBALS['request']->_dbi->readonly = true;
$this->readonly = true;
if (!file_exists($this->_file)) {
$ErrorManager->handleError($error);
flush();
}
} else {
trigger_error("dba_open failed", E_USER_ERROR);
}
}
$this->_dbh = $dbh;
return !empty($dbh);
}
开发者ID:hugcoday,项目名称:wiki,代码行数:75,代码来源:DbaDatabase.php
示例14: execute
/**
* Execute system command until the outfile $until exists.
*
* @param cmd string command to be invoked
* @param until string expected output filename
* @return boolean error status; true=ok; false=error
*/
function execute($cmd, $until = false)
{
// cmd must redirect stderr to stdout though!
$errstr = exec($cmd);
//, $outarr, $returnval); // normally 127
//$errstr = join('',$outarr);
$ok = empty($errstr);
if (!$ok) {
trigger_error("\n" . $cmd . " failed: {$errstr}", E_USER_WARNING);
} elseif ($GLOBALS['request']->getArg('debug')) {
trigger_error("\n" . $cmd . ": success\n", E_USER_NOTICE);
}
if (!isWindows()) {
if ($until) {
$loop = 100000;
while (!file_exists($until) and $loop > 0) {
$loop -= 100;
usleep(100);
}
} else {
usleep(5000);
}
}
if ($until) {
return file_exists($until);
}
return $ok;
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:35,代码来源:WikiPluginCached.php
示例15: PclZipUtilTranslateWinPath
function PclZipUtilTranslateWinPath($p_path, $p_remove_disk_letter = true)
{
if (isWindows() == true) {
// ----- Look for potential disk letter
if ($p_remove_disk_letter && ($v_position = strpos($p_path, ':')) != false) {
$p_path = substr($p_path, $v_position + 1);
}
// ----- Change potential windows directory separator
if (strpos($p_path, '\\') > 0 || substr($p_path, 0, 1) == '\\') {
$p_path = strtr($p_path, '\\', '/');
}
}
return $p_path;
}
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:14,代码来源:class.zip.php
示例16: text2png
function text2png($args)
{
extract($args);
/**
* Basic image creation and caching
*
* You MUST delete the image cache yourself in /images if you
* change the drawing routines!
*/
$filename = urlencode($text) . ".png";
// protect by urlencode!!!
/**
* FIXME: need something more elegant, and a way to gettext a
* different language depending on any individual
* user's locale preferences.
*/
if ($l == "C") {
$l = "en";
//english=C
} else {
$l = urlencode($l);
// who on earth forgot his?
}
$basedir = "text2png-image";
$filepath = getUploadFilePath() . "{$basedir}/{$l}";
if ($_force or !file_exists($filepath . $filename)) {
if (!file_exists($filepath)) {
$oldumask = umask(0);
// permissions affected by user the www server is running as
mkdir(getUploadFilePath() . $basedir, 0777);
mkdir($filepath, 0777);
umask($oldumask);
}
$filepath .= "/";
/**
* prepare a new image
*
* FIXME: needs a dynamic image size depending on text
* width and height
*/
// got this logic from GraphViz
if (defined('TTFONT')) {
$ttfont = TTFONT;
} elseif (PHP_OS == "Darwin") {
// Mac OS X
$ttfont = "/System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Home/lib/fonts/LucidaSansRegular.ttf";
} elseif (isWindows()) {
$ttfont = $_ENV['windir'] . '\\Fonts\\Arial.ttf';
} else {
$ttfont = 'luximr';
// This is the only what sourceforge offered.
//$ttfont = 'Helvetica';
}
/* http://download.php.net/manual/en/function.imagettftext.php
* array imagettftext (int im, int size, int angle, int x, int y,
* int col, string fontfile, string text)
*/
// get ready to draw
$s = ImageTTFBBox($fontsize, 0, $ttfont, $text);
$im = @ImageCreate(abs($s[4]) + 20, abs($s[7]) + 10);
if (empty($im)) {
$error_html = _("PHP was unable to create a new GD image stream. Read 'lib/plugin/text2png.php' for details.");
// FIXME: Error manager does not transform URLs passed
// through it.
$link = "http://www.php.net/manual/en/function.imagecreate.php";
$error_html .= sprintf(_("See %s"), $link) . ".";
trigger_error($error_html, E_USER_NOTICE);
return;
}
$rgb = $this->hexcolor($backcolor, array(255, 255, 255));
$bg_color = ImageColorAllocate($im, $rgb[0], $rgb[1], $rgb[2]);
if ($with_shadow) {
$rgb = $this->hexcolor($shadowcolor, array(175, 175, 175));
$text_color = ImageColorAllocate($im, $rgb[0], $rgb[1], $rgb[2]);
// shadow is 1 pixel down and 2 pixels right
ImageTTFText($im, $fontsize, 0, 12, abs($s[7]) + 6, $text_color, $ttfont, $text);
}
// draw text
$rgb = $this->hexcolor($fontcolor, array(0, 0, 0));
$text_color = ImageColorAllocate($im, $rgb[0], $rgb[1], $rgb[2]);
ImageTTFText($im, $fontsize, 0, 10, abs($s[7]) + 5, $text_color, $ttfont, $text);
/**
* An alternate text drawing method in case ImageTTFText
* doesn't work.
**/
//ImageString($im, 2, 10, 40, $text, $text_color);
// To dump directly to browser:
//header("Content-type: image/png");
//ImagePng($im);
// to save to file:
$success = ImagePng($im, $filepath . $filename);
} else {
$filepath .= "/";
$success = 2;
}
// create an <img src= tag to show the image!
$html = HTML();
if ($success > 0) {
if (defined('text2png_debug')) {
switch ($success) {
//.........这里部分代码省略.........
开发者ID:hugcoday,项目名称:wiki,代码行数:101,代码来源:text2png.php
示例17: fileSet
function fileSet($directory, $filepattern = false)
{
$this->_fileList = array();
$this->_pattern = $filepattern;
if ($filepattern) {
$this->_pcre_pattern = glob_to_pcre($this->_pattern);
}
$this->_case = !isWindows();
$this->_pathsep = '/';
if (empty($directory)) {
trigger_error(sprintf(_("%s is empty."), 'directoryname'), E_USER_NOTICE);
return;
// early return
}
@($dir_handle = opendir($dir = $directory));
if (empty($dir_handle)) {
trigger_error(sprintf(_("Unable to open directory '%s' for reading"), $dir), E_USER_NOTICE);
return;
// early return
}
while ($filename = readdir($dir_handle)) {
if ($filename[0] == '.' || filetype($dir . $this->_pathsep . $filename) != 'file') {
continue;
}
if ($this->_filenameSelector($filename)) {
array_push($this->_fileList, "{$filename}");
//trigger_error(sprintf(_("found file %s"), $filename),
// E_USER_NOTICE); //debugging
}
}
closedir($dir_handle);
}
开发者ID:hugcoday,项目名称:wiki,代码行数:32,代码来源:stdlib.php
示例18:
</th>
<th class="colDelete"> </th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<?php
}
if (ZM_WEB_SOUND_ON_ALARM) {
$soundSrc = ZM_DIR_SOUNDS . '/' . ZM_WEB_ALARM_SOUND;
?>
<div id="alarmSound" class="hidden">
<?php
if (ZM_WEB_USE_OBJECT_TAGS && isWindows()) {
?>
<object id="MediaPlayer" width="0" height="0"
classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902">
<param name="FileName" value="<?php
echo $soundSrc;
?>
"/>
<param name="autoStart" value="0"/>
<param name="loop" value="1"/>
<param name="hidden" value="1"/>
<param name="showControls" value="0"/>
<embed src="<?php
echo $soundSrc;
?>
开发者ID:schrorg,项目名称:ZoneMinder,代码行数:31,代码来源:watch.php
示例19: getAllPages
/**
* Retrieve all pages.
*
* Gets the set of all pages with non-default contents.
*
* @access public
*
* @param boolean $include_defaulted Normally pages whose most
* recent revision has empty content are considered to be
* non-existant. Unless $include_defaulted is set to true, those
* pages will not be returned.
*
* @return WikiDB_PageIterator A WikiDB_PageIterator which contains all pages
* in the WikiDB which have non-default contents.
*/
function getAllPages($include_empty = false, $sortby = false, $limit = false, $exclude = false)
{
// HACK: memory_limit=8M will fail on too large pagesets. old php on unix only!
if (USECACHE) {
$mem = ini_get("memory_limit");
if ($mem and !$limit and !isWindows() and !check_php_version(4, 3)) {
$limit = 450;
$GLOBALS['request']->setArg('limit', $limit);
$GLOBALS['request']->setArg('paging', 'auto');
}
}
$result = $this->_backend->get_all_pages($include_empty, $sortby, $limit, $exclude);
return new WikiDB_PageIterator($this, $result, array('include_empty' => $include_empty, 'exclude' => $exclude, 'limit' => $limit));
}
开发者ID:nterray,项目名称:tuleap,代码行数:29,代码来源:WikiDB.php
示例20: mainPull
/**
* The user has requested that we download the latest
* version of each application from its respective
*
*
*/
function mainPull()
{
# Don't hold up the system
Session_write_close();
$rows = svnVersions();
$dir = fsDirTop() . 'pkg-apps/';
x_echoFlush('<pre>');
x_EchoFlush('<h2>Pulling Software Updates From SVN</h2>');
// Loop through the apps.
foreach ($rows as $row) {
x_EchoFlush("");
x_echoFlush("<b>Application: " . $row['application'] . "</b>");
if ($row['svn_url'] == '') {
x_echoFlush(" No SVN repository, skipping.");
continue;
}
# Add a trailing slash to svn_url
$row['svn_url'] = AddSlash(trim($row['svn_url']));
# If there is a username and password both, use those
$urlDisplay = $row['svn_url'];
$url = $row['svn_url'];
if ($row['svn_uid'] != '' && $row['svn_pwd'] != '') {
list($proto, $urlstub) = explode("//", $url);
$uid = $row['svn_uid'];
$pwd = $row['svn_pwd'];
$url = "{$proto}//{$uid}:{$pwd}@{$urlstub}";
$urlDisplay = "{$proto}//{$uid}:*****@{$urlstub}";
}
x_echoFlush(" Complete URL: " . $urlDisplay);
# Now pull the list of versions
x_echoFlush(" Querying for latest version");
$rawtext = @file_get_contents($url);
if ($rawtext) {
$matches = array();
preg_match_all('!\\<li\\>\\<a.*\\>(.*)\\</a\\>\\</li\\>!U', $rawtext, $matches);
$versions = $matches[1];
foreach ($versions as $key => $version) {
if ($version == '..') {
unset($versions[$key]);
}
}
if (count($versions) == 0) {
x_EchoFlush(" No versions listed, nothing to pull.");
continue;
}
} else {
x_EchoFlush("Unable to get a release list from the svn server.");
continue;
}
# Work out what the latest was and report it
$latest = array_pop($versions);
if (substr($latest, -1) == '/') {
$latest = substr($latest, 0, strlen($latest) - 1);
}
x_echoFlush(" Latest version is: " . $latest);
x_EchoFlush(" Local version is: " . $row['local']);
# Decide if we need to continue
if ($latest == $row['local']) {
x_EchoFlush(" Local version is latest, nothing do to.");
continue;
}
# Determine some stub values and pass processing to
# the recursive file puller. If no uid & pwd, use subversion
x_EchoFlush(" Local version is out of date, pulling latest");
$dirv = $dir . trim($row['application']) . '-VER-' . $latest . '/';
if ($row['svn_uid'] != '' && $row['svn_pwd'] != '') {
mkdir($dirv);
$this->svnWalk("{$url}/{$latest}/", $dirv);
} else {
$command = "svn export {$url}{$latest} {$dirv}";
x_echoFlush(" Pulling code now, this make take a minute or three...");
x_EchoFlush($command);
`{$command}`;
x_echoFlush(" Code pulled, finished with this application.");
}
x_echoFlush(" Copying files into application directory");
$basedir = str_replace('andro/', '', fsDirTop());
if (isWindows()) {
$command = 'xcopy /y /e /c /k /o ' . $dirv . '* ' . $basedir . trim($row['application']) . '/';
} else {
$command2 = 'cp -Rf ' . $dirv . '* ' . $basedir . trim($row['application']) . '/';
}
echo $command2;
`{$command2}`;
}
x_echoFlush("<hr/>");
x_EchoFlush("<h3>Processing Complete</h3>");
$this->flag_buffer = false;
}
开发者ID:KlabsTechnology,项目名称:andro,代码行数:95,代码来源:a_pullsvn.php
注:本文中的isWindows函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论