This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v20.6
PHP modules support
|
Name | Web Site | Description |
BCMath | http://php.net/bc | Binary calculator handling numbers of any size and precision represented as strings. |
Example: | ||
C_LONGINT($value;$result) | ||
Calendar | http://php.net/calendar | Set of functions simplifying conversion between different calendar formats. Based on Julian Day Count. |
Example: | ||
C_LONGINT($NumberOfDays) | ||
Ctype | http://php.net/ctype | Functions that check whether a character or a string belongs to a certain character class, depending on the current local configuration |
Example: | ||
// Check that all the characters of a string are punctuation marks | ||
Date and Time | http://php.net/datetime | Recovery of the date and time from the server where the PHP script is executed |
Example: //Calculation of time of sunrise in Lisbon, Portugal | ||
Exif | http://php.net/exif | Work with image metadata. |
Fileinfo(*) | http://php.net/fileinfo | Detection of type of contents and encoding of a file. |
Filter | http://php.net/filter | Validate and filter data from a non-secure source, like user entries. |
Example: | ||
C_LONGINT($filterId) | ||
FTP (File Transfert Protocol) | http://php.net/ftp | Detailed access to a FTP server |
Hash | http://php.net/hash | Message Digest engine. Allows direct or incremental processing of arbitrary length messages using a variety of hashing algorithms |
Example: | ||
C_TEXT($md5Result) | ||
JSON (JavaScript Object Notation) | http://php.net/json | Implementation of JSON data exchange format |
LDAP | http://php.net/ldap | LDAP is an access protocol to "folder servers" that store information in the form of a tree diagram |
Multibyte String | http://php.net/mbstring | Set of functions for working with strings that can be used to handle multi-byte character encodings or to convert character strings. |
OpenSSL | http://php.net/openssl | Use of OpenSSL functions to generate and verify signatures, to seal (encode) and open (decode) data. |
PCRE (Perl Compatible Regular Expressions) | http://php.net/pcre | Set of functions that implement rational expressions using the same syntax and semantics Perl 5 |
Example: | ||
// This example removes unnecessary spaces from a string | ||
PDO (PHP Data Objects) | http://php.net/pdo | Interface for accessing a database. Requires a database-specific PDO driver. |
PDO_SQLITE | http://php.net/pdo_sqlite | Driver that implements the PHP Data Objects (PDO) interface to allow PHP access to SQLite 3 databases. |
Reflection | http://php.net/reflection | Complete reflection API that lets you reverse-engineer classes, interfaces, functions and methods as well as extensions |
Phar (PHP Archive) | http://php.net/phar | Allows a complete PHP application to be included in a unique file named "phar" (PHP Archive) to facilitate its installation and configuration |
Session | http://php.net/session | Support of PHP sessions |
Example: | ||
Sessions are used in Web applications to preserve the context between each request. When you call PHP Execute in 4D, the PHP script can start a session and store anything that is useful to be kept as context in the associated $_SESSION array. If a PHP script uses sessions, you must obtain the session ID returned by PHP using the PHP GET FULL RESPONSE command and specify it before each call to PHP Execute using the SET ENVIRONMENT VARIABLE command. | ||
// "PHP Execute with context" method | ||
Sockets | http://php.net/sockets | Implementation of a low-level interface to the socket communication functions based on BSD sockets and providing the possibility to act as both a socket server as well as a client. |
SPL (Standard PHP Library) | http://php.net/spl | Collection of interfaces and classes that are meant to solve standard problems. |
SQLite | http://php.net/sqlite | Extension for the SQLite database engine. This engine is embeddable. |
SQLite3 | http://php.net/sqlite3 | Support for SQLite version 3 databases |
Tokenizer | http://php.net/tokenizer | Functions that let you write your own PHP analysis tools or modification tools without having to deal with the language specification at the lexical level |
(*) In the current version of 4D, these modules are not available under Windows
For structural reasons, the following PHP modules are only available on the Windows platform.
Name | Web Site | Description |
COM | http://php.net/com | COM (Component Object Model) is one of the main ways for applications and components to communicate on Windows platforms. Note: Instantiation and creation of .Net assemblies via the COM layer is no longer supported as of 4D v17 R5. |
ODBC (Open DataBase Connectivity) | http://php.net/odbc | In addition to standard ODBC support, the Unified ODBC functions in PHP gives you access to several databases that have borrowed the semantics of the ODBC API to implement their own API. |
The following PHP modules have not been implemented in 4D. The rightmost column gives the reason they were not implemented:
Name | Web Site | Cause - Alternative solution (if any) |
DOM (Document Object Model) | http://php.net/dom | Useless - Use 4D XML DOM commands |
Iconv | http://php.net/iconv | Technical reasons |
LibXML | http://php.net/libxml | Useless - Use 4D XML DOM commands |
LibXSLT | http://php.net/xsl | Obsolete (Deprecated) |
SimpleXML | http://php.net/simpleXML | Useless - Use 4D XML DOM commands |
Mimetype | http://php.net/mime-magic | Obsolete (Deprecated) - Use Fileinfo |
POSIX (Portable Operating System Interface) | http://php.net/posix | Obsolete (Deprecated) |
Regular Expression (POSIX Extended) | http://php.net/regex | Obsolete (Deprecated) - Use PCRE |
Crack | http://php.net/crack | Restrictive license |
ffmpeg | http://ffmpeg-php.sourceforge.net/ | Restrictive license - Use ffmpeg in command line with LAUNCH EXTERNAL PROCESS |
GD (Graphics Draw) Library | http://php.net/gd | Technical reasons |
Image Magick | http://php.net/manual/book.imagick.php | Restrictive license - Use GD 2 |
IMAP (Internet Message Access Protocol) | http://php.net/imap | Restrictive license - Use the 4D Internet Commands integrated plugin |
PDF (Portable Document Format) | http://php.net/pdf | Restrictive license - Use Haru PDF |
Mysqlnd (MySQL Native Driver) | http://dev.mysql.com/downloads/connector/php-mysqlnd/ | Not pertinent in the 4D environment |
XML (eXtensible Markup Language) | http://php.net/xml | Useless - Use 4D XML DOM commands |
XMLreader | http://php.net/xmlreader | Useless - Use 4D XML DOM commands |
XMLwriter | http://php.net/xmlwriter | Useless - Use 4D XML DOM commands |
WDDX (Web Distributed Data eXchange) | http://php.net/wddx | Obsolete (Deprecated) |
Zlib | http://php.net/zlib | Useless - Use 4D ZipFile class |
Zip | http://php.net/zip | Useless - Use 4D ZipFile class |
The "php.ini" file to modify (see below) can be located either in the Resources\php folder of the 4D application (default file) or in the Resources folder of the database (custom file). For more on this subject, refer to Executing PHP scripts in 4D.
Warning: Modifying the "php.ini" file must be done with caution and requires a good knowledge of PHP. For more information about the configuration of custom php.ini files, you can consult the comments found in the php.ini file provided by 4D.
Note: If the duration of PHP processing is relatively long (beyond 30 seconds), by default a 'timeout' error will be returned in 4D and the processing will fail. In this case, you can set the default timeout in order to allocate more time to PHP execution. There are two ways to do this:
Product: 4D
Theme: PHP
Modified: 4D v20
4D Language Reference ( 4D v20)
4D Language Reference ( 4D v20.1)
4D Language Reference ( 4D v20.2)
4D Language Reference ( 4D v20.3)
4D Language Reference ( 4D v20.4)
4D Language Reference ( 4D v20.5)
4D Language Reference ( 4D v20.6)