PHP WinBinder 2: Introduction

 

UniServer 5-Nano
PHP WinBinder 2.

WinBinder Part 2

Introduction

I like alternatives and options! In my original WinBinder tutorial I avoided compiling because there was no real need and it would have introduced another level of complexity.

In reality that complexity is a myth because there is an excellent utility PHC-Win, a PHP compiler with WinBinder front end. All it takes is a few mouse clicks to compile a complete project this utility is an excellent piece of work by Andrew Fitzgerald “frantic”. All PHP files are compiled into a nativePHP format greatly reducing their size these are then compiled into a single file.

You may be wondering how this relates to UniServer? My original tutorial concluded with an alternative Uniform Server controller that is modifiable to meets your own requirements. However the tutorial skipped a need to explore programming Windows applications independent of Uniform Server.

To address this I have repackaged the newest release of WinBinder and converted it to be fully portable. For completeness included PHC-Win as a separate download. These are not strictly plugins however you will find them in the WinBinder plugin folder on SourceForge.

Top

WinBinder Portable

WinBinder portable is a repackaged verion of WinBinder for users that want a working version straight out of the box. Hence anything relating to compiling WinBinder has been removed. Folder structure changed to be more compatible with Uniform Server. The excellent documentation, examples and licence have been retained.

Hand positioning windows controls is tedious; WinBinder contains a “form editor” greatly reducing the tedium of this task. It takes a no frills approach, uses a minimalist interface hence extremely easy to use. Download is worth the effort just for this tool alone.

Top

Phc-win

In the previous tutorial compacting files into a single executable file bat_to_exe was used. Although this gets the job done each file needs to be extracted before the application can run. PHP files are not compiled hence their size remains unchanged.

PHC-Win on the other hand compiles each individual PHP file greatly reducing size. These along with any resource files are compacted into a single executable. Advantage of using PHC-Win total number of files to include in an application distribution is minimal.

Top

Download and Install

Note all download file names provide an indication of package content. Once downloaded these can be renamed. This tutorial assumes you will be installing on “C” drive and into a folder named “us_wb” you can chose any other location and folder name just substitute as appropriate in the tutorial description.

Top

WinBinder Portable

Portable WinBinder has been packaged in two file formats the “exe” is a 7z self-extracting archive while the “zip” archive requires manual extraction.

Depending on the file format choose one of the following installation methods:

exe:

  • Create a new folder us_wb and copy WinBinder_531VC6TS_FULL_1.0.exe to it.
  • To extract double click on file WinBinder_531VC6TS_FULL_1.0.exe
  • A new folder is created WinBinder_531VC6TS_FULL_1.0 rename this to wb (or any name you prefer)
  • To save space delete WinBinder_531VC6TS_FULL_1.0.exe

zip:

  • Create a new folder us_wb and copy WinBinder_531VC6TS_FULL_1.0.zip to it.
  • Extract all files to this current folder.
  • Navigate down to folder named WinBinder_531VC6TS_FULL_1.0 and rename to wb (or any name you prefer)
  • Move this folder up to us_wb
  • To save space you can delete file WinBinder_531VC6TS_FULL_1.0.zip. and folder WinBinder_531VC6TS_FULL_1.0

Note:

Folder structure:

c:\us_wb\'''wb''' - Top level

c:\us_wb\wb\docs           - Includes manual in chm and html format
c:\us_wb\wb\examples       - All WinBinder examples have a corresponding batch file
                             double click this file to run an example.
c:\us_wb\wb\form_editor    - The form editor allows you to quickly layout controls for a
                             windows application. To run double click on batch file
                             '''Run_form_editor.bat'''
c:\us_wb\wb\php            - PHP bineries and WinBinder files
c:\us_wb\wb\php\extensions - PHP dll's. Including '''php_winbinder.dll''' required for all
                             windows applications.
c:\us_wb\wb\php\include    - WinBinder files - Required for all applications
c:\us_wb\wb\php\resources  - Images used in examples. Optional, if you delete the
                             examples folder you can delete this folder. 
c:\us_wb\wb\us_tutorial    - Support files for this tutorial. 

Top

File download options

There are two file options VC6 or VC9 these refer to the compiler that was used to create the binaries. Reason for including both is to allow you to compare speed of your application when run on either.

Note: Uniform Server all components (Apache MySQL and PHP) currently uses VC6 binaries.

File option:

Like Uniform Server they only extract to a folder and sub-folders there is no install program hence nothing is placed in the registry. To uninstall just delete the folder and all it’s content.

Top

WinBinder extension compatibility

Please note the WinBinder extension php_winbinder.dll is compatible across a PHP series

that means the included dll will run on PHP versions 5.3.0, 5.3.1 and 5.3.2RC1 etc

Top

Phc-win

Phc-win has been packaged in two file formats the “exe” is a 7z self-extracting archive while the “zip” archive requires manual extraction.

Download from SourceForge.

Depending on the file format choose one of the following installation methods:

exe:

  • Create a new folder us_wb and copy V55_PHCWIN_531VC9TS_1.0.exe to it.
  • To extract double click on file V55_PHCWIN_531VC9TS_1.0.exe.
  • A new folder is created V55_PHCWIN_531VC9TS_1.0 rename this to phc (or any name you prefer)
  • To save space delete V55_PHCWIN_531VC9TS_1.0.exe

zip:

  • Create a new folder us_wb and copy V55_PHCWIN_531VC9TS_1.0.zip to it.
  • Extract all files to this current folder.
  • Navigate down to folder named V55_PHCWIN_531VC9TS_1.0 and rename to phc (or any name you prefer)
  • Move this folder up to us_wb
  • To save space you can delete file V55_PHCWIN_531VC9TS_1.0.zip and folder V55_PHCWIN_531VC9TS_1.0.


Folder structure:

c:\us_wb\'''phc'''             - Top level contains the executables

c:\us_wb\phc-winbinder-example - Includes an example application ready for compiling.

c:\us_wb\source                - Files used to create phc-win

c:\us_wb\us_example            - Uniform Server tutorial example

Top

File download options

Phc-win does not provide a VC6 version it is released with VC9 binaries only.

This is not a real restriction you must include binaries an application was compiled with.

PHC-Win does not install anything on your PC's system path or registry other than extracting to a folder. Hence the program is inherently portable. To uninstall just delete the folder and all it’s content.

Top

Acknowledgements

I would like to express my thanks to Alec Gorge "WinBinder forum name alecgorge" for allowing inclusion of his binaries.

Also may thanks to Andrew Fitzgerald (WinBinder Wiki name Frantik) for allowing publication of PHC-Win (I have made only a small modification essentially it remains unchanged)

The above two chaps are dedicated to the WinBinder project and its advancement.

Alec's binaries have been uploaded to mediafire for safekeeping:

Note 1:

This WinBinder forum thread source of original material

Note 2:

If you like scripting with PHP Alec published a full version of php5ts.dll where he statically compiled most of the PHP extensions including the kitchen sink it has a footprint of 3.8 MB. You also have a choice of using the mini version that has a footprint of 3MB.

Below a list of modules included:

Full Version - 3.8MB     Mini Version - 3MB

Core
PDO
Phar
Reflection
SPL
SQLite
SimpleXML
bcmath
bcompiler
bz2
calendar
com_dotnet
ctype
date
dom
ereg
exif

filter
ftp
gd
gettext
hash
iconv
json
libxml
mbstring 
mcrypt
mhash
mysql
mysqli
mysqlnd
odbc
openssl

pcre
pdo_mysql
pdo_sqlite
soap
sockets
sqlite3
standard
tokenizer
wddx
win32std
winbinder
xml
xmlreader
xmlwriter
zip
zlib

 

Core
PDO
Phar
Reflection
SPL
SimpleXML
com_dotnet
ctype
date
filter
ftp
gd
hash
iconv
json

libxml
mbstring
mcrypt
mhash
pcre
pdo_sqlite
soap
sockets
standard
tokenizer
win32std
winbinder
xmlwriter
zip
zlib

Hence the above forum thread is worth a visit.

Top

Summary

The real reason for including the above downloads is to provide a consistent reference source for Uniform Server users.

Specifically those users that would like to design and compile alternative control or other Windows application to run the servers or start associated applications.

Remainder of this tutorial provides a quick introduction to the above tools.

First to be covered is WinBinder portable.

Top