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


PHP Version::getVersionString方法代码示例

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


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

示例1: testParsesVersionNumbers

 /**
  * @dataProvider versionProvider
  *
  * @param string $versionString
  * @param string $expectedMajor
  * @param string $expectedMinor
  * @param string $expectedPatch
  * @param string $expectedLabel
  * @param string $expectedMetadata
  */
 public function testParsesVersionNumbers($versionString, $expectedMajor, $expectedMinor, $expectedPatch, $expectedLabel = '', $expectedMetadata = '')
 {
     $version = new Version($versionString);
     $this->assertSame($expectedMajor, $version->getMajor()->getValue());
     $this->assertSame($expectedMinor, $version->getMinor()->getValue());
     $this->assertSame($expectedPatch, $version->getPatch()->getValue());
     $this->assertSame($expectedLabel, $version->getLabel());
     $this->assertSame($expectedMetadata, $version->getBuildMetadata());
     $this->assertSame($versionString, $version->getVersionString());
 }
开发者ID:paul-schulleri,项目名称:phive,代码行数:20,代码来源:VersionTest.php

示例2: complies

 /**
  * @param Version $version
  *
  * @return bool
  */
 public function complies(Version $version)
 {
     return $this->asString() == $version->getVersionString();
 }
开发者ID:paul-schulleri,项目名称:phive,代码行数:9,代码来源:ExactVersionConstraint.php

示例3: getFirstMatchingPharNode

 /**
  * @param string  $name
  * @param Version $version
  *
  * @return \DOMElement
  */
 private function getFirstMatchingPharNode($name, Version $version)
 {
     $query = sprintf('//phar[@name="%s" and @version="%s"]', $name, $version->getVersionString());
     return $this->getXPath()->query($query)->item(0);
 }
开发者ID:paul-schulleri,项目名称:phive,代码行数:11,代码来源:PharRepository.php

