halvid,
I have gotten the same problem. How did you fix it?
I ended up using:
include_once $modx->config['base_path'] . "manager/processors/cache_sync.class.processor.php";
$sync = new synccache();
$sync->setCachepath($modx->config['base_path'] . "assets/cache/");
$sync->setReport(false);
$sync->emptyCache();
$modx->invokeEvent("OnSiteRefresh");
Using it with CodeIgniter
I’ve tried to include this API class into the libraries folder inside CodeIgniter and ensured that the paths are correct and are at the same level.
However regardless of what I do I can’t get the API class to either load, run or do any MODX stuff, such as getting chunks, parsing them, etc.
What I’d like to do is to use CI as a way of building modules that sit outside of MODX... but I’ve realised that its very difficult to do without using an IFRAME, and even then it doesn’t work 100%.
Does anyone have a full blow-by-blow list of how to create a module using CodeIgniter using this API as a library?
Thanks.
found a bug in function saveTVs:
some tvs were not saved. I found it is when the old value is the same as the tmplvarid.
Of course cannot, when the script continues the loop in the case old-value == tmplvarid.
here is a fix for that:
<?php
if(isset($this->tvNames[$tv])){
$tmplvarid=$this->tvNames[$tv];
if(isset($this->oldTVs[$tv])){
//echo $this->oldTVs[$tv].':'.$this->tvNames[$tv].' ';
//if($this->oldTVs[$tv]==$this->tvNames[$tv]) continue;//by Bruno: here found a bug
if($this->oldTVs[$tv]==$value) continue;//by Bruno: must be like this
$sql="UPDATE $tvc SET value='$value' WHERE tmplvarid=$tmplvarid AND contentid=$id";
}
else
$sql="INSERT INTO $tvc (tmplvarid,value,contentid) VALUES ($tmplvarid,'$value',$id)";
$modx->db->query($sql);
}
?>