Example #1
0
 /**
  * Displays the extra piece of information about the exception.
  *
  * @internal
  * @param Exception $exception The exception to process.
  * @param array $params The extra parameters passed from the port.
  */
 public function display(Exception $exception, array $params)
 {
     if (!$exception instanceof Opl_Dependency_Exception) {
         return;
     }
     switch ($exception->getDependencyType()) {
         case Opl_Dependency_Exception::PHP:
             echo '  			<p><strong>PHP dependency:</strong> one of required PHP extensions is missing. Update your php.ini configuration or contact the administrator to get to know more information.' . "</p>\r\n";
             echo '		<p class="directive">Installed extensions:</p>' . PHP_EOL;
             foreach (get_loaded_extensions() as $num => $extension) {
                 echo "\t\t<p class=\"directive\">" . ($num + 1) . ". <span>" . $extension . "</span></p>\r\n";
             }
             break;
         case Opl_Dependency_Exception::OPL:
             echo '  			<p><strong>OPL dependency:</strong> this feature relies on one of Open Power Libs project which is not installed in your case. Do not use the feature or install the requested OPL library.' . "</p>\r\n";
             break;
     }
 }