PHP Класс Whippet

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$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