forked from jegelstaff/formulize
/
Database.php
62 lines (57 loc) · 1.52 KB
/
Database.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
/**
* Database Base Class
*
* Defines abstract database wrapper class
*
* @copyright The ImpressCMS Project <http://www.impresscms.org/>
* @license LICENSE.txt
* @category ICMS
* @package Database
* @subpackage Legacy
* @author Kazumi Ono <onokazu@xoops.org>
* @author Gustavo Alejandro Pilla (aka nekro) <nekro@impresscms.org> <gpilla@nubee.com.ar>
* @version SVN: $Id: Database.php 22532 2011-09-02 20:16:01Z phoenyx $
*/
defined( 'ICMS_ROOT_PATH' ) or die();
/**
* Abstract base class for Database access classes
*
* @package database
* @subpackage main
* @author Gustavo Pilla (aka nekro) <nekro@impresscms.org>
*/
abstract class icms_db_legacy_Database implements icms_db_legacy_IDatabase {
/**
* Prefix for tables in the database
* @var string
*/
public $prefix = '';
/**
* reference to a {@link icms_core_Logger} object
* @see icms_core_Logger
* @var object icms_core_Logger
*/
public $logger;
/**
* If statements that modify the database are selected
* @var boolean
*/
public $allowWebChanges = false;
public function __construct( $connection = null, $allowWebChanges = false ) {
$this->allowWebChanges = $allowWebChanges;
}
public function setLogger($logger) {
$this->logger = $logger;
}
public function setPrefix($value) {
$this->prefix = $value;
}
public function prefix($tablename='') {
if ( $tablename != '' ) {
return $this->prefix .'_'. $tablename;
} else {
return $this->prefix;
}
}
}