Created
September 28, 2011 03:19
-
-
Save jiskanulo/1246906 to your computer and use it in GitHub Desktop.
apc_clear_cache()をwebからたたく的な
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
<?php | |
$ip = (isset($_SERVER['REMOTE_ADDR'])) ? $_SERVER['REMOTE_ADDR'] : ''; | |
$allowed_ips = array( | |
'127.0.0.1', | |
'192.168.11.*', | |
); | |
$validate = false; | |
foreach ($allowed_ips as $allowed_ip) { | |
if (preg_match('/^' . $allowed_ip . '$/', $ip)) { | |
$validate = true; | |
break; | |
} | |
} | |
if (!$validate) { | |
die('You are not allowed to access this file.'); | |
} | |
apc_clear_cache(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment