Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Rename find-binary.php to wizard.php.
  • Loading branch information
derickr committed Mar 24, 2012
1 parent 9376e0d commit 5f7fa1e
Show file tree
Hide file tree
Showing 4 changed files with 142 additions and 139 deletions.
6 changes: 3 additions & 3 deletions html/docs/include/features.php
Expand Up @@ -31,7 +31,7 @@
<p>
There are a few precompiled modules for Windows, they are all for the non-debug
version of PHP. You can get those at the <a href='/download.php'>download</a>
page. Follow <a href='/find-binary.php'>these instructions</a> to get Xdebug
page. Follow <a href='/wizard.php'>these instructions</a> to get Xdebug
installed.
</p>
Expand Down Expand Up @@ -77,7 +77,7 @@
<a name='compile'></a>
<h2>Compiling</h2>
<p>There is a <a href='/find-binary.php'>wizard</a> available that provides you
<p>There is a <a href='/wizard.php'>wizard</a> available that provides you
with the correct file to download, and which paths to use.</p>
<p>
You compile Xdebug separately from the rest of PHP. Note, however,
Expand Down Expand Up @@ -1343,7 +1343,7 @@ function calls but also function calls made more levels up and down.
look for a line <code>extension=xdebug.so</code> in any of the INI files that
are listed under "Loaded Configuration File" and "Additional .ini files parsed"
in the top block. Remove this line, and go back to the
<a href="/find-binary.php">Tailored Installation Instructions</a>.</p>
<a href="/wizard.php">Tailored Installation Instructions</a>.</p>
</dd>
<dt><a name="custom-phpize"></a>
Expand Down
2 changes: 1 addition & 1 deletion html/download.php
Expand Up @@ -32,7 +32,7 @@
version at that time. The VC<i>x</i> marker tells with which compiler the
extension was built, and Non-thread-safe whether ZTS was disabled. Those
qualifiers need to match the PHP version you're using. If you don't know which
one you need, please refer to the <a href='/find-binary.php'>custom
one you need, please refer to the <a href='/wizard.php'>custom
installation instructions</a>.</p>

<?php
Expand Down
136 changes: 1 addition & 135 deletions html/find-binary.php
@@ -1,137 +1,3 @@
<?php $title = "Xdebug: Support; Tailored Installation Instructions"; include "include/header.php"; hits ('xdebug-findbinary'); ?>
<tr>
<td>&nbsp;</td>
<td><span class="serif">

<!-- MAIN FEATURE START -->

<span class="sans">XDEBUG EXTENSION FOR PHP | DOCUMENTATION | INSTALLATION</span><br />

<?php include "include/menu.php"; ?>

<h2>Tailored Installation Instructions</h2>

