Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- * CRON
- *
- * Manage EidooID cron jobs
- *
- * @package EidooID
- * @category Cron
- */
- use Model\Cron;
- use Model\Pool;
- use Model\Context;
- class EidooID extends Cron
- {
- private $test = 'dasdas';
- public $_modules = [ 'db' => true ];
- function __construct() {}
- /**
- * cron: |* * * * *|
- * event: |minute|
- */
- public function cron_sync_worldcheck()
- {
- $db = new Pool();
- $mysql = $db->getMysql();
- $contextMysql = new Context($mysql);
- // we need to makeConnection using docker secrets
- $connMysql = $contextMysql->makeConnection('cryptolab', '43gryhfjd32uehw', '185.142.239.170', 'cryptolab', 3306);
- // get all users
- $users = $connMysql->query('SELECT first_name, last_name FROM _pu_users');
- echo " in EidooID task \n";
- trigger_error("Treba da padne", E_USER_ERROR);
- foreach ($users as $user) {
- echo $user['first_name'].' '.$user['last_name']."\n";
- }
- // Close connection
- $contextMysql->disposeConnection();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement