本文整理汇总了PHP中OC_Util::getVersionString方法的典型用法代码示例。如果您正苦于以下问题:PHP OC_Util::getVersionString方法的具体用法?PHP OC_Util::getVersionString怎么用?PHP OC_Util::getVersionString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OC_Util
的用法示例。
在下文中一共展示了OC_Util::getVersionString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCapabilities
public static function getCapabilities()
{
$result = array();
list($major, $minor, $micro) = OC_Util::getVersion();
$result['version'] = array('major' => $major, 'minor' => $minor, 'micro' => $micro, 'string' => OC_Util::getVersionString(), 'edition' => OC_Util::getEditionString());
$result['capabilities'] = \OC::$server->getCapabilitiesManager()->getCapabilities();
return new OC_OCS_Result($result);
}
示例2: getCapabilities
public static function getCapabilities($parameters)
{
$result = array();
list($major, $minor, $micro) = OC_Util::getVersion();
$result['version'] = array('major' => $major, 'minor' => $minor, 'micro' => $micro, 'string' => OC_Util::getVersionString(), 'edition' => OC_Util::getEditionString());
$result['capabilities'] = array('core' => array('pollinterval' => OC_Config::getValue('pollinterval', 60)));
return new OC_OCS_Result($result);
}
示例3: __construct
/**
* @param IConfig $config
* @param EventDispatcherInterface $dispatcher
* @param IRequest $request
*/
public function __construct(IConfig $config, EventDispatcherInterface $dispatcher, IRequest $request)
{
$defaults = new OC_Defaults();
$this->config = $config;
$this->application = new SymfonyApplication($defaults->getName(), \OC_Util::getVersionString());
$this->dispatcher = $dispatcher;
$this->request = $request;
}
示例4: checkVersion
public static function checkVersion($newVersionArray, $newVersionString)
{
$currentVersionArray = \OC_Util::getVersion();
$currentVersion = \OC_Util::getVersionString();
$difference = intval($newVersionArray[0]) - intval($currentVersionArray[0]);
if ($difference > 1 || $difference < 0 || version_compare($currentVersion, $newVersionString) > 0) {
$message = (string) App::$l10n->t('Not possible to update %s to %s. Downgrading or skipping major releases is not supported.', array($currentVersion, implode('.', $newVersionArray)));
App::log($message);
throw new \Exception($message);
}
}
示例5: checkVersion
public static function checkVersion($newVersionArray, $newVersionString)
{
$l10n = \OC::$server->getL10N('updater');
$currentVersionArray = \OCP\Util::getVersion();
$currentVersion = \OC_Util::getVersionString();
$difference = intval($newVersionArray[0]) - intval($currentVersionArray[0]);
if ($difference > 1 || $difference < 0 || version_compare($currentVersion, $newVersionString) > 0) {
$message = (string) $l10n->t('Not possible to update %s to %s. Downgrading or skipping major releases is not supported.', [$currentVersion, implode('.', $newVersionArray)]);
\OC::$server->getLogger()->error($message, ['app' => 'updater']);
throw new \Exception($message);
}
}
示例6: checkVersion
public static function checkVersion($newVersionArray, $newVersionString)
{
$l10n = \OC::$server->getL10N('updater');
$currentVersionArray = \OCP\Util::getVersion();
$currentVersion = \OC_Util::getVersionString();
// https://github.com/owncloud/core/issues/18880
// Always positive for versions >= 100.0.0.0
if (version_compare($newVersionString, '100.0.0.0', '>=')) {
return;
}
$difference = intval($newVersionArray[0]) - intval($currentVersionArray[0]);
if ($difference > 1 || $difference < 0 || version_compare($currentVersion, $newVersionString) > 0) {
$message = (string) $l10n->t('Not possible to update %s to %s. Downgrading or skipping major releases is not supported.', [$currentVersion, implode('.', $newVersionArray)]);
\OC::$server->getLogger()->error($message, ['app' => 'updater']);
throw new \Exception($message);
}
}
示例7: __construct
/**
* @param IConfig $config
*/
public function __construct(IConfig $config)
{
$defaults = new OC_Defaults();
$this->config = $config;
$this->application = new SymfonyApplication($defaults->getName(), \OC_Util::getVersionString());
}
示例8: checkUpgrade
/**
* Checks if the version requires an update and shows
* @param bool $showTemplate Whether an update screen should get shown
* @return bool|void
*/
public static function checkUpgrade($showTemplate = true)
{
if (\OCP\Util::needUpgrade()) {
$systemConfig = \OC::$server->getSystemConfig();
if ($showTemplate && !$systemConfig->getValue('maintenance', false)) {
$version = OC_Util::getVersion();
$oldTheme = $systemConfig->getValue('theme');
$systemConfig->setValue('theme', '');
OC_Util::addScript('config');
// needed for web root
OC_Util::addScript('update');
$tmpl = new OC_Template('', 'update.admin', 'guest');
$tmpl->assign('version', OC_Util::getVersionString());
// get third party apps
$apps = OC_App::getEnabledApps();
$incompatibleApps = array();
foreach ($apps as $appId) {
$info = OC_App::getAppInfo($appId);
if (!OC_App::isAppCompatible($version, $info)) {
$incompatibleApps[] = $info;
}
}
$tmpl->assign('appList', $incompatibleApps);
$tmpl->assign('productName', 'ownCloud');
// for now
$tmpl->assign('oldTheme', $oldTheme);
$tmpl->printPage();
exit;
} else {
return true;
}
}
return false;
}
示例9: execute
protected function execute(InputInterface $input, OutputInterface $output)
{
$values = array('installed' => \OC_Config::getValue('installed') ? 'true' : 'false', 'version' => implode('.', \OC_Util::getVersion()), 'versionstring' => \OC_Util::getVersionString(), 'edition' => \OC_Util::getEditionString());
print_r($values);
}
示例10: checkUpgrade
public static function checkUpgrade($showTemplate = true)
{
if (OC_Config::getValue('installed', false)) {
$installedVersion = OC_Config::getValue('version', '0.0.0');
$currentVersion = implode('.', OC_Util::getVersion());
if (version_compare($currentVersion, $installedVersion, '>')) {
if ($showTemplate && !OC_Config::getValue('maintenance', false)) {
OC_Config::setValue('theme', '');
$minimizerCSS = new OC_Minimizer_CSS();
$minimizerCSS->clearCache();
$minimizerJS = new OC_Minimizer_JS();
$minimizerJS->clearCache();
OC_Util::addscript('update');
$tmpl = new OC_Template('', 'update', 'guest');
$tmpl->assign('version', OC_Util::getVersionString());
$tmpl->printPage();
exit;
} else {
return true;
}
}
return false;
}
}
示例11: set_time_limit
/**
* Copyright (c) 2013 Bart Visscher <bartv@thisnet.nl>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
use Symfony\Component\Console\Application;
$RUNTIME_NOAPPS = true;
require_once 'lib/base.php';
// set to run indefinitely if needed
set_time_limit(0);
// Don't do anything if ownCloud has not been installed yet
if (!OC_Config::getValue('installed', false)) {
echo "Console can only be used once ownCloud has been installed" . PHP_EOL;
exit(0);
}
if (!OC::$CLI) {
echo "This script can be run from the command line only" . PHP_EOL;
exit(0);
}
$defaults = new OC_Defaults();
$application = new Application($defaults->getName(), \OC_Util::getVersionString());
require_once 'core/register_command.php';
foreach (OC_App::getAllApps() as $app) {
$file = OC_App::getAppPath($app) . '/appinfo/register_command.php';
if (file_exists($file)) {
require $file;
}
}
$application->run();
示例12: p
<?php
}
?>
</fieldset>
<fieldset class="personalblock">
<legend><strong><?php
p($l->t('Version'));
?>
</strong></legend>
<strong><?php
p($defaults->getName());
?>
</strong> <?php
p(OC_Util::getVersionString());
if (OC_Util::getEditionString() === '') {
?>
(<?php
print_unescaped(OC_Updater::ShowUpdatingHint());
?>
)<br/>
<?php
print_unescaped($l->t('Developed by the <a href="http://ownCloud.org/contact" target="_blank">ownCloud community</a>, the <a href="https://github.com/owncloud" target="_blank">source code</a> is licensed under the <a href="http://www.gnu.org/licenses/agpl-3.0.html" target="_blank"><abbr title="Affero General Public License">AGPL</abbr></a>.'));
}
?>
</fieldset>
<fieldset class="personalblock credits-footer">
<p>
<?php
print_unescaped($defaults->getShortFooter());
示例13: testGetVersionString
public function testGetVersionString()
{
$version = \OC_Util::getVersionString();
$this->assertTrue(is_string($version));
}
示例14: getHumanVersion
/**
* A human readable string is generated based on version, channel and build number
*
* @return string
*/
public static function getHumanVersion()
{
$version = OC_Util::getVersionString() . ' (' . OC_Util::getChannel() . ')';
$build = OC_Util::getBuild();
if (!empty($build) and OC_Util::getChannel() === 'daily') {
$version .= ' Build:' . $build;
}
return $version;
}
示例15: printUpgradePage
/**
* Prints the upgrade page
*/
private static function printUpgradePage()
{
$systemConfig = \OC::$server->getSystemConfig();
$oldTheme = $systemConfig->getValue('theme');
$systemConfig->setValue('theme', '');
\OCP\Util::addScript('config');
// needed for web root
\OCP\Util::addScript('update');
// check whether this is a core update or apps update
$installedVersion = $systemConfig->getValue('version', '0.0.0');
$currentVersion = implode('.', OC_Util::getVersion());
$appManager = \OC::$server->getAppManager();
$tmpl = new OC_Template('', 'update.admin', 'guest');
$tmpl->assign('version', OC_Util::getVersionString());
// if not a core upgrade, then it's apps upgrade
if (version_compare($currentVersion, $installedVersion, '=')) {
$tmpl->assign('isAppsOnlyUpgrade', true);
} else {
$tmpl->assign('isAppsOnlyUpgrade', false);
}
// get third party apps
$ocVersion = OC_Util::getVersion();
$tmpl->assign('appsToUpgrade', $appManager->getAppsNeedingUpgrade($ocVersion));
$tmpl->assign('incompatibleAppsList', $appManager->getIncompatibleApps($ocVersion));
$tmpl->assign('productName', 'ownCloud');
// for now
$tmpl->assign('oldTheme', $oldTheme);
$tmpl->printPage();
}