? 747118-fatal-error-or-supercron.php-warning-33.patch
? 994294-rules_issue_2.patch2.patch
? 994294-rules_issue_multi_thread_4.patch
? sav
? supercron-main.inc.teting
Index: supercron-main.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/supercron/supercron-main.inc,v
retrieving revision 1.1
diff -u -p -r1.1 supercron-main.inc
--- supercron-main.inc	18 Mar 2010 23:02:38 -0000	1.1
+++ supercron-main.inc	10 Dec 2010 22:18:22 -0000
@@ -216,8 +216,11 @@ function supercron_exit() {
 
 function supercron_base_path() {
   global $base_path;
-
-  return str_replace('/index.php', '', $_SERVER['SCRIPT_FILENAME']) . $base_path;
+  // strip index.php 
+  $path =  str_replace('/index.php', '', $_SERVER['SCRIPT_FILENAME']) . $base_path;
+  // strip script name if passed
+  $path =  str_replace('/'.SUPERCRON_SCRIPT_NAME, '', $_SERVER['SCRIPT_FILENAME']) . $base_path;
+  return($path);
 }
 
 function supercron_standard_path() {
@@ -226,13 +229,21 @@ function supercron_standard_path() {
 
 function supercron_get_script_URL() {
   global $base_url;
-  $script_path = variable_get(SUPERCRON_SCRIPT_PATH, SUPERCRON_SCRIPT_PATH_MODULE_ROOT);
 
-  if ($script_path === SUPERCRON_SCRIPT_PATH_DRUPAL_ROOT) {
+  $drupal_root_path = supercron_base_path();
+  if (strpos($drupal_root_path,'/',strlen($drupal_root_path)-1)){
+     $drupal_root_path = substr($drupal_root_path,0,strlen($drupal_root_path)-1);
+  }
+  $drupal_module_path = $drupal_root_path."/".drupal_get_path('module','supercron');
+
+  $script_path = variable_get(SUPERCRON_SCRIPT_PATH, $drupal_module_path);
+
+ 
+  if ($script_path == $drupal_root_path) {
     return $base_url .'/'. SUPERCRON_SCRIPT_NAME;
   }
-  elseif ($script_path == SUPERCRON_SCRIPT_PATH_MODULE_ROOT) {
-    return url(drupal_get_path('module', 'supercron') . 'supercron.php', array('absolute' => TRUE));
+  elseif ($script_path == $drupal_module_path) {
+    return url(drupal_get_path('module', 'supercron') . SUPERCRON_SCRIPT_NAME, array('absolute' => TRUE));
   }
   else {
     return $script_path;
@@ -240,16 +251,22 @@ function supercron_get_script_URL() {
 }
 
 function supercron_get_script_path() {
-  $script_path = variable_get(SUPERCRON_SCRIPT_PATH, SUPERCRON_SCRIPT_PATH_MODULE_ROOT);
 
-  if ($script_path == SUPERCRON_SCRIPT_PATH_DRUPAL_ROOT) {
+  $drupal_root_path = supercron_base_path();
+  if (strpos($drupal_root_path,'/',strlen($drupal_root_path)-1)){
+     $drupal_root_path = substr($drupal_root_path,0,strlen($drupal_root_path)-1);
+  }
+  $drupal_module_path = $drupal_root_path."/".drupal_get_path('module','supercron');
+  $script_path = variable_get(SUPERCRON_SCRIPT_PATH, $drupal_module_path);
+
+  if ($script_path == $drupal_root_path) {
     return supercron_standard_path();
   }
-  elseif ($script_path == SUPERCRON_SCRIPT_PATH_MODULE_ROOT) {
+  elseif ($script_path == $drupal_module_path) {
     return str_replace('supercron.module', '', realpath(__FILE__)) . SUPERCRON_SCRIPT_NAME;
   }
   else {
-    return '';
+    return ($script_path );
   }
 }
 
Index: supercron.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/supercron/supercron.admin.inc,v
retrieving revision 1.1
diff -u -p -r1.1 supercron.admin.inc
--- supercron.admin.inc	18 Mar 2010 23:02:38 -0000	1.1
+++ supercron.admin.inc	10 Dec 2010 22:18:22 -0000
@@ -9,10 +9,20 @@
 include_once(drupal_get_path('module', 'supercron') . '/supercron-main.inc');
 
 function _supercron_check_requirements() {
-  $supercron_script_path = variable_get('supercron_script_path', SUPERCRON_SCRIPT_PATH_MODULE_ROOT);
 
-  if ($superccron_script_path == SUPERCRON_SCRIPT_PATH_DRUPAL_ROOT) {
-    if (!file_exists(supercron_get_script_path())) {
+  $drupal_root_path = supercron_base_path().drupal_get_path('module', 'supercron');
+  //ignore trailing "/";
+  $drupal_root_path = supercron_base_path();
+
+  if (strpos($drupal_root_path,'/',strlen($drupal_root_path)-1)){
+     $drupal_root_path = substr($drupal_root_path,0,strlen($drupal_root_path)-1);
+  }
+
+  $drupal_module_path = $drupal_root_path."/".drupal_get_path('module','supercron');
+  $supercron_script_path = variable_get('supercron_script_path', $drupal_module_path);
+
+  if ($supercron_script_path == $drupal_root_path) {
+    if (!file_exists($supercron_script_path.'/'.SUPERCRON_SCRIPT_NAME)) {
       $message = t(
         'The !script file should copied from the !here directory to !path; until'
           . ' that is done, your tasks will not execute when scheduled to.',
@@ -150,8 +160,8 @@ function supercron_settings(&$form_state
 
   if (empty($_POST)) {
     if (empty($script_path)) {
-      $message = 'You decided to place supercron.php in a custom location. Please ';
-      $message .= 'copy supercron.php from supercron module directory to your ';
+      $message = 'You decided to place '.SUPERCRON_SCRIPT_NAME.' in a custom location. Please ';
+      $message .= 'copy '.SUPERCRON_SCRIPT_NAME.' from supercron module directory to your ';
       $message .= 'selected location. Then edit $drupal_dir variable.';
 
       drupal_set_message($message, 'warning');
Index: supercron.crontab-admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/supercron/supercron.crontab-admin.inc,v
retrieving revision 1.1
diff -u -p -r1.1 supercron.crontab-admin.inc
--- supercron.crontab-admin.inc	18 Mar 2010 23:02:38 -0000	1.1
+++ supercron.crontab-admin.inc	10 Dec 2010 22:18:22 -0000
@@ -13,6 +13,7 @@ function supercron_invocation_form(&$for
   drupal_add_js("{$module_path}/js/supercron.crontab.js");
   drupal_add_js(array('supercron_module_path' => drupal_get_path('module', 'supercron')), 'setting');
 
+  module_load_include('inc', 'supercron', 'supercron-main');
   $exefound = TRUE;
   $exe = variable_get(SUPERCRON_PHP_BINARY_PATH, '');
   if (!$exe) $exe = isset($_SERVER['PHP_PEAR_PHP_BIN']) ? $_SERVER['PHP_PEAR_PHP_BIN'] : '';
@@ -36,7 +37,7 @@ function supercron_invocation_form(&$for
     : $supercron_script_path,
     '#options'   => array(
       SUPERCRON_SCRIPT_PATH_DRUPAL_ROOT => t('Drupal root (@path)', array('@path' => supercron_standard_path())),
-      SUPERCRON_SCRIPT_PATH_MODULE_ROOT => t('Module root (@path)', array('@path' => supercron_base_path() . drupal_get_path('module', 'supercron') . '/supercron.php')),
+      SUPERCRON_SCRIPT_PATH_MODULE_ROOT => t('Module root (@path)', array('@path' => supercron_base_path() . drupal_get_path('module', 'supercron') . '/'. SUPERCRON_SCRIPT_NAME)),
       SUPERCRON_SCRIPT_PATH_CUSTOM      => t('Other place')
     ),
   );
@@ -51,7 +52,7 @@ function supercron_invocation_form(&$for
 
   $form['invocation']['help'] = array(
     '#type'  => 'markup',
-    '#value' => '<div>If you place supercron.php anywhere but in the Drupal root, make sure to edit the value of <tt>$drupal_dir</tt> in <tt>supercron.php</tt> so that it contains the path to the Drupal root directory.</div>'
+    '#value' => '<div>If you place '.SUPERCRON_SCRIPT_NAME.' anywhere but in the Drupal root, make sure to edit the value of <tt>$drupal_dir</tt> in <tt>'.SUPERCRON_SCRIPT_NAME.'</tt> so that it contains the path to the Drupal root directory.</div>'
   );
 
   $form['invocation']['submit'] = array(
Index: supercron.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/supercron/Attic/supercron.inc,v
retrieving revision 1.1
diff -u -p -r1.1 supercron.inc
--- supercron.inc	18 Mar 2010 23:02:38 -0000	1.1
+++ supercron.inc	10 Dec 2010 22:18:23 -0000
@@ -323,6 +323,7 @@ function _supercron_module_invoke_all_cr
       continue;
     }
 
+    module_load_include('inc', 'supercron', 'supercron-main');
     if ($run_in_parallel[$module->module_name]) {
       $url = supercron_get_script_URL();
       $url .= '?safety='. drupal_urlencode($safety);
@@ -418,9 +419,9 @@ function supercron_should_run($module) {
  */
 function _supercron_should_run($module, $now) {
   // check for valid rule format
-  $rules = supercron_rule_is_valid($rule, $module->rule);
+  $rules = supercron_rule_is_valid($module->rule);
   if (FALSE === $rules) {
-    watchdog('cron', 'Invalid rule found (%module): %rule', array(
+    watchdog('cron', 'Invalid rule found (%module): (%rule)', array(
       '%module' => $module->module_name,
       '%rule'   => $module->rule
     ));
Index: supercron.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/supercron/supercron.php,v
retrieving revision 1.2
diff -u -p -r1.2 supercron.php
--- supercron.php	18 Mar 2010 22:57:45 -0000	1.2
+++ supercron.php	10 Dec 2010 22:18:23 -0000
@@ -83,8 +83,10 @@ if ($safety) {
   // multi thread check
   $multithread = isset($_GET['multithread']) ? $_GET['multithread'] : '';
   $multithread = $multithread === 'yes';
+  module_load_include('inc', 'supercron', 'supercron-main');
   supercron_invoke_one($module, FALSE, $multithread);
 }
 else {
+  module_load_include('inc', 'supercron', 'supercron-main');
   supercron_module_invoke_all_cron();
 }
