C# 클래스 Pchp.Core.PhpResource

Base class for PHP Resources - both built-in and extension-resources. Resources rely on GC Finalization - override FreeManaged for cleanup. When printing a resource variable in PHP, "Resource id #x" prints out.
상속: IDisposable, IPhpConvertible
파일 보기 프로젝트 열기: iolevel/peachpie 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
_resourceId int
_typeName string

Private Properties

프로퍼티 타입 설명
IPhpConvertible Convert.NumberInfo
IPhpConvertible bool
IPhpConvertible double
IPhpConvertible long
IPhpConvertible object
IPhpConvertible string
PhpResource Pchp.Core
RegisterInternalInstance int

공개 메소드들

메소드 설명
Dispose ( ) : void

Disposes the resource.

Dispose ( bool disposing ) : void

Cleans-up the resource.

When disposing non-deterministically, only unmanaged resources should be freed. FreeUnmanaged

PhpResource ( string resourceTypeName ) : Pchp.Core

Create a new instance of a given Type and Name. The instance Id is auto-incrementing starting from 1.

ToString ( ) : string

Returns a string that represents the current PhpResource.

보호된 메소드들

메소드 설명
FreeManaged ( ) : void

Override this virtual method in your descendants to perform cleanup of Managed resources - those having a Finalizer of their own.

Note that when Disposing explicitly, both FreeManaged and FreeUnmanaged are called.

FreeUnmanaged ( ) : void

Override this virtual method to cleanup the contained unmanaged objects.

Note that when Dispose(false) is called from the Finalizer, the order of finalization is random. In other words, contained managed objects may have been already finalized - don't reference them.

PhpResource ( int resourceId, string resourceTypeName ) : Pchp.Core

Create a new instance with the given Id.

비공개 메소드들

메소드 설명
IPhpConvertible ( PhpNumber &number ) : Convert.NumberInfo
IPhpConvertible ( ) : bool
IPhpConvertible ( ) : double
IPhpConvertible ( ) : long
IPhpConvertible ( ) : object
IPhpConvertible ( Context ctx ) : string
PhpResource ( ) : Pchp.Core

Creates a new invalid resource.

RegisterInternalInstance ( ) : int

Allocate a unique identifier for a resource.

Internal resources are given even numbers while resources allocated by extensions get odd numbers to minimize the communication between internal and external resource managers.

메소드 상세

Dispose() 공개 메소드

Disposes the resource.
public Dispose ( ) : void
리턴 void

Dispose() 공개 메소드

Cleans-up the resource.
When disposing non-deterministically, only unmanaged resources should be freed. FreeUnmanaged
public Dispose ( bool disposing ) : void
disposing bool Whether the resource is disposed deterministically.
리턴 void

FreeManaged() 보호된 메소드

Override this virtual method in your descendants to perform cleanup of Managed resources - those having a Finalizer of their own.
Note that when Disposing explicitly, both FreeManaged and FreeUnmanaged are called.
protected FreeManaged ( ) : void
리턴 void

FreeUnmanaged() 보호된 메소드

Override this virtual method to cleanup the contained unmanaged objects.
Note that when Dispose(false) is called from the Finalizer, the order of finalization is random. In other words, contained managed objects may have been already finalized - don't reference them.
protected FreeUnmanaged ( ) : void
리턴 void

PhpResource() 보호된 메소드

Create a new instance with the given Id.
protected PhpResource ( int resourceId, string resourceTypeName ) : Pchp.Core
resourceId int Unique resource identifier (odd for external resources).
resourceTypeName string The type to be reported to use when dumping a resource.
리턴 Pchp.Core

PhpResource() 공개 메소드

Create a new instance of a given Type and Name. The instance Id is auto-incrementing starting from 1.
public PhpResource ( string resourceTypeName ) : Pchp.Core
resourceTypeName string The type to be reported to use when dumping a resource.
리턴 Pchp.Core

ToString() 공개 메소드

Returns a string that represents the current PhpResource.
public ToString ( ) : string
리턴 string

프로퍼티 상세

_resourceId 보호되어 있는 프로퍼티

Unique resource identifier (even for internal resources, odd for external ones).
Internal resources are given even numbers while resources allocated by extensions get odd numbers to minimize the communication between internal and external resource managers.
protected int _resourceId
리턴 int

_typeName 보호되어 있는 프로퍼티

Type resource name - string to be reported to user when dumping a resource.
protected string _typeName
리턴 string