PHP WinBinder: Overlay
|
UniServer 5-Nano PHP WinBinder. |
WinBinder Overlayed on Uniform Server
A penalty of using this plugin is a significant increase in the UniServer directory size. The plugin duplicates code that is already installed in the core.
If you check the size of folder UniServer\plugins\winbinder\php, you'll see it's around 9.8 MB, which is a significant hit. The solution is to copy files required for WinBinder to UniServer’s core and delete the above folder.
Copy files to core
Copy these folders and files to Uniform Server’s core:
- Copy folder UniServer\plugins\winbinder\php\include to follder UniServer\usr\local\php
- Copy folder UniServer\plugins\winbinder\php\resources to follder UniServer\usr\local\php
- Copy file UniServer\plugins\winbinder\php\extensions\php_winbinder.dll to folder UniServer\usr\local\php\extensions
- Copy file UniServer\plugins\winbinder\php\php-wb.ini to folder UniServer\usr\local\php
- Delete folder UniServer\plugins\winbinder\php
Adjust paths
Having moved folders and files, our examples will fail. Paths need to match the new configuration. Let's modify test9 to this new configuration.
Batch file
Edit file UniServer\test_9_final.bat (If it does not exist, copy it from folder UniServer\plugins\winbinder\alt_con_1)
Change this code:
cd plugins\winbinder\alt_con_1 ..\php\php.exe -c ..\php\php-wb.ini test_9.phpw
To:
cd plugins\winbinder\alt_con_1 ..\..\..\usr\local\php\php.exe -c ..\..\..\usr\local\php\php-wb.ini test_9.phpw
PHP Script
Edit file UniServer\plugins\winbinder\alt_con_1\test_9.phpw
Change this code:
<?php Include "../php/include/winbinder.php"; // Location Of Winbinder Library
To:
<?php Include "../../../usr/local/php/include/winbinder.php"; // Location Of Winbinder Library
Summary
Using WinBinder, I have show how to create an alternative controller for running the servers in standard program mode.
For running the servers as a service, you can add this functionality by adding a tab control. This will allow you to switch between standard and service.
The drop down menu allows you to quickly add additional functionality.
Conclusion
This tutorial has shown how to use WinBinder for producing Windows application coded in PHP.
If you do not like Uniform Server’s control interface, you now have the tools to create your own.
WinBinder remains an excellent PHP module for quickly programming windows applications.
Follow up tutorial.
Manually positioning controls is tedious. WinBinder has an excellent tool called "form editor" that removes this tedium. Scripts can become large, especially if you document code. The code packaging technique covered in this tutorial does not compile or reduce code size, however there is an excellent tool called PHC-Win that does.
Tutorial 2 covers both PHC-Win and "form editor". PHC-Win has been packaged in Uniform Servers format and WinBinder repackaged for portability. It includes "form editor" and original examples; these are separate downloads.