Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #66 from dereuromark/master

whitespace corrections
  • Loading branch information...
commit 335e3fec44c1ed56458f517a9f528fd7a729081d 2 parents 5652888 + 028e2af
@markstory markstory authored
View
2  Console/Command/BenchmarkShell.php
@@ -46,7 +46,7 @@ public function main() {
$url = $this->args[0];
$defaults = array('t' => 100, 'n' => 10);
- $options = array_merge($defaults, $this->params);
+ $options = array_merge($defaults, $this->params);
$times = array();
$this->out(String::insert(__d('debug_kit', '-> Testing :url'), compact('url')));
View
2  Console/Command/WhitespaceShell.php
@@ -52,7 +52,7 @@ public function main() {
}
/**
- * Much like main() except files are modified. Be sure to have
+ * Much like main() except files are modified. Be sure to have
* backups or use version control.
*
* @return void
View
4 Controller/ToolbarAccessController.php
@@ -91,8 +91,8 @@ public function history_state($key = null) {
/**
* Run SQL explain/profiling on queries. Checks the hash + the hashed queries,
- * if there is mismatch a 404 will be rendered. If debug == 0 a 404 will also be
- * rendered. No explain will be run if a 404 is made.
+ * if there is mismatch a 404 will be rendered. If debug == 0 a 404 will also be
+ * rendered. No explain will be run if a 404 is made.
*
* @throws BadRequestException
* @return void
View
2  Lib/DebugKitDebugger.php
@@ -161,7 +161,7 @@ public static function getMemoryUse() {
/**
* Get peak memory use
*
- * @return integer peak memory use (in bytes). Returns 0 if memory_get_peak_usage() is not available
+ * @return integer peak memory use (in bytes). Returns 0 if memory_get_peak_usage() is not available
* @deprecated Use DebugMemory::getPeak() instead.
*/
public static function getPeakMemoryUse() {
View
2  Lib/DebugMemory.php
@@ -40,7 +40,7 @@ public static function getCurrent() {
/**
* Get peak memory use
*
- * @return integer peak memory use (in bytes). Returns 0 if memory_get_peak_usage() is not available
+ * @return integer peak memory use (in bytes). Returns 0 if memory_get_peak_usage() is not available
*/
public static function getPeak() {
return memory_get_peak_usage();
View
2  Lib/DebugPanel.php
@@ -47,7 +47,7 @@ class DebugPanel {
public $javascript = array();
/**
- * Provide a custom element name for this panel. If null, the underscored version of the class
+ * Provide a custom element name for this panel. If null, the underscored version of the class
* name will be used.
*
* @var string
View
2  Lib/DebugTimer.php
@@ -192,7 +192,7 @@ public static function requestTime() {
public static function requestStartTime() {
if (defined('TIME_START')) {
$startTime = TIME_START;
- } else if (isset($GLOBALS['TIME_START'])) {
+ } elseif (isset($GLOBALS['TIME_START'])) {
$startTime = $GLOBALS['TIME_START'];
} else {
$startTime = env('REQUEST_TIME');
View
2  Lib/Panel/EnvironmentPanel.php
@@ -16,7 +16,7 @@ class EnvironmentPanel extends DebugPanel {
*
* @return array
*/
- public function beforeRender (Controller $controller) {
+ public function beforeRender(Controller $controller) {
parent::beforeRender ($controller);
$return = array();
View
8 Lib/Panel/IncludePanel.php
@@ -25,7 +25,7 @@ class IncludePanel extends DebugPanel {
/**
* Get a list of plugins on construct for later use
*/
- public function __construct() {
+ public function __construct() {
foreach (CakePlugin::loaded() as $plugin) {
$this->_pluginPaths[$plugin] = CakePlugin::path($plugin);
}
@@ -47,9 +47,9 @@ public function beforeRender(Controller $controller) {
if ($pluginName) {
$return['plugins'][$pluginName][$this->_getFileType($file)][] = $this->_niceFileName($file, $pluginName);
- } else if ($this->_isAppFile($file)) {
+ } elseif ($this->_isAppFile($file)) {
$return['app'][$this->_getFileType($file)][] = $this->_niceFileName($file, 'app');
- } else if ($this->_isCoreFile($file)) {
+ } elseif ($this->_isCoreFile($file)) {
$return['core'][$this->_getFileType($file)][] = $this->_niceFileName($file, 'core');
}
}
@@ -117,7 +117,7 @@ protected function _isPluginFile($file) {
* @return bool
*/
protected function _niceFileName($file, $type) {
- switch($type) {
+ switch ($type) {
case 'app':
return str_replace(APP, 'APP/', $file);
View
38 README.md
@@ -36,16 +36,16 @@ If you have an issues with DebugKit please open a ticket on lighthouse http://ca
## Contributing
-If you'd like to contribute to DebugKit, check out the [Roadmap](http://cakephp.lighthouseapp.com/projects/42880/roadmap) for any planned features. You can fork the project add features and send pull requests, or open tickets on lighthouse.
+If you'd like to contribute to DebugKit, check out the [Roadmap](http://cakephp.lighthouseapp.com/projects/42880/roadmap) for any planned features. You can fork the project add features and send pull requests, or open tickets on lighthouse.
## Versions
-DebugKit has several releases, they are compatible with different release of CakePHP. Downloading a tag, or checking out the correct branch.
+DebugKit has several releases, they are compatible with different release of CakePHP. Downloading a tag, or checking out the correct branch.
-* `1.0, 1.1, 1.2` are compatible with CakePHP 1.2.x. These releases of DebugKit will not work with CakePHP 1.3. You can also use the `1.2-branch` for the mos recent updates and bugfixes.
-* `1.3.0` is compatible with CakePHP 1.3.x only. It will not work with CakePHP 1.2. You can also use the `1.3` branch to get the most recent updates and bugfixes.
-* `2.0.0` is compatible with CakePHP 2.0.x only. It will not work with previous CakePHP versions.
-* `2.2.0` is compatible with CakePHP 2.2.0 and greater. It will not work with older versions of CakePHP as this release uses new API's available in 2.2. You can also use the `master` branch to get the most recent updates.
+* `1.0, 1.1, 1.2` are compatible with CakePHP 1.2.x. These releases of DebugKit will not work with CakePHP 1.3. You can also use the `1.2-branch` for the mos recent updates and bugfixes.
+* `1.3.0` is compatible with CakePHP 1.3.x only. It will not work with CakePHP 1.2. You can also use the `1.3` branch to get the most recent updates and bugfixes.
+* `2.0.0` is compatible with CakePHP 2.0.x only. It will not work with previous CakePHP versions.
+* `2.2.0` is compatible with CakePHP 2.2.0 and greater. It will not work with older versions of CakePHP as this release uses new API's available in 2.2. You can also use the `master` branch to get the most recent updates.
# Documentation
@@ -94,27 +94,27 @@ Using the panels key you can specify which panels you want to load, as well as t
'DebugKit.Toolbar' => array('panels' => array('myCustomPanel', 'timer' => false))
);
-Would add your custom panel `myCustomPanel` to the toolbar and exclude the default `Timer` panel. In addition to choosing which panels you want, you can pass options into the `__construct` of the panels. For example the built-in `History` panel uses the `history` key to set the number of historical requests to track.
+Would add your custom panel `myCustomPanel` to the toolbar and exclude the default `Timer` panel. In addition to choosing which panels you want, you can pass options into the `__construct` of the panels. For example the built-in `History` panel uses the `history` key to set the number of historical requests to track.
public $components = array(
'DebugKit.Toolbar' => array('history' => 10)
);
-Would load the `History` panel and set its history level to 10. The `panels` key is not passed to the Panel constructor.
+Would load the `History` panel and set its history level to 10. The `panels` key is not passed to the Panel constructor.
#### forceEnable
-The `forceEnable` setting is new in DebugKit 1.1. It allows you to force the toolbar to display regardless of the value of `Configure::read('debug');`. This is useful when profiling an application with debug kit as you can enable the toolbar even when running the application in production mode.
+The `forceEnable` setting is new in DebugKit 1.1. It allows you to force the toolbar to display regardless of the value of `Configure::read('debug');`. This is useful when profiling an application with debug kit as you can enable the toolbar even when running the application in production mode.
#### autoRun
-autoRun is a new configuration setting for DebugKit 1.2. It allows you to control whether or not the toolbar is displayed automatically or whether you would like to use a query string parameter to enable it. Set this configuration key to false to use query string parameter toggling of the toolbar.
+autoRun is a new configuration setting for DebugKit 1.2. It allows you to control whether or not the toolbar is displayed automatically or whether you would like to use a query string parameter to enable it. Set this configuration key to false to use query string parameter toggling of the toolbar.
var $components = array(
'DebugKit.Toolbar' => array('autoRun' => false)
);
-When visiting a page you can add `?debug=true` to the url and the toolbar will be visible. Otherwise it will stay hidden and not execute.
+When visiting a page you can add `?debug=true` to the url and the toolbar will be visible. Otherwise it will stay hidden and not execute.
## Developing your own panels
@@ -123,14 +123,14 @@ You can create your own custom panels for DebugKit to help in debugging your app
### Panel Classes
-Panel Classes simply need to be placed in`Panel` directory inside a `Lib` path. The filename should match the classname, so the class `MyCustomPanel` would be expected to have a filename of `app/Lib/Panel/MyCustomPanel.php`.
+Panel Classes simply need to be placed in`Panel` directory inside a `Lib` path. The filename should match the classname, so the class `MyCustomPanel` would be expected to have a filename of `app/Lib/Panel/MyCustomPanel.php`.
class MyCustomPanel extends DebugPanel {
...
}
-Notice that custom panels are required to subclass the `DebugPanel` class. Panels can define the
-`css` and `javascript` properties to include additional CSS or javascript on the page. Both
+Notice that custom panels are required to subclass the `DebugPanel` class. Panels can define the
+`css` and `javascript` properties to include additional CSS or javascript on the page. Both
properties should be an array.
class MyCustomPanel extends DebugPanel {
@@ -145,11 +145,11 @@ Panel objects have 2 callbacks, that allow them to hook into and introspect on t
startup(Controller $controller)
-Each panel's `startup()` method is called during component `startup()` process. `$controller` is a reference to the current controller object.
+Each panel's `startup()` method is called during component `startup()` process. `$controller` is a reference to the current controller object.
beforeRender(Controller $controller)
-Much like `startup()` `beforeRender()` is called during the Component beforeRender() process. Again `$controller` is a reference to the current controller. Normally at this point you could do additional introspection on the controller. The return of a panels `beforeRender()` is automatically passed to the View by the Toolbar Component. Therefore, under normal use you do not need to explicitly set variables to the controller.
+Much like `startup()` `beforeRender()` is called during the Component beforeRender() process. Again `$controller` is a reference to the current controller. Normally at this point you could do additional introspection on the controller. The return of a panels `beforeRender()` is automatically passed to the View by the Toolbar Component. Therefore, under normal use you do not need to explicitly set variables to the controller.
#### Example of beforeRender callback
@@ -162,17 +162,17 @@ Much like `startup()` `beforeRender()` is called during the Component beforeRend
return $controller->params;
}
-This would return cake's internal params array. The return of a panel's `beforeRender()` is available in you Panel element as `$content`
+This would return cake's internal params array. The return of a panel's `beforeRender()` is available in you Panel element as `$content`
### Panel Elements
-Each Panel is expected to have a view element that renders the content from the panel. The element name must be the underscored inflection of the class name. For example `SessionPanel` has an element named `session_panel.ctp`, and sqllogPanel has an element named `sqllog_panel.ctp`. These elements should be located in the root of your `View/Elements` directory.
+Each Panel is expected to have a view element that renders the content from the panel. The element name must be the underscored inflection of the class name. For example `SessionPanel` has an element named `session_panel.ctp`, and sqllogPanel has an element named `sqllog_panel.ctp`. These elements should be located in the root of your `View/Elements` directory.
#### Custom titles and elements
Panels should pick up their title and element name by convention. However, if you need to choose a custom element name or title, there are properties to allow that configuration.
-- `$title` - Set a custom title for use in the toolbar. This title will be used as the panels button.
+- `$title` - Set a custom title for use in the toolbar. This title will be used as the panels button.
- `$elementName` - Set a custom element name to be used to render the panel.
### Panels as Cake Plugins
View
2  View/Elements/environment_panel.ctp
@@ -48,7 +48,7 @@
}
if (isset($content['hidef'])) {
- echo '<h2>' . __('Hidef Environment') . '</h2>';
+ echo '<h2>' . __('Hidef Environment') . '</h2>';
if (!empty($content['hidef'])) {
$cakeRows = array();
foreach ($content['hidef'] as $key => $val) {
View
2  View/Elements/history_panel.ctp
@@ -20,7 +20,7 @@
?>
<h2> <?php echo __d('debug_kit', 'Request History'); ?></h2>
<?php if (empty($content)): ?>
- <p class="warning"><?php echo __d('debug_kit', 'No previous requests logged.'); ?></p>
+ <p class="warning"><?php echo __d('debug_kit', 'No previous requests logged.'); ?></p>
<?php else: ?>
<?php echo count($content); ?> <?php echo __d('debug_kit', 'previous requests available') ?>
<ul class="history-list">
View
4 View/Elements/include_panel.ctp
@@ -22,8 +22,8 @@
<h4>Include Paths</h4>
<?php
- foreach($content['paths'] as $i => $path) {
- if(strstr($path, CAKE)) {
+ foreach ($content['paths'] as $i => $path) {
+ if (strstr($path, CAKE)) {
$content['paths'][$i] = '-> ' . $path;
break;
}
View
2  View/Elements/timer_panel.ctp
@@ -45,7 +45,7 @@ endif;
$memoryPoints = DebugKitDebugger::getMemoryPoints();
$rows = array();
- foreach($memoryPoints as $key => $value):
+ foreach ($memoryPoints as $key => $value):
$rows[] = array($key, $this->Number->toReadableSize($value));
endforeach;
View
8 View/Helper/ToolbarHelper.php
@@ -1,7 +1,7 @@
<?php
/**
- * Abstract Toolbar helper. Provides Base methods for content
- * specific debug toolbar helpers. Acts as a facade for other toolbars helpers as well.
+ * Abstract Toolbar helper. Provides Base methods for content
+ * specific debug toolbar helpers. Acts as a facade for other toolbars helpers as well.
*
* PHP versions 5
*
@@ -25,7 +25,7 @@
class ToolbarHelper extends AppHelper {
/**
- * settings property to be overloaded. Subclasses should specify a format
+ * settings property to be overloaded. Subclasses should specify a format
*
* @var array
*/
@@ -111,7 +111,7 @@ public function __call($method, $params) {
/**
* Allows for writing to panel cache from view.
* Some panels generate all variables in the view by
- * necessity ie. Timer. Using this method, will allow you to replace in full
+ * necessity ie. Timer. Using this method, will allow you to replace in full
* the content for a panel.
*
* @param string $name Name of the panel you are replacing.
View
2  build.py
@@ -96,7 +96,7 @@ def zip_recursive(destination, source_dir, rootfiles):
"""
Recursively zips source_dir into destination.
rootfiles should contain a list of files in the top level directory that
- are to be included. Any top level files not in rootfiles will be omitted
+ are to be included. Any top level files not in rootfiles will be omitted
from the zip file.
"""
zipped = zipfile.ZipFile(destination, 'w', zipfile.ZIP_DEFLATED)
View
6 webroot/js/js_debug_toolbar.js
@@ -2,7 +2,7 @@
* Debug Toolbar Javascript.
*
* Creates the DEBUGKIT namespace and provides methods for extending
- * and enhancing the Html toolbar. Includes library agnostic Event, Element,
+ * and enhancing the Html toolbar. Includes library agnostic Event, Element,
* Cookie and Request wrappers.
*
*
@@ -456,7 +456,7 @@ DEBUGKIT.Util.Request = function (options) {
//open connection
this.transport.open(this.options.method, url, this.options.async);
- //set statechange and pass the active XHR object to it. From here it handles all status changes.
+ //set statechange and pass the active XHR object to it. From here it handles all status changes.
this.transport.onreadystatechange = function () {
self.onReadyStateChange.apply(self, arguments);
};
@@ -701,7 +701,7 @@ DEBUGKIT.toolbar = function () {
return false;
},
- // Deactivate a panel. use true to hide all panels.
+ // Deactivate a panel. use true to hide all panels.
deactivatePanel: function (id) {
if (id === true) {
for (var i in this.panels) {
Please sign in to comment.
Something went wrong with that request. Please try again.