PHP WinBinder: Project: Difference between revisions

Proofreading and grammatical changes; some minor reformatting
(New page: {{Nav PHP WinBinder}} '''''Windows Project''''' This page looks at creating a separate Windows application independent of Uniform Server. Applications produced using this method, are not...)
 
(Proofreading and grammatical changes; some minor reformatting)
 
Line 4: Line 4:
This page looks at creating a separate Windows application independent of Uniform Server.
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 require several support files.  
Applications produced using this method are not compiled, hence are not standalone executables. They require several support files.  
 
That said, they are easy to program using PHP and Winbinder.
That said they are easy to program using PHP and Winbinder.




Line 16: Line 15:
|-valign="top"
|-valign="top"
|
|
# Create a new folder for example '''c:\project1''' – Can be any name and location you like
# Create a new folder. For example '''c:\project1''' – Can be any name and location you like
# Copy folder UniServer\plugins\'''winbinder''' to folder c:\'''project1'''
# 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.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
# 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
# Delete folders C:\project1\winbinder\'''doc''' and C:\project1\winbinder\'''examples''' these are not required
# That completes the project structure (see image on right).
# That completes the project structure (see image on right).
Line 50: Line 49:
Include "php/include/winbinder.php";      // Location Of Winbinder Library
Include "php/include/winbinder.php";      // Location Of Winbinder Library
</pre>
</pre>
'''''[[#top | Top]]'''''
'''''[[#top | Top]]'''''
== Test ==
== Test ==
Check the configuration works by running test_4.bat
Check that the configuration works by running test_4.bat


You now have a working project template use this to develop your application.   
You now have a working project template. Use this to develop your application.   


'''''[[#top | Top]]'''''
'''''[[#top | Top]]'''''
== New batch file ==
== 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:
After completing your application, create a new batch file named '''test_5.bat''' (or any name you like) with the following content:
<pre>
<pre>
start winbinder\php\php-win.exe -c winbinder\php\php-wb.ini winbinder\test_4.phpw
start winbinder\php\php-win.exe -c winbinder\php\php-wb.ini winbinder\test_4.phpw
</pre>
</pre>
When run will automatically close the command window and start your application.
When run, it will automatically close the command window and start your application.


'''''[[#top | Top]]'''''
'''''[[#top | Top]]'''''
== Create an EXE file ==
== 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 also provides an opportunity of personalising the file by including your own icon.
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 also provides an opportunity for personalising the file by including your own icon.


{|
{|
Line 96: Line 93:
|-valign="top"
|-valign="top"
|
|
'''''Note'':''' Steps G) and H) are optional only required if using an icon for the exe file.
'''''Note'':''' Steps G) and H) are optional and only required if using an icon for the exe file.
   
   


Line 110: Line 107:
'''''Test EXE file'':'''
'''''Test EXE file'':'''


Navigate to folder C:\project1 and double click on the file created '''test_5.exe'''
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 are no longer required.
If you wish you can delete files test_4.bat and test_5.bat. They are no longer required.




Line 125: Line 122:


== Summary ==
== 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 require all the additional support files.
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 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 of hand where you compact all the necessary files into a single executable file.
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 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 is covered in project 2 on the [[PHP WinBinder: Project2 | '''nest page''']].
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 is covered in project 2 on the [[PHP WinBinder: Project2 | '''next page''']].


'''''[[#top | Top]]'''''
'''''[[#top | Top]]'''''