Changes

Jump to navigation Jump to search

PHP WinBinder: Project

22 bytes added, 18:28, 29 January 2010
Proofreading and grammatical changes; some minor reformatting
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.
|-valign="top"
|
# Create a new folder for . For example '''c:\project1''' – Can be any name and location you like
# Copy folder UniServer\plugins\'''winbinder''' to folder c:\'''project1'''
# Copy file C:\project1\winbinder\examples\'''test_4.bat''' to folder c:\'''project1''' – Runs your application ; rename if you like# Copy file C:\project1\winbinder\examples\'''test_4.phpw''' to folder C:\project1\'''winbinder''' – this folder will contain all your script files, ; rename file test_4.phpw if you like
# Delete folders C:\project1\winbinder\'''doc''' and C:\project1\winbinder\'''examples''' these are not required
# That completes the project structure (see image on right).
Include "php/include/winbinder.php"; // Location Of Winbinder Library
</pre>
 
'''''[[#top | Top]]'''''
 
== Test ==
Check that the configuration works by running test_4.bat
You now have a working project template use . Use this to develop your application.
'''''[[#top | Top]]'''''
 
== New batch file ==
After completing your application , create a new batch file named '''test_5.bat''' (or any name you like) with the following content:
<pre>
start winbinder\php\php-win.exe -c winbinder\php\php-wb.ini winbinder\test_4.phpw
</pre>
When run , it will automatically close the command window and start your application.
'''''[[#top | Top]]'''''
 
== Create an EXE file ==
Using a batch file to start your windows application produces an annoying flicker as the command window opens and closes. This can be avoided by converting the batch file to an executable it . It also provides an opportunity of for personalising the file by including your own icon.
{|
|-valign="top"
|
'''''Note'':''' Steps G) and H) are optional and only required if using an icon for the exe file.
'''''Test EXE file'':'''
Navigate to folder C:\project1 and double click on the file created : '''test_5.exe'''
If you wish you can delete files test_4.bat and test_5.bat they . They are no longer required.
== Summary ==
The above has shown how to create an independent windows application project. Your PHP script or scripts can be run using an executable file however you do still require all the additional support files.
If you want a single executable file , the only way to do this is compile the project. However there is an alternative! It is more a slight sleight of hand where you compact all the necessary files into a single executable file.
I mentioned the included utility was small and powerful, ; it has the ability to perform the above. To implement this method requires a flat file structure this . This is covered in project 2 on the [[PHP WinBinder: Project2 | '''nest next page''']].
'''''[[#top | Top]]'''''

Navigation menu