当前位置: 首页>>代码示例>>PHP>>正文


PHP OC_Util::getChannel方法代码示例

本文整理汇总了PHP中OC_Util::getChannel方法的典型用法代码示例。如果您正苦于以下问题:PHP OC_Util::getChannel方法的具体用法?PHP OC_Util::getChannel怎么用?PHP OC_Util::getChannel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OC_Util的用法示例。


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

示例1: check

 /**
  * Check if a new version is available
  * @param string $updaterUrl the url to check, i.e. 'http://apps.owncloud.com/updater.php'
  * @return array | bool
  */
 public function check($updaterUrl)
 {
     // Look up the cache - it is invalidated all 30 minutes
     if (\OC_Appconfig::getValue('core', 'lastupdatedat') + 1800 > time()) {
         return json_decode(\OC_Appconfig::getValue('core', 'lastupdateResult'), true);
     }
     \OC_Appconfig::setValue('core', 'lastupdatedat', time());
     if (\OC_Appconfig::getValue('core', 'installedat', '') == '') {
         \OC_Appconfig::setValue('core', 'installedat', microtime(true));
     }
     $version = \OC_Util::getVersion();
     $version['installed'] = \OC_Appconfig::getValue('core', 'installedat');
     $version['updated'] = \OC_Appconfig::getValue('core', 'lastupdatedat');
     $version['updatechannel'] = \OC_Util::getChannel();
     $version['edition'] = \OC_Util::getEditionString();
     $version['build'] = \OC_Util::getBuild();
     $versionString = implode('x', $version);
     //fetch xml data from updater
     $url = $updaterUrl . '?version=' . $versionString;
     // set a sensible timeout of 10 sec to stay responsive even if the update server is down.
     $ctx = stream_context_create(array('http' => array('timeout' => 10)));
     $xml = @file_get_contents($url, 0, $ctx);
     if ($xml == false) {
         return array();
     }
     $data = @simplexml_load_string($xml);
     $tmp = array();
     $tmp['version'] = $data->version;
     $tmp['versionstring'] = $data->versionstring;
     $tmp['url'] = $data->url;
     $tmp['web'] = $data->web;
     // Cache the result
     \OC_Appconfig::setValue('core', 'lastupdateResult', json_encode($data));
     return $tmp;
 }
开发者ID:omusico,项目名称:isle-web-framework,代码行数:40,代码来源:updater.php

示例2: check

 /**
  * Check if a new version is available
  *
  * @param string $updaterUrl the url to check, i.e. 'http://apps.owncloud.com/updater.php'
  * @return array|bool
  */
 public function check($updaterUrl = null)
 {
     // Look up the cache - it is invalidated all 30 minutes
     if ((int) $this->config->getAppValue('core', 'lastupdatedat') + 1800 > time()) {
         return json_decode($this->config->getAppValue('core', 'lastupdateResult'), true);
     }
     if (is_null($updaterUrl)) {
         $updaterUrl = 'https://updates.owncloud.com/server/';
     }
     $this->config->setAppValue('core', 'lastupdatedat', time());
     if ($this->config->getAppValue('core', 'installedat', '') === '') {
         $this->config->setAppValue('core', 'installedat', microtime(true));
     }
     $version = Util::getVersion();
     $version['installed'] = $this->config->getAppValue('core', 'installedat');
     $version['updated'] = $this->config->getAppValue('core', 'lastupdatedat');
     $version['updatechannel'] = \OC_Util::getChannel();
     $version['edition'] = \OC_Util::getEditionString();
     $version['build'] = \OC_Util::getBuild();
     $versionString = implode('x', $version);
     //fetch xml data from updater
     $url = $updaterUrl . '?version=' . $versionString;
     $tmp = [];
     $xml = $this->getUrlContent($url);
     if ($xml) {
         $loadEntities = libxml_disable_entity_loader(true);
         $data = @simplexml_load_string($xml);
         libxml_disable_entity_loader($loadEntities);
         if ($data !== false) {
             $tmp['version'] = (string) $data->version;
             $tmp['versionstring'] = (string) $data->versionstring;
             $tmp['url'] = (string) $data->url;
             $tmp['web'] = (string) $data->web;
         } else {
             libxml_clear_errors();
         }
     } else {
         $data = [];
     }
     // Cache the result
     $this->config->setAppValue('core', 'lastupdateResult', json_encode($data));
     return $tmp;
 }
开发者ID:stweil,项目名称:owncloud-core,代码行数:49,代码来源:VersionCheck.php

示例3: getChannel

 /**
  * Get current update channel
  * @return string
  * @since 8.1.0
  */
 public static function getChannel()
 {
     return \OC_Util::getChannel();
 }
开发者ID:enoch85,项目名称:owncloud-testserver,代码行数:9,代码来源:util.php

示例4: 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;
 }
开发者ID:pinoniq,项目名称:core,代码行数:14,代码来源:util.php

