public function __construct() { // Get current connection instance $connection = Ioc::resolve('connection'); $this->mongoDB = $connection->getMongoDB(); $this->mongo = new MB($this->mongoDB); }
/** * Main Exec fucniton * @throws Exception */ public function exec() { echo "START: " . date("Y-m-d H:i:s") . " \n"; switch ($this->dataType) { case 'TRN': $this->updateTransactions(); break; case 'SEC': $this->updateSecurities(); break; case 'POS': $this->updatePositions(); break; case 'TXT': $this->updateRealized(); break; case 'CBL': $this->updateUnrealized(); break; case 'CBP': $this->updateUnrealized(); break; case 'TWR': $this->updateTwrCalculator(); break; default: self::help(); throw new Exception("No executible function found. Most likely it's incorrect data Type.\n"); } echo "DONE: " . date("Y-m-d H:i:s") . " \n"; // Send all bugs $bugTracker = Ioc::resolve('bugTracker'); $bugTracker->send(); }
/** * Constructor * * @param string $argv */ public function __construct($argv) { // Register connection instance Ioc::instance('connection', new Connection()); set_time_limit(0); $allowedTypes = array_keys($this->headerMap); $inputDate = $this->checkInputDate($argv[2]); if (!$inputDate) { throw new \Exception('File date is required. Format: YYYY-MM-DD'); } $this->fileDate = $this->convertFileDate($inputDate); $this->fileType = trim(isset($argv[1]) ? $argv[1] : null); if (!in_array($this->fileType, $allowedTypes) || !isset($this->filePattern[$this->fileType])) { throw new \Exception('Invalid file type: ' . $this->fileType . ' (Allowed types: ' . implode(', ', $allowedTypes) . ')'); } $this->filePath = $this->loadFilePaths($argv); }
public function __construct() { $this->log = Ioc::resolve('log'); }