コード例 #1
0
ファイル: common.php プロジェクト: BackupTheBerlios/gcms-svn
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
/**
 * check php version
 */
if (0 > version_compare(PHP_VERSION, '5')) {
    die('This file was generated for PHP 5');
}
/**
 * include config data
 */
require_once dirname(__FILE__) . '/config.php';
/**
 * include base class files
 */
require_once LIB_PATH . 'gdatabase.class.php';
/**
 * try to create database object
 */
try {
    $options = array('debug' => DEBUG);
    $db = gdatabase::factory(DB_DSN, $options);
} catch (gdatabase_exception $e) {
    printf('database: %s', $e->custom_message());
}