Rev 635 | Rev 1086 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 635 | Rev 1050 | ||
---|---|---|---|
Line 15... | Line 15... | ||
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
16 | * See the License for the specific language governing permissions and |
16 | * See the License for the specific language governing permissions and |
17 | * limitations under the License. |
17 | * limitations under the License. |
18 | */ |
18 | */ |
19 | 19 | ||
20 | if (!defined('INSIDE_OIDPLUS')) die(); |
20 | namespace ViaThinkSoft\OIDplus; |
21 | 21 | ||
22 | class OIDplusSqlSlangPluginPgSQL extends OIDplusSqlSlangPlugin { |
22 | class OIDplusSqlSlangPluginPgSQL extends OIDplusSqlSlangPlugin { |
23 | 23 | ||
24 | public static function id(): string { |
24 | public static function id(): string { |
25 | return 'pgsql'; |
25 | return 'pgsql'; |
Line 56... | Line 56... | ||
56 | public function detect(OIDplusDatabaseConnection $db): bool { |
56 | public function detect(OIDplusDatabaseConnection $db): bool { |
57 | try { |
57 | try { |
58 | $vers = $db->query("select version() as dbms_version")->fetch_object()->dbms_version; |
58 | $vers = $db->query("select version() as dbms_version")->fetch_object()->dbms_version; |
59 | $vers = strtolower($vers); |
59 | $vers = strtolower($vers); |
60 | return strpos($vers, 'postgresql') !== false; |
60 | return strpos($vers, 'postgresql') !== false; |
61 | } catch (Exception $e) { |
61 | } catch (\Exception $e) { |
62 | return false; |
62 | return false; |
63 | } |
63 | } |
64 | } |
64 | } |
65 | 65 | ||
66 | public function insert_id(OIDplusDatabaseConnection $db): int { |
66 | public function insert_id(OIDplusDatabaseConnection $db): int { |