PHP 클래스 CI_Loader, ci-phpunit-test

Loads views and files
저자: ExpressionEngine Dev Team
파일 보기 프로젝트 열기: kenjis/ci-phpunit-test 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_ci_cached_vars array List of cached variables
$_ci_classes array List of loaded classes
$_ci_helper_paths array List of paths to load helpers from
$_ci_helpers array List of loaded helpers
$_ci_library_paths array List of paths to load libraries from
$_ci_model_paths array List of paths to load models from
$_ci_models array List of loaded models
$_ci_ob_level integer Nesting level of the output buffering mechanism
$_ci_varmap array List of class name mappings
$_ci_view_paths array List of paths to load views from

공개 메소드들

메소드 설명
__construct ( ) : void Class constructor
add_package_path ( string $path, boolean $view_cascade = TRUE ) : object Add Package Path
clear_vars ( ) : CI_Loader Clear Cached Variables
config ( string $file, boolean $use_sections = FALSE, boolean $fail_gracefully = FALSE ) : boolean Config Loader
database ( mixed $params = '', boolean $return = FALSE, boolean $query_builder = NULL ) : object | boolean Database Loader
dbforge ( object $db = NULL, boolean $return = FALSE ) : object Load the Database Forge Class
dbutil ( object $db = NULL, boolean $return = FALSE ) : object Load the Database Utilities Class
driver ( string | string[] $library, array $params = NULL, string $object_name = NULL ) : object | boolean Driver Loader
file ( string $path, boolean $return = FALSE ) : object | string Generic File Loader
get_package_paths ( boolean $include_base = FALSE ) : array Get Package Paths
get_var ( string $key ) : mixed Get Variable
get_vars ( ) : array Get Variables
helper ( string | string[] $helpers = [] ) : object Helper Loader
helpers ( string | string[] $helpers = [] ) : object Load Helpers
initialize ( ) : void Initializer
is_loaded ( string $class ) : string | boolean Is Loaded
language ( string | string[] $files, $lang = '' ) : object Language Loader
library ( string $library, array $params = NULL, string $object_name = NULL ) : object Library Loader
model ( string $model, string $name = '', boolean $db_conn = FALSE ) : object Model Loader
remove_package_path ( string $path = '' ) : object Remove Package Path
vars ( array | object | string $vars, string $val = '' ) : object Set Variables
view ( string $view, array $vars = [], boolean $return = FALSE ) : object | string View Loader

보호된 메소드들

메소드 설명
_ci_autoloader ( ) : void CI Autoloader
_ci_get_component ( string $component ) : boolean CI Component getter
_ci_init_library ( string $class, string $prefix, array | null | boolean $config = FALSE, string $object_name = NULL ) : void Internal CI Library Instantiator
_ci_load ( array $_ci_data ) : object Internal CI Data Loader
_ci_load_library ( string $class, mixed $params = NULL, string $object_name = NULL ) : void Internal CI Library Loader
_ci_load_stock_library ( string $library_name, string $file_path, mixed $params, string $object_name ) : void Internal CI Stock Library Loader
_ci_object_to_array ( object $object ) : array CI Object to Array translator
_ci_prep_filename ( string | string[] $filename, string $extension ) : array Prep filename

메소드 상세

__construct() 공개 메소드

Sets component load paths, gets the initial output buffering level.
public __construct ( ) : void
리턴 void

_ci_autoloader() 보호된 메소드

Loads component listed in the config/autoload.php file.
protected _ci_autoloader ( ) : void
리턴 void

_ci_get_component() 보호된 메소드

Get a reference to a specific library or model.
protected _ci_get_component ( string $component ) : boolean
$component string Component name
리턴 boolean

_ci_init_library() 보호된 메소드

Internal CI Library Instantiator
protected _ci_init_library ( string $class, string $prefix, array | null | boolean $config = FALSE, string $object_name = NULL ) : void
$class string Class name
$prefix string Class name prefix
$config array | null | boolean Optional configuration to pass to the class constructor: FALSE to skip; NULL to search in config paths; array containing configuration data
$object_name string Optional object name to assign to
리턴 void

_ci_load() 보호된 메소드

Used to load views and files. Variables are prefixed with _ci_ to avoid symbol collision with variables made available to view files.
protected _ci_load ( array $_ci_data ) : object
$_ci_data array Data to load
리턴 object

_ci_load_library() 보호된 메소드

Internal CI Library Loader
protected _ci_load_library ( string $class, mixed $params = NULL, string $object_name = NULL ) : void
$class string Class name to load
$params mixed Optional parameters to pass to the class constructor
$object_name string Optional object name to assign to
리턴 void modified by ci-phpunit-test

_ci_load_stock_library() 보호된 메소드

Internal CI Stock Library Loader
protected _ci_load_stock_library ( string $library_name, string $file_path, mixed $params, string $object_name ) : void
$library_name string Library name to load
$file_path string Path to the library filename, relative to libraries/
$params mixed Optional parameters to pass to the class constructor
$object_name string Optional object name to assign to
리턴 void modified by ci-phpunit-test

_ci_object_to_array() 보호된 메소드

Takes an object as input and converts the class variables to an associative array with key/value pairs.
protected _ci_object_to_array ( object $object ) : array
$object object Object data to translate
리턴 array

_ci_prep_filename() 보호된 메소드

This function prepares filenames of various items to make their loading more reliable.
protected _ci_prep_filename ( string | string[] $filename, string $extension ) : array
$filename string | string[] Filename(s)
$extension string Filename extension
리턴 array

add_package_path() 공개 메소드

Prepends a parent path to the library, model, helper and config path arrays.
또한 보기: CI_Loader::$_ci_library_paths
또한 보기: CI_Loader::$_ci_model_paths
또한 보기: CI_Loader::$_ci_helper_paths
또한 보기: CI_Config::$_config_paths
public add_package_path ( string $path, boolean $view_cascade = TRUE ) : object
$path string Path to add
$view_cascade boolean (default: TRUE)
리턴 object

clear_vars() 공개 메소드

Clears the cached variables.
public clear_vars ( ) : CI_Loader
리턴 CI_Loader

config() 공개 메소드

Loads a config file (an alias for CI_Config::load()).
public config ( string $file, boolean $use_sections = FALSE, boolean $fail_gracefully = FALSE ) : boolean
$file string Configuration file name
$use_sections boolean Whether configuration values should be loaded into their own section
$fail_gracefully boolean Whether to just return FALSE or display an error message
리턴 boolean TRUE if the file was loaded correctly or FALSE on failure

database() 공개 메소드

Database Loader
public database ( mixed $params = '', boolean $return = FALSE, boolean $query_builder = NULL ) : object | boolean
$params mixed Database configuration options
$return boolean Whether to return the database object
$query_builder boolean Whether to enable Query Builder (overrides the configuration setting)
리턴 object | boolean Database object if $return is set to TRUE, FALSE on failure, CI_Loader instance in any other case

dbforge() 공개 메소드

Load the Database Forge Class
public dbforge ( object $db = NULL, boolean $return = FALSE ) : object
$db object Database object
$return boolean Whether to return the DB Forge class object or not
리턴 object

dbutil() 공개 메소드

Load the Database Utilities Class
public dbutil ( object $db = NULL, boolean $return = FALSE ) : object
$db object Database object
$return boolean Whether to return the DB Utilities class object or not
리턴 object

driver() 공개 메소드

Loads a driver library.
public driver ( string | string[] $library, array $params = NULL, string $object_name = NULL ) : object | boolean
$library string | string[] Driver name(s)
$params array Optional parameters to pass to the driver
$object_name string An optional object name to assign to
리턴 object | boolean Object or FALSE on failure if $library is a string and $object_name is set. CI_Loader instance otherwise.

file() 공개 메소드

Generic File Loader
public file ( string $path, boolean $return = FALSE ) : object | string
$path string File path
$return boolean Whether to return the file output
리턴 object | string

get_package_paths() 공개 메소드

Return a list of all package paths.
public get_package_paths ( boolean $include_base = FALSE ) : array
$include_base boolean Whether to include BASEPATH (default: FALSE)
리턴 array

get_var() 공개 메소드

Check if a variable is set and retrieve it.
public get_var ( string $key ) : mixed
$key string Variable name
리턴 mixed The variable or NULL if not found

get_vars() 공개 메소드

Retrieves all loaded variables.
public get_vars ( ) : array
리턴 array

helper() 공개 메소드

Helper Loader
public helper ( string | string[] $helpers = [] ) : object
$helpers string | string[] Helper name(s)
리턴 object

helpers() 공개 메소드

An alias for the helper() method in case the developer has written the plural form of it.
public helpers ( string | string[] $helpers = [] ) : object
$helpers string | string[] Helper name(s)
리턴 object

initialize() 공개 메소드

Initializer
public initialize ( ) : void
리턴 void

is_loaded() 공개 메소드

A utility method to test if a class is in the self::$_ci_classes array.
public is_loaded ( string $class ) : string | boolean
$class string Class name to check for
리턴 string | boolean Class object name if loaded or FALSE

language() 공개 메소드

Loads language files.
public language ( string | string[] $files, $lang = '' ) : object
$files string | string[] List of language file names to load
리턴 object

library() 공개 메소드

Loads and instantiates libraries. Designed to be called from application controllers.
public library ( string $library, array $params = NULL, string $object_name = NULL ) : object
$library string Library name
$params array Optional parameters to pass to the library class constructor
$object_name string An optional object name to assign to
리턴 object

model() 공개 메소드

Loads and instantiates models.
public model ( string $model, string $name = '', boolean $db_conn = FALSE ) : object
$model string Model name
$name string An optional object name to assign to
$db_conn boolean An optional database connection configuration to initialize
리턴 object modified by ci-phpunit-test

remove_package_path() 공개 메소드

Remove a path from the library, model, helper and/or config path arrays if it exists. If no path is provided, the most recently added path will be removed removed.
public remove_package_path ( string $path = '' ) : object
$path string Path to remove
리턴 object

vars() 공개 메소드

Once variables are set they become available within the controller class and its "view" files.
public vars ( array | object | string $vars, string $val = '' ) : object
$vars array | object | string An associative array or object containing values to be set, or a value's name if string
$val string Value to set, only used if $vars is a string
리턴 object

view() 공개 메소드

Loads "view" files.
public view ( string $view, array $vars = [], boolean $return = FALSE ) : object | string
$view string View name
$vars array An associative array of data to be extracted for use in the view
$return boolean Whether to return the view output or leave it to the Output class
리턴 object | string

프로퍼티 상세

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

List of cached variables
protected array $_ci_cached_vars
리턴 array

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

List of loaded classes
protected array $_ci_classes
리턴 array

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

List of paths to load helpers from
protected array $_ci_helper_paths
리턴 array

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

List of loaded helpers
protected array $_ci_helpers
리턴 array

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

List of paths to load libraries from
protected array $_ci_library_paths
리턴 array

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

List of paths to load models from
protected array $_ci_model_paths
리턴 array

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

List of loaded models
protected array $_ci_models
리턴 array

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

Nesting level of the output buffering mechanism
protected int $_ci_ob_level
리턴 integer

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

List of class name mappings
protected array $_ci_varmap
리턴 array

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

List of paths to load views from
protected array $_ci_view_paths
리턴 array