Location: PHPKode > projects > DIY Blog > diy-blog/common.php
<?php

/**
 * Includes classes and sets paths required by all the applications.
 * @package diy-blog
 * @author	Martynas Jusevicius <hide@address.com>
 * @link	http://www.xml.lt
 */

error_reporting(E_ALL);

//define("ROOT_DIR", getcwd()."/");
define("CLASSES_DIR", "classes/");
define("MAIN_DIR", CLASSES_DIR."diy-blog/");
define("MODEL_DIR", MAIN_DIR."model/");
define("PROJECT_NAME", "diy-blog");
define("PROPEL_PROJECT", PROJECT_NAME.".model");

// PROPEL

set_include_path("lib/propel/runtime/classes".PATH_SEPARATOR.get_include_path());
set_include_path("lib/creole/classes" . PATH_SEPARATOR . get_include_path());
require("propel/Propel.php");

Propel::init(MODEL_DIR."conf/".PROPEL_PROJECT."-conf.php");
$con = Propel::getConnection();
$con->executeQuery("SET NAMES utf8;");
$con->executeQuery("SET CHARACTER SET utf8;");
$con->executeQuery('SET character_set_client="utf8"');
$con->executeQuery('SET character_set_connection="utf8"');
$con->executeQuery('SET character_set_results="utf8"');

// DIY FRAMEWORK
set_include_path("lib/diy-framework/classes/diy-framework".PATH_SEPARATOR.get_include_path());
require("propel/om/BaseObject.php"); // for Resource to extend
require("DIYFrameworkLoader.class.php");

// MODEL

set_include_path(CLASSES_DIR.PATH_SEPARATOR.get_include_path());

?>
Return current item: DIY Blog