Ejemplo n.º 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');
}
Ejemplo n.º 2
0
 /**
  * Initialize Propel
  *
  */
 protected function _initPropel()
 {
     static $done = false;
     if ($done) {
         return;
     }
     $done = true;
     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');
 }
Ejemplo n.º 3
0
            return $this->_values[$name];
        }
    }
    /**
     * Get error
     *
     * @param string $name
     * @return null|string
     */
    public function getError($name)
    {
        if (isset($this->_errors) && isset($this->_errors[$name])) {
            return $this->_errors[$name];
        }
    }
    /**
     * Set error
     *
     * @param string $field
     * @param string $error
     * @return void
     */
    public function setError($field, $error)
    {
        $errors = $this->_errors;
        $errors[$field] = $error;
        $this->_errors = $error;
    }
}
FWIncludePath::prepend(dirname(__FILE__));