C# Class PHP.Core.ScriptContext

Inheritance: ILogicalThreadAffinative
Datei anzeigen Open project: jadu/Phalanger Class Usage Examples

Private Properties

Property Type Description
CreateDefaultScriptContext ScriptContext
DynamicInclude object
IncludeScript object
InitConstants void
InitPlatformSpecific void
InitWebRequest ScriptContext
LoadDynamicScriptType System.ScriptInfo
RunApplication void
SearchForIncludedFile FullPath
StaticInclude bool

Public Methods

Method Description
Include ( string relativeSourcePath, bool once ) : object

Includes a specific script using current configuration.

InitApplication ( PHP.Core.ApplicationContext appContext, Type mainScript, string relativeSourcePath, string sourceRoot ) : ScriptContext

Initializes the script context for a PHP console application.

Use this method if you want to initialize application in the same way the PHP console/Windows application is initialized. The returned script context is initialized as follows: The application's source root is set. The main script of the application is defined. Output and input streams are set to standard output and input, respectively. Current culture it set to CultureInfo.InvariantCulture. Auto-global variables ($_GET, $_SET, etc.) are initialized. Working directory is set tothe current working directory.

InitContext ( PHP.Core.ApplicationContext appContext ) : ScriptContext

Initializes ScriptContext for the C#/PHP interoperability.

Use this method if you want to initialize application in the same way the PHP console/Windows application is initialized. CurrentContext is set, and initialized to simulate request begin and end.

InitContext ( PHP.Core.ApplicationContext appContext, Stream output ) : ScriptContext

Initializes ScriptContext for the C#/PHP interoperability.

Use this method if you want to initialize application in the same way the PHP console/Windows application is initialized. CurrentContext is set, and initialized to simulate request begin and end.

RegisterSessionGlobals ( ) : void

Adds session variables aliases to global variables.

Private Methods

Method Description
CreateDefaultScriptContext ( ) : ScriptContext

Initialize new ScriptContext and store it into the LogicalCallContext.

DynamicInclude ( string includedFilePath, string includerFileRelPath, object>.Dictionary variables, DObject self, DTypeDesc includer, InclusionTypes inclusionType ) : object
IncludeScript ( string relativeSourcePath, System.ScriptInfo script ) : object

Performs PHP inclusion on a specified script.

The inclusion inheres in adding the target to the list of included scripts on the current script context (see ScriptContext.Scripts and in a call to the global code of the target script.

InitConstants ( object>.DualDictionary _constants ) : void
InitPlatformSpecific ( ) : void
InitWebRequest ( PHP.Core.ApplicationContext appContext, HttpContext context ) : ScriptContext

Initializes the script context for a web request.

LoadDynamicScriptType ( PHP.Core.PhpSourceFile sourceFile ) : System.ScriptInfo

Loads a script type dynamically.

RunApplication ( Delegate mainRoutine, string relativeSourcePath, string sourceRoot ) : void
SearchForIncludedFile ( PhpError errorSeverity, string includedPath, FullPath includerFullPath ) : FullPath

Searches for a file in the script library, current directory, included paths, and web application root respectively.

StaticInclude ( int level, string relativeSourcePath, RuntimeTypeHandle includee, InclusionTypes inclusionType ) : bool

Method Details

Include() public method

Includes a specific script using current configuration.
public Include ( string relativeSourcePath, bool once ) : object
relativeSourcePath string Source root relative path to the script.
once bool Specifies whether script should be included only once.
return object

InitApplication() public static method

Initializes the script context for a PHP console application.
Use this method if you want to initialize application in the same way the PHP console/Windows application is initialized. The returned script context is initialized as follows: The application's source root is set. The main script of the application is defined. Output and input streams are set to standard output and input, respectively. Current culture it set to CultureInfo.InvariantCulture. Auto-global variables ($_GET, $_SET, etc.) are initialized. Working directory is set tothe current working directory.
/// Web configuration is invalid. The context is not initialized then. ///
public static InitApplication ( PHP.Core.ApplicationContext appContext, Type mainScript, string relativeSourcePath, string sourceRoot ) : ScriptContext
appContext PHP.Core.ApplicationContext Application context.
mainScript System.Type The main script's type or a null reference for a pure application.
relativeSourcePath string A path to the main script source file.
sourceRoot string A source root within which an application has been compiler.
return ScriptContext

InitContext() public static method

Initializes ScriptContext for the C#/PHP interoperability.
Use this method if you want to initialize application in the same way the PHP console/Windows application is initialized. CurrentContext is set, and initialized to simulate request begin and end.
public static InitContext ( PHP.Core.ApplicationContext appContext ) : ScriptContext
appContext PHP.Core.ApplicationContext Application context.
return ScriptContext

InitContext() public static method

Initializes ScriptContext for the C#/PHP interoperability.
Use this method if you want to initialize application in the same way the PHP console/Windows application is initialized. CurrentContext is set, and initialized to simulate request begin and end.
public static InitContext ( PHP.Core.ApplicationContext appContext, Stream output ) : ScriptContext
appContext PHP.Core.ApplicationContext Application context.
output Stream Output stream.
return ScriptContext

RegisterSessionGlobals() public method

Adds session variables aliases to global variables.
public RegisterSessionGlobals ( ) : void
return void