/pickles.php

Description

Core PICKLES Include File

This is the file that you include on the page you're instantiating the controller from (typically index.php). The path to the PICKLES code base is established as well as the path that Smarty will use to store the compiled pages.

PHP version 5

Licensed under The MIT License Redistribution of these files must retain the above copyright notice.

Constants
DISPLAY_JSON = 'JSON' (line 46)
DISPLAY_PHP = 'PHP' (line 47)
DISPLAY_RSS = 'RSS' (line 48)
DISPLAY_XML = 'XML' (line 49)
JSON_AVAILABLE = function_exists('json_encode') (line 52)
LOG_PATH = PRIVATE_PATH.'logs/' (line 42)
PICKLES_CLASS_PATH = PICKLES_PATH.'classes/' (line 31)
PICKLES_PATH = dirname(__FILE__).'/' (line 30)
PICKLES_START_TIME = microtime(true) (line 27)
PRIVATE_PATH = SITE_PATH.'private/' (line 41)
SITE_CLASS_PATH = SITE_PATH.'classes/' (line 36)
SITE_MODEL_PATH = SITE_PATH.'models/' (line 37)
SITE_MODULE_PATH = SITE_PATH.'modules/' (line 38)
SITE_PATH = getcwd().'/../' (line 34)
SITE_TEMPLATE_PATH = SITE_PATH.'templates/' (line 39)
SMARTY_PATH = PRIVATE_PATH.'smarty/' (line 43)
Functions
__autoload (line 121)

Magic function to automatically load classes

Attempts to load a core PICKLES class or a site level data model or module class. If Smarty is being requested, will load the proper class from the vendors directory

  • return: Return value of require_once() or false (default)
boolean __autoload (string $class)
  • string $class: Name of the class to be loaded
__handleError (line 158)

Error handling function that thinks it's magical

Catches errors (warnings and the like) and throws it back out as an ErrorException. This really helps trapping complex errors that need a ton of sanity checks, just try / catch and you're good. Also, this isn't a magic function, but I opted to use the __ prefix to help avoid a naming collision since namespace support is 5.3+ and PICKLES strives to be 5.0+ compatible.

Keep in mind that fetal errors cannot and will not be handled.

  • return: not really returned, but worth documenting
ErrorException __handleError (integer $number, string $string, string $file, integer $line,  $context)
  • integer $number: error number
  • string $string: error string (message)
  • string $file: name of the file with the error
  • integer $line: line number the error occurred on
  • array $context: variables that were in play
__handleException (line 176)

Exception handling function

Catches thrown exceptions and displays them.

void __handleException (object $exception)
  • object $exception: the exception

Documentation generated on Sun, 17 Oct 2010 23:17:23 -0400 by phpDocumentor 1.4.3