 |
| View previous topic :: View next topic |
| Author |
Message |
duez1981
Joined: 28 Aug 2007 Posts: 6 Location: Kenya in Africa
|
Posted: Wed Oct 03, 2007 6:31 pm Post subject: How can i develop a php-gtk2 client server application? |
|
|
Hi, This is Yonny, i must say that gnope has been really great in for me to learn php-gtk2, i've got a little situation i'd like you to help me to sort out
i developed a student management system that tracks students progress especially their examination grades. This system currently runs on php and mysql. basically the system is web based, or runs on an intranet.
i would like to redo the system with php-gtk2, i guess this is what i'd use to develope the client side. Since this application will run on several different computers, i'd like to have a centralized database(of course MySQL database server) for storing information, and use my client side php-gtk2 application to enter, view, modify and delete data.
My question is:
1. since the database will keep growing and growing, will this be to much for the client side application to handle? interms of extracting data from the database e.g 1000 entries of student name, and exam grades, generate reports etc?
will this load the database server machine or the client side application?
2. Do i need to develop a seperate server software for my application that extracts data from the database and sends/updates them to the client application on the client side?, could this be double work? if not, which softwares/languages can i use to develop the server? so far, am only good in php, php-gkt2, javascript, do i need to learn any other kind of language? or can i use php and php-gtk2?
3. What is the best approach for handling such kind of project, what i really wanted is a client side GUI application, but note that the client application will have users login with different rights, e.g users for data entry, administrators for configuration certain aspects of the system e.g years, exams to be done, terms or semesters, e.t.c, and users who can generate reports e.g students progress report for a certain year, a whole class report, a specific subject report etc
4. Can i extract complex sql queries(e,g using joins) from within php-gtk2 applications and output them on GtkListView. |
|
| Back to top |
|
 |
rgljr
Joined: 10 Apr 2006 Posts: 15 Location: Minnesota, USA
|
Posted: Thu Oct 11, 2007 11:39 pm Post subject: php-gtk2 and mysql |
|
|
Php-gtk2 provides all the features of php in so far as mysql database access. It uses the same calls you are already using in you web based version. If yoou is running as a web applicaiton now, the majority of the actual data base manipulation should transport to php-gtk2 as is (i.e. queries, database open, etc. ). The parts that will need a lot of work are the GUI. Glade will help with actually formatting the display. In the web interface model the browser does a lot of the formatting for you. That will all have to be replaced wih new code to take the data from the mysql query data and format it to work in PHP-GTK2 graphical display elements (i.e. GtkListStore and GtkTreeModel).
I have only translated a single application but what I ran into was that I once I had the basic functionality up and I ended up adding to and changing the mysql database manipulation because of the new GUI design of my PHP-GTK-2 application. Some things were handled by PHP-GTK2 that I had code written for (i.e. Sorting tables and redisplaying them) Others were new functions to take advantage of the new things I could do with PHP-GTK2 that I could not easily do with the web interface.
I eventually ended up moving off of mysql to the PHP built in SQLite database, but my application may not grow as much as you have indicated that yours might. For me moving to the PHP5 built in SQLite database meant that my application was standalone. It nolonger required any servers or server application installation. |
|
| Back to top |
|
 |
duez1981
Joined: 28 Aug 2007 Posts: 6 Location: Kenya in Africa
|
Posted: Fri Oct 12, 2007 9:01 am Post subject: |
|
|
| Thanks alot rgljr, i need to know one more thing, since my database will grow enoumously, but mysql database is actually a server application. Do i need to write my own server application say in php cli, that interfaces(sits between) mysql database and my client side php-gtk2 application for handling sql queries? is it really necessary? |
|
| Back to top |
|
 |
rgljr
Joined: 10 Apr 2006 Posts: 15 Location: Minnesota, USA
|
Posted: Sat Oct 13, 2007 3:24 am Post subject: |
|
|
I would think that a single app would be fine, but I can't say for sure.
As your app is web based now the PHP code is being run on the server. Depending on the web server in use and the number of users on the web server at the same time the app being run it is likely using only a portion of the servers cpu capacity. The real work as the database grows tends to be more fo a mysql server issue than an app issue.
The mysql searches are a separate issue. As the database searches grow in size the computer that is serving as a mysql database engine will require more and more cpu performance. Generally the mysql server is where the performance is needed not in the php-mysql interface unless you are doing most of your database logic in php and not making use of the mysql queries to do the work. You might look into some of the more advanced mysql queries available if you are concerned about performance.
If the PC that will be running the PHP-GTK2 app is realitively new the CPU performance should not be an issue in so far as the php code goes. IF you split the app and still run both parts of it on the same PC you won't be helping out the problem if fact with all the handshake back and forth between the two applications you might end up using more CPU.
Your app might reach a point where it is more efficient to have computer dedicated to the php-gtk application and a separate machine dedicated as a mysql database server. Taking the need for the web server and php code off of the server and running the php-gtk2 app on a separate machine to handle the gui should actually increase cpu performance. It really depends on the amount of database activity. Numbers of records really only affects search type operations not insertion, modification, and deletion of records. Proper use of indexes in mysql can really make a difference for large databases.
Even on a single machine the efficiency you pick up by using PHP-GTK2 for your application instead of using a web server and a browser may buy you some headroom for the increased database activity.
If you haven't guessed by now the question is complicated and not one that someone can give you an exact answer to. Maybe someone else could comment about it more.
After you get your application working you may want to look at Priado Blender. As I understand what it does, it takes your php-gtk2 code translates it to byte code and attaches it to the php interpreter creating a exe file. By eliminating the PHP interpreters translation to byte code it affectively speeds up your application as well. It is not as good as compiling the php-gtk2 code, but it is a good start. Priado Blender with PHP-GTK2 support is currently in beta release, but then so is PHP-GTK2. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
 |