Archive

Posts Tagged ‘install’

Install PHPDocumentor

January 21st, 2009 No comments

PHPDocumentor is a fast and convent way of creating API documentation for your PHP programs and classes. If you are familiar with the world of Java, it works in much the same way as the JavaDoc program, indeed, it is based on this program.

PHPDocumentor can be run in a number of different ways, but I have found that the easiest way is to, again, use PEAR to install everything you need. To install PHPDocumentor using PEAR use the following command.

phpdoc install phpdocumentor

To run PHPDocumentor and see a list of commands just type in the following:

phpdoc -h

To run PHPDocumentor you need to provide a couple of options, these are:

  • t The documentation directory (ie. where your documentation files will go).
  • o The output format (e. HTML, PDF etc), which is defined as output:converter:template directory.
  • d The directory (ie. where your source code files are).

Use the following syntax to run PHPDocumentor, using the above parameters.

C:\projectDir>phpdoc -t "c:\projectDir" -o HTML:default:default -d "c:\projectDir\docs"

The output format defined here is HTML, with the default style and format. This is as a document with frames and in the default style that the program uses. To see what sort of formats are available go to the PHPDocumentor install directory at <your PHP directory>\data\PhpDocumentor\phpDocumentor\Converters.

To get a different style on your PHPDocs use the following value for the -o parameter.

HTML:default:l0l33t

To create a PDF of your documentation use the following.

PDF:default:default

To product output that looks like the PHP home page use the following:

HTML:smarty:php

You might be asking how you get your PHP code to generate this documentation. Although this is not complicated, there is rather a lot to go over and so this will be the subject of a different blog post.

Categories: PHP Tags: , , , , , , ,

Installing PHPUnit

January 19th, 2009 No comments

PHPUnit is a powerful unit testing framework written in and for PHP. Rather than testing everything as a whole the idea behind PHPUnit is to test that everything works as it is expected to work before it is integrated into the rest of the program. In this way problems are found earlier rather than later and this makes fixing them a lot easier. With tests written for every small component of the program it is then possible to test the whole thing by running all of the tests at once. It is also possible to automate PHPUnit so that everything about a program is tested before it is built. If any tests fail then the build is stopped.

The best way to install PHPUnit is to use the PEAR installer. To install PHPUnit you first need to add the correct channel so that PEAR can find PHPUnit easily. You do this by typing the following into the command line.

pear channel-discover pear.phpunit.de

You can now install PHPUnit by using the following command.

pear install phpunit/PHPUnit

You can now test your install by trying to run PHPUni through the command line.

phpunit

If properly installed this command will print out usage and parameter information for PHPUnit.

You can see which version of PHPUnit is installed by using the –version parameter.

phpunit --version

For more information about PHPUnit take a look at the PHPUnit website.

Categories: PHP Tags: , , , ,

Getting And Installing Phing

January 2nd, 2009 No comments

To get Phing you will need to have PEAR installed along with PHP. On a Windows system you can install PEAR by running the go-pear.bat file and running through the prompts there.

To get Phing just run the following command.

pear install http://phing.info/pear/phing-current.tgz

You should see the install output looking like this:

downloading phing-current.tgz ...
Starting to download phing-current.tgz (361,527 bytes)
.........................................................................done: 361,527 bytes
install ok: channel://pear.php.net/phing-2.1.1

You can now run Phing by typing the following command:

phing

However, this will automatically try to find a file in the current directory called build.xml, and if it doesn’t find this file it will simply state the following:

Buildfile: build.xml does not exist!

Before stopping. This build.xml file (although it doesn’t have to be called this) is what controls what phing will do and is what you will spend most of your time looking at.

You can view which version of phing you are running by using the -v parameter.

phing -v

Which prints out something like:

Phing version 2.1.1

To view a list of available commands use the -h parameter.

phing -h

Which will print out:

