Autodoc
  • Namespace
  • Class
  • Tree

Namespaces

  • BlueTihi
    • Context
  • Brickrouge
    • Element
      • Nodes
    • Renderer
    • Widget
  • ICanBoogie
    • ActiveRecord
    • AutoConfig
    • CLDR
    • Composer
    • Core
    • Event
    • Exception
    • HTTP
      • Dispatcher
      • Request
    • I18n
      • Translator
    • Mailer
    • Modules
      • Taxonomy
        • Support
      • Thumbnailer
        • Versions
    • Object
    • Operation
      • Dispatcher
    • Prototype
    • Routes
    • Routing
      • Dispatcher
    • Session
  • Icybee
    • ActiveRecord
      • Model
    • ConfigOperation
    • Document
    • EditBlock
    • Element
      • ActionbarContextual
      • ActionbarSearch
      • ActionbarToolbar
    • FormBlock
    • Installer
    • ManageBlock
    • Modules
      • Articles
      • Cache
        • Collection
        • ManageBlock
      • Comments
        • ManageBlock
      • Contents
        • ManageBlock
      • Dashboard
      • Editor
        • Collection
      • Files
        • File
        • ManageBlock
      • Forms
        • Form
        • ManageBlock
      • I18n
      • Images
        • ManageBlock
      • Members
      • Modules
        • ManageBlock
      • Nodes
        • ManageBlock
        • Module
      • Pages
        • BreadcrumbElement
        • LanguagesElement
        • ManageBlock
        • NavigationBranchElement
        • NavigationElement
        • Page
        • PageController
      • Registry
      • Search
      • Seo
      • Sites
        • ManageBlock
      • Taxonomy
        • Terms
          • ManageBlock
        • Vocabulary
          • ManageBlock
      • Users
        • ManageBlock
        • NonceLogin
        • Roles
      • Views
        • ActiveRecordProvider
        • Collection
        • View
    • Operation
      • ActiveRecord
      • Constructor
      • Module
      • Widget
    • Rendering
  • None
  • Patron
  • PHP

Classes

  • RescueEvent

Exceptions

  • Config
 1 <?php
 2 
 3 /*
 4  * This file is part of the Icybee package.
 5  *
 6  * (c) Olivier Laviale <olivier.laviale@gmail.com>
 7  *
 8  * For the full copyright and license information, please view the LICENSE
 9  * file that was distributed with this source code.
10  */
11 
12 namespace ICanBoogie\Exception;
13 
14 use ICanBoogie\Exception;
15 use ICanBoogie\Module;
16 
17 class Config extends Exception
18 {
19     public function __construct($message, array $params=array(), $code=500)
20     {
21         global $core;
22 
23         if (is_string($message) && isset($core->modules->descriptors[$message]))
24         {
25             $message = $core->modules[$message];
26         }
27 
28         if ($message instanceof Module)
29         {
30             $params += array
31             (
32                 ':module_id' => (string) $message,
33                 '!title' => (string) $message
34             );
35 
36             $message = 'You need to <a href="' . $core->site->path . '/admin/:module_id/config">configure the <q>!title</q> module</a>.';
37         }
38 
39         parent::__construct($message, $params, $code);
40     }
41 
42     public function __toString()
43     {
44         parent::__toString();
45 
46         if ($this->code && !headers_sent())
47         {
48             header('HTTP/1.0 ' . $this->code . ' ' . $this->title);
49         }
50 
51         $rc  = '<code class="exception">';
52         $rc .= '<strong>' . $this->title . ', with the following message:</strong><br /><br />';
53         $rc .= $this->getMessage() . '<br />';
54         $rc .= '</code>';
55 
56         return $rc;
57     }
58 }
Autodoc API documentation generated by ApiGen 2.8.0