PHP 클래스 ref, php-ref

저자: digitalnature - http://digitalnature.eu
파일 보기 프로젝트 열기: digitalnature/php-ref 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$config
$debug
$env
$fmt
$startTime
$time
$timeout

공개 메소드들

메소드 설명
__construct ( string | RFormatter $format = 'html' ) Constructor
__get ( string $name ) Enforce proper use of this class
__set ( string $name, mixed $value ) Enforce proper use of this class
config ( string $key, mixed | null $value = null ) : mixed Set or get configuration options
getBacktrace ( ) : array | false Get relevant backtrace info for last ref call
getDebugInfo ( )
getInputExpressions ( array &$options = null ) : array Determines the input expression(s) passed to the shortcut function
getTime ( $precision = 4 ) : double Total CPU time used by the class
getTimeoutPoint ( )
parseComment ( string $comment, string | null $key = null ) : array | string | null Parses a DocBlock comment into a data structure.
query ( mixed $subject, string $expression = null ) Generate structured information about a variable/value/expression (subject)
splitRegex ( string $pattern ) : array Split a regex into its components
timeFunc ( integer $iterations, callable $function, &$output = null ) : double Executes a function the given number of times and returns the elapsed time.
timer ( integer $id = 1, integer $precision = 4 ) : void | double Timer utility

보호된 메소드들

메소드 설명
evaluate ( &$subject, boolean $specialStr = false ) : mixed Evaluates the given variable
evaluateExp ( string $expression = null ) : string Scans for known classes and functions inside the provided expression, and linkifies them when possible
fromReflector ( Reflector $reflector, string $single = '', Reflector $context = null ) : string Generate class / function info
getParentClasses ( Reflector $class ) : array Get all parent classes of a class
hasInstanceTimedOut ( )
linkify ( Reflector $reflector, string | null $constant = null ) : string | null Generates an URL that points to the documentation page relevant for the requested context
strLen ( string $string ) : integer Calculates real string length
strPad ( $input, integer $padLen, string $padStr = ' ', integer $padType = STR_PAD_RIGHT ) : string Safe str_pad alternative

메소드 상세

__construct() 공개 메소드

Constructor
public __construct ( string | RFormatter $format = 'html' )
$format string | RFormatter Output format ID, or formatter instance defaults to 'html'

__get() 공개 메소드

Enforce proper use of this class
public __get ( string $name )
$name string

__set() 공개 메소드

Enforce proper use of this class
public __set ( string $name, mixed $value )
$name string
$value mixed

config() 공개 정적인 메소드

Set or get configuration options
public static config ( string $key, mixed | null $value = null ) : mixed
$key string
$value mixed | null
리턴 mixed

evaluate() 보호된 메소드

Evaluates the given variable
protected evaluate ( &$subject, boolean $specialStr = false ) : mixed
$specialStr boolean Should this be interpreted as a special string?
리턴 mixed Result (both HTML and text modes generate strings)

evaluateExp() 보호된 메소드

Scans for known classes and functions inside the provided expression, and linkifies them when possible
protected evaluateExp ( string $expression = null ) : string
$expression string Expression to format
리턴 string Formatted output

fromReflector() 보호된 메소드

Generate class / function info
protected fromReflector ( Reflector $reflector, string $single = '', Reflector $context = null ) : string
$reflector Reflector Class name or reflection object
$single string Skip parent classes
$context Reflector Object context (for methods)
리턴 string

getBacktrace() 공개 정적인 메소드

Get relevant backtrace info for last ref call
public static getBacktrace ( ) : array | false
리턴 array | false

getDebugInfo() 공개 정적인 메소드

public static getDebugInfo ( )

getInputExpressions() 공개 정적인 메소드

Determines the input expression(s) passed to the shortcut function
public static getInputExpressions ( array &$options = null ) : array
$options array
리턴 array Array of string expressions

getParentClasses() 보호된 정적인 메소드

Get all parent classes of a class
protected static getParentClasses ( Reflector $class ) : array
$class Reflector Reflection object
리턴 array Array of ReflectionClass objects (starts with the ancestor, ends with the given class)

getTime() 공개 정적인 메소드

Total CPU time used by the class
public static getTime ( $precision = 4 ) : double
리턴 double

getTimeoutPoint() 공개 정적인 메소드

public static getTimeoutPoint ( )

hasInstanceTimedOut() 보호된 메소드

protected hasInstanceTimedOut ( )

linkify() 보호된 메소드

For internal functions and classes, the URI will point to the local PHP manual if installed and configured, otherwise to php.net/manual (the english one)
protected linkify ( Reflector $reflector, string | null $constant = null ) : string | null
$reflector Reflector Reflector object (used to determine the URL scheme for internal stuff)
$constant string | null Constant name, if this is a request to linkify a constant
리턴 string | null URL

parseComment() 공개 정적인 메소드

Parses a DocBlock comment into a data structure.
public static parseComment ( string $comment, string | null $key = null ) : array | string | null
$comment string DocBlock comment (must start with /**)
$key string | null Field to return (optional)
리턴 array | string | null Array containing all fields, array/string with the contents of the requested field, or null if the comment is empty/invalid

query() 공개 메소드

Output is flushed to the screen
public query ( mixed $subject, string $expression = null )
$subject mixed
$expression string

splitRegex() 공개 정적인 메소드

Based on "Regex Colorizer" by Steven Levithan (this is a translation from javascript)
public static splitRegex ( string $pattern ) : array
$pattern string
리턴 array

strLen() 보호된 정적인 메소드

Calculates real string length
protected static strLen ( string $string ) : integer
$string string
리턴 integer

strPad() 보호된 정적인 메소드

Safe str_pad alternative
protected static strPad ( $input, integer $padLen, string $padStr = ' ', integer $padType = STR_PAD_RIGHT ) : string
$padLen integer
$padStr string
$padType integer
리턴 string

timeFunc() 공개 정적인 메소드

Keep in mind that the returned time includes function call overhead (including microtime calls) x iteration count. This is why this is better suited for determining which of two or more functions is the fastest, rather than finding out how fast is a single function.
public static timeFunc ( integer $iterations, callable $function, &$output = null ) : double
$iterations integer Number of times the function will be executed
$function callable Function to execute
리턴 double Elapsed time

timer() 공개 정적인 메소드

First call of this function will start the timer. The second call will stop the timer and return the elapsed time since the timer started. Multiple timers can be controlled simultaneously by specifying a timer ID.
부터: 1.0
public static timer ( integer $id = 1, integer $precision = 4 ) : void | double
$id integer Timer ID, optional
$precision integer Precision of the result, optional
리턴 void | double Elapsed time, or void if the timer was just started

프로퍼티 상세

$config 보호되어 있는 정적으로 프로퍼티

protected static $config

$debug 보호되어 있는 정적으로 프로퍼티

protected static $debug

$env 보호되어 있는 정적으로 프로퍼티

protected static $env

$fmt 보호되어 있는 프로퍼티

protected $fmt

$startTime 보호되어 있는 프로퍼티

protected $startTime

$time 보호되어 있는 정적으로 프로퍼티

protected static $time

$timeout 보호되어 있는 정적으로 프로퍼티

protected static $timeout