phing [options] [target [target2 [target3] ...]]
Options:
-h -help print this message
-l -list list available targets in this project
-v -version print the version information and exit
-q -quiet be extra quiet
-verbose be extra verbose
-debug print debugging information
-logfile <file> use given file for log
-logger <classname> the class which is to perform logging
-f -buildfile <file> use given buildfile
-D<property>=<value> use value for given property
-find <file> search for buildfile towards the root of the
filesystem and use it
 
Report bugs to <dev@phing.tigris.org>

Categories: PHP Tags: , , , ,

Drupal

November 24th, 2008 No comments

Drupal is a CMS system that can be freely downloaded and used from the Drupal website. It is not an object orientated PHP driven system and so everything is available through function calls and variables.

Drupal

I have heard that the learning curve on developing Drupal is quite steep, but once you get around this initial hurdle the whole thing is pretty simple. This ease of development means that it is possible to take an idea and use Drupal and all its features as the CMS behind your idea, thus saving you time on your project development.

Drupal works in a kind of framework pattern in that you need to create files and folders in order to extend or overwrite the existing functionality, which is already quite extensive. This can trip up a lot of developers who are new to the system. My recommendation is to get someone to explain the initial steps to you and and then try it out for yourself. However, there is plenty of documentation available on the Drupal website.

From visiting the Drupal website to having a working version of the system on a test server took me literally 10 minutes, including the time it took to download and upload the files. I have used WordPress extensively in the past, but have always found that it can only be customized to a certain extent before you need to start hacking the source code. Although this is getting better with newer versions of Worpress I will be using Drual in my next website build.

Categories: Websites Tags: , , , , ,

Installing Flex 3 On Windows

November 3rd, 2008 1 comment

Flex is a powerful SDK that allows you to build Flash applications that can then be embedded into any web page. The SDK is that Flex uses quite large and covers a whole range of things from interface controls to data processing. To program in Flex you need to use ActionScript 3. What Flex creates as output is swf files, which can be run separately or embedded into a web page.

To get started you will need the Flex SDK. Download the Flex SDK 3 zip file and extract it into a directory where you can get to it. As an example, I put mine in C:\dev\flex_sdk_3.

Next, you will need something to compile your SDK applications. You could use the Adobe Flex Builder application, but since this is a commercial product it will set you back quite a bit of money. A very good alternative is to use FlashDevelop, which is a free, open source, Flex IDE. I have used it quite extensively and it definitely does the job.

Download FlashDevelop from the site and install it. You will then need to point FlashDevelop to your Flex SDK files. To do this run the IDE and go to Tool->Program Settings, you can also press F10 to get the same menu up. Click on AS3Context in the left hand menu and enter the path to the Flex SDK directory in the Flex SDK Location box. The screenshot below has the dialog box you need open, with the appropriate box filled in.

You will now need to create a new Flex 3 project, which will use the correct Flex SDK to create your application. To do this click on Project in the menu and then click New Project…, which will open a dialog. Scroll down this dialog until you find the section marked ActionScript 3, and select Flex 3 Project. Next, enter a name for your project, define a location and click OK.

Flex create new project

Flex create new project

This will create a directory in the place you stipulated that contains three folders (bin,obj and src) and a file called your_project_name.as3proj. The folder src will contain a file called Main.mxml, which is the name application file that controls everything else.

One final thing you will need is a special version of Flashplayer that will send messages back to your IDE. This is called the Flash debugging version is available from the Adobe website.

You will now need to point FlashDevelop at the debugging version of Flash. Unzip the file that you have downloaded from Adobe (which should be something like sa_flashplayer_9_debug.exe) and place it into a directory that you can get hold of. I put this file into the same folder as before (so as to keep everything in one place). Next open up the options menu again and go to the FlashViewer option in the left menu. Enter the file that you have downloaded.

Flex Flash debug setup

Flex Flash debug setup

So what next? Well I over the next few posts I am going to run through how to create simple applications and also how to solve some common problems that I have encountered whilst using Flex.

Categories: Flex Tags: , , , , , ,