Skip to content

Commit

Permalink
Merge pull request #6 from orrisroot/master
Browse files Browse the repository at this point in the history
support XCL 2.2, etc.
  • Loading branch information
suin committed Jul 24, 2014
2 parents e724ad3 + a1edb79 commit 2cdbf7e
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 12 deletions.
6 changes: 3 additions & 3 deletions build/AdelieDebug.class.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"build":1367540064,"datetime":"2013-05-03 09:14:24"}
{"build":1405183780,"datetime":"2014-07-13 01:49:40"}
2 changes: 1 addition & 1 deletion source/AdelieDebug/Debug/Trace.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static function trace($minus = 0, $return = false)
for ( $i = 0; $i < $minus; $i ++ )
{
$trace = preg_replace("/.*\n#1([^\d])/s", '#1$1', $trace);
$trace = preg_replace ('/^#(\d+)/me', '\'#\' . ($1 - 1)', $trace);
$trace = preg_replace_callback('/^#(\d+)/m', function($m) { return '#' . ($m[1] - 1); }, $trace);
}

if ( $return === true )
Expand Down
2 changes: 1 addition & 1 deletion source/AdelieDebug/Debug/XoopsDebugger.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function enableDebugRenderSystem()

public function prepare()
{
$GLOBALS['xoopsErrorHandler'] =& AdelieDebug_Debug_XoopsErrorHandler::getInstance();
$GLOBALS['xoopsErrorHandler'] =& AdelieDebug_Debug_XoopsErrorHandler::getInstanceWrapper();
$GLOBALS['xoopsErrorHandler']->activate(false);

$xoopsLogger = AdelieDebug_Debug_XoopsLogger::getInstance();
Expand Down
13 changes: 12 additions & 1 deletion source/AdelieDebug/Debug/XoopsErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ public static function getInstance()

return $instance;
}

public static function &getInstanceWrapper()
{
return self::getInstance();
}
}
}
else
Expand All @@ -42,7 +47,7 @@ public function __construct()
// 親のコンストラクタの処理を封じる
}

public function getInstance()
public function &getInstance()
{
static $instance = null;

Expand All @@ -53,6 +58,12 @@ public function getInstance()

return $instance;
}

public static function &getInstanceWrapper()
{
$obj = new self();
return $obj->getInstance();
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion source/AdelieDebug/Debug/XoopsLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static function getInstance()
$reflectionClass = new ReflectionClass('XoopsLogger');
$instanceMethod = $reflectionClass->getMethod('instance');

if ( $instanceMethod->isStatic() === true ) {
if ( $instanceMethod->returnsReference() === false ) {
return AdelieDebug_Debug_XoopsLogger_TP::instance();
} else {
return AdelieDebug_Debug_XoopsLogger_XCL::instance();
Expand Down
2 changes: 1 addition & 1 deletion source/AdelieDebug/Debug/XoopsLogger/XCL.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class AdelieDebug_Debug_XoopsLogger_XCL extends AdelieDebug_Debug_XoopsLogger
{
public function instance()
public static function &instance()
{
static $instance = null;

Expand Down
2 changes: 1 addition & 1 deletion source/AdelieDebug/Preload.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function setupDebugEventHandler(&$instance, $debugMode)
$this->debugger->enableErrorReporting(); // Legacy_Controller::_setupDebugger() で error_reproting = 0 にされちゃってるので必要
}

public function addOutputFilterToXoopsTpl(XoopsTpl $xoopsTpl)
public function addOutputFilterToXoopsTpl(Smarty $xoopsTpl)
{
if ( method_exists($xoopsTpl, 'registerFilter') === true )
{
Expand Down
4 changes: 2 additions & 2 deletions source/AdelieDebug/Template/Report/Index.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<strong><{$typeName}> (<{$ids|@count}>)</strong>
<span>...</span>
<{foreach from=$ids item="id"}>
<a href="#adelieDebugLogId<{$id}>" style="margin: 10px;">#<{$id}></a>
<a href="#adelieDebugLogId<{$id}>" style="margin: 10px;" onclick="javascript:document.getElementById('adelieDebugDetail').style.display='block'">#<{$id}></a>
<{/foreach}>
</div>
<{foreachelse}>
Expand Down Expand Up @@ -131,4 +131,4 @@
<{/if}>
<{/foreach}>
</div>
</div>
</div>

0 comments on commit 2cdbf7e

Please sign in to comment.