本文整理汇总了PHP中Version::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP Version::getName方法的具体用法?PHP Version::getName怎么用?PHP Version::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Version
的用法示例。
在下文中一共展示了Version::getName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: equals
/**
* @param Version $version
* @return bool
*/
public function equals(Version $version)
{
return $this->name === $version->getName() && $this->build === $version->getBuild();
}
示例2: updateVersion
private function updateVersion(Addon $addon, Version $package)
{
$version = null;
if ($addon->isInDB()) {
$version = $addon->Versions()->filter('Version', $package->getVersionNormalized())->first();
}
if (!$version) {
$version = new AddonVersion();
}
$version->Name = $package->getName();
$version->Type = str_replace('silverstripe-', '', $package->getType());
$version->Description = $package->getDescription();
$version->Released = strtotime($package->getTime());
$keywords = $package->getKeywords();
if ($keywords) {
foreach ($keywords as $keyword) {
$keyword = AddonKeyword::get_by_name($keyword);
$addon->Keywords()->add($keyword);
$version->Keywords()->add($keyword);
}
}
$version->Version = $package->getVersionNormalized();
$version->PrettyVersion = $package->getVersion();
$stability = VersionParser::parseStability($package->getVersion());
$isDev = $stability === 'dev';
$version->Development = $isDev;
$version->SourceType = $package->getSource()->getType();
$version->SourceUrl = $package->getSource()->getUrl();
$version->SourceReference = $package->getSource()->getReference();
if ($package->getDist()) {
$version->DistType = $package->getDist()->getType();
$version->DistUrl = $package->getDist()->getUrl();
$version->DistReference = $package->getDist()->getReference();
$version->DistChecksum = $package->getDist()->getShasum();
}
$version->Extra = $package->getExtra();
$version->Homepage = $package->getHomepage();
$version->License = $package->getLicense();
// $version->Support = $package->getSupport();
$addon->Versions()->add($version);
$this->updateLinks($version, $package);
$this->updateCompatibility($addon, $version, $package);
$this->updateAuthors($version, $package);
}