When writing PHP class or function (basically any file containing only PHP code) files you might have learnt to write them something like this:
Netbeans is a great IDE and with every version lots more features are introduced that make it even better. One thing that I like to use is the code templates, which have been available from version 6.5. Code templates allows you to type a simple command and get a section of code. What commands you can use depend on what version of Netbeans you are using and which programming language you focused on. As a PHP developer I usually download the PHP version, which comes with a set of PHP code templates.
If you are selling a system the last thing you want is for people to copy the system and pass it on for free. There are numerous ways to implement parts of the system that will stop this from happening.
By far the easiest is to create a section of code that is hidden, the removal of which will cause the application to fall over. It could even be as simple as a link back to your site so that even if you give you application away for free, you will always have that link present.
I talked a while ago about Adding Code To Wordpress Blogs And Comments, but I decided that it needed a bit of code to do this automatically.
So here it is, prepared by the text processor.
I recently talked about adding code to blogs and comments to Wordpress and making sure that certain characters are encoded properly. So to simplify things I thought I would create a little set of regular expressions that takes a sample of code and convert it into a Wordress friendly format. It consists of the following function, which takes the value of a text area called tochange and runs some regular expression replace functions on it.
Wordpress is a pretty neat blogging platform, but it falls over quite spectacularly when trying to write code in posts. I write a lot of code for #! code and so I have understand what needs to be encoded to make code examples work.
For code example on #! code I use the
By default, Phing will look for a file in the current working directory called build.xml when you run it. This document tells Phing what it will be doing during the build. You can change this by using the -f or the -buildfile property of phing and giving the build file as the parameter. The following code makes phing look for a build file called wibble.xml.
phing -f wibble.xml
Assuming that the project is called myProject, then a minimal buildfile would be look like the following:
Yesterday I talked about creating some simple Flex elements in your application. Today I will introduce a new element called Script.
The Script element, if you haven't already guessed is used to run your application function and should be contained within the Application element. You can either put script inline like this.