Results 1 to 4 of 4

Thread: Clear Cahce Code

  1. #1
    banning's Avatar
    banning is offline Sugar Community Member
    Join Date
    Jul 2010
    Location
    Kansas
    Posts
    73

    Exclamation Clear Cahce Code

    i've got this code

    Code:
    include_once('modules/Administration/QuickRepairAndRebuild.php') ;
    $repair = new RepairAndClear();
    $repair->clearVardefs();
    obviously by the title and code im trying to clear some cache LOL ... anyway no matter where i put it it doesn't seem to work. I put it on the page im working on i put it on contact.php i put it on all sorts of stuff. Is there something wrong with my code? My problem is is that im using window.location = url_with_some_variables. However when the link loads and i use the $_GET or $_REQUEST method all i get is the previous cached value. However when i run "Clear Vardefs Data Cache" in the admin panel and then refresh said page the new value comes in. But then the cycle starts a new and now since (i assume) since that value was just cached its stuck there HAHAHA until i run the "Clear Vardefs Data Cache" again.

    So i figured id just run "Clear Vardefs Data Cache" everytime i load that particular page and thats what im trying to accomplish with that code. Can't seem to get it to work though.

  2. #2
    davidboris is offline Sugar Community Member
    Join Date
    May 2010
    Posts
    1,113

    Default Re: Clear Cahce Code

    Hi,

    If you want to clear cache of an edit view, write the code inside view.edit.php

    and replace

    PHP Code:
    $repair->clearVardefs(); 
    by
    PHP Code:
    $repair->clearTpls(); 
    Thumbs up.

    Skype ID - david__boris

    SugarForge Projects:

    WYSIWYG now in studio!(Version 1.1 is out now!)

    Sugar Feeds on your personalized home pages like iGoogle, My Yahoo!, etc.

    Fab Tools! > Dashlet Not Followed Opportunities for past six Months

  3. #3
    banning's Avatar
    banning is offline Sugar Community Member
    Join Date
    Jul 2010
    Location
    Kansas
    Posts
    73

    Default Re: Clear Cahce Code

    david thank you for the replay but when i replace

    PHP Code:
     $repair->clearVardefs(); 
    with

    PHP Code:
     $repair->clearTpls(); 
    i get this error "Warning: in_array() [function.in-array]: Wrong datatype for second argument"

  4. #4
    banning's Avatar
    banning is offline Sugar Community Member
    Join Date
    Jul 2010
    Location
    Kansas
    Posts
    73

    Talking Re: Clear Cahce Code

    YAY! I figured it out!!! LOL

    here is the code in case anyone else runs into this issue... this does the same thing that the "Clear Vardefs Data Cache" link does in the "Admin" section under "Repair".

    PHP Code:

    include_once('modules/Administration/QuickRepairAndRebuild.php') ;
    $repair = new RepairAndClear();

    $modules = array('All Modules');
    $selected_actions = array('clearTpls''clearJsFiles''clearVardefs''clearJsLangFiles''clearDashlets''clearSugarFeedCache''clearThemeCache''rebuildAuditTables''rebuildExtensions''clearLangFiles''clearSearchCache''clearPDFFontCache''repairDatabase');
    $repair->repairAndClearAll($selected_actions$modulesfalsefalse); 

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. clear cache using code
    By neel1154 in forum Developer Help
    Replies: 0
    Last Post: 2010-07-26, 07:17 AM
  2. clear job log
    By user1000 in forum Developer Help
    Replies: 0
    Last Post: 2008-08-13, 04:23 AM
  3. Replies: 3
    Last Post: 2008-07-27, 06:30 PM
  4. Replies: 0
    Last Post: 2008-07-14, 04:40 PM
  5. Clear Sugar Bin
    By guptajee in forum General Discussion
    Replies: 0
    Last Post: 2006-01-13, 04:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •