Commit 4dd1dc1f authored by Francois Beaulieu's avatar Francois Beaulieu

Initial Commit

parents
<?xml version="1.0" encoding="UTF-8"?>
<buildpath>
<buildpathentry kind="src" path=""/>
<buildpathentry kind="con" path="org.eclipse.php.core.LANGUAGE"/>
</buildpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>medclearcache</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.dltk.core.scriptbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.php.core.PHPNature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
include_path=0;/clearfullcache
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<fixed facet="php.component"/>
<fixed facet="php.core.component"/>
<installed facet="php.core.component" version="1"/>
<installed facet="php.component" version="5.4"/>
</faceted-project>
<?php
/***************************************************************
* Copyright notice
*
* (c) 2014 Raphael Zschorsch <zschorsch@medialis.net>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* [CLASS/FUNCTION INDEX of SCRIPT]
*
*
*
* 44: class tx_clearfullcache
* 50: public static function clear()
*
* TOTAL FUNCTIONS: 1
*/
/**
* Main class file for the 'clearfullcache' extension
*
* @author Raphael Zschorsch <zschorsch@medialis.net>
* @package TYPO3
* @subpackage tx_clearfullcache
*/
class tx_clearfullcache {
/**
* Clears all caches
*
* @return void
*/
public static function clear() {
$cacheDir = PATH_site.'typo3temp/Cache';
self::rrmdir($cacheDir);
//ClearBootstrapComponents
$cacheDir = PATH_site.'typo3temp/bootstrapcomponents';
self::rrmdir($cacheDir);
//Clear compressor
$cacheDir = PATH_site.'typo3temp/compressor';
self::rrmdir($cacheDir);
//Clear Temp
$cacheDir = PATH_site.'typo3temp/temp';
self::rrmdir($cacheDir);
//Clear _processed_
$cacheDir = PATH_site.'typo3temp/_processed_';
self::rrmdir($cacheDir);
//Clear llxml
$cacheDir = PATH_site.'typo3temp/llxml';
self::rrmdir($cacheDir);
// Remove temp files
$files = glob(PATH_site.'typo3conf/temp_CACHED_*.php');
array_walk($files, function ($file) {
unlink($file);
});
// Remove locallang files
$files = glob(PATH_site.'typo3temp/locallang-*.*');
array_walk($files, function ($file) {
unlink($file);
});
// Remove javascript files
$files = glob(PATH_site.'typo3temp/javascript_*.*');
array_walk($files, function ($file) {
unlink($file);
});
// Remove javascript files
$files = glob(PATH_site.'typo3temp/rtehtmlarea_*.*');
array_walk($files, function ($file) {
unlink($file);
});
// Remove javascript files
$files = glob(PATH_site.'typo3temp/stylesheet_*.*');
array_walk($files, function ($file) {
unlink($file);
});
// Remove temp t3med files
if(is_dir(PATH_site.'typo3temp/t3med')) {
$files = glob(PATH_site.'typo3temp/t3med/t3med-*.css');
array_walk($files, function ($file) {
unlink($file);
});
// Get extension config
$extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['t3med']);
$tempDirectories = array(
PATH_site . 'typo3temp/t3med/less/' => $extConf['cacheTime'],
);
self::clearDirectories($tempDirectories);
}
// Clear cf_* tables
$GLOBALS['TYPO3_DB']->sql_query('TRUNCATE TABLE cf_cache_hash;');
$GLOBALS['TYPO3_DB']->sql_query('TRUNCATE TABLE cf_cache_hash_tags;');
$GLOBALS['TYPO3_DB']->sql_query('TRUNCATE TABLE cf_cache_pages;');
$GLOBALS['TYPO3_DB']->sql_query('TRUNCATE TABLE cf_cache_pagesection;');
$GLOBALS['TYPO3_DB']->sql_query('TRUNCATE TABLE cf_cache_pagesection_tags;');
$GLOBALS['TYPO3_DB']->sql_query('TRUNCATE TABLE cf_cache_pages_tags;');
$GLOBALS['TYPO3_DB']->sql_query('TRUNCATE TABLE cf_cache_rootline;');
$GLOBALS['TYPO3_DB']->sql_query('TRUNCATE TABLE cf_cache_rootline_tags;');
$GLOBALS['TYPO3_DB']->sql_query('TRUNCATE TABLE cf_extbase_datamapfactory_datamap;');
$GLOBALS['TYPO3_DB']->sql_query('TRUNCATE TABLE cf_extbase_datamapfactory_datamap_tags;');
$GLOBALS['TYPO3_DB']->sql_query('TRUNCATE TABLE cf_extbase_object;');
$GLOBALS['TYPO3_DB']->sql_query('TRUNCATE TABLE cf_extbase_object_tags;');
$GLOBALS['TYPO3_DB']->sql_query('TRUNCATE TABLE cf_extbase_reflection;');
$GLOBALS['TYPO3_DB']->sql_query('TRUNCATE TABLE cf_extbase_reflection_tags;');
$GLOBALS['TYPO3_DB']->sql_query('TRUNCATE TABLE cf_extbase_typo3dbbackend_queries;');
$GLOBALS['TYPO3_DB']->sql_query('TRUNCATE TABLE cf_extbase_typo3dbbackend_queries_tags;');
$GLOBALS['TYPO3_DB']->sql_query('TRUNCATE TABLE cf_extbase_typo3dbbackend_tablecolumns;');
$GLOBALS['TYPO3_DB']->sql_query('TRUNCATE TABLE cf_extbase_typo3dbbackend_tablecolumns_tags;');
$GLOBALS['TYPO3_DB']->sql_query('TRUNCATE TABLE cf_workspaces_cache;');
$GLOBALS['TYPO3_DB']->sql_query('TRUNCATE TABLE cf_workspaces_cache_tags;');
}
public static function clearDirectories($tempDirectories) {
$now = $GLOBALS['EXEC_TIME'];
foreach ($tempDirectories as $tempDirectory => $maxAge) {
if (!is_dir($tempDirectory)) {
continue;
}
$handle = opendir($tempDirectory);
while (FALSE !== ($file = readdir($handle))) {
if ($file === '.' || $file === '..') {
continue;
}
if (is_file($tempDirectory . $file)) {
// get last modification time
$lastAccess = fileatime($tempDirectory . $file);
$age = $now - $lastAccess;
if ($age >= $maxAge) {
unlink($tempDirectory . $file);
}
}
}
}
}
public static function rrmdir($dir) {
if (is_dir($dir)) {
$objects = scandir($dir);
foreach ($objects as $object) {
if ($object != "." && $object != "..") {
if (filetype($dir."/".$object) == "dir") self::rrmdir($dir."/".$object); else unlink($dir."/".$object);
}
}
reset($objects);
rmdir($dir);
}
}
}
/**
* XCLASS Inclusion
*/
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/clearfullcache/class.tx_clearfullcache.php']) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/clearfullcache/class.tx_clearfullcache.php']);
}
?>
\ No newline at end of file
<?php
/***************************************************************
* Copyright notice
*
* (c) 2014 Raphael Zschorsch <zschorsch@medialis.net>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* [CLASS/FUNCTION INDEX of SCRIPT]
*
*
*
* 45: class tx_clearfullcache_cachemenu implements backend_cacheActionsHook
* 54: public function manipulateCacheActions(&$a_cacheActions, &$a_optionValues)
*
* TOTAL FUNCTIONS: 1
*/
require_once(t3lib_extMgm::extPath('clearfullcache').'class.tx_clearfullcache.php');
/**
* Main class file for the 'clearfullcache' extension
*
* @author Raphael Zschorsch <zschorsch@medialis.net>
* @package TYPO3
* @subpackage tx_clearfullcache
*/
class tx_clearfullcache_cachemenu implements \TYPO3\CMS\Backend\Toolbar\ClearCacheActionsHookInterface {
/**
* Adds the option to clear all the caches in the back-end clear cache menu.
*
* @param array $a_cacheActions
* @param array $a_optionValues
* @return void
* @see typo3/interfaces/backend_cacheActionsHook#manipulateCacheActions($cacheActions, $optionValues)
*/
public function manipulateCacheActions(&$a_cacheActions, &$a_optionValues) {
if($GLOBALS['BE_USER']->isAdmin() || $GLOBALS['BE_USER']->getTSConfigVal('options.clearCache.clearfullcache')) {
$s_title = $GLOBALS['LANG']->sL('LLL:EXT:clearfullcache/locallang.xml:rm.clearCacheMenu_clearfullcache', true);
$s_imagePath = t3lib_extMgm::extRelPath('clearfullcache').'res/';
//if(strpos($s_imagePath,'typo3conf') !== false) $s_imagePath = '../'.$s_imagePath;
$a_cacheActions[] = array(
'id' => 'clearfullcache',
'title' => $s_title,
'href' => 'ajax.php?ajaxID=tx_clearfullcache::clear',
'icon' => '<img src="'.$s_imagePath.'be_icon.png" title="'.$s_title.'" alt="'.$s_title.'" />',
);
$a_optionValues[] = 'clearCacheMed';
}
}
}
/**
* XCLASS Inclusion
*/
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/clearfullcache/class.tx_clearfullcache_cachemenu.php']) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/clearfullcache/class.tx_clearfullcache_cachemenu.php']);
}
?>
\ No newline at end of file
a:3:{s:4:"save";a:3:{s:13:"extension_key";s:18:"realurl_clearcache";s:18:"print_wop_comments";s:1:"0";s:15:"overwrite_files";a:5:{s:9:"ChangeLog";s:1:"1";s:10:"README.txt";s:1:"1";s:12:"ext_icon.gif";s:1:"1";s:19:"doc/wizard_form.dat";s:1:"1";s:20:"doc/wizard_form.html";s:1:"1";}}s:6:"emconf";a:1:{i:1;a:7:{s:5:"title";s:20:"RealURL: Clear cache";s:11:"description";s:71:"Adds a clear cache button for RealURL in the back-end clear cache menu.";s:8:"category";s:2:"be";s:5:"state";s:4:"beta";s:12:"dependencies";s:7:"realurl";s:6:"author";s:43:"Sebastiaan de Jonge (SebastiaanDeJonge.com)";s:12:"author_email";s:20:"szebi.eger@gmail.com";}}s:6:"module";a:0:{}}
\ No newline at end of file
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
<table border="0" cellpadding="2" cellspacing="2"><tr bgcolor=""><td><strong><span style="font-family:verdana,arial,sans-serif; font-size:10px;">General info</span></strong></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;">Enter general information about the extension here: Title, description, category, author...</span></td></tr><tr><td></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><strong>Title:</strong><br /><a name="260dbfdff6"></a><input type="text" name="kickstarter[wizArray_upd][emconf][1][title]" value="RealURL: Clear cache" style="width:200px;" onchange="setFormAnchorPoint('260dbfdff6');" title="WOP: [emconf][1][title]"></span></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><strong>Description:</strong><br /><a name="e9cba6944a"></a><textarea name="kickstarter[wizArray_upd][emconf][1][description]" style="width:600px;" rows="10" wrap="off" onchange="setFormAnchorPoint('e9cba6944a');" title="WOP:[emconf][1][description]" title="WOP: [emconf][1][description]">
Adds a clear cache button for RealURL in the back-end clear cache menu.</textarea></span></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><strong>Category:</strong><br /><a name="b46008f89f"></a><select name="kickstarter[wizArray_upd][emconf][1][category]" onchange="setFormAnchorPoint('b46008f89f');" title="WOP: [emconf][1][category]"><option value=""></option><option value="fe">Frontend</option><option value="plugin">Frontend Plugins</option><option value="be" selected="selected">Backend</option><option value="module">Backend Modules</option><option value="services">Services</option><option value="example">Examples</option><option value="misc">Miscellaneous</option><option value="templates">Templates</option><option value="doc">Documentation</option></select></span></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><strong>State</strong><br /><a name="dbd328a5a5"></a><select name="kickstarter[wizArray_upd][emconf][1][state]" onchange="setFormAnchorPoint('dbd328a5a5');" title="WOP: [emconf][1][state]"><option value="alpha">Alpha (Very initial development)</option><option value="beta" selected="selected">Beta (Under current development, should work partly)</option><option value="stable">Stable (Stable and used in production)</option><option value="experimental">Experimental (Nobody knows if this is going anywhere yet...)</option><option value="test">Test (Test extension, demonstrates concepts etc.)</option></select></span></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><strong>Dependencies (comma list of extkeys):</strong><br /><a name="ce30f2d5ba"></a><input type="text" name="kickstarter[wizArray_upd][emconf][1][dependencies]" value="realurl" style="width:200px;" onchange="setFormAnchorPoint('ce30f2d5ba');" title="WOP: [emconf][1][dependencies]"></span></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><strong>Author Name:</strong><br /><a name="5317cdfcff"></a><input type="text" name="kickstarter[wizArray_upd][emconf][1][author]" value="Sebastiaan de Jonge (SebastiaanDeJonge.com)" style="width:200px;" onchange="setFormAnchorPoint('5317cdfcff');" title="WOP: [emconf][1][author]"></span></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><strong>Author email:</strong><br /><a name="58289f4384"></a><input type="text" name="kickstarter[wizArray_upd][emconf][1][author_email]" value="szebi.eger@gmail.com" style="width:200px;" onchange="setFormAnchorPoint('58289f4384');" title="WOP: [emconf][1][author_email]"></span></td></tr></table>
</body>
</html>
\ No newline at end of file
<?php
/***************************************************************
* Extension Manager/Repository config file for ext "medclearcache".
*
* Auto generated 24-11-2014 14:56
*
* Manual updates:
* Only the data in the array - everything else is removed by next
* writing. "version" and "dependencies" must not be touched!
***************************************************************/
$EM_CONF[$_EXTKEY] = array (
'title' => 'Clear Full Cache',
'description' => 'Remove all cache',
'category' => 'be',
'shy' => false,
'version' => '1.0.0',
'dependencies' => '',
'conflicts' => '',
'priority' => '',
'loadOrder' => '',
'module' => '',
'state' => 'alpha',
'uploadfolder' => false,
'createDirs' => '',
'modify_tables' => '',
'clearcacheonload' => true,
'lockType' => '',
'author' => 'Maxime Demers',
'author_email' => 'maxime.demers@msp.gouv.qc.ca',
'author_company' => 'Ministère de la sécurité publique - Gouvernement du Québec',
'CGLcompliance' => NULL,
'CGLcompliance_note' => NULL,
'constraints' =>
array (
'depends' =>
array (
'typo3' => '6.2'
),
'conflicts' =>
array (
),
'suggests' =>
array (
),
),
);
?>
\ No newline at end of file
<?php
if (!defined ("TYPO3_MODE")) die ("Access denied.");
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['additionalBackendItems']['cacheActions'][] = 'EXT:clearfullcache/class.tx_clearfullcache_cachemenu.php:&tx_clearfullcache_cachemenu';
$TYPO3_CONF_VARS['BE']['AJAX']['tx_clearfullcache::clear'] = 'EXT:clearfullcache/class.tx_clearfullcache.php:tx_clearfullcache->clear';
?>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3locallang>
<meta type="array">
<type>database</type>
<description>Language labels extension 'medclearcache'</description>
</meta>
<data type="array">
<languageKey index="default" type="array">
<label index="rm.clearCacheMenu_clearfullcache">Clear all caches</label>
</languageKey>
<languageKey index="de" type="array">
<label index="rm.clearCacheMenu_clearfullcache">Alle Caches löschen</label>
</languageKey>
</data>
</T3locallang>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment