framework/gii/CCodeGenerator.php
public function actionDiff()
	{
		Yii::import('gii.components.TextDiff');

		$model=$this->prepare();
		if(isset($_GET['id']) && isset($model->files[$_GET['id']]))
		{
			$file=$model->files[$_GET['id']];
			if(!in_array($file->type,array('php', 'txt','js','css','sql')))
				$diff=false;
			elseif($file->operation===CCodeFile::OP_OVERWRITE)
				$diff=TextDiff::compare(file_get_contents($file->path), $file->content);
			else
				$diff='';

			$this->renderPartial('/common/diff',array(
				'file'=>$file,
				'diff'=>$diff,
			));
		}
		else
			throw new CHttpException(404,'Unable to find the code you requested.');
	}
public function actionDiff()
	{
		Yii::import('gii.components.TextDiff');

		$model=$this->prepare();
		if(isset($_GET['id']) && isset($model->files[$_GET['id']]))
		{
			$file=$model->files[$_GET['id']];
			if(!in_array($file->type,array('php', 'txt','js','css','sql')))
				$diff=false;
			elseif($file->operation===CCodeFile::OP_OVERWRITE)
				$diff=TextDiff::compare(file_get_contents($file->path), $file->content);
			else
				$diff='';

			$this->renderPartial('/common/diff',array(
				'file'=>$file,
				'diff'=>$diff,
			));
		}
		else
			throw new CHttpException(404,'Unable to find the code you requested.');
	}
public function actionDiff ( ) { Yii :: import ( 'gii.components.TextDiff' ) ; $ model = $ this -> prepare ( ) ; if ( isset ( $ _GET [ 'id' ] ) && isset ( $ model -> files [ $ _GET [ 'id' ] ] ) ) { $ file = $ model -> files [ $ _GET [ 'id' ] ] ; if ( ! in_array ( $ file -> type , array ( 'php' , 'txt' , 'js' , 'css' , 'sql' ) ) ) $ diff = false ; elseif ( $ file -> operation === CCodeFile :: OP_OVERWRITE ) $ diff = TextDiff :: compare ( file_get_contents ( $ file -> path ) , $ file -> content ) ; else $ diff = '' ; $ this -> renderPartial ( '/common/diff' , array ( 'file' => $ file , 'diff' => $ diff , ) ) ; } else throw new CHttpException ( 404 , 'Unable to find the code you requested.' ) ; }
The code diff action.
This action shows up the difference between the newly generated code and the corresponding existing code.
@throws CHttpException if unable to find code generated.
The code diff action . This action shows up the difference between the newly generated code and the corresponding existing code .