PHP Class Eva\EvaEngine\Engine

Default application folder structures as - AppRoot -- apps -- cache -- config -- logs -- modules -- public -- tests -- vendor -- workers The most common workflow is: $engine = new Engine(__DIR__ . '/..'); $engine->loadModules(include __DIR__ . '/../config/modules.php') ->bootstrap() ->run();
Show file Open project: evaengine/evaengine Class Usage Examples

Public Properties

Property Type Description
$appStartTime float

Protected Properties

Property Type Description
$appMode string
$appName string
$appRoot null | string
$application Phalcon\Mvc\Application
$cacheEnable boolean
$configPath string
$debugger Phalcon\Debug
$di Phalcon\DiInterface
$environment string
$modulesPath string

Public Methods

Method Description
__construct ( $appRoot = null, $appName = 'evaengine', $appMode = 'web' ) Constructor
attachModuleEvents ( )
bootstrap ( ) Application Bootstrap, init DI, register Modules, init events, init ErrorHandler
diApiCache ( )
diConfig ( )
diCors ( )
diDbAdapter ( $adapterKey, array $options, $di )
diDbMaster ( )
diDbSlave ( )
diFastCache ( )
diFileSystem ( )
diGlobalCache ( )
diMailer ( )
diModelsCache ( )
diModelsMetadata ( )
diRouter ( )
diSession ( )
diSmsSender ( )
diTokenStorage ( )
diTranslate ( )
diViewCache ( )
getAppMode ( ) : string
getAppName ( ) : string
getAppRoot ( ) : null | string
getApplication ( ) : Phalcon\CLI\Console | Phalcon\Mvc\Application
getConfigPath ( ) : string
getDI ( ) : Phalcon\DI\FactoryDefault | Phalcon\DI\FactoryDefault\CLI Configuration application default DI
getDebugger ( ) : Phalcon\Debug
getEnvironment ( ) : string
getModulesPath ( ) : string
initErrorHandler ( Eva\EvaEngine\Error\ErrorHandlerInterface $errorHandler ) Register default error handler
loadModules ( array $moduleSettings ) Load modules from input settings, and call phalcon application->registerModules() for register
readCache ( $cacheFile, boolean $serialize = false ) : mixed | null
registerViewHelpers ( )
run ( ) Run application
runCustom ( ) A custum version for Application->run() WARNING: This method not able to replace phalcon default run()
setAppName ( $name )
setAppRoot ( $appRoot )
setConfigPath ( $path )
setDI ( Phalcon\DiInterface $di )
setEnvironment ( $environment )
setModulesPath ( $modulesPath )
writeCache ( $cacheFile, $content, boolean $serialize = false ) : boolean

Protected Methods

Method Description
cliDI ( Phalcon\DI\FactoryDefault\CLI $di ) CLI 模式下的 DI 配置
diCache ( $configKey, $prefix = 'eva_' )

Method Details

__construct() public method

Constructor
public __construct ( $appRoot = null, $appName = 'evaengine', $appMode = 'web' )

attachModuleEvents() public method

public attachModuleEvents ( )

bootstrap() public method

Application Bootstrap, init DI, register Modules, init events, init ErrorHandler
public bootstrap ( )

cliDI() protected method

CLI 模式下的 DI 配置
protected cliDI ( Phalcon\DI\FactoryDefault\CLI $di )
$di Phalcon\DI\FactoryDefault\CLI

diApiCache() public method

public diApiCache ( )

diCache() protected method

protected diCache ( $configKey, $prefix = 'eva_' )

diConfig() public method

public diConfig ( )

diCors() public method

public diCors ( )

diDbAdapter() public static method

public static diDbAdapter ( $adapterKey, array $options, $di )
$options array

diDbMaster() public method

public diDbMaster ( )

diDbSlave() public method

public diDbSlave ( )

diFastCache() public method

public diFastCache ( )

diFileSystem() public method

public diFileSystem ( )

diGlobalCache() public method

public diGlobalCache ( )

diMailer() public method

public diMailer ( )

diModelsCache() public method

public diModelsCache ( )

diModelsMetadata() public method

public diModelsMetadata ( )

diRouter() public method

public diRouter ( )

diSession() public method

public diSession ( )

diSmsSender() public method

public diSmsSender ( )

diTokenStorage() public method

public diTokenStorage ( )

diTranslate() public method

public diTranslate ( )

diViewCache() public method

public diViewCache ( )

getAppMode() public method

public getAppMode ( ) : string
return string

getAppName() public method

public getAppName ( ) : string
return string

getAppRoot() public method

public getAppRoot ( ) : null | string
return null | string

getApplication() public method

public getApplication ( ) : Phalcon\CLI\Console | Phalcon\Mvc\Application
return Phalcon\CLI\Console | Phalcon\Mvc\Application

getConfigPath() public method

public getConfigPath ( ) : string
return string

getDI() public method

Configuration application default DI
public getDI ( ) : Phalcon\DI\FactoryDefault | Phalcon\DI\FactoryDefault\CLI
return Phalcon\DI\FactoryDefault | Phalcon\DI\FactoryDefault\CLI

getDebugger() public method

public getDebugger ( ) : Phalcon\Debug
return Phalcon\Debug

getEnvironment() public method

public getEnvironment ( ) : string
return string

getModulesPath() public method

public getModulesPath ( ) : string
return string

initErrorHandler() public method

Register default error handler
public initErrorHandler ( Eva\EvaEngine\Error\ErrorHandlerInterface $errorHandler )
$errorHandler Eva\EvaEngine\Error\ErrorHandlerInterface

loadModules() public method

below events will be trigger - module:beforeLoadModule - module:afterLoadModule
public loadModules ( array $moduleSettings )
$moduleSettings array

readCache() public method

public readCache ( $cacheFile, boolean $serialize = false ) : mixed | null
$cacheFile cache file path
$serialize boolean
return mixed | null

registerViewHelpers() public method

public registerViewHelpers ( )

run() public method

Run application
public run ( )

runCustom() public method

A custum version for Application->run() WARNING: This method not able to replace phalcon default run()
public runCustom ( )

setAppName() public method

public setAppName ( $name )
$name

setAppRoot() public method

public setAppRoot ( $appRoot )
$appRoot

setConfigPath() public method

public setConfigPath ( $path )
$path

setDI() public method

public setDI ( Phalcon\DiInterface $di )
$di Phalcon\DiInterface

setEnvironment() public method

public setEnvironment ( $environment )
$environment

setModulesPath() public method

public setModulesPath ( $modulesPath )
$modulesPath

writeCache() public method

public writeCache ( $cacheFile, $content, boolean $serialize = false ) : boolean
$cacheFile
$content
$serialize boolean
return boolean

Property Details

$appMode protected property

protected string $appMode
return string

$appName protected property

protected string $appName
return string

$appRoot protected property

protected null|string $appRoot
return null | string

$appStartTime public static property

public static float $appStartTime
return float

$application protected property

protected Application,Phalcon\Mvc $application
return Phalcon\Mvc\Application

$cacheEnable protected property

protected bool $cacheEnable
return boolean

$configPath protected property

protected string $configPath
return string

$debugger protected property

protected Debug,Phalcon $debugger
return Phalcon\Debug

$di protected property

protected DiInterface,Phalcon $di
return Phalcon\DiInterface

$environment protected property

protected string $environment
return string

$modulesPath protected property

protected string $modulesPath
return string