本文整理匯總了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);
}