<?php
if ( $_POST && isset( $_POST['submit'] ) && $_POST['submit'] == 'Analyse my phpinfo() output' && isset( $_POST['data'] ) )
{
require 'include/phpinfo-scanner.php';

$x = new xdebugVersion();
$x->analyse( $_POST['data'] );

if ( ( $reason = $x->determineSupported() ) !== true )
{
echo "<h2>{$reason}</h2>\n";
}
else
{
$dlFile = $x->determineFile();
$iniFile = $x->determineIniFile();
$iniLine = $x->determineIniLine();

// add quotes when necessary
$x->extensionDir = strpos( $x->extensionDir, ' ') === false ? $x->extensionDir : "\"{$x->extensionDir}\"";

if ( $x->xdebugAsPhpExt && !$x->xdebugAsZendExt )
{
echo "<h2>Instructions</h2>\n";

echo "<p><span style='color: #f00'><b>Warning:</b></span> You seem to have Xdebug loaded as a normal
PHP extension only. This will cause odd issues, please see <a href='/docs/faq#php-ext'>the FAQ entry on it</a>.</p>\n";
}
else if ( $x->xdebugVersion && version_compare( $x->xdebugVersion, $x->xdebugVersionToInstall, '>=' ) )
{
echo "<h2>You're already running the latest Xdebug version</h2>\n";
echo "<p>But here are the instructions anyway:</p>\n";
}
else
{
echo "<h2>Instructions</h2>\n";

if ( $x->zendServer )
{
echo "<p><span style='color: #f00'><b>Warning:</b></span> You
seem to be using Zend Server, which is known to cause
issues with Xdebug. It might work, but you're on your
own.</p>\n";
}
}

echo "<ol>\n";
echo "<li>Download <a href='http://xdebug.org/files/{$dlFile}'>{$dlFile}</a></li>\n";
if ( !$x->windows )
{
echo "<li>Unpack the downloaded file with <code>tar -xvzf {$dlFile}</code></li>";
echo "<li>Run: <code>cd {$x->tarDir}</code></li>\n";
echo "<li><p>Run: <code>phpize</code></p>
<p>As part of its output it should show:<br/><pre>
Configuring for:
...
Zend Module Api No: {$x->phpApi}
Zend Extension Api No: {$x->zendApi}
</pre></p>
<p>If it does not, you are using the wrong <code>phpize</code>. Please follow
<a href='/docs/faq#custom-phpize'>this FAQ entry</a> and skip the next step.
</p>\n";
echo "<li>Run: <code>./configure</code></li>\n";
echo "<li>Run: <code>make</code></li>\n";
echo "<li>Run: <code>cp modules/xdebug.so {$x->extensionDir}</code></li>\n";
}
else
{
echo "<li>Move the downloaded file to {$x->extensionDir}</li>\n";
}
if ( $x->zendServer )
{
$file = $x->windows
? "{$x->zendServerInstallPath}{$x->dirSep}etc{$x->dirSep}cfg{$x->dirSep}debugger.ini"
: "{$x->zendServerInstallPath}{$x->dirSep}etc{$x->dirSep}conf.d{$x->dirSep}debugger.ini";
echo "<li>Open <code>$file</code>\n";
echo "and put a <code>;</code> in front of the line that says <code>zend_extension_manager.dir.debugger=</code>\n";
echo "so that it says <code>;zend_extension_manager.dir.debugger=</code></li>\n";
}
echo "<li>{$iniFile} and ";
echo $x->xdebugVersion ? "change " : ( $x->zendServer ? "add at the begining of the file " : "add " );
echo "the line<br/><code>{$iniLine}</code></li>\n";
if ( $x->sapi !== 'Command Line Interface' )
{
echo "<li>Restart the webserver</li>\n";
}
echo "</ol>\n";
}
echo "<p>\n\tIf you like Xdebug, and thinks it saves you time and money, please have a look at the <a href='/donate.php'>donation</a> page.\n</p>\n";
}
else
{
header( "Location: http://xdebug.org/wizard.php" );
?>
<p>
This page helps you finding which file to download, and how to configure
PHP to get Xdebug running. Please paste the <b>full</b> output of
phpinfo() (either a copy &amp; paste of the HTML version, the HTML source
or <code>php -i</code> output) and submit the form to receive tailored
download and installation instructions. Do <b>not</b> paste the raw HTML (from
view-source) into the form.
</p>
<form method='POST'>
<p>
<textarea name='data' cols="80" rows="25">
</textarea>
</p>
<p>
The information that you upload will not be stored. The script will only
use a few regular expressions to analyse the output and provide you with
instructions. You can see the code <a href='https://github.com/derickr/xdebug.org/blob/master/html/include/phpinfo-scanner.php'>here</a>.
</p>
<p>
<input type='submit' name='submit' value='Analyse my phpinfo() output'/>
</p>
</form>
<?php
}
?>
<!-- MAIN FEATURE END -->

</td>
<td>&nbsp;</td>
</tr>
<?php include "include/footer.php"; ?>
137 changes: 137 additions & 0 deletions html/wizard.php
@@ -0,0 +1,137 @@
<?php $title = "Xdebug: Support; Tailored Installation Instructions"; include "include/header.php"; hits ('xdebug-findbinary'); ?>
<tr>
<td>&nbsp;</td>
<td><span class="serif">

<!-- MAIN FEATURE START -->

<span class="sans">XDEBUG EXTENSION FOR PHP | DOCUMENTATION | INSTALLATION</span><br />

<?php include "include/menu.php"; ?>

<h2>Tailored Installation Instructions</h2>

