Advertisement
Atlanical

Hashbang FIle

Apr 17th, 2021
1,164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.34 KB | None | 0 0
  1. #!/usr/local/bin/php
  2. <?php
  3. /**
  4.  * This files pipes email messages into the system. This is configured to process
  5.  * messages for only a single company ID. Clone this file and change the
  6.  * $company_id variable below to add pipe support for additional companies.
  7.  */
  8. $company_id = 1;
  9.  
  10. try {
  11.     include(
  12.         dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR
  13.         . '..' . DIRECTORY_SEPARATOR . 'lib/init.php'
  14.     );
  15.  
  16.     $_SERVER['REQUEST_URI'] = null;
  17.     $argv = [
  18.         '',
  19.         'plugin/support_manager/ticket_pipe/index/' . $company_id
  20.     ];
  21.     unset($company_id);
  22.  
  23.     // Dispatch the Web request
  24.     if (!empty($_SERVER['REQUEST_URI'])) {
  25.         Dispatcher::dispatch($_SERVER['REQUEST_URI']);
  26.     } else {
  27.         // Dispatch the CLI request
  28.         Dispatcher::dispatchCli($argv);
  29.     }
  30. } catch (Exception $e) {
  31.     try {
  32.         // Attempt to raise any error, gracefully
  33.         Dispatcher::raiseError($e);
  34.     } catch (Exception $e) {
  35.         if (Configure::get('System.debug')) {
  36.             echo $e->getMessage() . ' on line <strong>' . $e->getLine() .
  37.                 '</strong> in <strong>' . $e->getFile() . "</strong>\n" .
  38.                 '<br />Printing Stack Trace:<br />' . nl2br($e->getTraceAsString());
  39.         } else {
  40.             echo $e->getMessage();
  41.         }
  42.     }
  43. }
  44.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement