This repository has been archived by the owner on Jul 18, 2023. It is now read-only.
forked from FabianBeiner/PHP-Dummy-Image-Generator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite Rules: Add Support php server, fix #1
- Loading branch information
Showing
2 changed files
with
45 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
const ROUTER_EXPREG = '#^(/images/)(film)?/?#i'; | ||
const FULLPATH_DUMMY_IMG_GENERATOR = '/path/to/PHP-Dummy-Image-Generator/index.php'; | ||
|
||
if (preg_match(ROUTER_EXPREG, $_SERVER['REQUEST_URI'], $extract)) { | ||
$_GET['cfg'] = $extract[2]; | ||
// var_dump($extract);return true; // debug | ||
require_once FULLPATH_DUMMY_IMG_GENERATOR; | ||
return true; | ||
|
||
} elseif (preg_match('#\.(?:png|jpe?g|gif|js|css|mp3|ogg|mp4|avi|webm|webp)$#', $_SERVER['REQUEST_URI'])) { | ||
return false; | ||
} else { | ||
require_once __DIR__.'/index.php'; | ||
} |