PEAR2_Services_NYTimes › PEAR2_Services_NYTimes-0.1.0/test/pear2.php.net/PEAR2_Services_NYTimes/TestInit.php
- PEAR2_Services_NYTimes-0.1.0/
- php/
- PEAR2/
- Autoload.php
- Exception.php
- MultiErrors/
- MultiErrors.php
- Services/
- PEAR2/
- test/
- pear2.php.net/
- PEAR2_Services_NYTimes/
- pear2.php.net/
- php/
- package.xml
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
<?php
/**
* @ignore
*/
require_once 'PHPUnit/Autoload.php';
if (file_exists(__DIR__ . '/config.php')) {
include __DIR__ . '/config.php';
}
/**
* testAutoloader
*
* @param string $className
*
* @return boolean
*/
function testAutoloader($className) {
if (substr($className, 0, 22) == 'PEAR2\Services\NYTimes') {
$file = substr($className, 6);
$file = str_replace("\\", '/', $file);
$file .= '.php';
$path = realpath(__DIR__ . '/../src');
return include $path . '/' . $file;
}
if (substr($className, 0, 6) == 'HTTP_R') {
return include str_replace('_', '/', $className) . '.php';
}
return false;
}
spl_autoload_register('testAutoloader');
EOF
