# MyImprovedDialect.class.php

Go to the documentation of this file.

    00001 <?php
    00002 /***************************************************************************
    00003  *   Copyright (C) 2007-2008 by Konstantin V. Arkhipov                     *
    00004  *                                                                         *
    00005  *   This program is free software; you can redistribute it and/or modify  *
    00006  *   it under the terms of the GNU Lesser General Public License as        *
    00007  *   published by the Free Software Foundation; either version 3 of the    *
    00008  *   License, or (at your option) any later version.                       *
    00009  *                                                                         *
    00010  ***************************************************************************/
    00011
    00020     final class MyImprovedDialect extends MyDialect
    00021     {
    00025         public static function me($link = null)
    00026         {
    00027             return Singleton::getInstance(__CLASS__, $link);
    00028         }
    00029
    00030         public static function quoteValue($value)
    00031         {
    00033
    00034             if ($value instanceof Identifier && !$value->isFinalized())
    00035                 return "''"; // instead of 'null', to be compatible with v. 4
    00036
    00037             return
    00038                 "'"
    00039                 .mysqli_real_escape_string(
    00040                     // can't find better way atm.
    00041                     DBPool::me()->getLink()->getLink(),
    00042                     $value
    00043                 )
    00044                 ."'";
    00045         }
    00046
    00047         public function quoteBinary($data)
    00048         {
    00049             return mysqli_real_escape_string(DBPool::me()->getLink()->getLink(), $data);
    00050         }
    00051     }
    00052 ?>