You are here

public static function Autoloader::resolveFile in Plug 7

Resolves proxy class name to a filename based on the following pattern.

1. Remove Proxy namespace from class name. 2. Remove namespace separators from remaining class name. 3. Return PHP filename from proxy-dir with the result from 2.

Parameters

string $proxyDir:

string $proxyNamespace:

string $className:

Return value

string

Throws

InvalidArgumentException

2 calls to Autoloader::resolveFile()
Autoloader::register in lib/doctrine/common/lib/Doctrine/Common/Proxy/Autoloader.php
Registers and returns autoloader callback for the given proxy dir and namespace.
AutoloaderTest::testResolveFile in lib/doctrine/common/tests/Doctrine/Tests/Common/Proxy/AutoloaderTest.php
@dataProvider dataResolveFile

File

lib/doctrine/common/lib/Doctrine/Common/Proxy/Autoloader.php, line 46

Class

Autoloader
Special Autoloader for Proxy classes, which are not PSR-0 compliant.

Namespace

Doctrine\Common\Proxy

Code

public static function resolveFile($proxyDir, $proxyNamespace, $className) {
  if (0 !== strpos($className, $proxyNamespace)) {
    throw InvalidArgumentException::notProxyClass($className, $proxyNamespace);
  }
  $className = str_replace('\\', '', substr($className, strlen($proxyNamespace) + 1));
  return $proxyDir . DIRECTORY_SEPARATOR . $className . '.php';
}