本文整理汇总了PHP中Craft::getYiiVersion方法的典型用法代码示例。如果您正苦于以下问题:PHP Craft::getYiiVersion方法的具体用法?PHP Craft::getYiiVersion怎么用?PHP Craft::getYiiVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Craft
的用法示例。
在下文中一共展示了Craft::getYiiVersion方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _calculateServerInfo
/**
* @access private
* @return string
*/
private function _calculateServerInfo()
{
$info[] = '<a href="http://buildwithcraft.com/">Craft</a> ' . Craft::t('{version} build {build}', array('version' => CRAFT_VERSION, 'build' => CRAFT_BUILD));
$info[] = isset($_SERVER['SERVER_SOFTWARE']) ? $_SERVER['SERVER_SOFTWARE'] : '';
$info[] = 'Yii v' . Craft::getYiiVersion();
$info[] = \CTimestamp::formatDate(craft()->locale->getTimeFormat());
return implode(' | ', $info);
}
示例2: beforeAction
/**
* @param string $action
* @param array $params
* @return bool
*/
public function beforeAction($action, $params)
{
if ($action == 'create') {
// If the 1nd dimension is the 1nd index, then we know it's a plugin. No need to make them specify the path.
if (isset($params[0][1])) {
$plugin = $params[0][1];
$path = craft()->path->getMigrationsPath($plugin);
if (!IOHelper::folderExists($path)) {
echo 'The migration folder does not exist at ' . $path . ". Creating...\n";
if (!IOHelper::createFolder($path)) {
echo 'Sorry... I tried to create the folder, but could not.';
return 1;
} else {
echo 'Successfully created.';
}
}
}
}
$yiiVersion = Craft::getYiiVersion();
echo "\nCraft Migration Tool (based on Yii v{$yiiVersion})\n\n";
return true;
}