Skip to content

Instantly share code, notes, and snippets.

@vishin-pavel
Created May 20, 2015 13:21
Show Gist options
  • Save vishin-pavel/b78bfc3b97f809267ff0 to your computer and use it in GitHub Desktop.
Save vishin-pavel/b78bfc3b97f809267ff0 to your computer and use it in GitHub Desktop.
Кастомный Yii.php для автокоиплита IDE
<?php
/**
* Yii bootstrap file.
* Used for enhanced IDE code autocompletion.
*/
class Yii extends \yii\BaseYii
{
/**
* @var BaseApplication|WebApplication|ConsoleApplication the application instance
*/
public static $app;
}
spl_autoload_register(['Yii', 'autoload'], true, true);
Yii::$classMap = include(__DIR__ . '/vendor/yiisoft/yii2/classes.php');
Yii::$container = new yii\di\Container;
/**
* Class BaseApplication
* Used for properties that are identical for both WebApplication and ConsoleApplication
*
* @property \app\components\RbacManager $authManager The auth manager for this application. Null is returned if auth manager is not configured. This property is read-only. Extended component.
* @property \app\components\Mailer $mailer The mailer component. This property is read-only. Extended component.
*/
abstract class BaseApplication extends yii\base\Application
{
}
/**
* Class WebApplication
* Include only Web application related components here
*
* @property \app\components\User $user The user component. This property is read-only. Extended component.
* @property \app\components\MyResponse $response The response component. This property is read-only. Extended component.
* @property \app\components\ErrorHandler $errorHandler The error handler application component. This property is read-only. Extended component.
*/
class WebApplication extends yii\web\Application
{
}
/**
* Class ConsoleApplication
* Include only Console application related components here
*
* @property \app\components\ConsoleUser $user The user component. This property is read-only. Extended component.
*/
class ConsoleApplication extends yii\console\Application
{
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment