Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Welcome, Guest. Please login or register.
March 27, 2017, 07:31:19 AM
Home Help Search Login Register
News: ATTENTION: Spambots must die! Humans must visit http://contact.futurescale.com to request forum access.
Pages: [1]
Print
Author Topic: Employee Admin for PHP  (Read 6785 times)
SasaT
Newbie
*
Posts: 7


View Profile
« on: January 15, 2011, 03:53:40 AM »

I've ported the Employee Admin Demo over to PHP using PHP-GTK for user interface. Not what most would expect from a PHP app, but it wouldn't be the same on the server side and I wanted the code to be as close to AS3 implementation as possible. If you want to try it and you're running Windows, the easiest way to get it working is to download a bundle from the PHP-GTK website — simply unzip and run.

Source

Screenshot (running on Ubuntu)
Screenshot (running on Windows XP)
Logged
Tekool
Sr. Member
****
Posts: 192


View Profile WWW
« Reply #1 on: January 15, 2011, 04:20:16 AM »

Interesting idea! I have made three or four ports of this demo to different languages, I know this take time to make it work correctly, so congrats! I only have tried once to run a PHP GTK application a long time ago. It isn't possible to bundle the application, GTK and PHP without to have to install anything? No packager have been made in this goal? To be honest I not had time to install/configure GTK/PHP to let it run, I surrender, but I'm sure everyone interested in will appreciate your work.
Logged
SasaT
Newbie
*
Posts: 7


View Profile
« Reply #2 on: January 15, 2011, 04:40:59 AM »

It isn't possible to bundle the application, GTK and PHP without to have to install anything? No packager have been made in this goal? To be honest I not had time to install/configure GTK/PHP to let it run, I surrender, but I'm sure everyone interested in will appreciate your work.

Well, I'm not a Windows regular but I got the bundle working immediately. No install, no dependencies, just unzip & run. Btw. I've seen your ports, they've been helpful to me. Smiley
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2860



View Profile WWW
« Reply #3 on: January 15, 2011, 10:06:30 AM »

Thanks for your hard work, this looks very good! About time we had another PHP demo. I'll try to get a repo/trac installation in place shortly for this. If you could post some info about requirements to run the thing it would be extremely helpful.

Here's what I went through:

  • I installed "php-gtk-2.0.1 Windows binary pack" from the http://gtk.php.net/download.php page, and unzipped, yielding C:\php-gtk2
  • I unzipped your http://mindframes.org/pmvc/EmployeeAdmin_PHP_GTK_1_0.zip into that folder yielding:
    C:\php-gtk2\EmployeeAdmin which is sibling to C:\php-gtk2\demos so I figured it should be able to run from there.
  • I associated php-win.exe with the .php extension by opening windows explorer, right clicking on one of the demos C:\php-gtk2\demos\stock-browser.php selecting 'Open with...' and choosing C:\php-gtk2\php-win.exe
  • At this point, the php-gtk demos all seem to open fine. However if I try to open EmployeeAdmin.php it doesn't complain, but doesn't launch.
  • Looking at your libs folder, I see there's no PureMVC_PHP.php
  • Looking at the PureMVC PHP project, I see why. We need a library file. Is there a utility similar to what the JavaScriptians use to put all the classes in a file, and remove extraneous spaces and returns (minify)?
  • So, for now I downloaded the PHP port from http://puremvc.org/pages/downloads/PHP/PureMVC_PHP.zip and unzipped to the desktop.
  • Navigated down to PureMVC_PHP_1_0_2\org\puremvc\php
  • Moved the patterns, core and interfaces folders into C:\php-gtk2\EmployeeAdmin\org\puremvc\php
  • Right clicked on EmployeeAdmin.php, selected Open, and voila! The demo runs perfectly!
So, clearly we will either need to figure out how to create a library file for inclusion in PHP projects, it's a great hinderance to have to handle it this way. That's not your fault of course, it's just the project owner hasn't gotten around to it. If you know of a good tool for doing this, please let me know.

Otherwise I will create a repo with the PureMVC classes included in the tree, so that users don't have so much hassle getting it running.

Again, I want to thank you contributing this and for packaging it and including the attribution comments, it speeds the process along greatly when contributors follow the patterns.

Cheers,
-=Cliff>
Cheers,
-=Cliff>
Logged
SasaT
Newbie
*
Posts: 7


View Profile
« Reply #4 on: January 15, 2011, 03:56:11 PM »

Looking at the PureMVC PHP project, I see why. We need a library file. Is there a utility similar to what the JavaScriptians use to put all the classes in a file, and remove extraneous spaces and returns (minify)?

So, clearly we will either need to figure out how to create a library file for inclusion in PHP projects, it's a great hinderance to have to handle it this way. That's not your fault of course, it's just the project owner hasn't gotten around to it. If you know of a good tool for doing this, please let me know.

Oh, I thought I wasn't supposed to include dependencies. Now I see what ‘libs’ directory is for. PHP CLI has a built in whitespace/comment stripper. You concatenate the files by hand or with a tool and run: php -w source.php

I've repackaged the demo, now it includes minified PureMVC sources.

New package
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2860



View Profile WWW
« Reply #5 on: February 20, 2011, 05:20:34 PM »

Hi all,

Happy to announce this latest EmployeeAdmin port has a home in the project repo. Codesion will be applying the template shortly, so forgive the appearance of the page for the next 24 hours or so.

http://trac.puremvc.org/Demo_PHP_GTK_EmployeeAdmin

Cheers,
-=Cliff>

@SasaT thanks so much for minifying the framework, next task is to make that available as a separate download.
Logged
SasaT
Newbie
*
Posts: 7


View Profile
« Reply #6 on: February 21, 2011, 05:53:47 AM »

Sweet!

Btw. this new thread is wrongly titled: http://forums.puremvc.org/index.php?topic=1882.0

It should be PHP/PHP-GTK and not Python/wxPython, obviously. Wink
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2860



View Profile WWW
« Reply #7 on: February 21, 2011, 08:45:33 AM »

Sorry for the misnaming. You can probably guess the post I copied over the title from Smiley

-=Cliff>
Logged
Pages: [1]
Print
Jump to: