Example #1
0
$ua = $user_agent;
if (!empty($x_array)) {
    if (in_array($_GET['nid'], $x_array) || $ua == 'bot' || $ua == 'text_browser' || $ua == 'gui_browser_msie') {
        unset($development_console);
    } else {
        // this could be slow, might want to have a setting to turn on / off
        foreach ($x_array as $value) {
            if (eregi($value, $_GET['nid'])) {
                unset($development_console);
            }
        }
    }
}
/* END EXCLUSIONS */
if ($development_console === true) {
    Nexista_Init::registerOutputHandler('nexista_devBuffer');
}
if (!function_exists('nexista_buildererror')) {
    Nexista_Error::addObserver('display', 'Nexista_builderError');
    /**
     * Error...
     *
     * @param object $e error object
     *
     * @return null
     */
    function Nexista_builderError($e)
    {
        if ($e->getCode() == NX_ERROR_FATAL || $e->getCode() == NX_ERROR_WARNING) {
            $use_xslt_cache = 'yes';
            if ($use_xslt_cache != 'yes' || !class_exists('xsltCache')) {
Example #2
0
 /**
  * Registers a function to be called on output
  *
  * This function can be used to manipulate the final output before it is
  * displayed. It can be used to create a caching system, compress output
  *
  * The handler should be a callable function or array of object/method as
  * defined in is_callable php function.  It should accept 1 arguments:
  * 1. The reference to the init class instance
  *
  * Note that the Nexista_Init::$_info property contains the current cache value
  * from the sitemap if set.
  *
  * This function should call:
  *      $output = Nexista_Init::run();
  * to get the final output. The function is responsible for displaying it.
  *
  * @param mixed $handler a function or an array of class=>method
  *
  * @return null
  */
 public static function registerOutputHandler($handler)
 {
     if (is_callable($handler)) {
         self::$_outputHandler = $handler;
     } else {
         Nexista_Error::init('Init Output Handler is not callable!');
     }
 }
Example #3
0
}
if (!empty($x_array)) {
    if (in_array($_GET['nid'], $x_array)) {
        unset($included);
    } else {
        // this could be slow, might want to have a setting to turn on / off
        foreach ($x_array as $value) {
            if (eregi($value, $_GET['nid'])) {
                unset($included);
            }
        }
    }
}
/* END EXCLUSIONS */
if ($included && $active) {
    Nexista_Init::registerOutputHandler('Nexista_cache');
}
/**
 * nexista_cache
 *
 * Output buffer utilizing PEAR_Cache
 *
 * @param object $init includes stuff
 *
 * @return boolean
 */
function Nexista_cache($init)
{
    //configuration - move to xml
    $timers = true;
    //necessary stuff no matter what
Example #4
0
} else {
    if (!empty($excludes)) {
        $x_array[] = $excludes;
    }
}
if (!empty($x_array)) {
    // this could be slow, might want to have a setting to turn on / off
    foreach ($x_array as $value) {
        if (eregi($value, $_GET['nid'])) {
            unset($tidy_it);
        }
    }
}
/* END EXCLUSIONS */
if ($tidy_it === true) {
    Nexista_Init::registerOutputHandler('tidy_output');
}
if (!function_exists('tidy_output')) {
    Nexista_Error::addObserver('display', 'tidy_output');
    /**
     * Error...
     *
     * @param object $e error object
     *
     * @return null
     */
    function Nexista_builderError($e)
    {
        if ($e->getCode() == NX_ERROR_FATAL || $e->getCode() == NX_ERROR_WARNING) {
            $use_xslt_cache = 'yes';
            if ($use_xslt_cache != 'yes' || !class_exists('xsltCache')) {