|
|
|
|
|
- Overview
- What is a PHP site?
- Why develop a PHP site with WEBDEV?
- Features of a PHP project
- Creating a PHP project
- RAD for PHP
- Testing a PHP site in the editor
- Deploying a PHP site
14. PHP generation in practice
WEBDEV allows you to generate PHP sites without prior knowledge of PHP. The site can be entirely developed in WLanguage, like any standard WEBDEV website. However, you can write your own PHP code (Server code). What is a PHP site? A PHP site is compiled in PHP. If this site uses a database, an ODBC driver (MyODBC, ODBC for Oracle, etc.) or a Native MySQL Connector (also called Native Access) will be used to access this database. The ODBC driver is specific to each database (it can be downloaded from the Website of the database publisher). A PHP site includes ".php" pages and requires a PHP engine to be run. To compile a PHP project created with WEBDEV, a PHP engine must be installed on the development computer. Several PHP engines are available on the Internet. Download and install the desired one. For example, you can use EasyPHP (http://www.easyphp.org/). This engine is given as an example. You can use any other PHP engine. Remark: Prerequisite: - PHP 5 servers: Minimum recommended version: version 5.6.
- PHP 7 servers: Minimum recommended version: version 7.0.22.
- PHP 8 servers: Minimum recommended version: version 8.0.10.
Why develop a PHP site with WEBDEV? It may be useful to develop some sites (especially small ones) using PHP to make it easy to host them at no cost. You can now do so using WEBDEV. Remark: The number of WLanguage functions that can be used in a PHP project is limited in this version. This number of functions will increase in forthcoming versions. Features of a PHP project Creating a PHP project A PHP project is created like any other WEBDEV project:- Click
in the quick access buttons of WEBDEV. The new element window appears: click "Project". - The project creation wizard starts.
- Choose the type of project to create: "Site, SaaS site".
- Select the desired skin (also referred to as "style book") and color palette, if necessary. This style book will be available by default when creating a page or report, and will be applied to all new controls. This option can be modified in the project description window ("Style" tab).
- Go to the next step.
- Specify the project name and location. These options cannot be modified. The project corresponds to a ".WWP" file for WEBDEV. This file can be opened by WINDEV and WINDEV Mobile. For more details, see Common project. All the objects associated with the project will be created in the specified directory ("C:\My Projects\<Project name>" by default).
- Finish the wizard. The new project is opened in the editor. By default, the project is a "Session" site.
- Open the project description window: on the "Project" tab, in the "Project" group, click "Description".
- On the "Project" tab, under "Type of site", select "PHP".
- Confirm.
Once the project has been defined as a PHP project, all available WEBDEV tools automatically adapt to that type of project: - The RAD tool specific to PHP generates PHP code for many WEBDEV features.
- The compiler indicates the functions or controls that cannot be used in PHP. A purple message is displayed in the "Compilation errors" pane.
- The PHP site is deployed via WDDeploy.
Remark: It is recommended to create a new WEBDEV project to develop a PHP site rather than converting a WEBDEV website to PHP. RAD for PHP As with any project associated with an analysis, you can use the RAD methodology to generate the pages of your site. The RAD methodology takes into account all the specific features of the PHP generation (controls, events and functions that can be used in a PHP site generated from WEBDEV). Testing a PHP site in the editor When testing a PHP site, the site is compiled in PHP and opened in your browser. You can directly see the PHP pages generated by WEBDEV. Reminder: A PHP engine is required on the development computer. The compilation of a PHP site is used to: - identify WLanguage programming errors.
- see the controls, events and WLanguage functions not available in PHP. These errors appear in purple in the "Compilation errors" pane.
Deploying a PHP site PHP sites and static sites are deployed using the same method. When creating the setup procedure, WDDeploy helps you implement your PHP site.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|