WP_CLI
Autoloader::add_namespace()
Add a specific namespace structure with our custom autoloader.
Метод класса: Autoloader{}
Хуков нет.
Возвращает
self
.
Использование
$Autoloader = new Autoloader(); $Autoloader->add_namespace(;
Код Autoloader::add_namespace() Autoloader::add namespace WP-CLI 2.8.0-alpha
public function add_namespace( $root, $base_dir, $prefix = '', $suffix = '.php', $lowercase = false, $underscores = false ) { $this->namespaces[] = [ 'root' => $this->normalize_root( (string) $root ), 'base_dir' => $this->add_trailing_slash( (string) $base_dir ), 'prefix' => (string) $prefix, 'suffix' => (string) $suffix, 'lowercase' => (bool) $lowercase, 'underscores' => (bool) $underscores, ]; return $this; }