| Topic Archived |
View previous topic :: View next topic |
| Author |
Message |
bitwisehost Nice poster


Offline Joined: Dec 20, 2004 Posts: 110 Location: Harrisburg, PA, USA
|
Posted: Thu Jul 21, 2005 8:07 pm Post subject: [solved]way to clear cache through Dragonfly |
|
I thought it would be cool if there was a button in the administration side that would clear the cache directory.
The only way I know of is through cpanel or ftp
bitwisehost's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Red Hat/ Apache 1.3.33/ mySQL 4.0.22/ PHP 4.3.10/CPGNuke 9.0.6.1
|
|
| Back to top |
|
 |
Head-e Silver Supporter


Offline Joined: Apr 20, 2004 Posts: 937
|
|
| Back to top |
|
 |
ians Heavy poster


Offline Joined: Feb 23, 2005 Posts: 209 Location: Switzerland
|
Posted: Thu Jul 21, 2005 8:54 pm Post subject: Re: way to clear cache through Dragonfly |
|
I think personally I'd be more concerned about what common circumstance leads you to need to clear the cache on a regular basis and if it's better to address that root cause.
ians's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) FreeBSD 5.2.1-RELEASE, Apache 1.3.33, MySQL 4.0.16, PHP 4.3.9, DragnFly 9.0.1.1
|
|
| Back to top |
|
 |
xfsunoles XHTML Specialist


Offline Joined: Apr 30, 2004 Posts: 2502 Location: Melbourne, Florida
|
Posted: Thu Jul 21, 2005 9:19 pm Post subject: Re: way to clear cache through Dragonfly |
|
i can do allow you view and clear Cache Dir right on Admin Super Access?
_________________

Firefox is my Favorite Browser
xfsunoles's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Apache/1.3.34 (Unix)/4.0.25-standard/4.4.1/CVS
|
|
| Back to top |
|
 |
Head-e Silver Supporter


Offline Joined: Apr 20, 2004 Posts: 937
|
Posted: Thu Jul 21, 2005 9:31 pm Post subject: Re: way to clear cache through Dragonfly |
|
ians.. creating themes.. working on porting modules, etc... they require clearing cache frequently
Head-e please enter your server specs in your user profile!
|
|
| Back to top |
|
 |
bitwisehost Nice poster


Offline Joined: Dec 20, 2004 Posts: 110 Location: Harrisburg, PA, USA
|
Posted: Fri Jul 22, 2005 2:28 am Post subject: Re: way to clear cache through Dragonfly |
|
| Head-e wrote: |
| creating themes.. working on porting modules, etc... they require clearing cache frequently |
Exactly why I thought it would be cool to have.
bitwisehost's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Red Hat/ Apache 1.3.33/ mySQL 4.0.22/ PHP 4.3.10/CPGNuke 9.0.6.1
|
|
| Back to top |
|
 |
ians Heavy poster


Offline Joined: Feb 23, 2005 Posts: 209 Location: Switzerland
|
Posted: Fri Jul 22, 2005 5:45 am Post subject: Re: way to clear cache through Dragonfly |
|
would it not be easier just to make your cache unwriteable for the duration of that testing? I'm surprised mod ports needs this, I wasn't aware many made much use of cache.
ians's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) FreeBSD 5.2.1-RELEASE, Apache 1.3.33, MySQL 4.0.16, PHP 4.3.9, DragnFly 9.0.1.1
|
|
| Back to top |
|
 |
xfsunoles XHTML Specialist


Offline Joined: Apr 30, 2004 Posts: 2502 Location: Melbourne, Florida
|
Posted: Fri Jul 22, 2005 7:33 am Post subject: Re: way to clear cache through Dragonfly |
|
ians, Cache is help to speed up the site by reduce Queries but it take Queries into array
_________________

Firefox is my Favorite Browser
xfsunoles's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Apache/1.3.34 (Unix)/4.0.25-standard/4.4.1/CVS
|
|
| Back to top |
|
 |
WebSiteGuru 1000+ Posts Club


Offline Joined: Jun 09, 2005 Posts: 2318
|
Posted: Fri Jul 22, 2005 2:14 pm Post subject: Re: way to clear cache through Dragonfly |
|
Ians, I would agree with having an option to clear cache on the admin area. It is tipically harder to test or work on a theme and having to clear cache dir often. Espescially having to login to FTP to just clearing cache (when you have to).
Let me ask you this. What is the purpose of Admin Menu (area)?
To be able to administer it, right? So why not have all the tools you need to work right there.
As there was a saying I heard before:
| Quote:: |
| Work smarter, not harder |
If you want to work harder, so be my guess. I rather work smarter.
_________________ Lead Theme Designer - WebSiteGuru Designs
WebSiteGuru's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux 2.6.9 / Apache 2.2.6 / MySQL 5.0.27 / PHP 5 / DF Version 9.2.1
|
|
| Back to top |
|
 |
run0 Supporter


Offline Joined: Jun 28, 2004 Posts: 1559
|
Posted: Fri Jul 22, 2005 4:26 pm Post subject: Re: way to clear cache through Dragonfly |
|
er...I have never cleared cache while making a theme. like ians said, you could just make it unwritable until you're done, that would be even easier than having to constantly clear in admin
_________________

