Advertisement
Guest User

Untitled

a guest
Feb 27th, 2020
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. <?php
  2. /*
  3. * CRON
  4. *
  5. * Manage EidooID cron jobs
  6. *
  7. * @package EidooID
  8. * @category Cron
  9. */
  10.  
  11. use Model\Cron;
  12. use Model\Pool;
  13. use Model\Context;
  14.  
  15. class EidooID extends Cron
  16. {
  17. private $test = 'dasdas';
  18. public $_modules = [ 'db' => true ];
  19.  
  20. function __construct() {}
  21. /**
  22. * cron: |* * * * *|
  23. * event: |minute|
  24. */
  25. public function cron_sync_worldcheck()
  26. {
  27. $db = new Pool();
  28. $mysql = $db->getMysql();
  29. $contextMysql = new Context($mysql);
  30. // we need to makeConnection using docker secrets
  31. $connMysql = $contextMysql->makeConnection('cryptolab', '43gryhfjd32uehw', '185.142.239.170', 'cryptolab', 3306);
  32.  
  33. // get all users
  34. $users = $connMysql->query('SELECT first_name, last_name FROM _pu_users');
  35.  
  36. echo " in EidooID task \n";
  37.  
  38. trigger_error("Treba da padne", E_USER_ERROR);
  39. foreach ($users as $user) {
  40. echo $user['first_name'].' '.$user['last_name']."\n";
  41. }
  42. // Close connection
  43. $contextMysql->disposeConnection();
  44.  
  45. }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement