public function construct($attrs) { \System\Directory::check(BASE_DIR . self::DIR_CACHE); $cache = \System\Settings::getSafe(array('cache', 'templates'), true); if (class_exists('Jade\\Jade')) { $this->jade = new \Jade\Jade(array('cache' => $cache ? BASE_DIR . self::DIR_CACHE : null)); } else { throw new \System\Error\MissingDependency('Could not find jade template compiler.', 'Please install ronan-gloo/jadephp'); } }
public function mail_payment_update() { $check = $this->check; if (!$check) { return; } $payments = $check->payments->fetch(); $paid = 0; foreach ($payments as $p) { $paid += $p->amount; } $ren = new \System\Template\Renderer\Txt(); $ren->reset_layout(); $ren->partial('mail/signup/payment-update', array("item" => $this, "check" => $check, "paid" => $paid, "payments" => $payments)); $mail = new \Helper\Offcom\Mail(array('rcpt' => array($this->email), 'subject' => 'Improtřesk 2016 - Přihláška, platební aktualizace', 'reply_to' => \System\Settings::getSafe(array('offcom', 'default', 'reply_to'), null), 'message' => $ren->render_content())); $mail->send(); $this->sent_notif = true; $this->save(); }
public static function init() { $whoops = new \Whoops\Run(); if (static::on_cli()) { $whoops->pushHandler(new \Whoops\Handler\PlainTextHandler()); } else { $whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler()); } $whoops->pushHandler(function ($exc, $inspector, $run) { $debug = \System\Settings::getSafe(array('dev', 'debug', 'backend'), true); static::filterException($exc, $debug); static::report('error', static::getExceptionMessage($exc)); }); $whoops->register(); }