ESTRICT fixes

This commit is contained in:
Grischa Brockhaus 2012-06-13 15:43:09 +02:00
parent fc19cfc5d0
commit 765c0d00d2

View file

@ -8,7 +8,7 @@
class TwitterPluginFileAccess {
function get_file_from_template( $filename, $plugin_rel_url ) {
static function get_file_from_template( $filename, $plugin_rel_url ) {
$filenamebase = basename($filename);
$tfile = serendipity_getTemplateFile($filenamebase, 'serendipityPath');
if (!$tfile || $tfile == $filenamebase) {
@ -35,12 +35,12 @@ class TwitterPluginFileAccess {
/**
* Returns the s9y cache directory
*/
function get_cache_prefix(){
static function get_cache_prefix(){
global $serendipity;
return $serendipity['serendipityPath'] . PATH_SMARTY_COMPILE . '/serendipity_event_twitter';
}
function get_lock($lock, $maxlock_sec=300) {
static function get_lock($lock, $maxlock_sec=300) {
$lockfname = TwitterPluginFileAccess::get_cache_prefix() . "_$lock.lock";
if(file_exists($lockfname) && ((time() - filemtime($lockfname)) < $maxlock_sec)) {
// The resource is locked. You can either move on to next tasks or wait and check periodically in a loop
@ -51,7 +51,7 @@ class TwitterPluginFileAccess {
}
}
function free_lock($lock) {
static function free_lock($lock) {
$lockfname = TwitterPluginFileAccess::get_cache_prefix() . "_$lock.lock";
@unlink($lockfname); // Release the lock
}