how to clear override cache?

Author Message

Eric Bourgain

Saturday 03 March 2007 8:25:04 am

As I'm am unable to make the class_group match override rule work, I generate overrides by script. The idea is that I create class (form class), and that I want them to use a specific template.
I generate the override, the class, that is OK. But when I create an instance of my class, the new override rule is not known: I get the default template!!
the override. ini has been generated through different ways. It is currently done through a code directly mimicked from visual/emplatecreate.php:

    $overrideINI=eZINI::instance('override.ini', 'settings', null, null, true);
    $overrideINI->prependOverrideDir("siteaccess/$siteAccess",
                                     false,
                                     'siteaccess');
    $overrideINI->loadCache();
    $overrideINI->setVariable("line_$classIdentifier",
                              'Source',
                              'node/view/line.tpl');
    $overrideINI->setVariable("line_$classIdentifier",
                              'MatchFile',
                              $lineTemplate);
    $overrideINI->setVariable("line_$classIdentifier",
                              'Subdir',
                              "templates");
    $overrideINI->setVariable("line_$classIdentifier",
                              'Match',
                              array('class_identifier' => $classIdentifier));
    $oldumask = umask(0);
    $overrideINI->save("siteaccess/$siteAccess/override.ini.append");
    chmod("settings/siteaccess/$siteAccess/override.ini.append.php",
          octdec($filePermission));
    umask($oldumask);
    include_once('kernel/classes/ezcontentcachemanager.php');
    eZContentCacheManager::clearAllContentCache();
    // Clear override cache
    $cachedDir = eZSys::cacheDirectory();
    $cachedDir .= "/override/";
    eZDir::recursiveDelete($cachedDir);

This is made at class creation, before the object creation. I've even added some extra clearcache instruction:

  include_once( "kernel/classes/ezcache.php" );
  eZCache::clearByTag( 'ini' );
  $cacheCleared['ini'] = true;
  include_once( 'kernel/classes/ezcontentcachemanager.php' );
  eZContentCacheManager::clearAllContentCache();
  $cachedDir = eZSys::cacheDirectory();
  $cachedDir .= "/override/";
  eZDir::recursiveDelete( $cachedDir );
  eZCache::clearByID( 'template-override' );

It does not work. The override is OK: if I remove template+contents cache, it works. But this is not an open option, since I mut be able to create form classes while the site is in production.
Does anyone have an idea?

Fabien Mas

Friday 09 March 2007 5:43:48 am

Hi,
I am also very interested by this ?
nobody knows ?

Thx, Fabien

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 31 2025 03:31:54
Script start
Timing: Jan 31 2025 03:31:54
Module start 'layout'
Timing: Jan 31 2025 03:31:54
Module start 'content'
Timing: Jan 31 2025 03:31:54
Module end 'content'
Timing: Jan 31 2025 03:31:54
Script end

Main resources:

Total runtime0.0214 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0039 588.1328151.2109
Module start 'layout' 0.00390.0033 739.3438220.6875
Module start 'content' 0.00720.0129 960.0313997.8047
Module end 'content' 0.02010.0013 1,957.835933.9922
Script end 0.0214  1,991.8281 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002210.3247140.0002
Check MTime0.00094.1459140.0001
Mysql Total
Database connection0.00062.960610.0006
Mysqli_queries0.002310.779730.0008
Looping result0.00000.042410.0000
Template Total0.00094.310.0009
Template load0.00073.475810.0007
Template processing0.00020.850810.0002
Override
Cache load0.00052.109810.0005
General
dbfile0.002411.343980.0003
String conversion0.00000.029040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs