PHP Класс PathFinder, atk4

.. Reference: http://agiletoolkit.org/doc/ref *ATK4***************************************************** This file is part of Agile Toolkit 4 http://agiletoolkit.org (c) 2008-2011 Agile Technologies Ireland Limited Distributed under Affero General Public License v3 If you are using this file in YOUR web software, you must make your make source code for YOUR web software public. See LICENSE.txt for more information You can obtain non-public copy of Agile Toolkit 4 at http://agiletoolkit.org/commercial ****************************************************ATK4*
Наследование: extends AbstractController
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$atk_location Agile Toolkit comes with some assets: lib, template. This location describes those resources. It's not publicly available.
$atk_public public/atk4 -> /vendor/atk4/atk4/public/atk4 If that folder is not there, PathFinder will point directly to vendor folder (such as if on development environment), if that is also unavailable, this can fall back to Agile Toolkit CDN.
$base_location Base location is where your interface files are located. Normally this location is added first and all the requests are checked here before elsewhere. Example: /my/path/agiletoolkit/admin/.
$default_exception
$public_location This is location where images, javascript files and some other public resources are located. Ex: /my/path/agiletoolkit/public.

Защищенные свойства (Protected)

Свойство Тип Описание
$report_autoload_errors boolean By default Agile Toolkit will report autoloading errors if the file couldn't be found by any of the autoloaders. To prevent this, you should pass ['report_autoload_errors'=>false] as second argument to initialization of this class.

Открытые методы

Метод Описание
_searchDirFiles ( $dir, &$files, $prefix = '' )
addDefaultLocations ( ) Agile Toolkit-based application comes with a predefined resource structure. For new users it's easier if they use a consistest structure, for example having all the PHP classes inside "lib" folder.
addLocation ( array $contents = [], mixed $old_contents = null ) : PathFinder_Location Cretes new PathFinder_Location object and specifies it's contents.
addSandbox ( )
init ( )
loadClass ( $className ) : string Provided with a class name, this will attempt to find and load it.
locate ( string $type, string $filename = '', string $return = 'relative', $throws_exception = true ) : string | object | array Search for a $filename inside multiple locations, associated with resource $type. By default will return relative path, but 3rd argument can change that.
search ( string $type, string $filename = '', string $return = 'relative' ) : string | object Search is similar to locate, but will return array of all matching files.
searchDir ( $type, $directory = '' ) Specify type and directory and it will return array of all files of a matching type inside that directory. This will work even if specified directory exists inside multiple locations.

Описание методов

_searchDirFiles() публичный Метод

public _searchDirFiles ( $dir, &$files, $prefix = '' )

addDefaultLocations() публичный Метод

A more advanced developer might be willing to add additional locations of resources to suit your own preferences. You might want to do this if you are integrating with your existing application or another framework or building multi-tiered project with extensive structure. To extend the default structure which this method defines - you should look into :php:class:App_CLI::addDefaultLocations and :php:class:App_CLI::addSharedLocations
public addDefaultLocations ( )

addLocation() публичный Метод

You can subsequentially add more contents by calling: :php:meth:PathFinder_Location::defineContents.
public addLocation ( array $contents = [], mixed $old_contents = null ) : PathFinder_Location
$contents array
$old_contents mixed
Результат PathFinder_Location

addSandbox() публичный Метод

public addSandbox ( )

init() публичный Метод

public init ( )

loadClass() публичный Метод

Provided with a class name, this will attempt to find and load it.
public loadClass ( $className ) : string
Результат string path from where the class was loaded

locate() публичный Метод

The third argument can also be 'location', in which case a :php:class:PathFinder_Location object will be returned. If file is not found anywhere, then :php:class:Exception_PathFinder is thrown unless you set $throws_exception to false, and then method would return null.
public locate ( string $type, string $filename = '', string $return = 'relative', $throws_exception = true ) : string | object | array
$type string Type of resource to search surch as "php"
$filename string Name of the file to search for
$return string 'relative','url','path' or 'location'
Результат string | object | array

searchDir() публичный Метод

Specify type and directory and it will return array of all files of a matching type inside that directory. This will work even if specified directory exists inside multiple locations.
public searchDir ( $type, $directory = '' )

Описание свойств

$atk_location публичное свойство

Agile Toolkit comes with some assets: lib, template. This location describes those resources. It's not publicly available.
public $atk_location

$atk_public публичное свойство

public/atk4 -> /vendor/atk4/atk4/public/atk4 If that folder is not there, PathFinder will point directly to vendor folder (such as if on development environment), if that is also unavailable, this can fall back to Agile Toolkit CDN.
public $atk_public

$base_location публичное свойство

Base location is where your interface files are located. Normally this location is added first and all the requests are checked here before elsewhere. Example: /my/path/agiletoolkit/admin/.
public $base_location

$default_exception публичное свойство

public $default_exception

$public_location публичное свойство

This is location where images, javascript files and some other public resources are located. Ex: /my/path/agiletoolkit/public.
public $public_location

$report_autoload_errors защищенное свойство

By default Agile Toolkit will report autoloading errors if the file couldn't be found by any of the autoloaders. To prevent this, you should pass ['report_autoload_errors'=>false] as second argument to initialization of this class.
protected bool $report_autoload_errors
Результат boolean