Created by Keloran, last update on 30/10/2008 11:38
A nice way to display errors when your on your dev area,
and then for the same errors to be sent to your email address when the site is on live, without having to change the code
all you have todo is, set your dev, live..defenitions
e.g. if (strstr($_SERVER['HTTP_HOST'], ".dev") {
define("DEV", true);
} else {
define("LIVE", true);
}
and then include the extension handler afterwards
<?php
/**
* The root of all errors.
*/
class Error extends Exception {
/**
* Create a new error
*
* @param string $message the error message
* @param int $errno one of E_ERROR, E_WARNING, etc.
* @param string $file the path to the file in which the error occurred
* @param int $line the line number in the file at which the error occurred
Actions make PHPEdit extremely customizable. You can create actions that are calling PHPEdit commands. You ever think of when you want to save a file and have code beautifier cycle through it, upload it through FTP or commit it to subversion/svn?
Actions make this possible. If you are finding yourself doing operations consistently that could be automated in some aspect Actions are for you.
To get started, you need to know a little about the PHPEdit commands. Navigate to Tools -> Script Command Editor. Here you can right click and create a custom script that later you can add as an action.
My script looks like this:
CodeBeautifierExecute
FileSave
FTPPublishActiveDocumen t
What this does is allow me to execute code beautifier, save the file and bring up the dialog to publish to FTP.
The next step is to go to Tools -> Edit Preferences. Navigate to Graphical user interface -> Actions. Click New Action. Add your script into the Script section. Give it a caption and category. Then bind it to a shortcut (I gave this one Ctrl + Alt + P). You can also give it certain Contexts to run in by setting specific types of documents to run on, etc.
I hope this quick tip gave you ideas for creating your own actions that produce more efficient productivity!