487
edits
(New page: {{Uc nav PHP PORTABLE IDE}} '''''Uniform Server portable PHP IDE''''' This step-by-step design guide shows how to create a simple portable PHP IDE (integrated development environment). I...) |
(Fix grammatical problems; clarify sentences.) |
||
Line 20: | Line 20: | ||
| | ||
| | | | ||
* Portable run from UDB memory stick | * Portable; run from UDB memory stick | ||
* Edit PHP web pages running on local server (Uniform Server) | * Edit PHP web pages running on local server (Uniform Server) | ||
* Debug PHP web pages running on local server (Uniform Server) | * Debug PHP web pages running on local server (Uniform Server) | ||
Line 32: | Line 32: | ||
Some time ago I was asked the following question "''Is there an easy way to develop and run PHP CLI scripts from a USB memory stick''"? | Some time ago I was asked the following question "''Is there an easy way to develop and run PHP CLI scripts from a USB memory stick''"? | ||
It transpires this user was learning PHP and wanted an easy way to run code snippets. | It transpires this user was learning PHP and wanted an easy way to run code snippets. The reason user had for running from a USB stick, they did not want to install PHP and a full-blown IDE on their PC. | ||
My reply was, use Notepad++ install the NppExec plugin add core binaries from PHP. To run currently displayed script write a small NppExec command script. You can create a shortcut key that runs this command script. For greater flexibility consider adding XDebug which will allow you to debug both CLI and server side scripts. | My reply was, use Notepad++, install the NppExec plugin and add core binaries from PHP. To run currently displayed script, write a small NppExec command script. You can create a shortcut key that runs this command script. For greater flexibility, consider adding XDebug which will allow you to debug both CLI and server side scripts. | ||
The response was not unexpected! "''Can you supply a complete idiots guide''?" | |||
== Guide Tutorial Breakdown == | == Guide Tutorial Breakdown == | ||
This guide is split across several pages | This guide is split across several pages. Each page builds on previous pages to construct the final IDE. Pages and topics covered are as follows: | ||
{| | {| | ||
Line 72: | Line 72: | ||
| | | | ||
This page covers the following: | This page covers the following: | ||
* How to [[PHP PORTABLE IDE: NppExec Configuration#Copy and Paste (console window) | copy and paste]] in console window. | * How to [[PHP PORTABLE IDE: NppExec Configuration#Copy and Paste (console window) | copy and paste]] in the console window. | ||
* Use [[PHP PORTABLE IDE: NppExec Configuration#Environment variables | environment variables]] for absolute paths to Notepad++'s folders. | * Use [[PHP PORTABLE IDE: NppExec Configuration#Environment variables | environment variables]] for absolute paths to Notepad++'s folders. | ||
* Using the above Environment variables [[PHP PORTABLE IDE: NppExec Configuration#Run Script Displayed | run script]] currently displayed in Notepad++ | * Using the above Environment variables [[PHP PORTABLE IDE: NppExec Configuration#Run Script Displayed | run script]] currently displayed in Notepad++ | ||
Line 82: | Line 82: | ||
[[PHP PORTABLE IDE: PHP extensions | PHP extensions]] | [[PHP PORTABLE IDE: PHP extensions | PHP extensions]] | ||
| | | | ||
This page shows how to enable PHP extensions in the CLI configuration and ensure correct file is being picked up. | This page shows how to enable PHP extensions in the CLI configuration and ensure that the correct file is being picked up. | ||
* Running CLI scripts the PHP interpreter needs to know [[PHP PORTABLE IDE: PHP extensions#Update NppExec command script |what configuration file to use]] | * Running CLI scripts, the PHP interpreter needs to know [[PHP PORTABLE IDE: PHP extensions#Update NppExec command script |what configuration file to use.]] Also true when run via a command script. | ||
* Checking correct configuration file is being picked up | * Checking that correct configuration file is being picked up. You can put a [[PHP PORTABLE IDE: PHP extensions#PHP configuration file - php_cli_ide.ini | dummy line]] in the configuration file to produce an error or use the [[PHP PORTABLE IDE: PHP extensions#PHP INFO | PHP info function]]. | ||
* How to enable PHP extensions using the [[PHP PORTABLE IDE: PHP extensions#Enabling extensions | WinBinder extension]] as an example. | * How to enable PHP extensions using the [[PHP PORTABLE IDE: PHP extensions#Enabling extensions | WinBinder extension]] as an example. | ||
* Generally when a file is double clicked you expect that file to be run with the correct application. Interestingly this can lead to some confusion especially for PHP files | * Generally when a file is double clicked you expect that file to be run with the correct application. Interestingly this can lead to some confusion, especially for PHP files. See [[PHP PORTABLE IDE: PHP extensions#Double clicking PHP file problem | Double clicking PHP file problem.]] | ||
* Want to preserve file associations for example .php is associated with a PHP editor and you want to run that script on a server when double clicked | * Want to preserve file associations; for example .php is associated with a PHP editor and you want to run that script on a server when double clicked. Use a [[PHP PORTABLE IDE: PHP extensions#PHP CLI redirect script | redirection file]]! | ||
|-valign="top" | |-valign="top" | ||
| | | | ||
[[PHP PORTABLE IDE: Run Menu | Run Menu]] | [[PHP PORTABLE IDE: Run Menu | Run Menu]] | ||
| | | | ||
This page looks at automating functionality using Notepad++ menu system. | This page looks at automating functionality using the Notepad++ menu system. | ||
* After editing a PHP script it is advisable to run a [[PHP PORTABLE IDE: Run Menu#PHP Syntax check | syntax check]]. This functionality is assigned to a menu item. | * After editing a PHP script, it is advisable to run a [[PHP PORTABLE IDE: Run Menu#PHP Syntax check | syntax check]]. This functionality is assigned to a menu item. | ||
* Similarly running a [[PHP PORTABLE IDE: Run Menu#Run PHP web page on server | page on a local web server]] is assigned to a [[PHP PORTABLE IDE: Run Menu#Edit Notepad++ file shortcuts.xml | menu item]]. This runs a [[PHP PORTABLE IDE: Run Menu#PHP CLI redirect script | PHP script]] that indirectly (via a browser) runs a script on a local server. A server may be configured to pass files with any extension hence the PHP redirection makes no distinction. | * Similarly running a [[PHP PORTABLE IDE: Run Menu#Run PHP web page on server | page on a local web server]] is assigned to a [[PHP PORTABLE IDE: Run Menu#Edit Notepad++ file shortcuts.xml | menu item]]. This runs a [[PHP PORTABLE IDE: Run Menu#PHP CLI redirect script | PHP script]] that indirectly (via a browser) runs a script on a local server. A server may be configured to pass files with any extension, hence the PHP redirection makes no distinction. | ||
|-valign="top" | |-valign="top" | ||
| | | | ||
Line 104: | Line 104: | ||
* To run XDebug a separate [[PHP PORTABLE IDE: Notepad++ XDebug 1#PHP Configuration file | configuration file] specific to PHP CLI is required. | * To run XDebug a separate [[PHP PORTABLE IDE: Notepad++ XDebug 1#PHP Configuration file | configuration file] specific to PHP CLI is required. | ||
* Similarly [[PHP PORTABLE IDE: Notepad++ XDebug 1#Notepad++ DBGp client configuration | configuration of Notepad++’s client]] plugin is easy requiring only a few mouse clicks. | * Similarly [[PHP PORTABLE IDE: Notepad++ XDebug 1#Notepad++ DBGp client configuration | configuration of Notepad++’s client]] plugin is easy requiring only a few mouse clicks. | ||
* Our IDE requires both console and debugging windows to be open however there is an issue when these are docked [[PHP PORTABLE IDE: Notepad++ XDebug 1#Docking Problem | | * Our IDE requires both console and debugging windows to be open, however there is an issue when these are docked. [[PHP PORTABLE IDE: Notepad++ XDebug 1#Docking Problem | Solution]] is to undock them. | ||
* Adding a [[PHP PORTABLE IDE: Notepad++ XDebug 1#New NppExec script | new command script]] to run PHP CLI debugging requires only minor changes to an existing script. | * Adding a [[PHP PORTABLE IDE: Notepad++ XDebug 1#New NppExec script | new command script]] to run PHP CLI debugging requires only minor changes to an existing script. | ||
|-valign="top" | |-valign="top" | ||
Line 113: | Line 113: | ||
* [[PHP PORTABLE IDE: Notepad++ Debugging 1#Debugging overview | Debugging overview]] shows complete sequence for debugging CLI scripts. | * [[PHP PORTABLE IDE: Notepad++ Debugging 1#Debugging overview | Debugging overview]] shows complete sequence for debugging CLI scripts. | ||
* A powerful feature is the ability to [[PHP PORTABLE IDE: Notepad++ Debugging 1#Change Value of a variable | change a variable]] while debugging. | * A powerful feature is the ability to [[PHP PORTABLE IDE: Notepad++ Debugging 1#Change Value of a variable | change a variable]] while debugging. | ||
* | * When interested in tracking a small number of variables, add them as [[PHP PORTABLE IDE: Notepad++ Debugging 1#Watches | watches]]. | ||
* How to use [[PHP PORTABLE IDE: Notepad++ Debugging 1#Xdebug Break function | Xdebug Break function]] useful for initiating a break point in included pages. | * How to use [[PHP PORTABLE IDE: Notepad++ Debugging 1#Xdebug Break function | Xdebug Break function]] useful for initiating a break point in included pages. | ||
* Notepad++'s integrated console window may be of limited use for your application alternative is to use an [[PHP PORTABLE IDE: Notepad++ Debugging 1#Alternative Console Window | external cmd window]] for debugging. | * Notepad++'s integrated console window may be of limited use for your application. The alternative is to use an [[PHP PORTABLE IDE: Notepad++ Debugging 1#Alternative Console Window | external cmd window]] for debugging. | ||
Line 124: | Line 124: | ||
| | | | ||
XDebug 2 covers setting up our IDE for running and debugging PHP web pages using the XDebug extension | XDebug 2 covers setting up our IDE for running and debugging PHP web pages using the XDebug extension | ||
* Again majority of material seems to be Linux orientated hence a quick [[PHP PORTABLE IDE: Notepad++ XDebug 2#Overview | overview]] for Windows users | * Again, the majority of material seems to be Linux orientated, hence a quick [[PHP PORTABLE IDE: Notepad++ XDebug 2#Overview | overview]] for Windows users | ||
* This section covers [[PHP PORTABLE IDE: Notepad++ XDebug 2#XDebug download and install | downloading and installing]] XDebug on Uniform Server. | * This section covers [[PHP PORTABLE IDE: Notepad++ XDebug 2#XDebug download and install | downloading and installing]] XDebug on Uniform Server. | ||
* Running XDebug on Uniform Server requires modifications to the [[PHP PORTABLE IDE: Notepad++ XDebug 2#PHP Configuration file | PHP configuration file]]. | * Running XDebug on Uniform Server requires modifications to the [[PHP PORTABLE IDE: Notepad++ XDebug 2#PHP Configuration file | PHP configuration file]]. | ||
* Similarly [[PHP PORTABLE IDE: Notepad++ XDebug 2#Notepad++ DBGp client configuration | configuration of Notepad++’s client]] plugin is easy requiring only a few mouse clicks. | * Similarly [[PHP PORTABLE IDE: Notepad++ XDebug 2#Notepad++ DBGp client configuration | configuration of Notepad++’s client]] plugin is easy requiring only a few mouse clicks. | ||
* Our IDE requires both console and debugging windows to be open however there is an issue when these are docked [[PHP PORTABLE IDE: Notepad++ XDebug 2#Docking Problem | solution]] is to undock them. | * Our IDE requires both console and debugging windows to be open however there is an issue when these are docked [[PHP PORTABLE IDE: Notepad++ XDebug 2#Docking Problem | solution]] is to undock them. | ||
* At this stage you will have noticed duplication between pages XDebug 1 and XDebug 2 | * At this stage you will have noticed duplication between pages XDebug 1 and XDebug 2. This is intentional; see [[PHP PORTABLE IDE: Notepad++ XDebug 2#Important Commonality | Important Commonality]]. | ||
|-valign="top" | |-valign="top" | ||
Line 136: | Line 136: | ||
| | | | ||
This page provides a recap of material already covered and provides an [[PHP PORTABLE IDE: Notepad++ Debugging 2#New redirection script | updated redirect script]]. | This page provides a recap of material already covered and provides an [[PHP PORTABLE IDE: Notepad++ Debugging 2#New redirection script | updated redirect script]]. | ||
* Recap example. | * Recap example. Debugging initiated using a browser and from Notepad++ | ||
* Add menu items to Context Menu | * Add menu items to Context Menu | ||
* Run Script On Server | * Run Script On Server | ||
Line 142: | Line 142: | ||
|} | |} | ||
== Download and Install == | == Download and Install == | ||
After reading this design tutorial why not download either the finished Portable IDE or Plugin | After reading this design tutorial, why not download either the finished Portable IDE or Plugin? | ||
Download and Install details are provided on this page: [[Uniform Server PHP IDE: Introduction | Uniform Server PHP IDE]] | Download and Install details are provided on this page: [[Uniform Server PHP IDE: Introduction | Uniform Server PHP IDE]] | ||
== Summary == | == Summary == | ||
First page introduces the core component [[PHP PORTABLE IDE: Notepad++ | '''Notepad++''']] | First page introduces the core component [[PHP PORTABLE IDE: Notepad++ | '''Notepad++''']] | ||
---- | ---- |