Skip to content

Commit

Permalink
Fix for mix of line break types in file Mysql.php.
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgeny authored and jack committed Dec 29, 2013
1 parent 29a77c3 commit 53e3540
Showing 1 changed file with 45 additions and 45 deletions.
90 changes: 45 additions & 45 deletions xhprof_lib/utils/Db/Mysql.php
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
<?php

/**
* When setting the `id` column, consider the length of the prefix you're specifying in $this->prefix
*
*
CREATE TABLE `details` (
`id` char(17) NOT NULL,
`url` varchar(255) default NULL,
`c_url` varchar(255) default NULL,
`timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`server name` varchar(64) default NULL,
`perfdata` MEDIUMBLOB,
`type` tinyint(4) default NULL,
`cookie` BLOB,
`post` BLOB,
`get` BLOB,
`pmu` int(11) unsigned default NULL,
`wt` int(11) unsigned default NULL,
`cpu` int(11) unsigned default NULL,
`server_id` char(3) NOT NULL default 't11',
`aggregateCalls_include` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `url` (`url`),
KEY `c_url` (`c_url`),
KEY `cpu` (`cpu`),
KEY `wt` (`wt`),
KEY `pmu` (`pmu`),
KEY `timestamp` (`timestamp`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/**
* When setting the `id` column, consider the length of the prefix you're specifying in $this->prefix
*
*
CREATE TABLE `details` (
`id` char(17) NOT NULL,
`url` varchar(255) default NULL,
`c_url` varchar(255) default NULL,
`timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`server name` varchar(64) default NULL,
`perfdata` MEDIUMBLOB,
`type` tinyint(4) default NULL,
`cookie` BLOB,
`post` BLOB,
`get` BLOB,
`pmu` int(11) unsigned default NULL,
`wt` int(11) unsigned default NULL,
`cpu` int(11) unsigned default NULL,
`server_id` char(3) NOT NULL default 't11',
`aggregateCalls_include` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `url` (`url`),
KEY `c_url` (`c_url`),
KEY `cpu` (`cpu`),
KEY `wt` (`wt`),
KEY `pmu` (`pmu`),
KEY `timestamp` (`timestamp`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
*/

require_once XHPROF_LIB_ROOT.'/utils/Db/Abstract.php';
Expand All @@ -37,17 +37,17 @@ class Db_Mysql extends Db_Abstract

public function connect()
{
$this->linkID = mysql_connect($this->config['dbhost'], $this->config['dbuser'], $this->config['dbpass']);
if ($this->linkID === FALSE)
{
xhprof_error("Could not connect to db");
throw new Exception("Unable to connect to database");
return false;
}
$this->query("SET NAMES utf8");
mysql_select_db($this->config['dbname'], $this->linkID);
$this->linkID = mysql_connect($this->config['dbhost'], $this->config['dbuser'], $this->config['dbpass']);
if ($this->linkID === FALSE)
{
xhprof_error("Could not connect to db");
throw new Exception("Unable to connect to database");
return false;
}
$this->query("SET NAMES utf8");
mysql_select_db($this->config['dbname'], $this->linkID);
}


public function query($sql)
{
return mysql_query($sql, $this->linkID);
Expand All @@ -68,13 +68,13 @@ public function affectedRows()
return mysql_affected_rows($this->linkID);
}

public static function unixTimestamp($field)
{
return 'UNIX_TIMESTAMP('.$field.')';
public static function unixTimestamp($field)
{
return 'UNIX_TIMESTAMP('.$field.')';
}

public static function dateSub($days)
{
return 'DATE_SUB(CURDATE(), INTERVAL '.$days.' DAY)';
public static function dateSub($days)
{
return 'DATE_SUB(CURDATE(), INTERVAL '.$days.' DAY)';
}
}

0 comments on commit 53e3540

Please sign in to comment.