partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

commit 72bd3f9756a9bea8dc37aca7c40f78e79031b78c
parent 2bc014bc1f3f8f3ae609165ebd6f775e2a9320a0
Author: Timo A. Hummel <timo@netraver.de>
Date:   Mon,  6 Jun 2011 15:17:22 +0200

Added utility service to clear the APC cache

Diffstat:
Msrc/de/RaumZeitLabor/PartDB2/REST/Request.php | 4++++
Asrc/de/RaumZeitLabor/PartDB2/Util/UtilService.php | 15+++++++++++++++
2 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/src/de/RaumZeitLabor/PartDB2/REST/Request.php b/src/de/RaumZeitLabor/PartDB2/REST/Request.php @@ -32,6 +32,10 @@ class Request { } public function getService () { + if ($this->controller == "") { + $this->controller = $_REQUEST["service"]; + } + $serviceName = $this->controller."Service"; $namespace = 'de\RaumZeitLabor\PartDB2\\'; $cat = $this->controller . "\\"; diff --git a/src/de/RaumZeitLabor/PartDB2/Util/UtilService.php b/src/de/RaumZeitLabor/PartDB2/Util/UtilService.php @@ -0,0 +1,14 @@ +<?php +namespace de\raumzeitlabor\PartDB2\Util; +declare(encoding = 'UTF-8'); + +use de\RaumZeitLabor\PartDB2\Service\AnonService; + +class UtilService extends AnonService { + public function clearCache () { + apc_clear_cache(); + apc_clear_cache("user"); + + return array("status" => "ok"); + } +}+ \ No newline at end of file