Browse files

This commit was manufactured by cvs2svn to create tag 'XDEBUG_2_0_0'.

SVN Rev: 2453
  • Loading branch information...
1 parent aaa68cd commit 90915c61f34f18ed8bdf2a7329e565fc5fcec733 Unknown Author committed Jul 18, 2007
Showing with 0 additions and 170 deletions.
  1. +0 −22 Changelog
  2. +0 −148 contrib/online_profiling_prepend.php
View
22 Changelog
@@ -1,25 +1,3 @@
-Wed Jul 18 19:34:56 CEST 2007 Derick Rethans <derick@derickrethans.nl>
-package.xml
-xdebug/package2.xml
-xdebug/php_xdebug.h:
-- Go with 2.0.0.
-
-Wed Jul 18 19:25:31 CEST 2007 Derick Rethans <derick@derickrethans.nl>
-test-4.3.sh:
-- Fixed test script.
-
-Mon Jul 16 12:09:07 CEST 2007 Derick Rethans <derick@derickrethans.nl>
-xdebug.c:
-- Removed unreferenced var.
-
-Sun Jul 15 20:39:01 CEST 2007 Derick Rethans <derick@derickrethans.nl>
-xdebug.c:
-- Fixed bug #279: PHP segfault on use of virtual() function.
-
-Sun Jul 08 22:04:02 CEST 2007 Derick Rethans <derick@derickrethans.nl>
-usefulstuff.c:
-- Fixed opening files (such as the remote log) on Windows.
-
Sun Jul 08 20:35:00 CEST 2007 Derick Rethans <derick@derickrethans.nl>
xdebug_profiler.c:
- Backing out debug statement.
View
148 contrib/online_profiling_prepend.php
@@ -1,148 +0,0 @@
-<?php
-
-/*
- * Online profiling dump - Written by Jani Taskinen <sniper@iki.fi> A.D. 2007
- *
- * $Id: online_profiling_prepend.php,v 1.2 2007-05-14 14:20:40 sniper Exp $
- *
- * Usage:
- *
- * You can either have this file included by using the php.ini
- * directive "auto_prepend_file" or including it in your script.
- *
- * Passing XDEBUG_PROFILE in GET/POST/COOKIE enables the output.
- *
- * Example of download.php:
-
- <?php
-
- if (file_exists("/{$_GET['file']}"))
- {
- $filesize=filesize("/{$_GET['file']}");
- $file=basename("/{$_GET['file']}");
-
-// If you want to have always same filename uncomment this:
-// header("Content-Disposition: attachment; filename=\"cachegrind.out\"");
- header("Content-Type: application/x-kcachegrind");
- header("Content-Length: {$filesize}");
- passthru("cat /tmp/xdebug/{$file}",$err);
- }
-
- exit;
-
- ?>
-
- *
- * Example of php.ini options:
- *
-
- [xdebug]
- zend_extension_debug = ${extension_dir}"/xdebug.so"
- xdebug.profiler_enable = Off
- xdebug.profiler_enable_trigger = On
- xdebug.profiler_output_dir = /tmp/xdebug
- xdebug.profiler_append = On
- xdebug.profiler_aggregate = Off
- xdebug.profiler_output_name = %H.%S ; <HTTP_HOST>.<SESSION_ID>
- xdebug.extended_info = 1
-
- *
- */
-
-function xdebug_profiler_shutdown_cb()
-{
- $is_xmlhttprequest = (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest');
-
- if (isset($_REQUEST['XDEBUG_PROFILE']))
- {
- $dump = '';
- $used_memory = xdebug_memory_usage();
- $sizename = array(" Bytes", " KB", " MB", " GB");
- $used_memory = round($used_memory/pow(1024, ($i = floor(log($used_memory, 1024)))), 2) . $sizename[$i];
- $elapsed_time = round(xdebug_time_index() * 1000, 3);
- $profile = xdebug_get_profiler_filename();
- $profile_id = md5($profile);
-
- if (file_exists($profile) && !$is_xmlhttprequest) // Fixme: How to provide profiler links for these without breaking possible json?
- {
- if ($_REQUEST['XDEBUG_PROFILE'] == 'long')
- {
- $dump = shell_exec("/usr/bin/callgrind_annotate --inclusive=yes --tree=both $profile");
- }
-
- echo <<< DATA
-<div style="position: absolute; top: 0; z-index: 5000; border: dashed black 1px; background-color: #fff;" id="xdebug_profile_{$profile_id}">
- <a href="#" style="font-size: 11px;" onclick="javascript: document.getElementById('xdebug_profile_{$profile_id}').style.display = 'none'; return false;">[close]</a>
- <pre style="padding: 5px;">
- <b>Page generated in</b> {$elapsed_time} ms <b>Used memory:</b> {$used_memory}
- <b>Profiler dump:</b> <a href="/download.php?file={$profile}">$profile</a>
- {$dump}</pre>
- <a href="#" style="font-size: 11px;" onclick="javascript: document.getElementById('xdebug_profile_{$profile_id}').style.display = 'none'; return false;">[close]</a>
-</div>
-DATA;
- }
- }
-
- /* Output button to enable/disable profiler */
- if (!$is_xmlhttprequest)
- {
- $profiler = isset($_REQUEST['XDEBUG_PROFILE']) ?
- array
- (
- 'enabled' => 1,
- 'checked' => 'checked="checked"',
- 'display' => 'inline',
- ) :
- array
- (
- 'enabled' => 0,
- 'checked' => '',
- 'display' => 'none',
- );
-
- echo <<< DATA
-<!-- XDEBUG Dynamic Profiler -->
-<script type="text/javascript">
-<!--
-var xdebug_Profiler = {$profiler['enabled']};
-function xdebug_setCookie(value)
-{
- if (value == '')
- document.cookie = "XDEBUG_PROFILE=; path=/; expires=Thu, 01-Jan-1970 00:00:01 GMT";
- else
- document.cookie = "XDEBUG_PROFILE=" + value + "; path=/; expires=Fri, 01-Jan-2038 00:00:01 GMT";
-}
-function xdebug_toggleProfiler(output)
-{
- var annotate = document.getElementById('xdebug_profiler_annotate');
-
- if (xdebug_Profiler) {
- xdebug_setCookie('');
- xdebug_Profiler = 0;
- annotate.style.display = 'none';
- } else {
- xdebug_setCookie(output);
- xdebug_Profiler = 1;
- annotate.style.display = 'inline';
- }
- return xdebug_Profiler;
-}
-// -->
-</script>
-<div style="padding: 5px; border: dashed black 1px; background-color: #fff; position: absolute; top: 0; z-index: 1000;" id="xdebug_profile_enable_cookie">
- <label for="xdebug_toggler" style="vertical-align: top">Toggle Profiler</label>
- <input id="xdebug_toggler" type="checkbox" onclick="this.checked = xdebug_toggleProfiler(this.value);" value="short" {$profiler['checked']} />
- <div id="xdebug_profiler_annotate" style="display: {$profiler['display']}">
- <label for="xdebug_annotate" style="vertical-align: top">Annotate</label>
- <input id="xdebug_annotate" type="checkbox" onclick="xdebug_setCookie((this.checked)?this.value:'short');" value="long" />
- </div>
-</div>
-DATA;
- }
-}
-
-/* Register shutdown function */
-if (PHP_SAPI != 'cli')
-{
- register_shutdown_function('xdebug_profiler_shutdown_cb');
-}

0 comments on commit 90915c6

Please sign in to comment.