Overview

Namespaces

  • Net
    • Bazzline
      • Component
        • Requirement
  • None

Classes

  • Net\Bazzline\Component\Requirement\AbstractCondition
  • Net\Bazzline\Component\Requirement\AbstractItem
  • Net\Bazzline\Component\Requirement\AndCondition
  • Net\Bazzline\Component\Requirement\OrCondition
  • Net\Bazzline\Component\Requirement\Requirement

Interfaces

  • Net\Bazzline\Component\Requirement\ConditionInterface
  • Net\Bazzline\Component\Requirement\IsDisabledInterface
  • Net\Bazzline\Component\Requirement\IsMetInterface
  • Net\Bazzline\Component\Requirement\ItemInterface
  • Net\Bazzline\Component\Requirement\RequirementInterface

Functions

  • netBazzlineComponentRequirementDevelopmentAutoloader
  • Overview
  • Namespace
  • Class
 1:  2:  3:  4:  5:  6:  7:  8:  9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 
<?php
/**
 * @param string $className - the name of the class the autoloader should load
 * @return bool
 * @author stev leibelt <artodeto@bazzline.net>
 * @since 2013-06-25
 */
function netBazzlineComponentRequirementDevelopmentAutoloader($className)
{
    $namespace = 'Net\\Bazzline\\Component\\Requirement\\';
    $lengthOfNamespace = strlen($namespace);
    $expectedNamespace = substr($className, 0, $lengthOfNamespace);

    $isSupportedClassnameByNamespace = ($namespace == $expectedNamespace);

    if ($isSupportedClassnameByNamespace) {
        $classNameWithRemovedNamespace = str_replace($namespace, '', $className);
        $fileName = str_replace('\\', DIRECTORY_SEPARATOR, $classNameWithRemovedNamespace) . '.php';
        $includePaths = array(
            realpath(__DIR__ . DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR
        );

        foreach ($includePaths as $includePath) {
            $filePath = realpath($includePath . DIRECTORY_SEPARATOR . $fileName);

            if (file_exists($filePath)) {
                require $filePath;

                break;
            } else {
                echo var_export(
                        array(
                            'classname' => $className,
                            'filename' => $fileName,
                            'filepath' => $filePath,
                            'includedPath' => $includePath
                        ),
                        true
                    ) . PHP_EOL;
            }
        }
    } else {
        return false;
    }
}

spl_autoload_register('netBazzlineComponentRequirementDevelopmentAutoloader');
PHP Requirement Component by bazzline.net API documentation generated by ApiGen