Changeset - 03df18f63802
[Not reviewed]
default
0 1 0
Nathan Brink (binki) - 15 years ago 2011-02-10 00:00:42
ohnobinki@ohnopublishing.net
Fix undefined variable notice during rehash.
1 file changed with 2 insertions and 0 deletions:
0 comments (0 inline, 0 general)
admin/rehash.php
Show inline comments
 
@@ -34,48 +34,50 @@ require_once($inc_base . 'admin.inc');
 

	
 
return main($argc, $argv);
 

	
 
function main($argc, $argv)
 
{
 
  $n = test();
 
  if ($n)
 
    {
 
      fprintf(STDERR, "%d tests failed; exiting\n",
 
	      $n);
 
      return 1;
 
    }
 

	
 
  $opts = getopt('hV:', array('no-crawl', 'crawl-only:', 'help', 'verbosity:'));
 

	
 
  if (isset($opts['help']) || isset($opts['h']))
 
    {
 
      usage($argv[0]);
 
      return 0;
 
    }
 

	
 
  $crawl = TRUE;
 
  if (isset($opts['no-crawl']))
 
    $crawl = FALSE;
 

	
 
  $crawl_only = NULL;
 
  if (isset($opts['crawl-only']))
 
    $crawl_only = split(',', $opts['crawl-only']);
 

	
 
  $verbosity = 1;
 
  if (isset($opts['verbosity']))
 
    $verbosity = (int)$opts['verbosity'];
 
  if (isset($opts['V']))
 
    $verbosity = (int)$opts['V'];
 
  if ($verbosity < 0 || $verbosity > 10)
 
    {
 
      fprintf(STDERR, "error: Invalid verbosity level: %d\n", $verbosity);
 
      fprintf(STDERR, "\n");
 
      usage();
 
      return 1;
 
    }
 

	
 
  if ($crawl)
 
    {
 
      $ret = school_cache_recreate($crawl_only, $verbosity);
 
      if ($ret)
 
	{
 
	  fprintf(STDERR, "error: Unable to successfully crawl schools.\n");
 
	  return 1;
 
	}
0 comments (0 inline, 0 general)