1 bushleaguecritic Jun 02, 2010 03:04
3 bushleaguecritic Jun 02, 2010 04:31
Yep. The path is slightly different of, course, but that is exactly how my cron job is set up. But b2evo is adding a session entry to the b2evo session table every time cron wakes up and checks cron_exec.php. It's no big deal, but it's rather unnecessary.
Plus, the requested URI that gets stored isn't really relevant to web traffic reports. With a cron job like you suggested (and I've implemented)... the Requested URI that gets stored in the database would be: www.example.com/home/user/public_html/blogs/cron/cron_exec.php
Are you saying that redirecting the job's output to /dev/null 2>&1 is supposed to prevent b2evo from logging those hits and sessions?
4 sam2kb Jun 02, 2010 06:13
Are you saying that redirecting the job's output to /dev/null 2>&1 is supposed to prevent b2evo from logging those hits and sessions?
I don't think so. Actually this hit shouldn't be logged at all.
Let me check how it works...
5 sam2kb Jun 02, 2010 06:21
Ok, add this line to cron_exec.php, it should prevent logging.
require_once $inc_path .'_main.inc.php';
$Hit->logged = true;
6 bushleaguecritic Jun 02, 2010 13:14
That stopped it from logging anything in the hit table... so thanks for that! But it's still assigning it a new session ID and logging it every time. I took a chance and tried:
$Session->logged = true;
I got absolutely no love with that bit of code. :-/
Any ideas?
7 yabba Jun 02, 2010 15:10
if( ! $is_cli )
{ // This is a web request:
echo '<p><a href="cron_exec.php">Refresh Now!</a></p>';
echo '<p>This page should refresh automatically in 15 seconds...</p>';
echo '<!-- This is invalid HTML but it is SOOOOOO helpful! (Delay will be triggered when we reach that point -->';
echo '<meta http-equiv="Refresh" content="15" />';
debug_info();
?>
</body>
</html>
<?php
}
$Session->_session_needs_save = false;
$Hit->logged = true;
?>
¥
8 bushleaguecritic Jun 02, 2010 16:52
I had high hopes, but...
$Session->_session_needs_save = false;
seemed to have no effect - still creating and logging new session ids every time cron accesses the file.
Perhaps it has something to do with the following code in _main.inc.php?
/**
* The Session class.
*/
load_class('sessions/model/_session.class.php');
/**
* The Session object.
* It has to be instantiated before the "SessionLoaded" hook.
* @global Session
* @todo dh> This needs the same "SET NAMES" MySQL-setup as with Session::dbsave() - see the "TODO" with unserialize() in Session::Session()
* @todo dh> makes no sense in CLI mode (no cookie); Add isset() checks to calls on the $Session object, e.g. below?
* fp> We might want to use a special session for CLI. And for cron jobs through http as well.
*/
$Session = & new Session(); // IF this can't pull asesion from the DB it will always INSERT a new one!
9 yabba Jun 02, 2010 16:59
What happens if you add :
$Session->dbdelete();
Just after the needs saving stuff?
¥
10 bushleaguecritic Jun 02, 2010 17:27
No love there either.
- plus it sounded a little scary 8|
EDIT: and apparently, dbdelete() is an undefined method. I wondered when I didn't see it in the _session.class.php file. ;)
How did you set up the cron job? You should use the command like this