-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added simple cache administration script
Fixes in qgisproxy Update phpFastCache to 3.0.11
- Loading branch information
Showing
9 changed files
with
130 additions
and
30 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
|
||
require '../vendor/autoload.php'; | ||
require_once("settings.php"); | ||
|
||
//TODO custom settings | ||
//$config = array( | ||
// //"htaccess" => false, | ||
// //"path" => "/var/tmp", // default path for files | ||
// //"securityKey" => "", // default will good. It will create a path by PATH/securityKey | ||
// "fallback" => "files" | ||
//); | ||
//$cache = phpFastCache("files", $config); | ||
$cache = phpFastCache("files"); | ||
|
||
$test = $cache->fallback; | ||
|
||
if (isset($_GET["clear"])) { | ||
|
||
$clear = $_GET["clear"]; | ||
if ($clear == 'all') { | ||
$cache->clean(); | ||
} | ||
else { | ||
$cache->delete($clear); | ||
} | ||
header("Location:" . $_SERVER['SCRIPT_NAME']); | ||
} else { | ||
echo '<a href="' . $_SERVER['SCRIPT_NAME'] . '?clear=all">Clear all cache</a>'; | ||
} | ||
//TODO | ||
if (isset($_GET["view"])) { | ||
$view = $_GET["view"]; | ||
} | ||
|
||
// Stats | ||
echo "<pre>"; | ||
$stats = $cache->stats(); | ||
$path = $cache->getPath(); | ||
|
||
print_r("Cache size in bytes: ".$stats["size"]); //size of cached objects in bytes | ||
print_r("\nPath to store files: ".$path); | ||
print_r("\nCache content (key, size, write time):"); | ||
|
||
foreach ($stats["data"] as $key => $el) { | ||
$cmd_clear = '<a href="' . $_SERVER['SCRIPT_NAME'] . '?clear='.$key.'">clear </a>'; | ||
//$cmd_view = '<a href="' . $_SERVER['SCRIPT_NAME'] . '?view='.$key.'">view </a>'; | ||
print_r('</br>'.$cmd_clear.'<b>'.$key.'</b>,'.$el['size'].','.date('c',$el['write_time'])); | ||
} | ||
|
||
//TODO bug, doesn't work on files | ||
//print_r($cache->systemInfo()); | ||
|
||
echo "</pre>"; |
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
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
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
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 @@ | ||
1.0.0.beta2 |