yiiapi/build/tasks/YiiInitTask.php

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php
/**
 * YiiInitTask class file.
 *
 * @author Qiang Xue <qiang.xue@gmail.com>
 * @link http://www.yiiframework.com/
 * @copyright 2008-2013 Yii Software LLC
 * @license http://www.yiiframework.com/license/
 */

require_once 'phing/Task.php';
require_once 'phing/tasks/system/PropertyTask.php';

/**
 * YiiInitTask initializes a few property values.
 *
 * The following properties are created:
 * <pre>
 * <li>yii.version: the version number of Yii</li>
 * <li>yii.revision: the SVN revision number of Yii</li>
 * <li>yii.winbuild: whether this build is on Windows (true) or not (false)</li>
 * </pre>
 *
 * @author Qiang Xue <qiang.xue@gmail.com>
 * @package build.tasks
 * @since 1.0
 */
class YiiInitTask extends PropertyTask
{
	/**
	 * Execute lint check against PhingFile or a FileSet
	 */
	public function main()
	{
		$this->addProperty('yii.version',$this->getYiiVersion());
		$this->addProperty('yii.revision',$this->getYiiRevision());
		$this->addProperty('yii.winbuild', substr(PHP_OS, 0, 3) == 'WIN' ? 'true' : 'false');
		$this->addProperty('yii.release',$this->getYiiRelease());
		$this->addProperty('yii.date',date('M j, Y'));
	}

	/**
	 * @return string Yii version
	 */
	private function getYiiVersion()
	{
		$coreFile=dirname(__FILE__).'/../../framework/YiiBase.php';
		if(is_file($coreFile))
		{
			$contents=file_get_contents($coreFile);
			$matches=array();
			if(preg_match('/public static function getVersion.*?return \'(.*?)\'/ms',$contents,$matches)>0)
				return $matches[1];
		}
		return 'unknown';
	}

	private function getYiiRelease()
	{
		$changelog=dirname(__FILE__).'/../../CHANGELOG';
后面还有 20 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。