<?php
if ( $_POST && isset( $_POST['submit'] ) && $_POST['submit'] == 'Analyse my phpinfo() output' && isset( $_POST['data'] ) )
{
require 'include/phpinfo-scanner.php';

$x = new xdebugVersion();
$x->analyse( $_POST['data'] );

if ( ( $reason = $x->determineSupported() ) !== true )
{
echo "<h2>{$reason}</h2>\n";
}
else
{
$dlFile = $x->determineFile();
$iniFile = $x->determineIniFile();
$iniLine = $x->determineIniLine();

// add quotes when necessary
$x->extensionDir = strpos( $x->extensionDir, ' ') === false ? $x->extensionDir : "\"{$x->extensionDir}\"";

if ( $x->xdebugAsPhpExt && !$x->xdebugAsZendExt )
{
echo "<h2>Instructions</h2>\n";

echo "<p><span style='color: #f00'><b>Warning:</b></span> You seem to have Xdebug loaded as a normal
PHP extension only. This will cause odd issues, please see <a href='/docs/faq#php-ext'>the FAQ entry on it</a>.</p>\n";
}
else if ( $x->xdebugVersion && version_compare( $x->xdebugVersion, $x->xdebugVersionToInstall, '>=' ) )
{
echo "<h2>You're already running the latest Xdebug version</h2>\n";
echo "<p>But here are the instructions anyway:</p>\n";
}
else
{
echo "<h2>Instructions</h2>\n";

if ( $x->zendServer )
{
echo "<p><span style='color: #f00'><b>Warning:</b></span> You
seem to be using Zend Server, which is known to cause
issues with Xdebug. It might work, but you're on your
own.</p>\n";
}
}

echo "<ol>\n";
echo "<li>Download <a href='http://xdebug.org/files/{$dlFile}'>{$dlFile}</a></li>\n";
if ( !$x->windows )
{
echo "<li>Unpack the downloaded file with <code>tar -xvzf {$dlFile}</code></li>";
echo "<li>Run: <code>cd {$x->tarDir}</code></li>\n";
echo "<li><p>Run: <code>phpize</code></p>
<p>As part of its output it should show:<br/><pre>
Configuring for:
...
Zend Module Api No: {$x->phpApi}
Zend Extension Api No: {$x->zendApi}
</pre></p>
<p>If it does not, you are using the wrong <code>phpize</code>. Please follow
<a href='/docs/faq#custom-phpize'>this FAQ entry</a> and skip the next step.
</p>\n";
echo "<li>Run: <code>./configure</code></li>\n";
echo "<li>Run: <code>make</code></li>\n";
echo "<li>Run: <code>cp modules/xdebug.so {$x->extensionDir}</code></li>\n";
}
else
{
echo "<li>Move the downloaded file to {$x->extensionDir}</li>\n";
}
if ( $x->zendServer )
{
$file = $x->windows
? "{$x->zendServerInstallPath}{$x->dirSep}etc{$x->dirSep}cfg{$x->dirSep}debugger.ini"
: "{$x->zendServerInstallPath}{$x->dirSep}etc{$x->dirSep}conf.d{$x->dirSep}debugger.ini";
echo "<li>Open <code>$file</code>\n";
echo "and put a <code>;</code> in front of the line that says <code>zend_extension_manager.dir.debugger=</code>\n";
echo "so that it says <code>;zend_extension_manager.dir.debugger=</code></li>\n";
}
echo "<li>{$iniFile} and ";
echo $x->xdebugVersion ? "change " : ( $x->zendServer ? "add at the begining of the file " : "add " );
echo "the line<br/><code>{$iniLine}</code></li>\n";
if ( $x->sapi !== 'Command Line Interface' )
{
echo "<li>Restart the webserver</li>\n";
}
echo "</ol>\n";
}
echo "<p>\n\tIf you like Xdebug, and thinks it saves you time and money, please have a look at the <a href='/donate.php'>donation</a> page.\n</p>\n";
}
else
{
?>
<p>
This page helps you finding which file to download, and how to configure
PHP to get Xdebug running. Please paste the <b>full</b> output of
phpinfo() (either a copy &amp; paste of the HTML version, the HTML source
or <code>php -i</code> output) and submit the form to receive tailored
download and installation instructions. Do <b>not</b> paste the raw HTML (from
view-source) into the form.
</p>
<form method='POST'>
<p>
<textarea name='data' cols="80" rows="25">
</textarea>
</p>
<p>
The information that you upload will not be stored. The script will only
use a few regular expressions to analyse the output and provide you with
instructions. You can see the code <a href='https://github.com/derickr/xdebug.org/blob/master/html/include/phpinfo-scanner.php'>here</a>.
</p>
<p>
<input type='submit' name='submit' value='Analyse my phpinfo() output'/>
</p>
</form>
<?php
}
?>
<!-- MAIN FEATURE END -->

</td>
<td>&nbsp;</td>
</tr>
<?php include "include/footer.php"; ?>

0 comments on commit 5f7fa1e

Please sign in to comment.