run0's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux/1.3.33 (Unix)/4.0.22-standard/4.3.9/DF 9.x
|
|
| Back to top |
|
 |
norbie Silver Supporter


Offline Joined: Jun 29, 2004 Posts: 737 Location: Norbie's World
|
Posted: Fri Jul 22, 2005 4:46 pm Post subject: Re: way to clear cache through Dragonfly |
|
If you're testing a theme though, you need to know that it will work properly in a normal environment.
Not everybody has to utilize the facility, if you don't want to use it then don't.
Several people do, that's why there's a request here
Personally, I think this would be a handy option in the Admin Section, even if I didn't use it that frequently.
_________________ Norbie

www.norbiesworld.co.uk
norbie's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux / Apache Custom Version / 4.0.26-standard (client: 5.0.15) / 4.4.4 / 9.1.1
|
|
| Back to top |
|
 |
bitwisehost Nice poster


Offline Joined: Dec 20, 2004 Posts: 110 Location: Harrisburg, PA, USA
|
Posted: Fri Jul 22, 2005 4:51 pm Post subject: Re: way to clear cache through Dragonfly |
|
Ok I figured out how to do this! Someone let me know if you see any problems or a better way to do this...
in admin/links/adlnk_main.php around line 43 rem out the if statement like below
| PHP: |
//if (function_exists('mmcache') || function_exists('eaccelerator')) { $menuitems['_AMENU1']['Cache']['URL'] = adminlink('cache'); $menuitems['_AMENU1']['Cache']['IMG'] = 'cache'; //}
|
Than I made changes to admin/modules/cache.php
Add this code just below line 26
| PHP: |
if ($mode == 'clear') { Cache::clear(); }
|
Add this code just below line 75
| PHP: |
if ($mode == 'clear') { echo '<center><font class="option"><strong>Cache Cleared</strong></font></center>'; } echo '<center><font class="option"><strong><a href="'.adminlink('&mode=clear').'">Click Here to Clear Cache</a></strong></font></center><br />';
|
Here is all of the cache.php code
| PHP: |
<?php /********************************************* CPG Dragonfly™ CMS ******************************************** Copyright © 2004 - 2005 by CPG-Nuke Dev Team www.dragonflycms.com
Dragonfly is released under the terms and conditions of the GNU GPL version 2 or any later version
$Source: /cvs/html/admin/modules/cache.php,v $ $Revision: 9.7 $ $Author: trevor $ $Date: 2005/05/09 21:04:24 $ **********************************************/ if (!defined('ADMIN_PAGES')) { exit; } if (!can_admin()) { die('Access Denied'); }
$showblocks = 0; $pagetitle .= ' '._BC_DELIM.' Caching';
if (isset($_POST['mode']) || isset($_GET['mode'])) { $mode = isset($_POST['mode']) ? $_POST['mode'] : $_GET['mode']; } else { $mode = ''; } /***************** Added to clear cache *****************/ if ($mode == 'clear') { Cache::clear(); }
$type = isset($_GET['type']) ? $_GET['type'] : '';
// External cache options $mmcache['installed'] = function_exists('mmcache'); $eaccel['installed'] = function_exists('eaccelerator');
if ($mmcache['installed']) { // $mmcache['encoder'] = (is_callable('mmcache_encode') || (!extension_loaded('Turck MMCache') && dl((PHP_OS=='WINNT'||PHP_OS=='WIN32')?'mmcache.dll':'mmcache.so') && is_callable('mmcache_encode'))); ob_start(); mmcache(); $cache = ob_get_contents(); ob_end_clean(); $cache = preg_split('/(<body>|<\/body>|<form.*?center>|<\/center><\/form>)/i', $cache, -1, PREG_SPLIT_NO_EMPTY); $mmcache['title'] = $cache[1]; $mmcache['form'] = $cache[2]; $mmcache['info'] = $cache[3]; unset($cache); if ($type == 'mmcache') { $pagetitle .= ' > Turck MMCache'; } } if ($eaccel['installed']) { // $eaccel['encoder'] = (is_callable('eaccelerator_encode') || (!extension_loaded('Turck MMCache') && dl((PHP_OS=='WINNT'||PHP_OS=='WIN32')?'mmcache.dll':'mmcache.so') && is_callable('mmcache_encode'))); ob_start(); eaccelerator(); $cache = ob_get_contents(); ob_end_clean(); $cache = preg_split('/(<body>|<\/body>|<form.*?center>|<\/center><\/form>)/i', $cache, -1, PREG_SPLIT_NO_EMPTY); // die(print_r($cache)); $eaccel['title'] = $cache[1]; $eaccel['form'] = $cache[2]; $eaccel['info'] = $cache[3]; unset($cache); if ($type == 'eaccel') { $pagetitle .= ' > eAccelerator'; } }
require('header.php'); GraphicAdmin('_AMENU1'); OpenTable(); /***************** Added to clear cache *****************/ if ($mode == 'clear') { echo '<center><font class="option"><strong>Cache Cleared</strong></font></center>'; } echo '<center><font class="option"><strong><a href="'.adminlink('&mode=clear').'">Click Here to Clear Cache</a></strong></font></center><br />';
echo '<fieldset><legend>Turck MMCache</legend>'; if (!$mmcache['installed']) { echo 'Turck MMCache is not installed on this server. You won\'t be able to give you website a tremendous speed boost. If you have full access to your server thru SSH you can get it at <a href="http://turck-mmcache.sourceforge.net/" target="_blank">turck-mmcache.sourceforge.net</a>. Additional information can be found <a href="http://www.vbulletin.com/forum/showthread.php?t=75878" target="_blank">here</a>.'; } else { echo ' <form method="post" action="'.adminlink('cache&type=mmcache').'"> <input type="submit" name="mode" value="Info" title="Current cached" style="width: 100px;" /> '; if ($mmcache['encoder']) { // 2.3.10 echo ' <input type="submit" name="mode" value="Encode" title="Encode a file/directory" style="width: 100px;" /> '; } echo $mmcache['form'].'</form>'; } echo '</fieldset>'; if ($type == 'mmcache') { if (!$mmcache['installed']) { echo '<h1 align="center">Turck MMCache is not installed</h1>'; } else if ($mode == 'Info') { echo $mmcache['title'].$mmcache['info']; } else if ($mode == 'Encode') { require('admin/modules/cache/mmcache.php'); } }
echo '<fieldset><legend>eAccelerator</legend>'; if (!$eaccel['installed']) { echo 'eAccelerator is not installed on this server. You won\'t be able to give you website a tremendous speed boost. If you have full access to your server thru SSH you can get it at <a href="http://eaccelerator.sourceforge.net/" target="_blank">eaccelerator.sourceforge.net</a>. Additional information can be found <a href="http://www.vbulletin.com/forum/showthread.php?t=75878" target="_blank">here</a>.'; } else { echo ' <form method="post" action="'.adminlink('cache&type=eaccel').'"> <input type="submit" name="mode" value="Info" title="Current cached" style="width: 100px;" /> '; if (isset($eaccel['encoder']) && $eaccel['encoder']) { // 2.3.10 echo ' <input type="submit" name="mode" value="Encode" title="Encode a file/directory" style="width: 100px;" /> '; } echo $eaccel['form'].'</form>'; } echo '</fieldset>'; if ($type == 'eaccel') { if (!$eaccel['installed']) { echo '<h1 align="center">eAccelerator is not installed</h1>'; } else if ($mode == 'Info') { echo $eaccel['title'].$eaccel['info']; } else if ($mode == 'Encode') { require('admin/modules/cache/eaccel.php'); } } CloseTable();
|
bitwisehost's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Red Hat/ Apache 1.3.33/ mySQL 4.0.22/ PHP 4.3.10/CPGNuke 9.0.6.1
|
|
| Back to top |
|
 |
ians Heavy poster


Offline Joined: Feb 23, 2005 Posts: 209 Location: Switzerland
|
Posted: Fri Jul 22, 2005 5:07 pm Post subject: Re: way to clear cache through Dragonfly |
|
| norbie wrote: |
If you're testing a theme though, you need to know that it will work properly in a normal environment.
Not everybody has to utilize the facility, if you don't want to use it then don't.
Several people do, that's why there's a request here 
Personally, I think this would be a handy option in the Admin Section, even if I didn't use it that frequently. |
I'd personally call features that aren't needed or used much "bloat"
I'm still having a hard time understanding the requirement for it. There's something about testing in a normal environment that would appear at odds with clearing the cache. So, it's unclear if this is supposed to be a testing tool or a development tool to me at least.
ians's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) FreeBSD 5.2.1-RELEASE, Apache 1.3.33, MySQL 4.0.16, PHP 4.3.9, DragnFly 9.0.1.1
|
|
| Back to top |
|
 |
bitwisehost Nice poster


Offline Joined: Dec 20, 2004 Posts: 110 Location: Harrisburg, PA, USA
|
Posted: Fri Jul 22, 2005 5:17 pm Post subject: Re: way to clear cache through Dragonfly |
|
I have had issues in the past when I installed a new mod and it wouldn't work. I think if you do a search in the forums alot of issues are solved by clearing the cache.
The function to clear the cache is already built into the Cache class. I just added a link to the cache.php that calls it.
bitwisehost's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Red Hat/ Apache 1.3.33/ mySQL 4.0.22/ PHP 4.3.10/CPGNuke 9.0.6.1
|
|
| Back to top |
|
 |
WebSiteGuru 1000+ Posts Club


Offline Joined: Jun 09, 2005 Posts: 2318
|
Posted: Fri Jul 22, 2005 5:45 pm Post subject: Re: way to clear cache through Dragonfly |
|
Cool I'll try that.
_________________ Lead Theme Designer - WebSiteGuru Designs
WebSiteGuru's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux 2.6.9 / Apache 2.2.6 / MySQL 5.0.27 / PHP 5 / DF Version 9.2.1
|
|
| Back to top |
|
 |
|
|