die; } if ($argv[1] == '--database-exists') { execute_database_exists($argv[2]); die; } if ($argv[1] == '--table-exists') { execute_table_exists($argv[2], $argv[3]); die; } if ($argv[1] == '--rownum') { execute_rownum($argv[2], $argv[3]); die; } if ($argv[1] == '--GetAsSQLText') { GetAsSQLText($argv[2]); die; } if ($argv[1] == '--backup') { Backup($argv[2]); die; } if ($argv[1] == '--checks') { checks(); die; } if ($argv[1] == '--maintenance') { maintenance(); die; } if (!Build_pid_func(__FILE__, "MAIN")) {
include_once(dirname(__FILE__).'/ressources/class.mysql.inc'); include_once(dirname(__FILE__)."/framework/class.unix.inc"); include_once(dirname(__FILE__)."/framework/frame.class.inc"); if(preg_match("#--verbose#",implode(" ",$argv))){$GLOBALS["DEBUG"]=true;$GLOBALS["VERBOSE"]=true;} if(posix_getuid()<>0){die("Cannot be used in web server mode\n\n");} $unix=new unix(); $unix->events("Executing ".@implode(" ",$argv)); if($argv[1]=='--execute'){execute_sql($argv[2],$argv[3]);die();} if($argv[1]=='--database-exists'){execute_database_exists($argv[2]);die();} if($argv[1]=='--table-exists'){execute_table_exists($argv[2],$argv[3]);die();} if($argv[1]=='--rownum'){execute_rownum($argv[2],$argv[3]);die();} if($argv[1]=='--GetAsSQLText'){GetAsSQLText($argv[2]);die();} if($argv[1]=='--backup'){Backup($argv[2]);die();} if($argv[1]=='--checks'){checks();die();} if($argv[1]=='--maintenance'){maintenance();die();} if(!Build_pid_func(__FILE__,"MAIN")){ writelogs(basename(__FILE__).":Already executed.. aborting the process",basename(__FILE__),__FILE__,__LINE__); die(); } if($argv[1]=='--tables'){$mysql=new mysql();$mysql->BuildTables();die();} if($argv[1]=='--imapsync'){rebuild_imapsync();die();} if($argv[1]=='--rebuild-zarafa'){rebuild_zarafa();die();} if($argv[1]=='--squid-events-purge'){squid_events_purge();die();} if($argv[1]=='--mysqlcheck'){mysqlcheck($argv[2],$argv[3]);die();}