本文整理汇总了PHP中xPDO::getVersionData方法的典型用法代码示例。如果您正苦于以下问题:PHP xPDO::getVersionData方法的具体用法?PHP xPDO::getVersionData怎么用?PHP xPDO::getVersionData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xPDO
的用法示例。
在下文中一共展示了xPDO::getVersionData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkDependencies
/**
* Check dependency constraints for the package.
*
* @param array $dependencies An array of dependencies to check.
*
* @return array An array of unsatisfied dependencies.
*/
public function checkDependencies(array $dependencies)
{
$unsatisfied = array();
$dependencies = xPDOTransport::checkPlatformDependencies($dependencies);
foreach ($dependencies as $package => $constraint) {
if (strtolower($package) === strtolower($this->identifier)) {
continue;
}
switch (strtolower($package)) {
case 'modx':
$versionData = $this->xpdo->getVersionData();
if (!xPDOTransport::satisfies($versionData['full_version'], $constraint)) {
$unsatisfied[$package] = $constraint;
}
break;
default:
/* get latest installed package version */
$latestQuery = $this->xpdo->newQuery('modTransportPackage', array(array("UCASE({$this->xpdo->escape('package_name')}) LIKE UCASE({$this->xpdo->quote($package)})"), 'installed:IS NOT' => null));
$latestQuery->sortby('installed', 'DESC');
/** @var modTransportPackage $latest */
$latest = $this->xpdo->getObject('modTransportPackage', $latestQuery);
if ($latest) {
$latest->parseSignature();
if (xPDOTransport::satisfies($latest->version, $constraint)) {
unset($latest);
continue;
}
}
$unsatisfied[$package] = $constraint;
break;
}
}
return $unsatisfied;
}
示例2: args
protected function args(array $args = array())
{
if (!is_array($this->xpdo->version)) {
$this->xpdo->getVersionData();
}
$baseArgs = array('api_key' => $this->get('api_key'), 'username' => $this->get('username'), 'uuid' => $this->xpdo->uuid, 'database' => $this->xpdo->config['dbtype'], 'revolution_version' => $this->xpdo->version['code_name'] . '-' . $this->xpdo->version['full_version'], 'supports' => $this->xpdo->version['code_name'] . '-' . $this->xpdo->version['full_version'], 'http_host' => $this->xpdo->getOption('http_host'), 'php_version' => XPDO_PHP_VERSION, 'language' => $this->xpdo->getOption('manager_language'));
return array_merge($baseArgs, $args);
}