Location: PHPKode > projects > Meeting Request Scheduling and Booking System > mrsbs/util/admin.php
#!/usr/bin/php
<?PHP

   // MRSBS command line admin tools
   //
   // Version: $Revision: 1.5 $
   // Date: $Date: 2008/04/22 01:20:13 $
   //
   // Copyright (c) 2006 - 2008 Benjamin Oshrin
   // License restrictions apply, see LICENSE for details.

$cli_mode = 1;  // Don't dump the style sheet
include dirname(__FILE__) . "/../php/lib/mrsbs.inc";

if($argc == 2)
{
  switch($argv[1])
  {
  case 'createdb':
  case 'updatedb':
    if(db_create_tables())
    {
      print $tx['op.createdb'] . " " . $tx['op.successful'] . "\n";
      exit(0);
    }
    else
    {
      print $tx['op.createdb'] . " " . $tx['op.failed'] . "\n";
      exit(1);
    }
    break;
  case 'createdbsql':
  case 'updatedbsql':
    db_create_tables_print_sql();
    exit(0);
    break;
  case "cron":
    schedule_ready_events();
    exit(0);
    break;
  case "dropdb":
    if(db_drop_tables())
    {
      print $tx['op.dropdb'] . " " . $tx['op.successful'] . "\n";
      exit(0);
    }
    else
    {
      print $tx['op.dropdb'] . " " . $tx['op.failed'] . "\n";
      exit(1);
    }
    break;
  case 'dropdbsql':
    db_drop_tables_print_sql();
    exit(0);
  case 'resetdb':
    db_reset_tables("all");
    exit(0);
    break;
  }
}
?>
Usage: <?php print $argv[0]; ?> <command>
Return current item: Meeting Request Scheduling and Booking System