本文整理汇总了PHP中getVersion函数的典型用法代码示例。如果您正苦于以下问题:PHP getVersion函数的具体用法?PHP getVersion怎么用?PHP getVersion使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getVersion函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: userman_configpageinit
function userman_configpageinit($pagename)
{
global $currentcomponent;
global $amp_conf;
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : null;
$extdisplay = isset($_REQUEST['extdisplay']) ? $_REQUEST['extdisplay'] : null;
$extension = isset($_REQUEST['extension']) ? $_REQUEST['extension'] : null;
$tech_hardware = isset($_REQUEST['tech_hardware']) ? $_REQUEST['tech_hardware'] : null;
if (version_compare_freepbx(getVersion(), '12.0', '<') && $pagename == 'userman') {
$userman = setup_userman();
$userman->doConfigPageInit($_REQUEST['display']);
}
// We only want to hook 'users' or 'extensions' pages.
if ($pagename != 'users' && $pagename != 'extensions') {
return true;
}
//$currentcomponent->addprocessfunc('userman_configprocess', 1);
if ($tech_hardware != null || $extdisplay != '' || $pagename == 'users' || $action == 'add') {
// On a 'new' user, 'tech_hardware' is set, and there's no extension. Hook into the page.
if ($tech_hardware != null) {
userman_applyhooks();
} elseif ($action == 'add') {
$currentcomponent->addprocessfunc('userman_configprocess', 1);
} elseif ($extdisplay != '' || $pagename == 'users') {
// We're now viewing an extension, so we need to display _and_ process.
userman_applyhooks();
$currentcomponent->addprocessfunc('userman_configprocess', 1);
}
}
}
示例2: checkAllUpdate
public static function checkAllUpdate($_filter = '', $_findNewObject = true)
{
$findCore = false;
$marketObject = array('logical_id' => array(), 'version' => array());
if ($_findNewObject) {
self::findNewUpdateObject();
}
$updates = self::all($_filter);
if (is_array($updates)) {
foreach (self::all($_filter) as $update) {
if ($update->getType() == 'core') {
if ($findCore) {
$update->remove();
continue;
}
$findCore = true;
$update->setType('core');
$update->setLogicalId('jeedom');
if (method_exists('jeedom', 'version')) {
$update->setLocalVersion(jeedom::version());
} else {
$update->setLocalVersion(getVersion('jeedom'));
}
$update->save();
$update->checkUpdate();
} else {
if ($update->getStatus() != 'hold') {
$marketObject['logical_id'][] = array('logicalId' => $update->getLogicalId(), 'type' => $update->getType());
$marketObject['version'][] = $update->getConfiguration('version', 'stable');
$marketObject[$update->getType() . $update->getLogicalId()] = $update;
}
}
}
}
if (!$findCore) {
$update = new update();
$update->setType('core');
$update->setLogicalId('jeedom');
if (method_exists('jeedom', 'version')) {
$update->setLocalVersion(jeedom::version());
} else {
$update->setLocalVersion(getVersion('jeedom'));
}
$update->save();
$update->checkUpdate();
}
$markets_infos = market::getInfo($marketObject['logical_id'], $marketObject['version']);
foreach ($markets_infos as $logicalId => $market_info) {
$update = $marketObject[$logicalId];
if (is_object($update)) {
$update->setStatus($market_info['status']);
$update->setConfiguration('market_owner', $market_info['market_owner']);
$update->setConfiguration('market', $market_info['market']);
$update->setRemoteVersion($market_info['datetime']);
$update->save();
}
}
config::save('update::lastCheck', date('Y-m-d H:i:s'));
}
示例3: startup
/**
* startup
*/
public function startup()
{
$this->clear();
$this->out("<info>Welcome to baserCMS v" . getVersion() . " Console</info>");
$this->hr();
$this->out('App : ' . APP_DIR);
$this->out('Path: ' . APP);
$this->hr();
}
示例4: com_install
function com_install()
{
$db =& JFactory::getDBO();
$ver = getVersion();
$error = false;
$sqlDir = JPATH_ADMINISTRATOR . DS . "components" . DS . "com_webmapplus" . DS . "install" . DS;
$sql = "";
if ($ver == false) {
echo "Installing clean database...";
$sql .= file_get_contents($sqlDir . "install.sql");
} elseif ($ver[1] == 5 || $ver[1] == 2 && $ver[2] == 5) {
echo "N/A.<br />";
return true;
//Short circuit because we are already at latest version
} else {
echo "Upgrade Database from version " . implode('.', $ver) . "...";
$sqlDir .= "upgrade" . DS;
switch ($ver[1]) {
case 0:
$sql .= file_get_contents($sqlDir . "1.0-1.1.0-upgrade.sql");
case 1:
if ($ver[2] == 0 || $ver[1] == 0) {
$sql .= file_get_contents($sqlDir . "1.1-1.1.3-upgrade.sql");
$sql .= file_get_contents($sqlDir . "1.1-1.2.0-upgrade.sql");
}
case 2:
if ($ver[2] >= 5) {
} elseif ($ver[2] != 4 && $ver[2] >= 1) {
$sql .= file_get_contents($sqlDir . "1.2.1-1.2.4-upgrade.sql");
} elseif ($ver[2] == 0) {
$sql .= file_get_contents($sqlDir . "1.2.0-1.2.1-upgrade.sql");
$sql .= file_get_contents($sqlDir . "1.2.1-1.2.4-upgrade.sql");
}
break;
}
$sql .= file_get_contents($sqlDir . "1.2.4-1.2.5-upgrade.sql");
}
$sql = preg_replace('#/\\*(.*?)\\*/#sm', '', $sql);
$sql = $db->splitSql($sql);
foreach ($sql as $stmt) {
$stmt = trim($stmt);
if ($stmt != "" && $stmt[0] != "#" && substr($stmt, 0, 2) != "--") {
$db->setQuery($stmt);
$result = $db->query();
if (!$result) {
echo "<br />" . JText::_("Install Error") . ": " . $db->ErrorMsg() . "<br />";
$error = true;
}
}
}
echo "Done!<br /> Executed " . count($sql) . " SQL statements. <br />";
return !$error;
}
示例5: step1
function step1()
{
$options = array('http' => array('user_agent' => $_SERVER['HTTP_USER_AGENT']));
$context = stream_context_create($options);
$branches = json_decode(file_get_contents('https://api.github.com/repos/Team-Quantum/QuantumCMS/branches', false, $context));
echo '<b>Please select the branch you want to install:</b><br /><br />';
echo '<form method="get">';
echo '<select name="branch">';
foreach ($branches as $branch) {
echo '<option value="' . $branch->name . '">' . $branch->name . ' (' . getVersion($branch->commit->sha) . ')' . '</option>';
}
echo '</select><br /><br />';
echo '<input type="hidden" name="step" value="2" />';
echo '<input class="btn btn-default" type="submit" value="Download" />';
echo '</form>';
}
示例6: __construct
/**
* Constructor
*
* Initializes the boundary strings and part counters
*/
public function __construct()
{
global $conf;
$server = parse_url(DOKU_URL, PHP_URL_HOST);
$this->partid = md5(uniqid(rand(), true)) . '@' . $server;
$this->boundary = '----------' . md5(uniqid(rand(), true));
$listid = join('.', array_reverse(explode('/', DOKU_BASE))) . $server;
$listid = strtolower(trim($listid, '.'));
$this->allowhtml = (bool) $conf['htmlmail'];
// add some default headers for mailfiltering FS#2247
$this->setHeader('X-Mailer', 'DokuWiki ' . getVersion());
$this->setHeader('X-DokuWiki-User', $_SERVER['REMOTE_USER']);
$this->setHeader('X-DokuWiki-Title', $conf['title']);
$this->setHeader('X-DokuWiki-Server', $server);
$this->setHeader('X-Auto-Response-Suppress', 'OOF');
$this->setHeader('List-Id', $conf['title'] . ' <' . $listid . '>');
}
示例7: render
/**
* Create output
*/
function render($format, &$renderer, $data)
{
if ($format == 'xhtml') {
//handle various info stuff
switch ($data[0]) {
case 'version':
$renderer->doc .= getVersion();
break;
case 'syntaxmodes':
$renderer->doc .= $this->_syntaxmodes_xhtml();
break;
case 'syntaxtypes':
$renderer->doc .= $this->_syntaxtypes_xhtml();
break;
case 'syntaxplugins':
$this->_plugins_xhtml('syntax', $renderer);
break;
case 'adminplugins':
$this->_plugins_xhtml('admin', $renderer);
break;
case 'actionplugins':
$this->_plugins_xhtml('action', $renderer);
break;
case 'rendererplugins':
$this->_plugins_xhtml('renderer', $renderer);
break;
case 'helperplugins':
$this->_plugins_xhtml('helper', $renderer);
break;
case 'helpermethods':
$this->_helpermethods_xhtml($renderer);
break;
default:
$renderer->doc .= "no info about " . htmlspecialchars($data[0]);
}
return true;
}
return false;
}
示例8: getURL
function getURL($type, $version = 0)
{
global $siteId, $token;
$monthAgo = date('Y-m-d', strtotime('-1 month'));
switch ($type) {
case 'installs':
return 'http://stats.getnightingale.com/?module=API&method=VisitsSummary.getUniqueVisitors&idSite=' . $siteId . '&language=' . $lang . '&token_auth=' . $token . '&period=day&date=' . $monthAgo . ',today&format=JSON&segment=customVariableValue1==install';
case 'downloads':
return 'http://stats.getnightingale.com/?module=API&method=VisitsSummary.getVisits&idSite=2&language=' . $lang . '&token_auth=' . $token . '&period=day&date=' . $monthAgo . ',today&format=JSON&segment=visitConvertedGoalId==1';
case 'infiniteInstalls':
return 'http://stats.getnightingale.com/?module=API&method=VisitsSummary.getUniqueVisitors&idSite=' . $siteId . '&language=' . $lang . '&token_auth=' . $token . '&period=day&date=2014-01-12,today&format=JSON&segment=customVariableValue1==install;customVariableValue2==' . $version;
case 'updates':
return 'http://stats.getnightingale.com/?module=API&method=VisitsSummary.getUniqueVisitors&idSite=' . $siteId . '&language=' . $lang . '&token_auth=' . $token . '&period=day&date=' . $monthAgo . ',today&format=JSON&segment=customVariableValue1==upgrade';
case 'infiniteUpdates':
return 'http://stats.getnightingale.com/?module=API&method=VisitsSummary.getUniqueVisitors&idSite=' . $siteId . '&language=' . $lang . '&token_auth=' . $token . '&period=day&date=2014-01-12,today&format=JSON&segment=customVariableValue1==upgrade;customVariableValue2==' . $version;
case 'versionGraph':
return 'http://stats.getnightingale.com/?module=API&method=CustomVariables.getCustomVariables&idSite=' . $siteId . '&language=' . $lang . '&token_auth=' . $token . '&period=day&date=' . $monthAgo . ',today&flat=1&format=JSON&filter_pattern_recursive=Version*';
case 'osDistribution':
return 'http://stats.getnightingale.com/?module=API&method=DevicesDetection.getOsFamilies&idSite=' . $siteId . '&language=' . $lang . '&token_auth=' . $token . '&period=range&date=2014-01-12,today&format=JSON&segment=customVariableValue2==' . getVersion();
default:
return '';
}
}
示例9: getHeader
<?php
getHeader();
Posts::handleSiteViewsStatic();
?>
<div align="center" class="col-xs-12 col-sm-12 col-md-2 col-lg-2 col-md-offset-1 col-lg-offset-1">
<a class="btn btn-warning btn-lg"><i class="mdi mdi-download"></i> Download</a>
<span class="help-block">v.<?php
echo getVersion();
?>
Alpha</span>
</div>
<div class="col-xs-12 col-sm-12 col-md-4 col-lg-4 col-md-offset-1 col-lg-offset-1 div_white_left">
<article class="post">
<a href="submit.php"><h3 align="center" style="font-weight: bold;">Submit Page</h3></a>
<p>You have been redirected here from a submit form in our website.</p>
<span>Please confirm that you want to complete the action.</span><br><br>
<span>Action: <?php
echo 'action';
?>
</span>
<br><br>
</article>
</div>
<?php
getFooter();
示例10: getVersion
$pattern = $filename;
}
}
} else {
$indir = INSTALLDIR;
}
function getVersion()
{
// define('GNUSOCIAL_VERSION', '0.9.1');
$source = file_get_contents(INSTALLDIR . '/lib/common.php');
if (preg_match('/^\\s*define\\s*\\(\\s*[\'"]GNUSOCIAL_VERSION[\'"]\\s*,\\s*[\'"](.*)[\'"]\\s*\\)\\s*;/m', $source, $matches)) {
return $matches[1];
}
return 'unknown';
}
$replacements = array('%%version%%' => getVersion(), '%%indir%%' => $indir, '%%pattern%%' => $pattern, '%%outdir%%' => $outdir, '%%htmlout%%' => $outdir, '%%exclude%%' => $exclude);
var_dump($replacements);
$template = file_get_contents(dirname(__FILE__) . '/doxygen.tmpl');
$template = strtr($template, $replacements);
$templateFile = tempnam(sys_get_temp_dir(), 'statusnet-doxygen');
file_put_contents($templateFile, $template);
$cmd = "doxygen " . escapeshellarg($templateFile);
$retval = 0;
passthru($cmd, $retval);
if ($retval == 0) {
echo "Done!\n";
unlink($templateFile);
exit(0);
} else {
echo "Failed! Doxygen config left in {$templateFile}\n";
exit($retval);
示例11: getPluginInfo
/**
* プラグイン情報を取得する
*
* @param array $datas プラグインのデータ配列
* @param string $file プラグインファイルのパス
* @return array
*/
public function getPluginInfo($datas, $file)
{
$plugin = basename($file);
$pluginData = array();
$exists = false;
foreach ($datas as $data) {
if ($plugin == $data['Plugin']['name']) {
$pluginData = $data;
$exists = true;
break;
}
}
// プラグインのバージョンを取得
$corePlugins = Configure::read('BcApp.corePlugins');
$core = false;
if (in_array($plugin, $corePlugins)) {
$core = true;
$version = getVersion();
} else {
$version = getVersion($plugin);
}
// 設定ファイル読み込み
$title = $description = $author = $url = $adminLink = '';
// TODO 互換性のため古いパスも対応
$oldAppConfigPath = $file . DS . 'Config' . DS . 'config.php';
$appConfigPath = $file . DS . 'config.php';
if (!file_exists($appConfigPath)) {
$appConfigPath = $oldAppConfigPath;
}
if (file_exists($appConfigPath)) {
include $appConfigPath;
} elseif (file_exists($oldAppConfigPath)) {
include $oldAppConfigPath;
}
if (isset($title)) {
$pluginData['Plugin']['title'] = $title;
}
if (isset($description)) {
$pluginData['Plugin']['description'] = $description;
}
if (isset($author)) {
$pluginData['Plugin']['author'] = $author;
}
if (isset($url)) {
$pluginData['Plugin']['url'] = $url;
}
$pluginData['Plugin']['update'] = false;
$pluginData['Plugin']['old_version'] = false;
$pluginData['Plugin']['core'] = $core;
if ($exists) {
if (isset($adminLink)) {
$pluginData['Plugin']['admin_link'] = $adminLink;
}
// バージョンにBaserから始まるプラグイン名が入っている場合は古いバージョン
if (!$pluginData['Plugin']['version'] && preg_match('/^Baser[a-zA-Z]+\\s([0-9\\.]+)$/', $version, $matches)) {
$pluginData['Plugin']['version'] = $matches[1];
$pluginData['Plugin']['old_version'] = true;
} elseif (verpoint($pluginData['Plugin']['version']) < verpoint($version) && !in_array($pluginData['Plugin']['name'], Configure::read('BcApp.corePlugins'))) {
$pluginData['Plugin']['update'] = true;
}
$pluginData['Plugin']['registered'] = true;
} else {
// バージョンにBaserから始まるプラグイン名が入っている場合は古いバージョン
if (preg_match('/^Baser[a-zA-Z]+\\s([0-9\\.]+)$/', $version, $matches)) {
$version = $matches[1];
$pluginData['Plugin']['old_version'] = true;
}
$pluginData['Plugin']['id'] = '';
$pluginData['Plugin']['name'] = $plugin;
$pluginData['Plugin']['created'] = '';
$pluginData['Plugin']['version'] = $version;
$pluginData['Plugin']['status'] = false;
$pluginData['Plugin']['modified'] = '';
$pluginData['Plugin']['admin_link'] = '';
$pluginData['Plugin']['registered'] = false;
}
return $pluginData;
}
示例12: html_admin
/**
* List available Administration Tasks
*
* @author Andreas Gohr <andi@splitbrain.org>
* @author Håkan Sandell <hakan.sandell@home.se>
*/
function html_admin()
{
global $ID;
global $INFO;
global $conf;
/** @var DokuWiki_Auth_Plugin $auth */
global $auth;
// build menu of admin functions from the plugins that handle them
$pluginlist = plugin_list('admin');
$menu = array();
foreach ($pluginlist as $p) {
/** @var DokuWiki_Admin_Plugin $obj */
if (($obj = plugin_load('admin', $p)) === null) {
continue;
}
// check permissions
if ($obj->forAdminOnly() && !$INFO['isadmin']) {
continue;
}
$menu[$p] = array('plugin' => $p, 'prompt' => $obj->getMenuText($conf['lang']), 'sort' => $obj->getMenuSort());
}
// data security check
// simple check if the 'savedir' is relative and accessible when appended to DOKU_URL
// it verifies either:
// 'savedir' has been moved elsewhere, or
// has protection to prevent the webserver serving files from it
if (substr($conf['savedir'], 0, 2) == './') {
echo '<a style="border:none; float:right;"
href="http://www.dokuwiki.org/security#web_access_security">
<img src="' . DOKU_URL . $conf['savedir'] . '/security.png" alt="Your data directory seems to be protected properly."
onerror="this.parentNode.style.display=\'none\'" /></a>';
}
print p_locale_xhtml('admin');
// Admin Tasks
if ($INFO['isadmin']) {
ptln('<ul class="admin_tasks">');
if ($menu['usermanager'] && $auth && $auth->canDo('getUsers')) {
ptln(' <li class="admin_usermanager"><div class="li">' . '<a href="' . wl($ID, array('do' => 'admin', 'page' => 'usermanager')) . '">' . $menu['usermanager']['prompt'] . '</a></div></li>');
}
unset($menu['usermanager']);
if ($menu['acl']) {
ptln(' <li class="admin_acl"><div class="li">' . '<a href="' . wl($ID, array('do' => 'admin', 'page' => 'acl')) . '">' . $menu['acl']['prompt'] . '</a></div></li>');
}
unset($menu['acl']);
if ($menu['extension']) {
ptln(' <li class="admin_plugin"><div class="li">' . '<a href="' . wl($ID, array('do' => 'admin', 'page' => 'extension')) . '">' . $menu['extension']['prompt'] . '</a></div></li>');
}
unset($menu['extension']);
if ($menu['config']) {
ptln(' <li class="admin_config"><div class="li">' . '<a href="' . wl($ID, array('do' => 'admin', 'page' => 'config')) . '">' . $menu['config']['prompt'] . '</a></div></li>');
}
unset($menu['config']);
if ($menu['styling']) {
ptln(' <li class="admin_styling"><div class="li">' . '<a href="' . wl($ID, array('do' => 'admin', 'page' => 'styling')) . '">' . $menu['styling']['prompt'] . '</a></div></li>');
}
unset($menu['styling']);
}
ptln('</ul>');
// Manager Tasks
ptln('<ul class="admin_tasks">');
if ($menu['revert']) {
ptln(' <li class="admin_revert"><div class="li">' . '<a href="' . wl($ID, array('do' => 'admin', 'page' => 'revert')) . '">' . $menu['revert']['prompt'] . '</a></div></li>');
}
unset($menu['revert']);
if ($menu['popularity']) {
ptln(' <li class="admin_popularity"><div class="li">' . '<a href="' . wl($ID, array('do' => 'admin', 'page' => 'popularity')) . '">' . $menu['popularity']['prompt'] . '</a></div></li>');
}
unset($menu['popularity']);
// print DokuWiki version:
ptln('</ul>');
echo '<div id="admin__version">';
echo getVersion();
echo '</div>';
// print the rest as sorted list
if (count($menu)) {
// sort by name, then sort
usort($menu, function ($a, $b) {
$strcmp = strcasecmp($a['prompt'], $b['prompt']);
if ($strcmp != 0) {
return $strcmp;
}
if ($a['sort'] == $b['sort']) {
return 0;
}
return $a['sort'] < $b['sort'] ? -1 : 1;
});
// output the menu
ptln('<div class="clearer"></div>');
print p_locale_xhtml('adminplugins');
ptln('<ul>');
foreach ($menu as $item) {
if (!$item['prompt']) {
continue;
}
//.........这里部分代码省略.........
示例13: _step_unpack
/**
* Unpack the tarball
*
* @return bool
*/
private function _step_unpack()
{
$this->_say('<b>' . $this->getLang('pk_extract') . '</b>');
@set_time_limit(120);
@ignore_user_abort();
try {
$tar = new VerboseTar();
$tar->open($this->tgzfile);
$tar->extract($this->tgzdir, 1);
$tar->close();
} catch (Exception $e) {
$this->_warn($e->getMessage());
$this->_warn($this->getLang('pk_fail'));
return false;
}
$this->_say($this->getLang('pk_done'));
$this->_say($this->getLang('pk_version'), hsc(file_get_contents($this->tgzdir . '/VERSION')), getVersion());
return true;
}
示例14: mysql_query
$berhasil++;
} else {
//echo "Error Insert data to new table";
$gagal++;
}
}
//Endwhile
echo "<p>Horreee.. !! Data Kas berhasil di upgrade. Berhasil di transfer {$berhasil} item, Gagal di transfer {$gagal} item. Selesai</p>";
if ($berhasil != 0) {
$finish_query = mysql_query("DROP TABLE buku, kas, pinjaman,tempo");
//Daffuk we
if ($finish_query) {
catat("SISTEM", "Berhasil Upgrade ke versi " . getVersion());
echo "<a href='?upgrade=finish' class='btn btn-success'>Selesai >></a>";
} else {
echo "Unable to drop old tables, do it manualy :D<br>" . mysql_error();
}
}
exit(0);
} elseif ($mode == 'finish') {
echo "<h1>Horeee..</h1><p>Versi Libska berhasil di update, versi saat ini adalah " . getVersion() . ".<br>Silahkan hapus / rename folder upgrade pada direktori utama :D.</p>";
echo "<a href='../index.php?upgrade=selesai' class='btn'>Kembali Ke laptop >></a>";
}
?>
</div>
</div>
</body>
</html>
<?php
putus();
示例15: getVersion
function getVersion()
{
return getVersion();
}