PHP 클래스 Whippet

파일 보기 프로젝트 열기: dxw/whippet-server 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$cb_cache * Used to manage a cache of hook callbacks
$done_shutdown_function * Flag used to ensure that only one shutdown function gets set
$options * Stores options passed to the routing script
$request_path Note: For a request for a real resource (like a css file) it should be a path to an existing file. For a request for a WordPress page, it will not be.
$request_type * The type of request we're serving
$request_uri * Stores the normalised version of the requested URI's path component.
$start_time * The time this request started being processed

공개 메소드들

메소드 설명
__construct ( )
emit_php_error ( $number, $error, $file, $line, $options = ['show-errors' => E_ALL] ) This function actually emits handled PHP errors. It's here instead of in handle_php_error because we want a static version to be used from the bootstrap script.
file_is_in_core ( $file, $options )
get_options ( ) : Array Parse options that are passed to us from stdin.Not sure what the format should be yet. To start with, we probably need options to specify the location of the wordpress installation to run.
handle_php_error ( $number, $error, $file, $line, $context ) Called by the PHP core when an error occurs
message ( $string ) Emits a message to STDOUT, prepended with the current time.
print_r ( $variable ) Dumps an object to STDOUT, using print_r
register_shutdown_function ( )
request_message ( ) Prints basic information about the request being processed
run ( ) Called when the command is run. Sets up the options and environment and then passes off to a more specific handler
serve_file ( ) Serves a static file from the disk
serve_headers ( ) The built-in webserver only emits a minimal set of headers, so add in the usual ones.
serve_script ( ) Serves a specific script; for example, /wp-admin/install.php
serve_wordpress ( ) Serves a wordpress permalink
startswith ( $haystack, $needle )
wps_filter_all ( $hook ) Emits the details of hooks and filters as they are called, if required
wps_filter_parse_query ( $query ) Emits page parameters
wps_filter_query ( $query ) Emits all queries to the console
wps_filter_shutdown ( ) Runs right at the end of execution
wps_filter_template_include ( $template ) Emits template loads to the console

메소드 상세

__construct() 공개 메소드

public __construct ( )

emit_php_error() 공개 정적인 메소드

This function actually emits handled PHP errors. It's here instead of in handle_php_error because we want a static version to be used from the bootstrap script.
public static emit_php_error ( $number, $error, $file, $line, $options = ['show-errors' => E_ALL] )

file_is_in_core() 공개 정적인 메소드

public static file_is_in_core ( $file, $options )

get_options() 공개 메소드

Eventually it would be nice to be able to start a development version of wordpress using sqlite (with minimal setup) and just a wp-content folder, with the core being loaded from /usr/share (or similar)
public get_options ( ) : Array
리턴 Array An array of options (probably)

handle_php_error() 공개 메소드

Called by the PHP core when an error occurs
public handle_php_error ( $number, $error, $file, $line, $context )

message() 공개 정적인 메소드

Note: if the first character of the string is a newline, that newline will be emitted before the time. Note: this method appends a newline to the string.
public static message ( $string )

print_r() 공개 정적인 메소드

Dumps an object to STDOUT, using print_r
public static print_r ( $variable )

register_shutdown_function() 공개 메소드

request_message() 공개 메소드

Prints basic information about the request being processed
public request_message ( )

run() 공개 메소드

Called when the command is run. Sets up the options and environment and then passes off to a more specific handler
public run ( )

serve_file() 공개 메소드

Serves a static file from the disk
public serve_file ( )

serve_headers() 공개 메소드

Note: this function will not serve content-type or content-length headers.
public serve_headers ( )

serve_script() 공개 메소드

Serves a specific script; for example, /wp-admin/install.php
public serve_script ( )

serve_wordpress() 공개 메소드

Serves a wordpress permalink
public serve_wordpress ( )

startswith() 공개 메소드

public startswith ( $haystack, $needle )

wps_filter_all() 공개 메소드

Emits the details of hooks and filters as they are called, if required
public wps_filter_all ( $hook )

wps_filter_parse_query() 공개 메소드

Emits page parameters
public wps_filter_parse_query ( $query )

wps_filter_query() 공개 메소드

Emits all queries to the console
public wps_filter_query ( $query )

wps_filter_shutdown() 공개 메소드

Runs right at the end of execution
public wps_filter_shutdown ( )

wps_filter_template_include() 공개 메소드

Emits template loads to the console
public wps_filter_template_include ( $template )

프로퍼티 상세

$cb_cache 공개적으로 프로퍼티

* Used to manage a cache of hook callbacks
public $cb_cache

$done_shutdown_function 공개적으로 프로퍼티

* Flag used to ensure that only one shutdown function gets set
public $done_shutdown_function

$options 공개적으로 프로퍼티

* Stores options passed to the routing script
public $options

$request_path 공개적으로 프로퍼티

Note: For a request for a real resource (like a css file) it should be a path to an existing file. For a request for a WordPress page, it will not be.
public $request_path

$request_type 공개적으로 프로퍼티

* The type of request we're serving
public $request_type

$request_uri 공개적으로 프로퍼티

* Stores the normalised version of the requested URI's path component.
public $request_uri

$start_time 공개적으로 프로퍼티

* The time this request started being processed
public $start_time