Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. // Set flag that this is a parent file.
  2. const _JEXEC = 1;
  3.  
  4. error_reporting(E_ALL | E_NOTICE);
  5. //error_reporting(E_ALL & ~E_NOTICE);
  6. ini_set('display_errors', 1);
  7.  
  8. // Load system defines
  9. if (file_exists(dirname(__DIR__) . '/defines.php'))
  10. {
  11. require_once dirname(__DIR__) . '/defines.php';
  12. }
  13.  
  14. if (!defined('_JDEFINES'))
  15. {
  16. define('JPATH_BASE', dirname(__DIR__));
  17. require_once JPATH_BASE . '/includes/defines.php';
  18. }
  19.  
  20. require_once JPATH_LIBRARIES . '/import.legacy.php';
  21. require_once JPATH_LIBRARIES . '/cms.php';
  22.  
  23. // Load the configuration
  24. require_once JPATH_CONFIGURATION . '/configuration.php';
  25.  
  26. require_once JPATH_SITE . '/modules/gng/gng_shared.php';
  27.  
  28. $myApp = JApplicationCli::getInstance('GNGEmailToGuideDownloader');
  29. $hostname = GNGParam::getParam('email', 'hostname');
  30. $username = GNGParam::getParam('email_account_guides', 'username');
  31. $password = GNGParam::getParam('email_account_guides', 'password');
  32. $myApp->initStream($hostname, $username, $password);
  33. $myApp->execute();
  34.  
  35. //retrieves new guides@ email from the server, saves it in the DB and notifies the guide
  36. class GNGEmailToGuideDownloader extends GNGEmailDownloader
  37. {
  38. //downloads the emails from the stream and assigns them to a tour or inquiry
  39. public function loadEmails() {
  40.  
  41. $filepath = JPATH_SITE . '/modules/gng/EmailReplyParser/Parser/EmailParser.php';
  42. if (file_exists($filepath)) {
  43. JLoader::register('EmailParser', $filepath);
  44. $parser = new EmailParser();
  45. }
  46.  
  47. namespace EmailReplyParserParser;
  48.  
  49. use EmailReplyParserEmail;
  50. use EmailReplyParserFragment;
  51.  
  52. /**
  53. * @author William Durand <william.durand1@gmail.com>
  54. */
  55. class EmailParser
  56. {
  57. const QUOTE_REGEX = '/>+$/s';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement