Don't init output in CLI mode
Fixes infinite recurssion on raise_error() call when executing scripts
out of the INSTALL_PATH. Also use 'rcube' if 'rcmail' is not needed.
| | |
| | | ); |
| | | |
| | | // connect to DB |
| | | $RCMAIL = rcmail::get_instance(); |
| | | $RCMAIL = rcube::get_instance(); |
| | | $db = $RCMAIL->get_dbh(); |
| | | $db->db_connect('w'); |
| | | |
| | |
| | | die("Usage: " . basename($argv[0]) . " encrypted-hdr-part [encrypted-hdr-part ...]\n"); |
| | | } |
| | | |
| | | $RCMAIL = rcmail::get_instance(); |
| | | $RCMAIL = rcube::get_instance(); |
| | | |
| | | for ($i = 1; $i < $argc; $i++) { |
| | | printf("%s\n", $RCMAIL->decrypt($argv[$i])); |
| | |
| | | ini_set('memory_limit', -1); |
| | | |
| | | // connect to DB |
| | | $RCMAIL = rcmail::get_instance(); |
| | | $RCMAIL = rcube::get_instance(); |
| | | |
| | | $db = $RCMAIL->get_dbh(); |
| | | $db->db_connect('w'); |
| | |
| | | $pref_value = $args['delete'] ? null : trim($args[1]); |
| | | |
| | | // connect to DB |
| | | $rcmail = rcmail::get_instance(); |
| | | $rcmail = rcube::get_instance(); |
| | | |
| | | $db = $rcmail->get_dbh(); |
| | | $db->db_connect('w'); |
| | |
| | | $_SESSION['task'] = $this->task; |
| | | } |
| | | |
| | | // init output class |
| | | if (!empty($_REQUEST['_remote'])) |
| | | // init output class (not in CLI mode) |
| | | if (!empty($_REQUEST['_remote'])) { |
| | | $GLOBALS['OUTPUT'] = $this->json_init(); |
| | | else |
| | | } |
| | | else if ($_SERVER['REMOTE_ADDR']) { |
| | | $GLOBALS['OUTPUT'] = $this->load_gui(!empty($_REQUEST['_framed'])); |
| | | } |
| | | |
| | | // load plugins |
| | | $this->plugins->init($this, $this->task); |