Jump to content

[SOLVED] set parameters hardcoded in searchcron.php, how to?


deech123

Recommended Posts

UPDATE,

I solved the problem.

Hi guys,

I'v been looking and looking for a solution but nobody seems to be able to solve it.

I want to run my re-index page searchcron.php file in cronjob.
my hostingsfirm does not allow the extra parameters.

So my question is, is there any way to set the values :

full=1
token=fApv0mFp

this parameters are given normaly in the url like :
http://www.shop.com/adminfolder/searchcron.php?full=1&token=fApv0mFp

I can run the cronjob but without the full en token parameters.
so can I set them hardcoded in my code here under? (code is the full searchcron.php page)

<?php

include(dirname(__FILE__).'/../config/config.inc.php');

if (substr(_COOKIE_KEY_, 34, 8) != Tools::getValue('token'))
   die;

ini_set('max_execution_time', 7200);
Search::indexation(Tools::getValue('full'));
Tools::redirectAdmin($_SERVER['HTTP_REFERER'].'&conf=4');

?>




I thank every body that has a clue or tip.

Link to comment
Share on other sites

  • 2 months later...

You should create a new file in your admin folder (eg: searchcron_auto.php)

The searchcron_auto.php file :

<?php
include(dirname(__FILE__).'/../config/config.inc.php');
ini_set('max_execution_time', 7200);
Search::indexation(1);
?>



This file must have CHMOD 755 rights.

And now, run your cron file with this url : /absolute_dir/admin_folder/searchcron_auto.php

Sample cron file :

#!/bin/sh
php /absolute_dir/admin_folder/searchcron_generalissime.php

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...