X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fsymfony%2Fhttp-kernel%2FProfiler%2FMysqlProfilerStorage.php;fp=vendor%2Fsymfony%2Fhttp-kernel%2FProfiler%2FMysqlProfilerStorage.php;h=0000000000000000000000000000000000000000;hp=45d9cfffbbb7f01fd841d12a946ea67415a3bd4f;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/vendor/symfony/http-kernel/Profiler/MysqlProfilerStorage.php b/vendor/symfony/http-kernel/Profiler/MysqlProfilerStorage.php deleted file mode 100644 index 45d9cfffb..000000000 --- a/vendor/symfony/http-kernel/Profiler/MysqlProfilerStorage.php +++ /dev/null @@ -1,84 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\HttpKernel\Profiler; - -@trigger_error('The '.__NAMESPACE__.'\MysqlProfilerStorage class is deprecated since Symfony 2.8 and will be removed in 3.0. Use FileProfilerStorage instead.', E_USER_DEPRECATED); - -/** - * A ProfilerStorage for Mysql. - * - * @author Jan Schumann - * - * @deprecated Deprecated since Symfony 2.8, to be removed in Symfony 3.0. - * Use {@link FileProfilerStorage} instead. - */ -class MysqlProfilerStorage extends PdoProfilerStorage -{ - /** - * {@inheritdoc} - */ - protected function initDb() - { - if (null === $this->db) { - if (0 !== strpos($this->dsn, 'mysql')) { - throw new \RuntimeException(sprintf('Please check your configuration. You are trying to use Mysql with an invalid dsn "%s". The expected format is "mysql:dbname=database_name;host=host_name".', $this->dsn)); - } - - if (!class_exists('PDO') || !in_array('mysql', \PDO::getAvailableDrivers(), true)) { - throw new \RuntimeException('You need to enable PDO_Mysql extension for the profiler to run properly.'); - } - - $db = new \PDO($this->dsn, $this->username, $this->password); - $db->exec('CREATE TABLE IF NOT EXISTS sf_profiler_data (token VARCHAR(255) PRIMARY KEY, data LONGTEXT, ip VARCHAR(64), method VARCHAR(6), url VARCHAR(255), time INTEGER UNSIGNED, parent VARCHAR(255), created_at INTEGER UNSIGNED, status_code SMALLINT UNSIGNED, KEY (created_at), KEY (ip), KEY (method), KEY (url), KEY (parent))'); - - $this->db = $db; - } - - return $this->db; - } - - /** - * {@inheritdoc} - */ - protected function buildCriteria($ip, $url, $start, $end, $limit, $method) - { - $criteria = array(); - $args = array(); - - if ($ip = preg_replace('/[^\d\.]/', '', $ip)) { - $criteria[] = 'ip LIKE :ip'; - $args[':ip'] = '%'.$ip.'%'; - } - - if ($url) { - $criteria[] = 'url LIKE :url'; - $args[':url'] = '%'.addcslashes($url, '%_\\').'%'; - } - - if ($method) { - $criteria[] = 'method = :method'; - $args[':method'] = $method; - } - - if (!empty($start)) { - $criteria[] = 'time >= :start'; - $args[':start'] = $start; - } - - if (!empty($end)) { - $criteria[] = 'time <= :end'; - $args[':end'] = $end; - } - - return array($criteria, $args); - } -}