Overview

Packages

  • None
  • Pastie

Classes

  • Pastie_Api
  • Pastie_Application
  • Pastie_Exception
  • Pastie_Highlighter
  • Pastie_Highlighter_LibGeshi
  • Pastie_Highlighter_TextHighlighter
  • Pastie_Test
  • Overview
  • Package
  • Class
  • Tree
 1: <?php
 2: /**
 3:  * Pastie application API.
 4:  *
 5:  * This file defines Horde's core API interface. Other core Horde libraries
 6:  * can interact with Pastie through this API.
 7:  *
 8:  * Copyright 2010-2012 Horde LLC (http://www.horde.org/)
 9:  *
10:  * See the enclosed file COPYING for license information (GPL). If you
11:  * did not receive this file, see http://www.horde.org/licenses/gpl.
12:  *
13:  * @package Pastie
14:  */
15: 
16: /* Determine the base directories. */
17: if (!defined('PASTIE_BASE')) {
18:     define('PASTIE_BASE', dirname(__FILE__) . '/..');
19: }
20: 
21: if (!defined('HORDE_BASE')) {
22:     /* If Horde does not live directly under the app directory, the HORDE_BASE
23:      * constant should be defined in config/horde.local.php. */
24:     if (file_exists(PASTIE_BASE . '/config/horde.local.php')) {
25:         include PASTIE_BASE . '/config/horde.local.php';
26:     } else {
27:         define('HORDE_BASE', PASTIE_BASE . '/..');
28:     }
29: }
30: 
31: /* Load the Horde Framework core (needed to autoload
32:  * Horde_Registry_Application::). */
33: require_once HORDE_BASE . '/lib/core.php';
34: 
35: class Pastie_Application extends Horde_Registry_Application
36: {
37:     /**
38:      */
39:     public $version = 'H4 (0.1-git)';
40: 
41:     /**
42:      */
43:     protected function _init()
44:     {
45:         try {
46:             $this->driver = Pastie_Driver::factory();
47:         } catch (Pastie_Exception $e) {
48:             $GLOBALS['notification']->notify($e);
49:         }
50:     }
51: 
52:     /**
53:      */
54:     public function menu($menu)
55:     {
56:         return Pastie::getMenu();
57:     }
58: 
59: }
60: 
API documentation generated by ApiGen