示例5: doUpgrade

 /**
  * runs the update actions in maintenance mode, does not upgrade the source files
  * except the main .htaccess file
  *
  * @param string $currentVersion current version to upgrade to
  * @param string $installedVersion previous version from which to upgrade from
  *
  * @throws \Exception
  * @return bool true if the operation succeeded, false otherwise
  */
 private function doUpgrade($currentVersion, $installedVersion)
 {
     // Stop update if the update is over several major versions
     $allowedPreviousVersion = $this->getAllowedPreviousVersion();
     if (!self::isUpgradePossible($installedVersion, $currentVersion, $allowedPreviousVersion)) {
         throw new \Exception('Updates between multiple major versions and downgrades are unsupported.');
     }
     // Update .htaccess files
     try {
         Setup::updateHtaccess();
         Setup::protectDataDirectory();
     } catch (\Exception $e) {
         throw new \Exception($e->getMessage());
     }
     // create empty file in data dir, so we can later find
     // out that this is indeed an ownCloud data directory
     // (in case it didn't exist before)
     file_put_contents($this->config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data') . '/.ocdata', '');
     // pre-upgrade repairs
     $repair = new Repair(Repair::getBeforeUpgradeRepairSteps());
     $this->emitRepairMessages($repair);
     $repair->run();
     // simulate DB upgrade
     if ($this->simulateStepEnabled) {
         $this->checkCoreUpgrade();
         // simulate apps DB upgrade
         $this->checkAppUpgrade($currentVersion);
     }
     if ($this->updateStepEnabled) {
         $this->doCoreUpgrade();
         // install new shipped apps on upgrade
         OC_Installer::installShippedApps();
         // update all shipped apps
         $disabledApps = $this->checkAppsRequirements();
         $this->doAppUpgrade();
         // upgrade appstore apps
         $this->upgradeAppStoreApps($disabledApps);
         // post-upgrade repairs
         $repair = new Repair(Repair::getRepairSteps());
         $this->emitRepairMessages($repair);
         $repair->run();
         //Invalidate update feed
         $this->config->setAppValue('core', 'lastupdatedat', 0);
         // Check for code integrity on the stable channel
         if (\OC_Util::getChannel() === 'stable') {
             $this->emit('\\OC\\Updater', 'startCheckCodeIntegrity');
             $this->checker->runInstanceVerification();
             $this->emit('\\OC\\Updater', 'finishedCheckCodeIntegrity');
         }
         // only set the final version if everything went well
         $this->config->setSystemValue('version', implode('.', \OCP\Util::getVersion()));
     }
 }
开发者ID:chrsch,项目名称:core,代码行数:63,代码来源:updater.php

示例6: buildUpdateUrl

 /**
  * @param string $baseUrl
  * @return string
  */
 private function buildUpdateUrl($baseUrl)
 {
     return $baseUrl . '?version=' . implode('x', \OCP\Util::getVersion()) . 'xinstalledatxlastupdatedatx' . \OC_Util::getChannel() . 'x' . \OC_Util::getEditionString() . 'x';
 }
开发者ID:kenwi,项目名称:core,代码行数:8,代码来源:updater.php

示例7: getHumanVersion

 /**
  * A human readable string is generated based on version, channel and build number
  * @return string
  */
 public static function getHumanVersion()
 {
     $version = '7.0.4+dfsg-4~deb8u1 (Debian)' . ' (' . OC_Util::getChannel() . ')';
     $build = OC_Util::getBuild();
     if (!empty($build) and OC_Util::getChannel() === 'daily') {
         $version .= ' Build:' . $build;
     }
     return $version;
 }
开发者ID:WYSAC,项目名称:oregon-owncloud,代码行数:13,代码来源:util.php

示例8: testGetChannel

 public function testGetChannel()
 {
     $this->assertSame(\OC_Util::getChannel(), $this->environmentHelper->getChannel());
 }
开发者ID:rchicoli,项目名称:owncloud-core,代码行数:4,代码来源:EnvironmentHelperTest.php

示例9: getChannel

 /**
  * @return string
  */
 protected function getChannel()
 {
     return \OC_Util::getChannel();
 }
开发者ID:rchicoli,项目名称:owncloud-core,代码行数:7,代码来源:BackgroundJob.php

示例10: check

	/**
	 * Check if a new version is available
	 *
	 * @param string $updaterUrl the url to check, i.e. 'http://apps.owncloud.com/updater.php'
	 * @return array|bool
	 */
	public function check($updaterUrl = null) {

		// Look up the cache - it is invalidated all 30 minutes
		if (($this->config->getValue('core', 'lastupdatedat') + 1800) > time()) {
			return json_decode($this->config->getValue('core', 'lastupdateResult'), true);
		}

		if (is_null($updaterUrl)) {
			$updaterUrl = 'https://apps.owncloud.com/updater.php';
		}

		$this->config->setValue('core', 'lastupdatedat', time());

		if ($this->config->getValue('core', 'installedat', '') == '') {
			$this->config->setValue('core', 'installedat', microtime(true));
		}

		$version = \OC_Util::getVersion();
		$version['installed'] = $this->config->getValue('core', 'installedat');
		$version['updated'] = $this->config->getValue('core', 'lastupdatedat');
		$version['updatechannel'] = \OC_Util::getChannel();
		$version['edition'] = \OC_Util::getEditionString();
		$version['build'] = \OC_Util::getBuild();
		$versionString = implode('x', $version);

		//fetch xml data from updater
		$url = $updaterUrl . '?version=' . $versionString;

		// set a sensible timeout of 10 sec to stay responsive even if the update server is down.

		$tmp = array();
		$xml = $this->httpHelper->getUrlContent($url);
		if ($xml) {
			$loadEntities = libxml_disable_entity_loader(true);
			$data = @simplexml_load_string($xml);
			libxml_disable_entity_loader($loadEntities);
			if ($data !== false) {
				$tmp['version'] = $data->version;
				$tmp['versionstring'] = $data->versionstring;
				$tmp['url'] = $data->url;
				$tmp['web'] = $data->web;
			}
		} else {
			$data = array();
		}

		// Cache the result
		$this->config->setValue('core', 'lastupdateResult', json_encode($data));
		return $tmp;
	}
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:56,代码来源:updater.php


注:本文中的OC_Util::getChannel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。