-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfnmatch.php
38 lines (34 loc) · 1.08 KB
/
fnmatch.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
<?php
/**
* TechDivision\ServletContainer\fnmatch
*
* PHP version 5
*
* @category Appserver
* @package TechDivision_ServletContainer
* @author Markus Stockbauer <[email protected]>
* @author Tim Wagner <[email protected]>
* @author Johann Zelger <[email protected]>
* @copyright 2013 TechDivision GmbH <[email protected]>
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* @link http://www.appserver.io
*/
$urls = array(
'/index.do',
'/index.do/index',
'/index.do/login'
);
$servlets = array(
'/index.do*' => '\TechDivision\ServletContainer\Servlets\IndexServlet',
'/index.do' => '\TechDivision\ServletContainer\Servlets\IndexServlet',
'/*' => '\TechDivision\ServletContainer\Servlets\IndexServlet',
'/' => '\TechDivision\ServletContainer\Servlets\IndexServlet'
);
foreach ($urls as $url) {
foreach ($servlets as $urlPattern => $className) {
if (fnmatch($urlPattern, $url)) {
echo "SUCCESS: $url:$urlPattern => $className\n";
continue (2);
}
}
}