Monday Aug 25, 2008

Creating a PHP Project from a Subversion repository

I recently created a PHP project in NetBeans IDE 6.5 Beta based on the repository version of Mediawiki. To begin with, I looked up the Mediawiki wiki page on their Subversion repository. In my IDE, I installed both the Subversion plugin and the Subversion 1.5 for Windows client, available from the Plugins manager (Tools > Plugins). Then I went to Versioning > Subversion > Checkout and entered the URL.

Because I am not a Mediawiki developer, I left the username and password fields blank. If I had developer privileges, I would have entered my authorization credentials so I could later commit changes back to the Mediawiki repository. In the next panel of the checkout wizard, the IDE automatically filled out the Repository Folder field with the path to the phase3 folder. I accepted this default. Then in the local folder field, I specified the path to the web folder for my Xampp installation. This meant that the Apache server in my Xampp could immediately expose my checked out Mediawiki repository. I left all other fields and check boxes blank, which is the default setting.

When I clicked Finish, the IDE checked out the Mediawiki phase3 SVN repository correctly to my Xampp web folder, with the path G:/xampp/htdocs/phase3.

Next I completed the Mediawiki installation procedure as described in the Mediawiki installation guide:
  1. Prepare the directories.
  2. Create a database.
  3. Run the installation script.
Now I wanted to create a NetBeans project with this repository. I opened the New Project wizard and selected PHP Application with Existing Sources.

In the Name and Location panel, I browsed to the G:/xampp/htdocs/phase3 folder. I then selected "Put NetBeans metadata into a separate directory" This is so that no NetBeans metadata would be committed back to the Subversion repository. (I had no check in privileges in any case but wanted to test the feature.) I created a "mediawiki" folder in my NetBeansProjects directory for this purpose. I left all other fields at their default settings.

In the Run Configuration panel, I chose to run the project as a local web site, on my Xampp Apache server. I could instead have chosen to run the project on a remote FTP server or as a command-line script, as described in the Setting Up a PHP Project tutorial. Because I had already checked out the Mediawiki repository to my web folder, I did not need to copy source files to that location. So I left all fields at their default settings.

That was it! When I clicked Finish, the IDE created a PHP project out of the checked out Mediawiki repository. It took about 30 seconds to index all the files. From then on, I could use the IDE's PHP editing features to work on the project and its versioning features to update and commit my changes.

About

I'm a technical writer for NetBeans, covering web service support.

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today