Skip to content

Commit aad71bb

Browse files
committed
use alternative php console file storage
1 parent fb2ed4f commit aad71bb

File tree

5 files changed

+14
-9
lines changed

5 files changed

+14
-9
lines changed

ChangeLog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Changelog
22

3-
### 1.3.6 (09 jul 2015)
3+
### 1.3.7 (09 jul 2015)
44
* Fixes a bug `Cannot send session cache limiter - headers already sent`
55
* Updated PHP Console Library to 3.1.4
66

README.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
44
Tags: development, debug, debugging
55
Requires at least: 3.6.0
66
Tested up to: 4.2.2
7-
Stable tag: 1.3.6
7+
Stable tag: 1.3.7
88
License: GPLv2 or later
99
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1010

@@ -121,7 +121,7 @@ None yet.
121121

122122
== Changelog ==
123123

124-
= 1.3.6 =
124+
= 1.3.7 =
125125
* Fixes a bug `Cannot send session cache limiter - headers already sent`
126126
* Updated PHP Console Library to 3.1.4
127127

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "nekojira/wp-php-console",
33
"description": "A WordPress implementation of PHP Console.",
44
"type": "wordpress-plugin",
5-
"version": "1.3.6",
5+
"version": "1.3.7",
66
"keywords": [
77
"wordpress",
88
"debug",

lib/class-wp-php-console.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class WP_PHP_Console {
5555
public function __construct() {
5656

5757
$this->plugin_name = 'wp-php-console';
58-
$this->version = '1.3.6';
58+
$this->version = '1.3.7';
5959
$this->options = get_option( 'wp_php_console' );
6060

6161
if ( ! class_exists( 'PhpConsole\Connector' ) ) {
@@ -65,8 +65,14 @@ public function __construct() {
6565
// By default PHP Console uses PhpConsole\Storage\Session for postponed responses,
6666
// so all temporary data will be stored in $_SESSION.
6767
// But there is some problem with frameworks like WordPress that override PHP session handler.
68-
// So we need to call the Storage session very early.
69-
PhpConsole\Connector::setPostponeStorage( new PhpConsole\Storage\Session() );
68+
// PHP Console has alternative storage drivers for this - we will write to a temporary file:
69+
$phpcdir = dirname( __FILE__ ) . '/tmp';
70+
$make_dir = wp_mkdir_p( $phpcdir );
71+
if ( $make_dir === true ) {
72+
PhpConsole\Connector::setPostponeStorage(
73+
new PhpConsole\Storage\File( $phpcdir . '/' . md5( __FILE__ ) . '_pc.data', false )
74+
);
75+
}
7076

7177
// Perform PHP Console initialisation required asap for other code to be able to output to the JavaScript console
7278
$connector = PhpConsole\Connector::getInstance();

wp-php-console.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Plugin Name: WP PHP Console
1010
* Plugin URI: https://github.com/nekojira/wp-php-console/
1111
* Description: An implementation of PHP Console for WordPress. Easily debug and trace PHP errors and warnings from your Chrome dev tools console using a Google Chrome extension.
12-
* Version: 1.3.6
12+
* Version: 1.3.7
1313
* Author: Fulvio Notarstefano
1414
* Author URI: https://github.com/nekojira/
1515
* License: GPL-2.0+
@@ -75,4 +75,3 @@ function() {
7575
* The main class of this plugin.
7676
*/
7777
require_once 'lib/class-wp-php-console.php';
78-

0 commit comments

Comments
 (0)