PHP Classes

File: vendor/wp-cli/php-cli-tools/tests/bootstrap.php

Recommend this page to a friend!
  Classes of Adeleye Ayodeji   Nolimitbuzz WP Theme   vendor/wp-cli/php-cli-tools/tests/bootstrap.php   Download  
File: vendor/wp-cli/php-cli-tools/tests/bootstrap.php
Role: Auxiliary script
Content type: text/plain
Description: Configuration script
Class: Nolimitbuzz WP Theme
WordPress theme to used as start of new themes
Author: By
Last change:
Date: 27 days ago
Size: 603 bytes
 

Contents

Class file image Download
<?php


function cli_autoload( $className ) {
   
$className = ltrim($className, '\\');
   
$fileName = '';
   
$namespace = '';
    if (
$lastNsPos = strrpos($className, '\\')) {
       
$namespace = substr($className, 0, $lastNsPos);
       
$className = substr($className, $lastNsPos + 1);
       
$fileName = str_replace('\\', DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR;
    }
   
$fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';

    if (
'cli' !== substr( $fileName, 0, 3 ) ) {
        return;
    }

    require
dirname( dirname( __FILE__ ) ) . '/lib/' . $fileName;
}

spl_autoload_register( 'cli_autoload' );