Difference between revisions of "PHP WinBinder 2: Introduction"

From The Uniform Server Wiki
Jump to navigation Jump to search
(Proofreading and grammatical changes; some minor reformatting)
Line 2: Line 2:
 
'''''WinBinder Part 2'''''
 
'''''WinBinder Part 2'''''
 
== Introduction ==
 
== Introduction ==
I like alternatives and options! In my original [[PHP WinBinder: Introduction | WinBinder tutorial]] I avoided compiling because there was no real need and it would have introduced another level of complexity.
+
I like alternatives and options! In my original [[PHP WinBinder: Introduction | 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.  
+
In reality that complexity is a myth, because there is an excellent utility called PHC-Win, a PHP compiler with a 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.
+
You may be wondering how this relates to UniServer? My original tutorial concluded with an alternative Uniform Server controller that is modifiable to meet 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.
+
To address this I have repackaged the newest release of WinBinder and converted it to be fully portable. For completeness, I included PHC-Win as a separate download. These are not strictly plugins, but you will find them in the WinBinder plugin folder on SourceForge.
  
'''''[[#top | Top]]'''''
 
 
=== WinBinder Portable ===
 
=== 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.
+
WinBinder portable is a repackaged version of WinBinder for users that want a working version straight out of the box. Hence anything relating to compiling WinBinder has been removed. The folder structure was 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.
+
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 and is extremely easy to use. Downloading it is worth the effort just for this tool alone.
  
'''''[[#top | Top]]'''''
 
  
 
=== Phc-win ===
 
=== Phc-win ===
In the previous tutorial compacting files into a [[PHP WinBinder: Project2#Create a single EXE file | '''single executable''']] file [[PHP WinBinder: Project#Create an EXE 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.
+
In the previous tutorial, compacting files into a [[PHP WinBinder: Project2#Create a single EXE file | '''single executable''']] file, [[PHP WinBinder: Project#Create an EXE 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, so 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.
+
PHC-Win on the other hand compiles each individual PHP file, greatly reducing their size. These along with any resource files are compacted into a single executable. The advantage of using PHC-Win is that the total number of files included in an application distribution is minimal.
  
 
'''''[[#top | Top]]'''''
 
'''''[[#top | Top]]'''''
  
 
== Download and Install ==
 
== 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.
+
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 choose any other location and folder name; just substitute as appropriate in the tutorial description.
  
'''''[[#top | Top]]'''''
 
 
=== WinBinder Portable ===
 
=== 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.
 
Portable WinBinder has been packaged in two file formats the “exe” is a 7z self-extracting archive while the “zip” archive requires manual extraction.
Line 70: Line 67:
  
 
</pre>
 
</pre>
'''''[[#top | Top]]'''''
 
 
==== File download options ====
 
==== 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.
+
There are two file options: VC6 or VC9. These refer to the compiler that was used to create the binaries. The reason for including both is to allow you to compare the speed of your application when run on either.
  
'''''Note'':''' Uniform Server all components (Apache MySQL and PHP) currently uses VC6 binaries.
+
If you are using PHP with Apache 1 or Apache2 from apache.org you need to use the VC6 versions of PHP
 +
 
 +
VC6 Versions are compiled with the legacy Visual Studio 6 compiler. 
 +
VC9 Versions are compiled with the Visual Studio 2008 compiler. The VC9 versions require you to have the Microsoft 2008 C++ Runtime (x86) or the Microsoft 2008 C++ Runtime (x64) installed. 
 +
 
 +
'''''Note'':''' In Uniform Server, all components (Apache, MySQL and PHP) currently use VC6 binaries.
  
 
'''''File option'':'''
 
'''''File option'':'''
Line 80: Line 81:
 
* [http://sourceforge.net/projects/miniserver/files/Plugins/UniServer%2055-Nano%20Plugins/WinBinder/winbindervc9/ WinBinder_531VC9TS_FULL_1.0] - PHP version 5.3.1 VC9 Thread safe
 
* [http://sourceforge.net/projects/miniserver/files/Plugins/UniServer%2055-Nano%20Plugins/WinBinder/winbindervc9/ WinBinder_531VC9TS_FULL_1.0] - PHP version 5.3.1 VC9 Thread safe
  
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.  
+
Like Uniform Server they only extract to a folder and sub-folders. There is no install program, so nothing is placed in the registry. To uninstall, just delete the folder and all its content.  
  
'''''[[#top | Top]]'''''
 
 
==== WinBinder extension compatibility ====
 
==== WinBinder extension compatibility ====
  
Please note the WinBinder extension '''php_winbinder.dll''' is compatible across a PHP series
+
Please note that 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.
that means the included dll will run on PHP versions 5.3.0, 5.3.1 and 5.3.2RC1 etc
 
 
 
'''''[[#top | Top]]'''''
 
  
 
=== Phc-win ===
 
=== Phc-win ===
Line 125: Line 122:
  
 
</pre>
 
</pre>
'''''[[#top | Top]]'''''
+
 
 
==== File download options ====
 
==== File download options ====
Phc-win does not provide a VC6 version it is released with VC9 binaries only.
+
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.
+
This is not a real restriction, but you must include the 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.
+
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 its content.
  
 
'''''[[#top | Top]]'''''
 
'''''[[#top | Top]]'''''
  
 
== Acknowledgements ==
 
== Acknowledgements ==
I would like to express my thanks to Alec Gorge "WinBinder forum name alecgorge" for allowing inclusion of his binaries.
+
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)
+
Also may thanks to Andrew Fitzgerald (WinBinder Wiki name Frantik) for allowing publication of PHC-Win (I have made only a small modification; it essentially it remains unchanged).
  
 
The above two chaps are dedicated to the WinBinder project and its advancement.
 
The above two chaps are dedicated to the WinBinder project and its advancement.
Line 148: Line 145:
 
'''''Note 1'':'''
 
'''''Note 1'':'''
  
This WinBinder [http://winbinder.org/forum/viewtopic.php?f=10&t=1058 '''forum thread'''] source of original material
+
This WinBinder [http://winbinder.org/forum/viewtopic.php?f=10&t=1058 '''forum thread'''] is the source of original material.
  
 
'''''Note 2'':'''
 
'''''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.
+
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:
+
Below is a list of modules included:
 
{|
 
{|
 
|-
 
|-
Line 253: Line 250:
 
The real reason for including the above downloads is to provide a consistent reference source for Uniform Server users.
 
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.
+
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.
 
  
 +
The remainder of this tutorial provides a quick introduction to these tools. 
 
First to be covered is [[PHP WinBinder 2: WinBinder portable | '''WinBinder portable''']].
 
First to be covered is [[PHP WinBinder 2: WinBinder portable | '''WinBinder portable''']].
  

Revision as of 22:33, 29 January 2010

 

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 called PHC-Win, a PHP compiler with a 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 meet 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, I included PHC-Win as a separate download. These are not strictly plugins, but you will find them in the WinBinder plugin folder on SourceForge.

WinBinder Portable

WinBinder portable is a repackaged version of WinBinder for users that want a working version straight out of the box. Hence anything relating to compiling WinBinder has been removed. The folder structure was 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 and is extremely easy to use. Downloading it is worth the effort just for this tool alone.


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, so their size remains unchanged.

PHC-Win on the other hand compiles each individual PHP file, greatly reducing their size. These along with any resource files are compacted into a single executable. The advantage of using PHC-Win is that the total number of files included 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 choose any other location and folder name; just substitute as appropriate in the tutorial description.

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. 

File download options

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

If you are using PHP with Apache 1 or Apache2 from apache.org you need to use the VC6 versions of PHP

VC6 Versions are compiled with the legacy Visual Studio 6 compiler. VC9 Versions are compiled with the Visual Studio 2008 compiler. The VC9 versions require you to have the Microsoft 2008 C++ Runtime (x86) or the Microsoft 2008 C++ Runtime (x64) installed.

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

File option:

Like Uniform Server they only extract to a folder and sub-folders. There is no install program, so nothing is placed in the registry. To uninstall, just delete the folder and all its content.

WinBinder extension compatibility

Please note that 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.

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

File download options

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

This is not a real restriction, but you must include the 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 its 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; it 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 is the 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 is 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.

The remainder of this tutorial provides a quick introduction to these tools. First to be covered is WinBinder portable.

Top