Does anyone know how I could run
dev/buildcache?flush=1&force
each night on a PC which is running Windows 2003?
Thanks.
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
Does anyone know how I could run
dev/buildcache?flush=1&force
each night on a PC which is running Windows 2003?
Thanks.
I did not expect this to be so challenging!
The following command
d:/wamp/bin/php/php5.2.11/php d:/vhosts/buckfastleigh/sapphire/cli-script.php dev/buildcache flush=1 force=1
which I have issued at a dos prompt has so far taken 6 hours to publish 14 out of 17 pages. This operation takes seconds when issued in the browser after logging in.
Rather than trying to jump though all the hoops which running cli-script.php involves I think my preferred option would now be to run the command from my browser by bypassing authentication through checking IP address and script name.
However even this appears to be difficult in so far as I am struggling to find in which script I can add logic to stop the login page from appearing.
I will probably get there in the end but why does this have to be so time consuming? So far I have spent all day on this.
Ok, after 2 whole days of trying various things I think I have this sussed.
I inserted the following line at the top of Security::permissionFailure
if(stristr($_SERVER['QUERY_STRING'],'buildcache') && $_SERVER['REMOTE_ADDR']==$exempt_ip)return;
where $exempt_ip is the IP address which runs the script.
I am running Version 2.4.7.
PS. For some reason the script would only complete and create the cache files if the script's url contained a trailing slash.
e.g. dev/buildcache/?flush=1&force