示例4: run

 public function run()
 {
     $timer = new SystemTimer();
     $connection = null;
     $statsConnection = null;
     $rawStatsConnection = null;
     $trace = new NullTrace();
     if (FajrConfig::get('Debug.Trace') === true) {
         $trace = new HtmlTrace($timer, "--Trace--");
     }
     try {
         Input::prepare();
         $login = Input::get('login');
         Input::set('login', null);
         $krbpwd = Input::get('krbpwd');
         Input::set('krbpwd', null);
         $cosignCookie = Input::get('cosignCookie');
         Input::set('cosignCookie', null);
         // FIXME this should be refactored
         if ($login !== null && $krbpwd !== null || $cosignCookie !== null) {
             // we are going to log in, so we get a clean session
             // this needs to be done before a connection
             // is created, because we pass cookie file name
             // that contains session_id into AIS2CurlConnection
             // If we regenerated the session id afterwards,
             // we could not find the cookie file after a redirect
             FajrUtils::dropSession();
         }
         $connection = new connection\CurlConnection(FajrUtils::getCookieFile());
         $rawStatsConnection = new connection\StatsConnection($connection, new SystemTimer());
         $connection = $rawStatsConnection;
         $connection = new connection\GzipDecompressingConnection($connection, FajrConfig::getDirectory('Path.Temporary'));
         $connection = new connection\AIS2ErrorCheckingConnection($connection);
         $statsConnection = new connection\StatsConnection($connection, new SystemTimer());
         $connection = $statsConnection;
         $simpleConnection = new connection\HttpToSimpleConnectionAdapter($connection);
         AIS2Utils::connection($simpleConnection);
         // toto tu je docasne
         if (Input::get('logout') !== null) {
             FajrUtils::logout($connection);
             FajrUtils::redirect();
         }
         if ($login !== null && $krbpwd !== null) {
             $loggedIn = FajrUtils::login(new CosignLogin($login, $krbpwd), $connection);
             $login = null;
             $krbpwd = null;
         } else {
             if ($cosignCookie !== null) {
                 $loggedIn = FajrUtils::login(new AIS2CookieLogin($cosignCookie), $connection);
                 $cosignCookie = null;
             } else {
                 $loggedIn = FajrUtils::isLoggedIn();
             }
         }
         if ($loggedIn) {
             DisplayManager::addContent('<div class=\'logout\'><a class="button negative" href="' . FajrUtils::linkUrl(array('logout' => true)) . '">
     <img src="images/door_in.png" alt=""/>Odhlásiť</a></div>');
             $adminStudia = new VSES017\AdministraciaStudiaScreen($trace, $simpleConnection);
             if (Input::get('studium') === null) {
                 Input::set('studium', 0);
             }
             $zoznamStudii = $adminStudia->getZoznamStudii($trace->addChild("Get Zoznam Studii:"));
             $zoznamStudiiTable = new Table(TableDefinitions::zoznamStudii(), 'studium', array('tab' => Input::get('tab')));
             $zoznamStudiiTable->addRows($zoznamStudii->getData());
             $zoznamStudiiTable->setOption('selected_key', Input::get('studium'));
             $zoznamStudiiTable->setOption('collapsed', true);
             $zoznamStudiiCollapsible = new Collapsible(new HtmlHeader('Zoznam štúdií'), $zoznamStudiiTable, true);
             DisplayManager::addContent($zoznamStudiiCollapsible->getHtml());
             $zapisneListy = $adminStudia->getZapisneListy($trace->addChild('getZapisneListy'), Input::get('studium'));
             $zapisneListyTable = new Table(TableDefinitions::zoznamZapisnychListov(), 'list', array('studium' => Input::get('studium'), 'tab' => Input::get('tab')));
             if (Input::get('list') === null) {
                 $tmp = $zapisneListy->getData();
                 $lastList = end($tmp);
                 Input::set('list', $lastList['index']);
             }
             $zapisneListyTable->addRows($zapisneListy->getData());
             $zapisneListyTable->setOption('selected_key', Input::get('list'));
             $zapisneListyTable->setOption('collapsed', true);
             $zapisneListyCollapsible = new Collapsible(new HtmlHeader('Zoznam zápisných listov'), $zapisneListyTable, true);
             DisplayManager::addContent($zapisneListyCollapsible->getHtml());
             $terminyHodnotenia = new VSES017\TerminyHodnoteniaScreen($trace, $simpleConnection, $adminStudia->getIdZapisnyList($trace, Input::get('list')), $adminStudia->getIdStudium($trace, Input::get('list')));
             if (Input::get('tab') === null) {
                 Input::set('tab', 'TerminyHodnotenia');
             }
             $tabs = new TabManager('tab', array('studium' => Input::get('studium'), 'list' => Input::get('list')));
             // FIXME: chceme to nejak refaktorovat, aby sme nevytvarali zbytocne
             // objekty, ktore v konstruktore robia requesty
             $hodnoteniaScreen = new VSES017\HodnoteniaPriemeryScreen($trace, $simpleConnection, $adminStudia->getIdZapisnyList($trace, Input::get('list')));
             $tabs->addTab('TerminyHodnotenia', 'Moje skúšky', new MojeTerminyHodnoteniaCallback($trace, $terminyHodnotenia, $hodnoteniaScreen));
             $tabs->addTab('ZapisSkusok', 'Prihlásenie na skúšky', new ZoznamTerminovCallback($trace, $terminyHodnotenia, $hodnoteniaScreen));
             $tabs->addTab('ZapisnyList', 'Zápisný list', new ZapisanePredmetyCallback($trace, $terminyHodnotenia));
             $tabs->addTab('Hodnotenia', 'Hodnotenia/Priemery', new HodnoteniaCallback($trace, $hodnoteniaScreen));
             $tabs->setActive(Input::get('tab'));
             DisplayManager::addContent($tabs->getHtml());
             $version = '<div>Fajr verzia ' . hescape(Version::getVersionString()) . '</div>';
             DisplayManager::addContent($version);
             $statistics = "<div> Fajr made " . $statsConnection->getTotalCount() . " requests and downloaded " . $rawStatsConnection->getTotalSize() . " bytes (" . $statsConnection->getTotalSize() . " bytes uncompressed) of data from AIS2 in " . sprintf("%.3f", $statsConnection->getTotalTime()) . " seconds. It took " . sprintf("%.3f", $timer->getElapsedTime()) . " seconds to generate this page.</div>";
             DisplayManager::addContent($statistics);
         } else {
             DisplayManager::addContent('loginBox', true);
//.........这里部分代码省略.........
开发者ID:BGCX067,项目名称:fajr-svn-to-git,代码行数:101,代码来源:fajr.php

示例5: testGetVersion

 /**
  * Tests Version::createSource
  */
 public function testGetVersion()
 {
     $version = Version::getVersionString();
     $this->assertEquals('phpbu 3.0', substr($version, 0, 9), 'version should match');
 }
开发者ID:todiadiyatmo,项目名称:phpbu,代码行数:8,代码来源:VersionTest.php

示例6: complies

 /**
  * @param Version $version
  *
  * @return bool
  */
 public function complies(Version $version)
 {
     return $version->getVersionString() == $this->minimalVersion->getVersionString() || $version->isGreaterThan($this->minimalVersion);
 }
开发者ID:paul-schulleri,项目名称:phive,代码行数:9,代码来源:GreaterThanOrEqualToVersionConstraint.php

示例7: ZapisanePredmetyCallback

        $tabs->addTab('ZapisnyList', 'Zápisný list', new ZapisanePredmetyCallback($terminyHodnotenia));
        $tabs->addTab('Hodnotenia', 'Hodnotenia/Priemery', new HodnoteniaCallback($hodnoteniaScreen));
        $tabs->setActive(Input::get('tab'));
        DisplayManager::addContent($tabs->getHtml());
        $timeDiff = microtime(true) - $startTime;
        $version = '<div>Fajr verzia ' . hescape(Version::getVersionString()) . '</div>';
        DisplayManager::addContent($version);
        $statistics = "<div> Fajr made " . $statsConnection->getTotalCount() . " requests and downloaded " . $rawStatsConnection->getTotalSize() . " bytes (" . $statsConnection->getTotalSize() . " bytes uncompressed) of data from AIS2 in " . sprintf("%.3f", $statsConnection->getTotalTime()) . " seconds. It took " . sprintf("%.3f", $timeDiff) . " seconds to generate this page.</div>";
        DisplayManager::addContent($statistics);
    } else {
        DisplayManager::addContent('loginBox', true);
        DisplayManager::addContent('warnings', true);
        DisplayManager::addContent('terms', true);
        DisplayManager::addContent('credits', true);
        $version = "<div class='version prepend-1 span-21 last increase-line-height'>\n<strong>Verzia fajru:</strong> \n";
        $version .= hescape(Version::getVersionString());
        $version .= '</div>';
        DisplayManager::addContent($version);
        DisplayManager::addContent(Version::getChangelog(), false);
    }
} catch (AIS2LoginException $e) {
    if ($connection) {
        FajrUtils::logout($connection);
    }
    DisplayManager::addException($e);
} catch (Exception $e) {
    DisplayManager::addException($e);
}
if ($debugConnection) {
    DisplayManager::dumpRequests($debugConnection->getRequests());
}
开发者ID:BGCX067,项目名称:fajr-svn-to-git,代码行数:31,代码来源:fajr.php


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