webCOMAND

loader::add_base_path()

Add a new base path to search when looking for packages, or looking for files in the classes, config, extensions, or other custom subfolders.  The base path's added last will be searched first.

Prototype

void add_base_path(string or array $new_paths = [])

Parameters

  • new_paths - string or array of strings where each string is a path to a folder where the COMAND auto-loader should look for packages and config files.  Paths can be absolute or relative to the directory where the initial PHP script file was loaded from.

Example

require_once('path/to/comand.php');

// add new base path to be searched first
\io_comand\loader::add_base_path('new/base/path');

// try to load config from config folder under new/base/path
// and then the default paths, in that order
$my_config = \io_comand\loader::load_config('my_config');