Home Private Messages Search
CPG Dragonfly™ CMS Dedicated Server & Bandwidth Sponsored by DedicatedNOW
Toggle Content
 
Forums ⇒ CMS (All) ⇒ Requests :: Archives ⇒ [solved]way to clear cache through Dragonfly :: Archived


[solved]way to clear cache through Dragonfly :: Archived
Requests for core changes must be submitted through the Projects Features section.
Go to page 1, 2  Next
This forum is locked: you cannot post, reply to, or edit topics.    This topic is locked: you cannot edit posts or make replies.    Printer Friendly Page     Forum Index ⇒  Requests

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

Offline Offline
Joined: Dec 20, 2004
Posts: 110
Location: Harrisburg, PA, USA
PostPosted: 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
View user's profile Visit poster's website AIM Address
Head-e
Silver Supporter
Silver Supporter

Offline Offline
Joined: Apr 20, 2004
Posts: 937

PostPosted: Thu Jul 21, 2005 8:33 pm
Post subject: Re: way to clear cache through Dragonfly

i second this idea Smile


Head-e please enter your server specs in your user profile! Crying or Very sad
Back to top
View user's profile Photo Gallery
ians
Heavy poster
Heavy poster

Offline Offline
Joined: Feb 23, 2005
Posts: 209
Location: Switzerland
PostPosted: 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
View user's profile Visit poster's website MSN Messenger
xfsunoles
XHTML Specialist
XHTML Specialist

Offline Offline
Joined: Apr 30, 2004
Posts: 2502
Location: Melbourne, Florida
PostPosted: 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
View user's profile Visit poster's website AIM Address MSN Messenger Yahoo Messenger Photo Gallery
Head-e
Silver Supporter
Silver Supporter

Offline Offline
Joined: Apr 20, 2004
Posts: 937

PostPosted: 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! Crying or Very sad
Back to top
View user's profile Photo Gallery
bitwisehost
Nice poster
Nice poster

Offline Offline
Joined: Dec 20, 2004
Posts: 110
Location: Harrisburg, PA, USA
PostPosted: 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
View user's profile Visit poster's website AIM Address
ians
Heavy poster
Heavy poster

Offline Offline
Joined: Feb 23, 2005
Posts: 209
Location: Switzerland
PostPosted: 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
View user's profile Visit poster's website MSN Messenger
xfsunoles
XHTML Specialist
XHTML Specialist

Offline Offline
Joined: Apr 30, 2004
Posts: 2502
Location: Melbourne, Florida
PostPosted: 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
View user's profile Visit poster's website AIM Address MSN Messenger Yahoo Messenger Photo Gallery
WebSiteGuru
1000+ Posts Club
1000+ Posts Club

Offline Offline
Joined: Jun 09, 2005
Posts: 2318

PostPosted: 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. Wink

_________________
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
View user's profile Visit poster's website Yahoo Messenger
run0
Supporter
Supporter

Offline Offline
Joined: Jun 28, 2004
Posts: 1559

PostPosted: 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
View user's profile Visit poster's website
norbie
Silver Supporter
Silver Supporter

Offline Offline
Joined: Jun 29, 2004
Posts: 737
Location: Norbie's World
PostPosted: 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 Wink

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
View user's profile Send e-mail Visit poster's website MSN Messenger
bitwisehost
Nice poster
Nice poster

Offline Offline
Joined: Dec 20, 2004
Posts: 110
Location: Harrisburg, PA, USA
PostPosted: 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('&amp;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 .= ' &gt; 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 .= ' &gt; 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('&amp;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&amp;type=mmcache').'">
<input type="submit" name="mode" value="Info" title="Current cached" style="width: 100px;" />&nbsp;'
;
if ($mmcache['encoder']) { // 2.3.10
echo '
<input type="submit" name="mode" value="Encode" title="Encode a file/directory" style="width: 100px;" />&nbsp;'
;
}
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&amp;type=eaccel').'">
<input type="submit" name="mode" value="Info" title="Current cached" style="width: 100px;" />&nbsp;'
;
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;" />&nbsp;'
;
}
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
View user's profile Visit poster's website AIM Address
ians
Heavy poster
Heavy poster

Offline Offline
Joined: Feb 23, 2005
Posts: 209
Location: Switzerland
PostPosted: 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 Wink

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" Very Happy

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
View user's profile Visit poster's website MSN Messenger
bitwisehost
Nice poster
Nice poster

Offline Offline
Joined: Dec 20, 2004
Posts: 110
Location: Harrisburg, PA, USA
PostPosted: 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
View user's profile Visit poster's website AIM Address
WebSiteGuru
1000+ Posts Club
1000+ Posts Club

Offline Offline
Joined: Jun 09, 2005
Posts: 2318

PostPosted: Fri Jul 22, 2005 5:45 pm
Post subject: Re: way to clear cache through Dragonfly

Cool I'll try that. Wink

_________________
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
View user's profile Visit poster's website Yahoo Messenger
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.    This topic is locked: you cannot edit posts or make replies.    Printer Friendly Page    Forum Index ⇒  Requests
Page 1 of 2
All times are GMT
Go to page 1, 2  Next

Archive Revive
Username:
This is an archived topic - your reply will not be appended here.
Instead, a new topic will be generated in the active forum.
The new topic will provide a reference link to this archived topic.
 
   Toggle Content User Info

Welcome Anonymous

Nickname
Password
(Register)

   Toggle Content Last CVS commits
· Fixed .ico Expires header.
· Removed domain name from cookies so subdomains wont access them anymore.
· CSS and JS, case insensitives.
· CSS and JS, send correct HTTP 1.1 headers and fixed issues where themes and...
· Further security class improvements.
· 301 redirects on LEO changes
· Option to force 3xx http status codes
· Validate googlebot.com and google.com crawlers.
· CCBot
· Rss with etag and atom.

閱讀詳細內容...

   Toggle Content Community

Support for DragonflyCMS in a other languages:

Deutsch
Español

   Toggle Content X-links
UltraEdit Browse Happy logo Firefox MySQL PostgreSQL Valid CSS! Valid XHTML 1.0! Unicode Encoded Badge NukeBiz Resources Raven DragonflyCMS Dedicated Now InsideSupport Lampe Berger

You are seeing squares or questionmarks on this page?

All content of this website is copyrighted by the Creative Commons NC-SA
The logos and trademarks used on this site are the property of their respective owners
We are not responsible for comments posted by our users, as they are the property of the poster.
Our server runs on a P3 1.2GHz with 512MB RAM with no accelerators
Support GoPHP5.org
Interactive software released under GNU GPL, Code Credits, Privacy Policy