You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

adapteroci8.php 828B

12345678910111213141516171819202122232425262728
  1. <?php
  2. /**
  3. * Copyright (c) 2013 Bart Visscher <bartv@thisnet.nl>
  4. * This file is licensed under the Affero General Public License version 3 or
  5. * later.
  6. * See the COPYING-README file.
  7. */
  8. namespace OC\DB;
  9. class AdapterOCI8 extends Adapter {
  10. public function lastInsertId($table) {
  11. if($table !== null) {
  12. $suffix = '_SEQ';
  13. $table = '"'.$table.$suffix.'"';
  14. }
  15. return $this->conn->realLastInsertId($table);
  16. }
  17. const UNIX_TIMESTAMP_REPLACEMENT = "(cast(sys_extract_utc(systimestamp) as date) - date'1970-01-01') * 86400";
  18. public function fixupStatement($statement) {
  19. $statement = str_replace( '`', '"', $statement );
  20. $statement = str_ireplace( 'NOW()', 'CURRENT_TIMESTAMP', $statement );
  21. $statement = str_ireplace( 'UNIX_TIMESTAMP()', self::UNIX_TIMESTAMP_REPLACEMENT, $statement );
  22. return $statement;
  23. }
  24. }