| 1: | <?php
|
| 2: | |
| 3: | |
| 4: | |
| 5: | |
| 6: | |
| 7: | |
| 8: | |
| 9: | |
| 10: | |
| 11: | |
| 12: | |
| 13: |
|
| 14: |
|
| 15: |
|
| 16: | if (class_exists('ArtObject')) {
|
| 17: | return null;
|
| 18: | }
|
| 19: |
|
| 20: | |
| 21: | |
| 22: | |
| 23: | |
| 24: | |
| 25: | |
| 26: | |
| 27: | |
| 28: |
|
| 29: | class ArtObject extends XoopsObject
|
| 30: | {
|
| 31: | |
| 32: | |
| 33: |
|
| 34: | public $plugin_path;
|
| 35: |
|
| 36: | |
| 37: | |
| 38: | |
| 39: |
|
| 40: |
|
| 41: | public function __construct()
|
| 42: | {
|
| 43: | $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
|
| 44: | $GLOBALS['xoopsLogger']->addDeprecated('Class ' . __CLASS__ . " is deprecated, instantiated from {$trace[0]['file']} line {$trace[0]['line']}");
|
| 45: |
|
| 46: | }
|
| 47: | }
|
| 48: |
|
| 49: | |
| 50: | |
| 51: | |
| 52: | |
| 53: | |
| 54: | |
| 55: | |
| 56: | |
| 57: |
|
| 58: | class ArtObjectHandler extends XoopsPersistableObjectHandler
|
| 59: | {
|
| 60: | public $db;
|
| 61: |
|
| 62: | |
| 63: | |
| 64: | |
| 65: | |
| 66: | |
| 67: | |
| 68: | |
| 69: | |
| 70: |
|
| 71: |
|
| 72: | public function __construct(XoopsMySQLDatabase $db, $table = '', $className = '', $keyName = '', $identifierName = '')
|
| 73: | {
|
| 74: | $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
|
| 75: | $GLOBALS['xoopsLogger']->addDeprecated('Class ' . __CLASS__ . " is deprecated, instantiated from {$trace[0]['file']} line {$trace[0]['line']}");
|
| 76: | $this->db = $db;
|
| 77: | parent::__construct($db, $table, $className, $keyName, $identifierName);
|
| 78: | }
|
| 79: |
|
| 80: | |
| 81: | |
| 82: | |
| 83: | |
| 84: | |
| 85: | |
| 86: |
|
| 87: | public function mysql_server_version($conn = null)
|
| 88: | {
|
| 89: | if (null === $conn) {
|
| 90: | $conn = $this->db->conn;
|
| 91: | }
|
| 92: | return mysqli_get_server_info($conn);
|
| 93: | }
|
| 94: |
|
| 95: | |
| 96: | |
| 97: | |
| 98: | |
| 99: |
|
| 100: | public function mysql_major_version()
|
| 101: | {
|
| 102: | $version = $this->mysql_server_version($this->db->conn);
|
| 103: | if (version_compare($version, '5.0.0', 'ge')) {
|
| 104: | $mysql_version = 5;
|
| 105: | } elseif (version_compare($version, '4.1.0', 'ge')) {
|
| 106: | $mysql_version = 4;
|
| 107: | } else {
|
| 108: | $mysql_version = 3;
|
| 109: | }
|
| 110: |
|
| 111: | return $mysql_version;
|
| 112: | }
|
| 113: |
|
| 114: | |
| 115: | |
| 116: | |
| 117: | |
| 118: | |
| 119: |
|
| 120: | public function insert(XoopsObject $object, $force = true)
|
| 121: | {
|
| 122: | if (!($object instanceof $this->className)) {
|
| 123: | return false;
|
| 124: | }
|
| 125: | if ($ret = parent::insert($object, $force)) {
|
| 126: | $object->unsetNew();
|
| 127: | }
|
| 128: |
|
| 129: | return $ret;
|
| 130: | }
|
| 131: | }
|
| 132: |
|
| 133: | |