PHP Class 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*
Inheritance: extends AbstractController
Exibir arquivo Open project: atk4/atk4 Class Usage Examples

Public Properties

Property Type Description
$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 Properties

Property Type Description
$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.

Public Methods

Method Description
_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.

Method Details

_searchDirFiles() public method

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

addDefaultLocations() public method

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() public method

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
return PathFinder_Location

addSandbox() public method

public addSandbox ( )

init() public method

public init ( )

loadClass() public method

Provided with a class name, this will attempt to find and load it.
public loadClass ( $className ) : string
return string path from where the class was loaded

locate() public method

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'
return string | object | array

searchDir() public method

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 = '' )

Property Details

$atk_location public_oe property

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

$atk_public public_oe property

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 public_oe property

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_oe property

public $default_exception

$public_location public_oe property

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 protected_oe property

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
return boolean