Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php /** * AutoloadCommand class file. * * @author Qiang Xue <[email protected]> * ..

Decoded Output download

<?php
/**
 * AutoloadCommand class file.
 *
 * @author Qiang Xue <[email protected]>
 * @link https://www.yiiframework.com/
 * @copyright 2008-2013 Yii Software LLC
 * @license https://www.yiiframework.com/license/
 */

/**
 * AutoloadCommand generates the class map for {@link YiiBase}.
 * The class file YiiBase.php will be modified with updated class map.
 *
 * @author Qiang Xue <[email protected]>
 * @package system.build
 * @since 1.0
 */
class AutoloadCommand extends CConsoleCommand
{
	public function getHelp()
	{
		return <<<EOD
USAGE
  build autoload

DESCRIPTION
  This command updates YiiBase.php with the latest class map.
  The class map is used by Yii::autoload() to quickly include a class on demand.

  Do not run this command unless you change or add core framework classes.

EOD;
	}

	/**
	 * Execute the action.
	 * @param array command line parameters specific for this command
	 */
	public function run($args)
	{
		$options=array(
			'fileTypes'=>array('php'),
			'exclude'=>array(
				'.gitignore',
				'/messages',
				'/views',
				'/cli',
				'/yii.php',
				'/yiit.php',
				'/yiilite.php',
				'/web/js',
				'/vendors',
				'/i18n/data',
				'/utils/mimeTypes.php',
				'/test',
				'/zii',
				'/gii',
			),
		);
		$files=CFileHelper::findFiles(YII_PATH,$options);
		$map=array();
		foreach($files as $file)
		{
			if(($pos=strpos($file,YII_PATH))!==0)
				die("Invalid file '$file' found.");
			$path=str_replace('\','/',substr($file,strlen(YII_PATH)));
			$className=substr(basename($path),0,-4);
			if($className[0]==='C')
				$map[$path]="		'$className' => '$path',
";
		}
		ksort($map);
		$map=implode($map);

		$yiiBase=file_get_contents(YII_PATH.'/YiiBase.php');
		$newYiiBase=preg_replace('/private\s+static\s+\$_coreClasses\s*=\s*array\s*\([^\)]*\)\s*;/',"private static \$_coreClasses=array(
{$map}	);",$yiiBase);
		if($yiiBase!==$newYiiBase)
		{
			file_put_contents(YII_PATH.'/YiiBase.php',$newYiiBase);
			echo "YiiBase.php is updated successfully.
";
		}
		else
			echo "Nothing changed.
";
	}
}
 ?>

Did this file decode correctly?

Original Code

<?php
/**
 * AutoloadCommand class file.
 *
 * @author Qiang Xue <[email protected]>
 * @link https://www.yiiframework.com/
 * @copyright 2008-2013 Yii Software LLC
 * @license https://www.yiiframework.com/license/
 */

/**
 * AutoloadCommand generates the class map for {@link YiiBase}.
 * The class file YiiBase.php will be modified with updated class map.
 *
 * @author Qiang Xue <[email protected]>
 * @package system.build
 * @since 1.0
 */
class AutoloadCommand extends CConsoleCommand
{
	public function getHelp()
	{
		return <<<EOD
USAGE
  build autoload

DESCRIPTION
  This command updates YiiBase.php with the latest class map.
  The class map is used by Yii::autoload() to quickly include a class on demand.

  Do not run this command unless you change or add core framework classes.

EOD;
	}

	/**
	 * Execute the action.
	 * @param array command line parameters specific for this command
	 */
	public function run($args)
	{
		$options=array(
			'fileTypes'=>array('php'),
			'exclude'=>array(
				'.gitignore',
				'/messages',
				'/views',
				'/cli',
				'/yii.php',
				'/yiit.php',
				'/yiilite.php',
				'/web/js',
				'/vendors',
				'/i18n/data',
				'/utils/mimeTypes.php',
				'/test',
				'/zii',
				'/gii',
			),
		);
		$files=CFileHelper::findFiles(YII_PATH,$options);
		$map=array();
		foreach($files as $file)
		{
			if(($pos=strpos($file,YII_PATH))!==0)
				die("Invalid file '$file' found.");
			$path=str_replace('\\','/',substr($file,strlen(YII_PATH)));
			$className=substr(basename($path),0,-4);
			if($className[0]==='C')
				$map[$path]="\t\t'$className' => '$path',\n";
		}
		ksort($map);
		$map=implode($map);

		$yiiBase=file_get_contents(YII_PATH.'/YiiBase.php');
		$newYiiBase=preg_replace('/private\s+static\s+\$_coreClasses\s*=\s*array\s*\([^\)]*\)\s*;/',"private static \$_coreClasses=array(\n{$map}\t);",$yiiBase);
		if($yiiBase!==$newYiiBase)
		{
			file_put_contents(YII_PATH.'/YiiBase.php',$newYiiBase);
			echo "YiiBase.php is updated successfully.\n";
		}
		else
			echo "Nothing changed.\n";
	}
}

Function Calls

None

Variables

None

Stats

MD5 e1a27df2efef394ebe8bb57785f6f186
Eval Count 0
Decode Time 101 ms