The online racing simulator
Anyone here good with IIS + Cronjobs?
(8 posts, started )
#1 - CSU1
Anyone here good with IIS + Cronjobs?
...on the off chance anyone is clued up on the above.

[brief description of setup]
IIS7 running latest MySQL and versions of PHP, the site in question is running Jooomla 1.5

I'm using MS Task Scheduler to run this batch file (cron.bat):
SET PATH="E:\php"
start php.exe E:\www\AMD\administrator\components\com_feedgator\cron.feedgator.php

and here is cron.feedgator.php:


<?php 
php

/**
* FeedGator - Aggregate RSS newsfeed content into a Joomla! database
* @version 2.3.2
* @package FeedGator
* @author Original author Stephen Simmons
* @now continued and modified by Matt Faulds, Remco Boom & Stephane Koenig and others
* @email mattfaulds@gmail.com
* @Joomla 1.5 Version by J. Kapusciarz (mrjozo)
* @copyright (C) 2005 by Stephen Simmons - All rights reserved
* @license GNU/GPL: http://www.gnu.org/copyleft/gpl.html
*
**/


define'_JEXEC');

define('DS'DIRECTORY_SEPARATOR);
define('JPATH_ROOT'substr(__FILE__,0,strrpos(__FILE__DS.'administrator')));
define('JPATH_BASE'JPATH_ROOT.DS.'administrator');
define('JPATH_COMPONENT'JPATH_BASE.DS.'components'.DS.'com_feedgator');

@require_once( 
JPATH_BASE.DS.'includes'.DS.'defines.php' );
require_once( 
JPATH_BASE.DS.'includes'.DS.'framework.php' );
require_once( 
JPATH_BASE.DS.'includes'.DS.'helper.php' );
require_once( 
JPATH_BASE.DS.'includes'.DS.'toolbar.php' );

$mainframe = &JFactory::getApplication('site');
$mainframe->initialise();

define('FG_VERSION''2.3.2');

$version = new JVersion();
define('J_VERSION'$version->getShortVersion());

require_once ( 
JPATH_COMPONENT.DS.'controller.php');
require_once ( 
JPATH_COMPONENT.DS.'factory.feedgator.php');
require_once ( 
JPATH_COMPONENT.DS.'helpers'.DS.'feedgator.helper.php');
require_once ( 
JPATH_COMPONENT.DS.'helpers'.DS.'feedgator.utility.php');
if(
file_exists(JPATH_ROOT.DS.'plugins'.DS.'system'.DS.'addkeywords.php')) {
    require_once( 
JPATH_ROOT.DS.'plugins'.DS.'system'.DS.'addkeywords.php' );
}
FeedgatorUtility:[:p]rofiling('Start cron');

define('SPIE_CACHE_AGE'60*10);

require_once( 
JPATH_ROOT.DS.'libraries'.DS.'simplepie'.DS.'simplepie.php');
require_once(
JPATH_COMPONENT.DS.'inc'.DS.'simplepie'.DS.'overrides.php');
FeedgatorUtility:[:p]rofiling('Loaded SimplePie');

JRequest::setVar('task','cron','get');
JRequest::setVar(JUtility::getToken(),'1','get');

$controller = new FeedgatorController();
$controller->import('all');

FeedgatorUtility:[:p]rofiling('End');
echo 
'Import finished';
?>

Long story short, I have to use this component (feedgator) as it grabs RSS feeds in a specific way no others do. Other components run their cron's without fail, but feedgators just doesn't seem to do anything even when I manually run the cron.bat

Q. How do I "see" any error's created by cron.feedgator.php? I have tried manually navigating to \administrator\components\com_feedgator\cron.feedgator.php with PHP error reporting turned ON but it creates nothing, no errors... Anyone have any ideas of what could be wrong by glancing through it and how I could debug it???
Echo a unique string after each suspicious line of code to see where the program stops. Or echo the important variables at various point to work as "watches" for values.
#3 - CSU1
Quote from breadfan :Echo a unique string after each suspicious line of code to see where the program stops. Or echo the important variables at various point to work as "watches" for values.

would you mind giving me (complete n00b) an example please?

I have MS Visual Web Dev. installed...dunno why lol, I've no clue about coding
"echo" in PHP is a command to write text to output. What breadfan suggests is that you put

echo "Script got here";

In the PHP script in a few places. As the script is executed line by line, you'll see the text written by "echo" appearing. It will help you track down where the script hangs, I hope you get the idea behind this...
you had set the path to E:\php, did it create anything in there?
#6 - CSU1
Quote from bunder9999 :you had set the path to E:\php, did it create anything in there?

na, afaik you just need to declare where php.exe is at the start of the batch file, php.exe itself would direct any errors to the set error/log folders

Quote from MadCatX :"echo" in PHP is a command to write text to output. What breadfan suggests is that you put

echo "Script got here";

In the PHP script in a few places. As the script is executed line by line, you'll see the text written by "echo" appearing. It will help you track down where the script hangs, I hope you get the idea behind this...

yes, thanks - It's getting to the 3rd last line of code ($controller->import('all');), and firefox threw out this error:
SimplePie error: XML error: XML_ERR_NAME_REQUIRED at line 376, column 64 for Auto Mechanic Dublin (http://www.beepbeep.ie/newsrss.php?section=Industry+News)

Reading around about this Simplepie error it seems to be something todo with the ampersand in feeds...feed validation for this feed confirms...

What's up with this '&', has anyone come across such errors and have worked around it???

E;

Ok, I understand the ampersand is XML spec and should not be used in RSS feeds,
Anyone know how I could tell the cron.php to replace '&' with 'and' in that code above???
w3c html validation.

use & instead of the & character.
#8 - CSU1
Quote from bunder9999 :w3c html validation.

use & instead of the & character.

Feedgator takes RSS feeds and converts it into content and articles, the problem is that the component (feedgator) does not like to see XML language anywhere in the title or body of any RSS feed.
This is only happening with that one feed so screw it - i thought it was a problem on my end (although it would be nice to have a workaround in case it comes across this & in the future...)

Anyone here good with IIS + Cronjobs?
(8 posts, started )
FGED GREDG RDFGDR GSFDG