google-code-backups / get-simple-cms

Automatically exported from code.google.com/p/get-simple-cms
GNU General Public License v3.0
0 stars 0 forks source link

caching-save hook called for every file #310

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Is the caching-save hook supposed to be called for every file in the loop in
create_pagesxml()
or only after ?

Because it is being called once for each file.

Original issue reported on code.google.com by tablatronics on 3 Apr 2012 at 2:40

GoogleCodeExporter commented 8 years ago
'caching-save' was initially intended to let plugin authors to add custom 
fields to the pages index:

http://get-simple.info/wiki/config:caching-function#caching-save

Later it it was not necessary since all fields but content were now added 
automatically.

r690 has just undone this.

Original comment by carnav on 3 Apr 2012 at 7:40

GoogleCodeExporter commented 8 years ago
@tabletronics its should run for each file to allow plugin writers to 
manipulate or change the caching. 

@carnav, I took it out to do some testing in the caching, there are occasions 
when a infinite loop is created and the site will crash. This should be fixed 
now. 

Original comment by MichaelS...@gmail.com on 3 Apr 2012 at 8:25

GoogleCodeExporter commented 8 years ago

Original comment by MichaelS...@gmail.com on 3 Apr 2012 at 8:26

GoogleCodeExporter commented 8 years ago
How does a plugin author know which file the hook call is on in the loop ?

Original comment by tablatronics on 3 Apr 2012 at 8:27

GoogleCodeExporter commented 8 years ago

Original comment by tablatronics on 3 Apr 2012 at 8:43

GoogleCodeExporter commented 8 years ago
actually not sure the hook is usable as only $pagesArray is available in GLOBAL 
scope. 

I'll see if I can dig up how I used it initially. 

Original comment by MichaelS...@gmail.com on 3 Apr 2012 at 9:34

GoogleCodeExporter commented 8 years ago
Yeah it seems as if the hook should be called once before the xml is saved, and 
things added to the array. Not in side the loop. If one tried to use it now, it 
would do what they wanted many many times.

Original comment by tablatronics on 3 Apr 2012 at 11:16

GoogleCodeExporter commented 8 years ago

Original comment by tablatronics on 18 Jul 2012 at 1:46