Jump to navigation Jump to search

PHP WinBinder: Introduction

358 bytes removed, 13:00, 29 January 2010
Proofreading and grammatical changes; some minor reformatting
PHP’s command line interface “CLI” is extremely powerful, however using a command window for user interfacing is restrictive. An ideal solution would be to use a Windows interface.
WinBinder provides a neat solution to the above. It remains actively supported by the open source community. Of importance , the WinBinder extension '''php_winbinder.dll''' is being compiled for new versions of PHP (currently 5.3.1) , hence WinBinder is alive and kicking.
This plugin uses WinBinder to provide a PHP CLI Windows interface. It intentionally does not include a compiler, if . If you wish to produce standalone code , check out this page [[PHP WinBinder 2: PHC-Win | '''PHC-Win''']].
Windows applications are generally coded in “c” “C”, so before they can be executed require compiling, they must be compiled. In contrast this self-contained plugin uses WinBinder , allowing an application to be coded in PHP. This has the advantage of providing a common language for web-design, control architecture and user interface. It eliminates the need to learn a new language.
This The WinBinder plugin is self-contained allowing it to be run independently of Uniform Server. However it is designed to fit neatly into Uniform Server’s control architecture thus providing an [[PHP WinBinder: Alternative control 1 | alternative control interface]]. If space is at a premium the plugin can be overplayed overlayed onto Uniform Server allowing it to use the existing PHP core (VC6).
During development , windows scripts are run using a batch file. This batch file can be converted to an .exe using a small utility program included with this the plugin.
== Tutorial ==
This tutorial explains how to use the plugin and introduces some basics of windows programming using WinBinder.
An emphasis is on scripting hence , so I have avoided the complexity of compiling a windows application. Even with this restriction you can deploy a single file windows application ; all necessary files are compacted compressed using the included utility.
Tutorial The tutorial format is based around working examples; first basic principals principles are explained , followed by a working script you can run.
'''''[[#top | Top]]'''''
=== Topics covered ===
[[PHP WinBinder: Basic IO | '''Basic IO''']] introduces two windows components '''Labels''' and '''Push button'''.
Label text can be dynamically changed hence provide , providing user feedback.
The example shows how to change text using a push button and
introduces the Handler Function (callback function).
introduces the Handler Function (callback function).
'''''[[#top | Top]]'''''
[[PHP WinBinder: Text input | '''Text input''']] allows a user to enter either a text string or numeric data.
Included is the "draw rectangle " function this . This can be used for user feedback.
Introduces a control's style parameter.
'''''[[#top | Top]]'''''
==== Tab Control 1 ====
[[PHP WinBinder: Tab Control | '''Tab Control''']] allows a designer to split a single page application that has
become too visually crowded into smaller logical pages.
==== Tab Control 2 ====
[[PHP WinBinder: Tab Control 2 | '''Tab Control 2''']] Looks at coding style Handles and ID’s concludes
with a working template.
==== Tab Control 3 ====
[[PHP WinBinder: Tab Control 3 | '''Tab Control 3''']] Covers adding cosmetics (static controls) a logo (icon)
and some additional functionality to produce a specific application template.
==== Project 1 ====
[[PHP WinBinder: Project | '''Project 1''']] This page looks at creating a separate Windows application
independent of Uniform Server. Applications produced using this method,
 are not compiled hence are not standalone executables they . They require 
several support files.
That said , they are easy to program using PHP and Winbinder
'''''[[#top | Top]]'''''
==== Project 2 ====
[[PHP WinBinder: Alternative control 2 | '''Project 2''']] This page looks at Bat_To_Exe Converter from
Fatih Kodak combined with WinBinder produces a windows application coded in PHP without the need for compiling.
Fatih Kodak combined with WinBinder produces a windows application coded in PHP without the need for compiling. An entire windows project can be distributed and run as a single (exe) file.
Uniform server 4-Mona series introduced UniController a simple Windows
program written in C to control both Apache and MySQL servers.
This page looks at converting this application into a WinBinder script.
'''''[[#top | Top]]'''''
It covers starting and stopping Apache and MySQL servers from a windows
application. It introduces the timer control and concludes with a fully
functional server.
'''''[[#top | Top]]'''''
=== Alternative control 3 ===
[[PHP WinBinder: Alternative control 3 | '''Alternative control 3''']] Adding functionality to buttons Logs, Edit and Test
requires access to several files that in turn require additional buttons. At a
later date you may require that extra button! Solution is to replace the three
buttons with a drop down menuthis requires minimal changes and offers
'''''[[#top | Top]]'''''
'''''[[#top | Top]]'''''
=== Alternative control 4 ===
[[PHP WinBinder: Alternative control 4 | '''Alternative control 4''']] WinBinder has a few limitations most of which can be worked around. One limitation, there is no direct way to detect that an application has been restored from the tray menu this page provides a solution.
| ||'''bat2exe'''|| ||Bat to exe converter folder|| 
| ||  Bat_To_Exe_Converter.exe|| ||Utility program that converts bat to exe||From Fatih Kodak
| ||  Help [English].chm|| ||Utility documentation||From Fatih Kodak
| || ||'''extensions'''||PHP extensions folder|| 
| || ||  php_winbinder.dll||WinBinder extention||From ; see above.
| || ||  php_curl.dll|| ||From PHP 5.3.1
| || ||'''resources'''||WinBinder image resources folder|| From
'''''[[#top | Top]]'''''
=== Adding PHP extensions ===
* Copy additional PHP extensions to folder UniServer\plugins\winbinder\php\'''extensions'''
Add lines similar to the first line (enables an extension)
'''''[[#top | Top]]'''''
=== Modification to winbinder.php ===
When WinBinder was written , PHP 5.3.1 did not exist hence the file UniServer\plugins\winbinder\php\include\'''winbinder.php''' 
has been modified to remove PHP version checking. The following section was removed:
== Plugin Components ==
This section is included for completeness, it . It provides details on where to obtain the plugin components.
'''''[[#top | Top]]'''''
=== Bat To Exe Converter ===
A utility to convert a batch file to an executable.
Although not open source, it is an excellent freeware utility.
Although not open source is an excellent freeware utility.  Download [ Bat To Exe Converter] version date , dated 18.02.2009
'''''[[#top | Top]]'''''
=== WinBinder ===
WinBinder is an extension to PHP for building native Windows graphical user interfaces.
Although currently at alpha design stage, it is fully functional. A minor change is required to disable the PHP version check.
Although currently at alpha design stage is fully functional. A minor change is required to disable PHP version check. Uniform Server's WinBinder plugin is a minimal solution see . See the download for a complete version of WinBinder.
Download []
'''''[[#top | Top]]'''''
=== DLL ===
A core component of WinBinder is the PHP extension '''php_winbinder.dll'''
Be sure you use a compiled extension that matches the version of PHP.
Depending on the PHP version you use ensure you use a matching compiled extension. Your first port of call is [] .
Check out [ this page] for a compatible version.
* Binary The binary used in this plugin was compiled by Alec Gorge "(WinBinder forum name "alecgorge" ) (Sun Dec 13, 2009 4:05 am) found on the above page
* Download page
* Compiled for PHP 5.3.1 V6 TS
Alec's web site is [ Ramblingwood] '''''[[#top | Top]]'''''
=== PHP ===
Depending on your Windows application requirements you may require additional extensions hence its worth downloading a full version of PHP.
'''''[[#top | Top]]'''''
== Summary ==
The above introduced introduction to WinBinder and shows how easy the plugin is to install.
Each Windows application starts with a basic script (template) covered on the [[PHP WinBinder: Template | '''next page''']].

Navigation menu