-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathLearningLibrary.php
executable file
·64 lines (57 loc) · 1.48 KB
/
LearningLibrary.php
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
/**
* LearningLibrary.php
* Robotgen_autoload
* @author Yu Chao <[email protected]>
* @package Robotgen/algorithm/
* @version v1.0
* @license GPL
*
* @reference
* -Algorithm Reference
* @see
* -web Links
* -
*
*/
/**
* Algorithm Description
*=================================================================
*/
//namespace Robotgen;
/*
Copyright (c) 2013 Yu Chao <[email protected]> - under the GNU GPL.
See LICENSE for more information.
*/
function Robotgen_autoload($className) {
$libdir = dirname(__FILE__);
$directories = array(
"",
"algorithm/",
"algorithm/accessory/",
"algorithm/genetic/",
"algorithm/parametric/",
"algorithm/parametric/regression/",
"algorithm/swarm/genetices/strategies/",
"algorithm/swarm/genetices/strategies/concrete/",
"algorithm/unsupervised/",
);
$fileNameFormats = array(
"interface.%s.php",
"class.%s.php",
);
foreach ($directories as $directory) {
foreach ($fileNameFormats as $fileNameFormat) {
$path = $libdir . "/" . $directory . sprintf($fileNameFormat, $className);
if (file_exists($path)) {
echo $path."<br/>";
require_once $path;
return;
}
}
}
}
//pl_autoload_extensions(".php"); // comma-separated list
//spl_autoload_register(__NAMESPACE__."\Robotgen_autoload");
spl_autoload_register("Robotgen_autoload");
?>