<?php if (!_gotErrors()) { $displayFiles = _getDisplay(); $assignVars = _getAssign(); // assigning smarty variables $smarty->assign($assignVars); // displaying every template given foreach ($displayFiles as $d) { $smarty->display($d); } } else { // display error template instead of display queue $arrErrors = _getErrors(); __cfthrow(array("type" => "runtime.applicationErrors", "message" => $arrErrors, "detail" => join("\n", $arrErrors))); }
/** * Un-links error report to associated issue on Github * */ public function unlink_issue($reportId) { if (!$reportId) { throw new NotFoundException(__('Invalid reportId')); } $report = TableRegistry::get('Reports')->findById($reportId)->all()->first(); if (!$report) { throw new NotFoundException(__('Invalid Report')); } $ticket_id = $report['sourceforge_bug_id']; if (!$ticket_id) { throw new NotFoundException(__('Invalid Ticket ID!!')); } // "formatted" text of the comment. $commentText = "This Issue is no longer associated with [Report#" . $reportId . "](" . Router::url('/reports/view/' . $reportId, true) . ")" . "\n\n*This comment is posted automatically by phpMyAdmin's " . "[error-reporting-server](http://reports.phpmyadmin.net).*"; list($commentDetails, $status) = $this->GithubApi->createComment(Configure::read('GithubRepoPath'), array('body' => $commentText), $ticket_id, $this->request->session()->read("access_token")); if (!$this->_handleGithubResponse($status, 3, $reportId)) { $flash_class = "alert alert-error"; $this->Flash->default(_getErrors($commentDetails, $status), array("params" => array("class" => $flash_class))); } $this->redirect(array('controller' => 'reports', 'action' => 'view', $reportId)); }
function _debug($file, $mode, $caption = "") { global $application; global $attributes; global $oDB; global $oUser; global $XFA; global $oSettingsManager; global $oFuseaction; ob_start(); echo $caption . ": " . date("m/d/Y H:i:s") . "\n"; echo "Executed in " . $oFuseaction->getLifeTime() . " sec\n\n"; echo "Attributes: "; print_r($attributes); echo "Settings: "; print_r($oSettingsManager->getSettings()); echo "Session: "; print_r($_SESSION); echo "User: "******"Queries: "; print_r($oDB->getDump()); echo "Errors: "; print_r(_getErrors()); echo "Warnings: "; print_r(_getWarnings()); echo "Messages: "; print_r(_getMessages()); echo "XFA: "; print_r($XFA); $debug = ob_get_contents(); ob_end_clean(); if ($f = fopen($file, $mode)) { fwrite($f, $debug); fclose($f); } return true; }