Commit 89ecc548 by Vitalik

Support php 5.2

parent 5725cd7e
Pipeline #177 skipped
<?php <?php
return array( return array(
'server' => 'localhost',
'database' => 'dibi', 'database' => 'dibi',
'table' => 'links', 'table' => 'links',
'username' => 'root', 'username' => 'root',
......
...@@ -6,7 +6,7 @@ function connect_db() ...@@ -6,7 +6,7 @@ function connect_db()
{ {
global $config; global $config;
$link = mysql_connect('localhost', $config['username'], $config['password']); $link = mysql_connect($config['server'], $config['username'], $config['password']);
if (!$link) { if (!$link) {
die('Could not connect: ' . mysql_error()); die('Could not connect: ' . mysql_error());
......
<?php <?php
if( !defined( __DIR__ ) ) define( __DIR__, dirname(__FILE__) );
define('PATH_BASE', __DIR__); define('PATH_BASE', __DIR__);
require_once PATH_BASE . '/helper.php'; require_once PATH_BASE . '/helper.php';
......
<?php <?php
if( !defined( __DIR__ ) ) define( __DIR__, dirname(__FILE__) );
if (!file_exists(__DIR__ . '/config.php')) { if (!file_exists(__DIR__ . '/config.php')) {
die("Copy `config.php.example` file to `config.php` file\n"); die("Copy `config.php.example` file to `config.php` file\n");
} }
...@@ -7,7 +9,7 @@ if (!file_exists(__DIR__ . '/config.php')) { ...@@ -7,7 +9,7 @@ if (!file_exists(__DIR__ . '/config.php')) {
$config = require __DIR__ . '/config.php'; $config = require __DIR__ . '/config.php';
$link = mysql_connect( $link = mysql_connect(
'localhost', $config['server'],
$config['username'], $config['username'],
$config['password'] $config['password']
); );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment