Skip to content
Permalink
Browse files

Removing inheritance from Object.

Adding missing visibility keywords, and adding static keywords.
Removing @tags.
  • Loading branch information...
markstory committed Apr 19, 2010
1 parent c05c985 commit 2bf9504cfbeb9eb8d3fe800c32b107f19ba4ac58
Showing with 11 additions and 25 deletions.
  1. +11 −22 cake/libs/debugger.php
  2. +0 −3 cake/tests/cases/libs/debugger.test.php
@@ -24,9 +24,6 @@
* Included libraries.
*
*/
if (!class_exists('Object')) {
require_once LIBS . 'object.php';
}
if (!class_exists('CakeLog')) {
require_once LIBS . 'cake_log.php';
}
@@ -43,7 +40,7 @@
* @subpackage cake.cake.libs
* @link http://book.cakephp.org/view/1191/Using-the-Debugger-Class
*/
class Debugger extends Object {
class Debugger {
/**
* A list of errors generated by the application.
@@ -109,7 +106,6 @@ class Debugger extends Object {
* Holds current output data when outputFormat is false.
*
* @var string
* @access private
*/
protected $_data = array();
@@ -180,7 +176,7 @@ function __construct() {
* @access public
* @static
*/
function &getInstance($class = null) {
public static function &getInstance($class = null) {
static $instance = array();
if (!empty($class)) {
if (!$instance || strtolower($class) != strtolower(get_class($instance[0]))) {
@@ -208,11 +204,10 @@ function &getInstance($class = null) {
* @param $var mixed the variable to dump
* @return void
* @see Debugger::exportVar()
* @access public
* @static
* @link http://book.cakephp.org/view/1191/Using-the-Debugger-Class
*/
function dump($var) {
public static function dump($var) {
$_this =& Debugger::getInstance();
pr($_this->exportVar($var));
}
@@ -227,7 +222,7 @@ function dump($var) {
* @static
* @link http://book.cakephp.org/view/1191/Using-the-Debugger-Class
*/
function log($var, $level = LOG_DEBUG) {
public static function log($var, $level = LOG_DEBUG) {
$_this =& Debugger::getInstance();
$source = $_this->trace(array('start' => 1)) . "\n";
CakeLog::write($level, "\n" . $source . $_this->exportVar($var));
@@ -330,11 +325,10 @@ public function handleError($code, $description, $file = null, $line = null, $co
*
* @param array $options Format for outputting stack trace
* @return mixed Formatted stack trace
* @access public
* @static
* @link http://book.cakephp.org/view/1191/Using-the-Debugger-Class
*/
function trace($options = array()) {
public static function trace($options = array()) {
$_this =& Debugger::getInstance();
$defaults = array(
'depth' => 999,
@@ -410,10 +404,9 @@ function trace($options = array()) {
*
* @param string $path Path to shorten
* @return string Normalized path
* @access public
* @static
*/
function trimPath($path) {
public static function trimPath($path) {
if (!defined('CAKE_CORE_INCLUDE_PATH') || !defined('APP')) {
return $path;
}
@@ -442,11 +435,10 @@ function trimPath($path) {
* @param integer $line Line number to highlight
* @param integer $context Number of lines of context to extract above and below $line
* @return array Set of lines highlighted
* @access public
* @static
* @link http://book.cakephp.org/view/1191/Using-the-Debugger-Class
*/
function excerpt($file, $line, $context = 2) {
public static function excerpt($file, $line, $context = 2) {
$data = $lines = array();
if (!file_exists($file)) {
return array();
@@ -475,11 +467,10 @@ function excerpt($file, $line, $context = 2) {
*
* @param string $var Variable to convert
* @return string Variable as a formatted string
* @access public
* @static
* @link http://book.cakephp.org/view/1191/Using-the-Debugger-Class
*/
function exportVar($var, $recursion = 0) {
public static function exportVar($var, $recursion = 0) {
$_this =& Debugger::getInstance();
switch (strtolower(gettype($var))) {
case 'boolean':
@@ -563,7 +554,7 @@ function __object($var) {
* straight HTML output, or 'txt' for unformatted text.
* @param array $strings Template strings to be used for the output format.
*/
protected function output($format = null, $strings = array()) {
public function output($format = null, $strings = array()) {
$_this =& Debugger::getInstance();
$data = null;
@@ -601,9 +592,8 @@ protected function output($format = null, $strings = array()) {
* Renders error messages
*
* @param array $data Data about the current error
* @access private
*/
function _output($data = array()) {
protected function _output($data = array()) {
$defaults = array(
'level' => 0,
'error' => 0,
@@ -674,10 +664,9 @@ function _output($data = array()) {
/**
* Verifies that the application's salt and cipher seed value has been changed from the default value.
*
* @access public
* @static
*/
function checkSecurityKeys() {
public static function checkSecurityKeys() {
if (Configure::read('Security.salt') == 'DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi') {
trigger_error(__('Please change the value of \'Security.salt\' in app/config/core.php to a salt value specific to your application'), E_USER_NOTICE);
}
@@ -251,9 +251,6 @@ function testExportVar() {
View::$modelId = NULL
View::$uuids = array
View::$output = false
View::$__passedVars = array
View::$__scripts = array
View::$__paths = array
View::$webroot = NULL';
$result = str_replace(array("\t", "\r\n", "\n"), "", strtolower($result));
$expected = str_replace(array("\t", "\r\n", "\n"), "", strtolower($expected));

0 comments on commit 2bf9504

Please sign in to comment.
You can’t perform that action at this time.