Example #1
0
}
// UTF8 encoding
header('Content-Type: text/html; charset=UTF-8');
// include path
require_once FW_DIR . '/lib/classes/FWIncludePath.class.php';
FWIncludePath::clean();
FWIncludePath::prepend(FW_DIR . '/lib/classes');
FWIncludePath::prepend(APP_DIR . '/lib');
FWIncludePath::prepend(APP_DIR . '/lib/forms');
require_once 'exceptions.php';
// error handler
require_once 'FWErrorHandler.class.php';
FWErrorHandler::resetAssertOptions();
FWErrorHandler::enable();
if (DEVELOPMENT) {
    FWErrorHandler::setDebug(true);
}
// autoloader
require_once 'FWAutoloader.class.php';
FWAutoloader::register();
// i18n
if (defined('APP_LOCALE')) {
    FWI18N::setLocale(APP_LOCALE);
}
// load propel
if (APP_ENABLE_PROPEL) {
    FWIncludePath::prepend(FW_DIR . '/lib/vendor/propel/runtime/classes');
    FWIncludePath::prepend(APP_DIR . '/model/build/classes/propel');
    FWIncludePath::prepend(APP_DIR . '/model/build/classes');
    require 'propel/Propel.php';
    Propel::init(APP_DIR . '/model/build/conf/propel-conf.php');
Example #2
0
                $link_id = trim($dom_link->getAttribute('l'));
                if (!$link_id) {
                    throw new Exception('menu plugin: link id cannot be empty.');
                }
                $dom_link->removeAttribute('l');
            } else {
                $link_id = null;
            }
            // add placeholders
            $placeholders = array();
            $placeholders['class'] = '--' . FWU::randomString() . '--';
            if ($dom_link->hasAttribute('class')) {
                $dom_link->setAttribute('class', trim($dom_link->getAttribute('class') . ' ' . $placeholders['class']));
            } else {
                $dom_link->setAttribute('class', $placeholders['class']);
            }
            if (!$dom_link->hasAttribute('id')) {
                $placeholders['id'] = '--' . FWU::randomString() . '--';
                $dom_link->setAttribute('id', $placeholders['id']);
            } else {
                $placeholders['id'] = null;
            }
            // add to $links array
            $links[] = array('id' => $link_id, 'placeholders' => $placeholders);
        }
        // done
        return array('links' => $links, 'html' => preg_replace('|^\\s*<\\?xml version="1.0"\\?>\\s*<root>(.*)</root>\\s*$|s', '$1', $dom->saveXML()));
    }
}
FWErrorHandler::relax(E_WARNING, dirname(__FILE__) . '/../vendor/dwoo', 'No such file or directory');
Example #3
0
 /**
  * Enable or disable debug mode
  *
  * @param boolean $enable
  * @return void
  */
 public static function setDebug($enable)
 {
     assert('is_bool($enable)');
     self::$_debug = $enable;
 }