diff --git a/docs/API/DataClassClass.md b/docs/API/DataClassClass.md index 5ec725310b0f81..6ec0d8d43a7016 100644 --- a/docs/API/DataClassClass.md +++ b/docs/API/DataClassClass.md @@ -1092,7 +1092,7 @@ ds.Class.query("info.coll[a].val != :1";0) You can use any letter from the alphabet as the `[a]` notation. -#### Linking collection attribute query arguments +### Linking collection attribute query arguments When searching within dataclass object attributes containing collections using multiple query arguments joined by the AND operator, you may want to make sure that only entities containing elements that match all arguments are returned, and not entities where arguments can be found in different elements. To do this, you need to link query arguments to collection elements, so that only single elements containing linked arguments are found. @@ -1139,8 +1139,7 @@ With the above entities, if you write: ds.People.query("places.locations[a].kind= :1 and places.locations[a].city= :2";"home";"paris") ``` -... the query will only return "martin" because it has a "locations" element whose "kind" is "home" and whose "city" is "paris". The query will not return "smith" because the values "home" and "paris" are not in the same collection element. - +... the query will only return "martin" because it has a "locations" element whose "kind" is "home" and whose "city" is "paris". The query will not return "smith" because the values "home" and "paris" are not in the same collection element. ### Queries in many-to-many relations @@ -1304,6 +1303,8 @@ queryPath: steps:[{steps:[{description:[index : Company.revenues ] > 10000000,time:0,recordsfounds:933}]}]}]}]} ``` +### Examples + #### Example 1 This section provides various examples of queries. diff --git a/docs/Notes/updates.md b/docs/Notes/updates.md index d3d11c47db4e57..f66a02ec73c1fc 100644 --- a/docs/Notes/updates.md +++ b/docs/Notes/updates.md @@ -28,7 +28,7 @@ Read [**What’s new in 4D 21 R2**](https://blog.4d.com/en-whats-new-in-4d-21-r2 |Library|Current version|Updated in 4D|Comment| |---|---|---|----| -|BoringSSL|fa47b1d|**21**|Used for QUIC| +|BoringSSL|9b86817|**21 R2**|Used for QUIC| |CEF|7258|**21**|Chromium 139| |Hunspell|1.7.2|20|Used for spell checking in 4D forms and 4D Write Pro| |ICU|77.1|**21**|This upgrade forces an automatic rebuild of alphanumeric, text and object indexes.| @@ -38,10 +38,9 @@ Read [**What’s new in 4D 21 R2**](https://blog.4d.com/en-whats-new-in-4d-21-r2 |Libuv |1.51.0|**21**|Used for QUIC| |libZip|1.11.4|**21**|Used by zip class, 4D Write Pro, svg and serverNet components| |LZMA|5.8.1|**21**|| -|ngtcp2|1.16.0|**21**|Used for QUIC| +|ngtcp2|1.18.0|**21 R2**|Used for QUIC| |OpenSSL|3.5.2|**21**|| |PDFWriter|4.7.0|**21**|Used for [`WP Export document`](../WritePro/commands/wp-export-document.md) and [`WP Export variable`](../WritePro/commands/wp-export-variable.md) | -|PHP|8.2.4|20|| |SpreadJS|17.1.0|20 R7|See [this blog post](https://blog.4d.com/4d-view-pro-whats-new-in-4d-20-r7/) for an overview of the new features| |webKit|WKWebView|19|| |Xerces|3.3.0|**21**|Used for XML commands| diff --git a/docs/commands-legacy/dom-parse-xml-source.md b/docs/commands-legacy/dom-parse-xml-source.md index ca139512b79213..07ce527eea8126 100644 --- a/docs/commands-legacy/dom-parse-xml-source.md +++ b/docs/commands-legacy/dom-parse-xml-source.md @@ -25,9 +25,11 @@ The document can be located on the disk or on the Internet/Intranet. In the *document* parameter, you can pass: -* either a standard complete pathname (of the type C:\\\\Folder\\\\File\\\\... under Windows and MacintoshHD:Folder:File under Mac OS), -* or a Unix path under Mac OS (which must start with /). +* either a standard complete pathname (of the type C:\\\\Folder\\\\File\\\\... under Windows and MacintoshHD:Folder:File under macOS), +* or a Unix path under macOS (which must start with /). * or a network path of the type http://www.site.com/File or ftp://public.ftp.com... +* or an empty string to display an Open File dialog box. + The Boolean parameter *validation* indicates whether or not to validate the structure. diff --git a/docs/commands-legacy/php-execute.md b/docs/commands-legacy/php-execute.md deleted file mode 100644 index 0cc3e5a002c0c9..00000000000000 --- a/docs/commands-legacy/php-execute.md +++ /dev/null @@ -1,291 +0,0 @@ ---- -id: php-execute -title: PHP Execute -slug: /commands/php-execute -displayed_sidebar: docs ---- - - - -**PHP Execute** ( *scriptPath* {; *functionName* {; *phpResult* {; *param*} {; *param2* ; ... ; *paramN*}}} ) : Boolean - -| Parameter | Type | | Description | -| --- | --- | --- | --- | -| scriptPath | Text | → | Pathname to PHP script or
"" to execute a PHP function | -| functionName | Text | → | PHP function to be executed | -| phpResult | *, Variable, Field | ← | Result of PHP function execution or * to not receive any result | -| param | Text, Boolean, Real, Integer, Date, Time | → | Parameter(s) of PHP function | -| Function result | Boolean | ← | True = execution correct
False = execution error | - - - -:::info Compatibility - -**PHP is deprecated in 4D**. It is now recommended to use the [`4D.SystemWorker class`](../API/SystemWorkerClass.md). - -::: - -## Description - -The **PHP Execute** command can be used to execute a PHP script or function. - -Pass the pathname of the PHP script to be executed in the *scriptPath* parameter. This can be a relative pathname if the file is located next to the database structure or an absolute path. The pathname can be expressed in either the system syntax or POSIX syntax. -If you want to execute a standard PHP function directly, pass an empty string ("") in *scriptPath*. The function name must be passed in the second parameter - -Pass a PHP function name in the *functionName* parameter if you want to execute a specific function in the *scriptPath* script. If you pass an empty string or omit the *functionName* parameter, the script is entirely executed. - -**Note:** PHP is case sensitive for function names. Do not use parentheses, just enter the function name only. - -The *phpResult* parameter receives the result of the execution of the PHP function. You can pass either: - -* a variable, an array or a field in order to receive the result, -* the \* character if the function does not return any result or if you do not want to retrieve it. - -The *phpResult* parameter can be of the Text, Longint, Real, Boolean, or Date type as well as (except for arrays) a field of the BLOB or Time type. 4D will carry out the conversion of the data and any adjustments needed according to the principles described in the *Conversion of data returned* section below. - -* If you passed a function name in the *functionName* parameter, *phpResult* will receive what the PHP developer returned with the **return** command from the body of the function. -* If you use the command without passing a function name in the *functionName* parameter, *phpResult* will receive what the PHP developer returned with the **echo** command (or a similar command). - -If you call a PHP function that expects arguments, use the *param1...N* parameters to pass one or more values. The values must be separated by semi-colons. You can pass values of the Alpha, Text, Boolean, Real, Integer, Longint, Date or Time type. Pictures, BLOBs and Objects are not accepted. You can send an array; in this case, you must pass a pointer to the array to the [PHP Execute](php-execute.md) command, otherwise the current index of the array will be sent as an integer (see the example). The command accepts all types of arrays except for pointer, picture and 2D arrays. -The *param1...N* parameters are sent in PHP in the JSON format in UTF-8\. They are automatically decoded with the PHP **json\_decode** command before being sent to the PHP *functionName* function. - -**Note:** For technical reasons, the size of parameters passed via the FastCGI protocol must not exceed 64 KB. You need to take this limitation into account if you use parameters of the Text type. - -The command returns True if the execution has been carried out correctly on the 4D side, in other words, if the launching of the execution environment, the opening of the script and the establishing of the communication with the PHP interpreter were successful. Otherwise, an error is generated, which you can intercept with the [ON ERR CALL](on-err-call.md) command and analyze with [Last errors](../commands/last-errors.md) . -In addition, the script itself may generate PHP errors. In this case, you must use the [PHP GET FULL RESPONSE](php-get-full-response.md) command in order to analyze the source of the error (see example 4). - -**Note:** PHP can be used to configure error management. For more information, please refer, for example, to the following page: . - -### Conversion of data returned - -The following table specifies how 4D interprets and converts data that is returned according to the type of the *phpResult* parameter. - -| **Type of *phpResult parameter*** | **Processing by 4D** | **Example** | -| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------- | -| BLOB | 4D recovers the data received without any modifications(\*). | | -| Text | 4D expects data encoded in UTF-8 (\*). The PHP developer may need to use the PHP **utf8\_encode** command. | Example of PHP script: echo utf8\_encode(myText) | -| Date | 4D expects a date sent as a string in the RFC 3339 format (sometimes called DATE\_ATOM in PHP). This format is of the type "YYYY-MM-DDTHH:MM:SS", for example: 2005-08-15T15:52:01+00:00\. 4D ignores the time part and returns the date in UTC. | | -| Time | 4D expects a time sent as a string in the RFC 3339 format (see the Date type). 4D ignores the date part and returns the number of seconds elapsed since midnight while considering the date in the local time zone. | Example of PHP script for sending 2h30'45": echo date( DATE\_ATOM, mktime( 2,30,45)) | -| Integer or Real | 4D interprets the numerical value expressed with numbers, the + or - sign and/or the exponent prefixed by 'e'. Any '.' or ',' character is interpreted as a decimal separator. | Example of PHP script: echo -1.4e-16; | -| Boolean | 4D returns True if it receives the string "true" from PHP or if the numerical evaluation gives a value that is not Null. | Example of PHP script: echo (a==b); | -| Array | 4D considers that the PHP array was returned in the JSON format. | Example of PHP script for returning an array of two texts: echo json\_encode( array( "hello", "world")); | - -(\*) By default, HTTP headers are not returned: -\- If you use [PHP Execute](php-execute.md) by passing a function in the *functionName* parameter, HTTP headers are never returned in *phpResult*. They are only available through the [PHP GET FULL RESPONSE](php-get-full-response.md) command. -\- If you use [PHP Execute](php-execute.md) without a function name (the *functionName* parameter is omitted or contains an empty string), you can return HTTP headers by setting the PHP raw result option to True using the [PHP SET OPTION](php-set-option.md) command. - -**Note:** If you need to recover large volumes of data using PHP, it is usually more efficient to pass by the *stdOut* buffer (**echo** command or similar) rather than by the function return. For more information, refer to the description of the [PHP GET FULL RESPONSE](php-get-full-response.md) command. - -### Using environment variables - -You can use the [SET ENVIRONMENT VARIABLE](set-environment-variable.md) command to specify the environment variables used by the script. Warning: after calling [LAUNCH EXTERNAL PROCESS](launch-external-process.md) or **PHP Execute**, the set of environment variables is erased. - -### Special functions - -4D provides the following special functions: - -* **quit\_4d\_php**: used to quit the PHP interpreter and all its child processes. If at least one child process is executing a script, the interpreter does not quit and the PHP Execute command returns False. -* **relaunch\_4d\_php**: used to relaunch the PHP interpreter. - -Note that the interpreter is relaunched automatically when the first request is sent by PHP Execute. - -## Example 1 - -Calling the "myPhpFile.php" script without any function. Here are the contents of the script: - -```PHP - -``` - -The following 4D code: - -```4d - var $result : Text - var $isOK : Boolean - $isOK:=PHP Execute("C:\\php\\myPhpFile.php";"";$result) - ALERT($Result) -``` - -... will display the current PHP version. - -## Example 2 - -Calling the *myPhpFunction* function in the "myNewScript.php" script with parameters. Here are the contents of the script: - -```PHP - -``` - -Calling with function: - -```4d - var $result : Text - var $param1 : Text - var $param2 : Text - var $isOk : Boolean - $param1 :="Hello" - $param2 :="4D world!" - $isOk:=PHP Execute("C:\\MyFolder\\myNewScript.php";"myPhpFunction";$result;$param1;$param2) - ALERT($result) // Displays "Hello 4D world!" -``` - -## Example 3 - -Quitting the PHP interpreter: - -```4d - $ifOk:=PHP Execute("";"quit_4d_php") -``` - -## Example 4 - -Error management: - -```4d -  // Installation of the error-management method - phpCommError:="" // Modified by PHPErrorHandler - $T_saveErrorHandler :=Method called on error - ON ERR CALL("PHPErrorHandler") - - // Execution of script - var $T_result : Text - If(PHP Execute("C:\\MyScripts\\MiscInfos.php";"";$T_result)) -  // No error, $T_Result contains the result - Else -  // An error is detected, managed by PHPErrorHandler -    If(phpCommError="") -       ... // PHP error, use PHP GET FULL RESPONSE -    Else -       ALERT(phpCommError) -    End if - End if -  -  // Uninstalling method - ON ERR CALL($T_saveErrorHandler) - - -``` - -The PHP\_errHandler method is as follows: - -```4d - phpCommError:="" - GET LAST ERROR STACK(arrCodes;arrComps;arrLabels) - For($i;1;Size of array(arrCodes)) -    phpCommError:=phpCommError+String(arrCodes{$i})+" "+arrComps{$i}+" "+ -    arrLabels{$i}+Char(Carriage return) - End for -``` - -## Example 5 - -Dynamic creation by 4D of a script before its execution: - -```4d - DOCUMENT TO BLOB("C:\\Scripts\\MyScript.php";$blobDoc) - If(OK=1) -    $strDoc:=BLOB to text($blobDoc;UTF8 text without length) -  -    $strPosition:=Position("function2Rename";$strDoc) -  -    $strDoc:=Insert string($strDoc;"_v2";Length("function2Rename")+$strPosition) -  -    TEXT TO BLOB($strDoc;$blobDoc;UTF8 text without length) -    BLOB TO DOCUMENT("C:\\Scripts\\MyScript.php";$blobDoc) -    If(OK#1) -       ALERT("Error on script creation") -    End if - End if -``` - -The script is then executed: - -```4d - $err:=PHP Execute("C:\\Scripts\\MyScript.php";"function2Rename_v2";*) -``` - -## Example 6 - -Direct retrieval of a Date and Time type value. Here are the contents of the script: - -```PHP - -``` - -Receiving the date on the 4D side: - -```4d - var $phpResult_date : Date - $result :=PHP Execute("C:\php_scripts\ReturnDate.php";"";$phpResult_date) -  //$phpResult_date is !05/04/2009 ! -  - var $phpResult_time : Time - $result :=PHP Execute("C:\php_scripts\ReturnDate.php";"";$phpResult_time) -  //$phpResult_time is ?01 :02 :03 ? -``` - -## Example 7 - -Distribution of data in arrays: - -```4d - ARRAY TEXT($arText ;0) - ARRAY LONGINT($arLong ;0) - $p1 :="," - $p2 :="11,22,33,44,55" - $phpok :=PHP Execute("";"explode";$arText;$p1;$p2) - $phpok :=PHP Execute("";"explode";$arLong;$p1;$p2) -  -  // $arText contains the Alpha values "11", "22", "33", etc. -  // $arLong contains the numbers, 11, 22, 33, etc. -``` - -## Example 8 - -Initialization of an array: - -```4d - ARRAY TEXT($arText ;0) - $phpok :=PHP Execute("";"array_pad";$arText;->$arText;50;"undefined") -  // Execute in PHP: $arrTest = array_pad($arrTest, 50, ’undefined’); -  // Fills the $arText array with 50 "undefined" elements -``` - -## Example 9 - -Passing of parameters via an array: - -```4d - ARRAY INTEGER($arInt;0) - $phpok :=PHP Execute("";"json_decode";$arInt;"[13,51,69,42,7]") -  // Execute in PHP: $arInt = json_decode(’[13,51,69,42,7]’); -  // Fills the array with the initial values -``` - -## Example 10 - -Here is an example of the basic use of the trim function, to remove extra spaces and/or invisible characters from the beginning and end of a string: - -```4d - var $T_String : Text - $T_String:="   Hello  " - var $B : Boolean - $B:=PHP Execute("";"trim";$T_String;$T_String) -``` - -For more information concerning the trim function, please refer to the PHP documentation. - -## See also - -*Executing PHP scripts in 4D* -[PHP GET FULL RESPONSE](php-get-full-response.md) -[PHP SET OPTION](php-set-option.md) - -## Properties - -| | | -| --- | --- | -| Command number | 1058 | -| Thread safe | ✗ | - - diff --git a/docs/commands-legacy/php-get-full-response.md b/docs/commands-legacy/php-get-full-response.md deleted file mode 100644 index 620128ae9e1595..00000000000000 --- a/docs/commands-legacy/php-get-full-response.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -id: php-get-full-response -title: PHP GET FULL RESPONSE -slug: /commands/php-get-full-response -displayed_sidebar: docs ---- - - - -**PHP GET FULL RESPONSE** ( *stdOut* {; *errLabels* ; *errValues*} {; *httpHeaderFields* {; *httpHeaderValues*}} ) - -| Parameter | Type | | Description | -| --- | --- | --- | --- | -| stdOut | Text, Blob | ← | Contents of stdOut buffer | -| errLabels | Text array | ← | Labels of errors | -| errValues | Text array | ← | Values of errors | -| httpHeaderFields | Text array | ← | Names of HTTP headers | -| httpHeaderValues | Text array | ← | Values of HTTP headers | - - - -:::info Compatibility - -**PHP is deprecated in 4D**. It is now recommended to use the [`4D.SystemWorker class`](../API/SystemWorkerClass.md). - -::: - - -## Description - -The PHP GET FULL RESPONSE command lets you obtain additional information about the response returned by the PHP interpreter. This command is particularly useful in the case of an error occurring during execution of the script. - -The PHP script can write data in the stdOut buffer (echo, print, etc.). The command returns the data directly in the *stdOut* variable and applies the same conversion principles as described in the [PHP Execute](php-execute.md) command. - -The synchronized *errLabels* and *errValues* text arrays are filled when the execution of the PHP scripts causes errors. These arrays provide information in particular on the error origin, script and line. These two arrays are inseparable: if *errLabels* is passed, *errValues* must be passed as well. - -Since exchanges between 4D and the PHP interpreter are carried out via FastCGI, the PHP interpreter functions as if it were called by an HTTP server and therefore sends HTTP headers. You can recover these headers and their values in the *httpHeaderFields* and *httpHeaderValues* arrays. - -## See also - -[PHP Execute](php-execute.md) -[PHP GET OPTION](php-get-option.md) - -## Properties - -| | | -| --- | --- | -| Command number | 1061 | -| Thread safe | ✗ | - - diff --git a/docs/commands-legacy/php-get-option.md b/docs/commands-legacy/php-get-option.md deleted file mode 100644 index 4ec0b9ed3c2a88..00000000000000 --- a/docs/commands-legacy/php-get-option.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -id: php-get-option -title: PHP GET OPTION -slug: /commands/php-get-option -displayed_sidebar: docs ---- - - - - -**PHP GET OPTION** ( *option* ; *value* ) - -| Parameter | Type | | Description | -| --- | --- | --- | --- | -| option | Integer | → | Option to get | -| value | Boolean | ← | Current value of option | - - - -:::info Compatibility - -**PHP is deprecated in 4D**. It is now recommended to use the [`4D.SystemWorker class`](../API/SystemWorkerClass.md). - -::: - - -## Description - -The PHP GET OPTION command can be used to find out the current value of an option relating to the execution of PHP scripts. - -Pass a constant from the "*PHP*" theme in the *option* parameter to designate the option to be read. The command returns the current value of the option in the *value* parameter. - -| Constant | Type | Value | Comment | -| -------------- | ------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| PHP raw result | Integer | 2 | Definition of processing mode for HTTP headers returned by PHP in the execution result when this result is of the Text type (when the result is of the BLOB type, headers are always kept).
**Possible value(s)**: Boolean. False (default value = remove HTTP headers from result. True = keep HTTP headers. | - -## See also - -[PHP GET FULL RESPONSE](php-get-full-response.md) -[PHP SET OPTION](php-set-option.md) - -## Properties - -| | | -| --- | --- | -| Command number | 1060 | -| Thread safe | ✗ | - - diff --git a/docs/commands-legacy/php-set-option.md b/docs/commands-legacy/php-set-option.md deleted file mode 100644 index a6a8505f9b4a52..00000000000000 --- a/docs/commands-legacy/php-set-option.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -id: php-set-option -title: PHP SET OPTION -slug: /commands/php-set-option -displayed_sidebar: docs ---- - - - -**PHP SET OPTION** ( *option* ; *value* {; *} ) - -| Parameter | Type | | Description | -| --- | --- | --- | --- | -| option | Integer | → | Option to be set | -| value | Boolean | → | New value of option | -| * | Operator | → | If passed: modification only applied to next call | - - - -:::info Compatibility - -**PHP is deprecated in 4D**. It is now recommended to use the [`4D.SystemWorker class`](../API/SystemWorkerClass.md). - -::: - -## Description - -The **PHP SET OPTION** command is used to set specific options before calling the [PHP Execute](php-execute.md) command. The scope of this command is the current process. - -Pass a constant from the "*PHP*" theme in the *option* parameter to designate the option to be modified and pass the new value for the option in the *value* parameter. - -| Constant | Type | Value | Comment | -| -------------- | ------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| PHP raw result | Integer | 2 | Definition of processing mode for HTTP headers returned by PHP in the execution result when this result is of the Text type (when the result is of the BLOB type, headers are always kept).
**Possible value(s)**: Boolean. False (default value = remove HTTP headers from result. True = keep HTTP headers. | - -By default, **PHP SET OPTION** sets the option for all subsequent calls to [PHP Execute](php-execute.md) of the process. If you want to set it for the next call only, pass the star (*\**) parameter. - -## See also - -[PHP Execute](php-execute.md) -[PHP GET OPTION](php-get-option.md) - -## Properties - -| | | -| --- | --- | -| Command number | 1059 | -| Thread safe | ✗ | - - diff --git a/docs/commands-legacy/xml-get-options.md b/docs/commands-legacy/xml-get-options.md index 506b9f29426c61..d267d6e682ba76 100644 --- a/docs/commands-legacy/xml-get-options.md +++ b/docs/commands-legacy/xml-get-options.md @@ -5,7 +5,7 @@ slug: /commands/xml-get-options displayed_sidebar: docs --- -**XML GET OPTIONS** ( *elementRef* ; *selector* ; *value* {; *selector2* ; *value2* ; ... ; *selectorN* ; *valueN*} )
**XML GET OPTIONS** ( *document ; *selector* ; *value* {; *selector2* ; *value2* ; ... ; *selectorN* ; *valueN*} ) +**XML GET OPTIONS** ( *elementRef* ; *selector* ; *value* {; *selector2* ; *value2* ; ... ; *selectorN* ; *valueN*} )
**XML GET OPTIONS** ( *document* ; *selector* ; *value* {; *selector2* ; *value2* ; ... ; *selectorN* ; *valueN*} ) | Parameter | Type | | Description | | --- | --- | --- | --- | diff --git a/docs/commands/command-index.md b/docs/commands/command-index.md index 361980267b1377..b800ed9edb113f 100644 --- a/docs/commands/command-index.md +++ b/docs/commands/command-index.md @@ -848,10 +848,6 @@ title: Commands by name [`Path to object`](../commands-legacy/path-to-object.md)
[`PAUSE INDEXES`](../commands-legacy/pause-indexes.md)
[`PAUSE PROCESS`](../commands-legacy/pause-process.md)
-[`PHP Execute`](../commands-legacy/php-execute.md)
-[`PHP GET FULL RESPONSE`](../commands-legacy/php-get-full-response.md)
-[`PHP GET OPTION`](../commands-legacy/php-get-option.md)
-[`PHP SET OPTION`](../commands-legacy/php-set-option.md)
[`PICTURE CODEC LIST`](../commands-legacy/picture-codec-list.md)
[`PICTURE LIBRARY LIST`](../commands-legacy/picture-library-list.md)
[`PICTURE PROPERTIES`](../commands-legacy/picture-properties.md)
diff --git a/docs/commands/theme/PHP.md b/docs/commands/theme/PHP.md deleted file mode 100644 index be037190fc4b0f..00000000000000 --- a/docs/commands/theme/PHP.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -id: PHP_theme -title: PHP -sidebar_label: PHP -slug: /commands/theme/PHP ---- - - -|| -|---| -|[](../../commands-legacy/php-execute.md)
| -|[](../../commands-legacy/php-get-full-response.md)
| -|[](../../commands-legacy/php-get-option.md)
| -|[](../../commands-legacy/php-set-option.md)
| diff --git a/i18n/es/docusaurus-plugin-content-docs/current/API/DataClassClass.md b/i18n/es/docusaurus-plugin-content-docs/current/API/DataClassClass.md index 75f992ea902db8..86842c59631455 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/API/DataClassClass.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/API/DataClassClass.md @@ -1101,7 +1101,7 @@ ds.Class.query("info.coll[a].val != :1";0) Puede utilizar cualquier letra del alfabeto como notación `[a]`. -#### Vinculación de los argumentos de búsqueda y los atributos de colección +### Vinculación de los argumentos de búsqueda y los atributos de colección Para ello, es necesario vincular los argumentos de la búsqueda a los elementos de colección, de modo que sólo se encuentren los elementos únicos que contengan argumentos vinculados. Al buscar dentro de los atributos de objetos de clases de datos que contengan colecciones utilizando varios argumentos de consulta unidos por el operador AND, es posible que desee asegurarse de que sólo se devuelvan entidades que contengan elementos que coincidan con todos los argumentos, y no entidades en las que los argumentos puedan encontrarse en elementos diferentes. @@ -1309,6 +1309,8 @@ queryPath: steps:[{steps:[{description:[index : Company.revenues ] > 10000000,time:0,recordsfounds:933}]}]}]}]} ``` +### Ejemplos + #### Ejemplo 1 Esta sección ofrece varios ejemplos de búsquedas. diff --git a/i18n/es/docusaurus-plugin-content-docs/current/API/EntityClass.md b/i18n/es/docusaurus-plugin-content-docs/current/API/EntityClass.md index 0e843360644b5d..893d227692a201 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/API/EntityClass.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/API/EntityClass.md @@ -1283,7 +1283,7 @@ Los siguientes valores pueden ser devueltos en las propiedades `status`y `status | `dk status entity does not exist anymore` | 5 | La entidad ya no existe en los datos. Este error puede ocurrir en los siguientes casos:
  • la entidad ha sido eliminada (el marcador ha cambiado y ahora el espacio de memoria está libre)
  • la entidad ha sido eliminada y reemplazada por otra con otra clave primaria (el marcador ha cambiado y una nueva entidad ahora utiliza el espacio memoria). Cuando se utiliza `.drop()`, este error puede devolverse cuando se utiliza la opción `dk force drop if stamp changed`. Cuando se utiliza `.lock()`, este error puede ser devuelto cuando se utiliza la opción `dk reload if stamp changed`

  • **statusText asociado**: "Entity does not exist anymore" | | `dk status locked` | 3 | La entidad está bloqueada por un bloqueo pesimista. **statusText asociado**: "Already locked" | | `dk status validation failed` | 7 | Error no crítico enviado por el desarrollador para un [evento de validación](../ORDA/orda-events.md). **statusText asociado**: "Mild Validation Error" | -| `dk status serious error` | 4 | A serious error is a low-level database error (e.g. duplicated key), a hardware error, etc. **Associated statusText**: "Other error" | +| `dk status serious error` | 4 | Un error grave es un error de base de datos de bajo nivel (por ejemplo, una llave duplicada), un error de hardware, etc. **statusText asociado**: "Other error" | | `dk status serious validation error` | 8 | Error crítico enviado por el desarrollador para un [evento de validación](../ORDA/orda-events.md). **statusText asociado**: "Serious Validation Error" | | `dk status stamp has changed` | 2 | The internal stamp value of the entity does not match the one of the entity stored in the data (optimistic lock).
  • with `.save()`: error only if the `dk auto merge` option is not used
  • with `.drop()`: error only if the `dk force drop if stamp changed` option is not used
  • with `.lock()`: error only if the `dk reload if stamp changed` option is not used

  • **Associated statusText**: "Stamp has changed" | | `dk status wrong permission` | 1 | Los privilegios actuales no permiten guardar la entidad. **Associated statusText**: "Permission Error" | diff --git a/i18n/es/docusaurus-plugin-content-docs/current/Notes/updates.md b/i18n/es/docusaurus-plugin-content-docs/current/Notes/updates.md index 3d5948bfa59404..f8df4c78b11580 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/Notes/updates.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/Notes/updates.md @@ -35,7 +35,6 @@ Lea [**Novedades en 4D 21 R2**](https://blog.4d.com/en-whats-new-in-4d-21-r2/), | ngtcp2 | 1.16.0 | **21** | Utilizado para QUIC | | OpenSSL | 3.5.2 | **21** | | | PDFWriter | 4.7.0 | **21** | Utilizado para [`WP Export document`](../WritePro/commands/wp-export-document.md) y [`WP Export variable`](../WritePro/commands/wp-export-variable.md) | -| PHP | 8.2.4 | 20 | | | SpreadJS | 17.1.0 | 20 R7 | Consulte [esta entrada de blog](https://blog.4d.com/4d-view-pro-whats-new-in-4d-20-r7/) para obtener una visión general de las nuevas funciones | | webKit | WKWebView | 19 | | | Xerces | 3.3.0 | **21** | Utilizado para comandos XML | diff --git a/i18n/es/docusaurus-plugin-content-docs/current/WebServer/webServerConfig.md b/i18n/es/docusaurus-plugin-content-docs/current/WebServer/webServerConfig.md index 39361baf4edd38..804c9c733ae651 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/WebServer/webServerConfig.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/WebServer/webServerConfig.md @@ -605,7 +605,7 @@ Estado de validación de la dirección IP para las cookies de sesión. Por razon ### Usuario web genérico -This option allows you to designate a user, previously defined in the [4D password table](../Users/handling_users_groups.md), as a "Generic Web User". In this case, each browser allowed to connect to the database gets access authorizations and restrictions associated with this user. +This option allows you to designate a user, previously defined in the [4D password table](../Users/handling_users_groups.md), as a "Generic Web User". En este caso, cada navegador autorizado a conectarse a la base de datos obtiene las autorizaciones y restricciones de acceso asociadas a este usuario. #### Enviar directamente los caracteres extendidos diff --git a/i18n/es/docusaurus-plugin-content-docs/current/aikit/Classes/OpenAIVisionHelper.md b/i18n/es/docusaurus-plugin-content-docs/current/aikit/Classes/OpenAIVisionHelper.md index a810d60497882e..10830ea841702a 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/aikit/Classes/OpenAIVisionHelper.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/aikit/Classes/OpenAIVisionHelper.md @@ -17,7 +17,7 @@ title: OpenAIVisionHelper | *parámetros* | [OpenAIChatCompletionsParameters](OpenAIChatCompletionsParameters.md) | Parámetros opcionales para la solicitud de finalización del chat. | | Resultado | [OpenAIChatCompletionsResult](OpenAIChatCompletionsResult.md) | El resultado de la visión. | -Sends a prompt to the OpenAI chat API along with an associated image URL, and optionally accepts parameters for the chat completion. +Envía un mensaje a la API de chat OpenAI con una URL de imagen asociada, y opcionalmente acepta los parámetros para la finalización del chat. #### Ejemplo de Uso diff --git a/i18n/es/docusaurus-plugin-content-docs/current/commands-legacy/php-execute.md b/i18n/es/docusaurus-plugin-content-docs/current/commands-legacy/php-execute.md deleted file mode 100644 index 10a21b6b44889d..00000000000000 --- a/i18n/es/docusaurus-plugin-content-docs/current/commands-legacy/php-execute.md +++ /dev/null @@ -1,290 +0,0 @@ ---- -id: php-execute -title: PHP Execute -slug: /commands/php-execute -displayed_sidebar: docs ---- - - - -**PHP Execute** ( *rutaScript* {; *nomFuncion* {; *resultPHP* {; *param*} {; *param2* ; ... ; *paramN*}}} ) : Boolean - -| Parámetro | Tipo | | Descripción | -| --- | --- | --- | --- | -| rutaScript | Text | → | Ruta de acceso al script PHP o "" para ejecutar una función PHP | -| nomFuncion | Text | → | Función PHP a ejecutar | -| resultPHP | *, Variable, Field | ← | Resultado de ejecución de la función PHP o * para no recibir el resultado | -| param | Text, Boolean, Real, Integer, Date, Time | → | Parámetros de la función PHP | -| Resultado | Boolean | ← | True = ejecución correcta, False = error de ejecución | - - - -:::info Compatibilidad - -**PHP es obsoleto en 4D**. Se recomienda utilizar la clase [`4D.SystemWorker class`](../API/SystemWorkerClass.md). - -::: - -## Descripción - -El comando **PHP Execute** permite ejecutar un script o una función PHP. - -Pase en el parámetro *rutaScrip*t la ruta de acceso del archivo de script PHP a ejecutar. Puede ser una ruta de acceso relativa si el archivo está ubicado junto a la estructura de la base o de una ruta absoluta. La ruta de acceso puede expresarse en sintaxis sistema o POSIX. -Si quiere ejecutar directamente una función PHP estándar, pase una cadena vacía ("") en *rutaScript*. El nombre de la función debe pasarse en el segundo parámetro. - -Pase en el parámetro *nomFuncion* un nombre de función PHP si quiere ejecutar una función específica en el script *rutaScript*. Si pasa una cadena vacía u omite el parámetro *nomFuncion*, el script se ejecuta completamente. - -**Nota:** PHP tiene en cuenta las mayúsculas y minúsculas de los caracteres en el nombre de la función. No utilice paréntesis, introduzca únicamente el nombre de la función. - -El parámetro *resultPHP* recibe el resultado de la ejecución de la función PHP. Puede pasar: - -* una variable, un array o un campo para recibir el resultado, -* el carácter *\** si la función no devuelve ningún resultado o si no quiere recuperar el resultado. - -El parámetro *resultPHP* puede ser de tipo texto, entero largo, real, booleano o fecha así como también (excepto para arrays) BLOB u hora. 4D efectuará la conversión de los datos y los ajustes necesarios siguiendo los principios descritos en la sección a continuación. - -* si pasa un nombre de función en el parámetro *nomFuncion*, *resultPHP* recibirá lo que el desarrollador PHP devuelve con el comando return del cuerpo de la función. -* Si utiliza el comando sin pasar un nombre de función en el parámetro *nomFuncion*, *r* *esultPHP* recibirá lo que el desarrollador PHP devolvió con el comando echo ( o un comando similar). - - Si llama a una función PHP que espera argumentos, utilice los parámetros *param1...N* para pasar uno o varios valores. Los valores deben estar separados por punto y coma. Puede pasar valores de tipo alfa, texto, booleano, real, entero, entero largo, fecha u hora. Las imágenes y los BLOBs y objetos no se aceptan. Puede enviar un array; en este caso debe pasar un puntero en el array al comando **PHP Execute**, de lo contrario el índice actual del array se enviará como un entero (ver el ejemplo). El comando acepta todos los tipos de arrays excepto los arrays puntero, los arrays imagen y los arrays 2D. - -**Nota:** por razones técnicas, el tamaño de los parámetros pasados vía el protocolo FastCGI no debe pasar los 64 KB. Debe tener en cuenta esta limitación si utiliza parámetros de tipo Texto. - -El comando devuelve True si la ejecución se ha efectuado correctamente del lado de 4D, en otras palabras, si el lanzamiento del entorno de ejecución, la apertura del script y el establecimiento de la comunicación con el intérprete PHP fueron exitosos. De lo contrario, se genera un error, que puede interceptar con el comando [ON ERR CALL](on-err-call.md "ON ERR CALL") y analizar con [Last errors](../commands/last-errors.md). -Además, el script mismo puede generar errores PHP. En este caso, debe utilizar el comando [PHP GET FULL RESPONSE](php-get-full-response.md "PHP GET FULL RESPONSE") para analizar la fuente del error (ver ejemplo 4). - -**Nota:** PHP permite configurar la gestión de errores. Para mayor información, consulte por ejemplo la página: . - -### Conversión de los datos devueltos - -La siguiente tabla especifica cómo 4D interpreta y convierte los datos devueltos en función del tipo del parámetro *resultPHP*. - -| **Tipo del parámetro *resultPHP*** | **Proceso 4D** | **Ejemplo** | -| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------- | -| BLOB | 4D recupera los datos recibidos sin ninguna modificación(\*). | | -| Texto | 4D espera los datos codificados en UTF-8 (\*). El desarrollador PHP puede necesitar utilizar el comando PHP **utf8\_encode**. | Ejemplo de script PHP: echo utf8\_encode(miTexto) | -| Fecha | 4D espera una fecha enviada como una cadena en formato RFC 3339 (también llamado DATE\_ATOM en PHP). Este formato es de tipo "AAAA-MM-DDTHH:MM:SS", por ejemplo: 2005-08-15T15:52:01+00:00\. 4D ignora la parte hora y devuelve la fecha en UTC. | | -| Hora | 4D espera una hora enviada en forma de cadena en formato RFC 3339 (ver el tipo Fecha). 4D ignora la parte fecha y devuelve el número de segundos transcurridos desde la media noche considerando la fecha en la zona horaria local. | Ejemplo de script PHP para enviar 2h30'45": echo date( DATE\_ATOM, mktime( 2,30,45)) | -| Entero o Real | 4D interpreta el valor numérico expresado con números, signo + o - y/o el exponente con el prefijo 'e'. Todo carácter '.' o ',' se interpreta como un separador decimal. | Ejemplo de script PHP: echo -1.4e-16; | -| Booleano | 4D devuelve True si recibe la cadena "true" desde PHP o si la evaluación numérica da un valor no nulo. | Ejemplo de script PHP: echo (a==b); | -| Array | 4D considera que el array PHP fue devuelto en el formato JSON. | Ejemplo de script PHP para devolver un array de dos textos: echo json\_encode( array( "hola", "mundo")); | - -(\*) Por defecto, no se devuelven los encabezados HTTP: -\- Si utiliza [PHP Execute](php-execute.md) al pasar una función en el parámetro *nomFuncion*, los encabezados HTTP nunca se devuelven en *resultPHP*. Sólo están disponibles por medio del comando [PHP GET FULL RESPONSE](php-get-full-response.md). -\- Si utiliza [PHP Execute](php-execute.md) sin un nombre de función (el parámetro *nomFuncion* se omite o contiene una cadena vacía), puede devolver los encabezados HTTP fijando la opción PHP Raw result en True utilizando el comando [PHP SET OPTION](php-set-option.md). - -**Nota:** si debe recuperar grandes volúmenes de datos utilizando PHP, es más eficiente pasar por el canal del buffer *stdOut* (comando **echo** o similar) que por el retorno de función. Para mayor información, consulte la descripción del comando [PHP GET FULL RESPONSE](php-get-full-response.md). - -### Using environment variables - -Puede utilizar el comando [SET ENVIRONMENT VARIABLE](set-environment-variable.md "SET ENVIRONMENT VARIABLE") para definir las variables de entorno utilizadas por el script. Atención: después de llamar [LAUNCH EXTERNAL PROCESS](launch-external-process.md "LAUNCH EXTERNAL PROCESS") o PHP Execute, el conjunto de las variables entorno se borra. - -### Special functions - -4D ofrece las siguientes funciones especiales: - -* **quit\_4d\_php**: permite salir del intérprete PHP y de todos sus procesos hijos. Si al menos uno de los procesos hijo está ejecutando un script, el intérprete no sale y el comando PHP Execute devuelve False. -* **relaunch\_4d\_php**: permite relanzar el intérprete PHP. - -Note que el intérprete se relanza automáticamente cuando la primera petición se envía por PHP Execute. - -## Ejemplo 1 - -Llamada del script "myPhpFile.php" sin función. Este es el contenido del script: - -```PHP - -``` - -El siguiente código 4D: - -```4d - var $result : Text - var $isOK : Boolean - $isOK:=PHP Execute("C:\php\myPhpFile.php";"";$result) - ALERT($Result) -``` - -...mostrará la versión PHP actual. - -## Ejemplo 2 - -Llamada de la función *myPhpFunction* en el script "myNewScript.php" con parámetros. Este es el contenido del script: - -```PHP - -``` - -Llamada con función: - -```4d - var $result : Text - var $param1 : Text - var $param2 : Text - var $isOk : Boolean - $param1 :="¡Hola" - $param2 :="mundo 4D!" - $isOk:=PHP Execute("C:\MyFolder\myNewScript.php";"myPhpFunction";$result;$param1;$param2) - ALERT($result) // Muestra "¡Hola mundo 4D!" -``` - -## Ejemplo 3 - -Salir del intérprete PHP: - -```4d - $ifOk:=PHP Execute("";"quit_4d_php") -``` - -## Ejemplo 4 - -Gestión de errores: - -```4d -  // Instalación del método de gestión de errores - phpCommError:="" // Modificado por PHPErrorHandler - $T_saveErrorHandler :=Method called on error - ON ERR CALL("PHPErrorHandler") - - // Ejecución del script - var $T_result : Text - If(PHP Execute("C:\MyScripts\MiscInfos.php";"";$T_result)) -  // Ningún error, $T_Result contiene el resultado - Else -  // Se ha detectado un error, administrado por PHPErrorHandler -    If(phpCommError="") -       ... // error PHP, utilice PHP GET FULL RESPONSE -    Else -       ALERT(phpCommError) -    End if - End if -  -  // Desinstalación del método - ON ERR CALL($T_saveErrorHandler) - - -``` - -El método PHP\_errHandler es el siguiente: - -```4d - phpCommError:="" - GET LAST ERROR STACK(arrCodes;arrComps;arrLabels) - For($i;1;Size of array(arrCodes)) -    phpCommError:=phpCommError+String(arrCodes{$i})+" "+arrComps{$i}+" "+ -    arrLabels{$i}+Char(Carriage return) - End for -``` - -## Ejemplo 5 - -Creación dinámica por 4D de un script antes de su ejecución: - -```4d - DOCUMENT TO BLOB("C:\Scripts\MyScript.php";$blobDoc) - If(OK=1) -    $strDoc:=BLOB to text($blobDoc;UTF8 text without length) -  -    $strPosition:=Position("function2Rename";$strDoc) -  -    $strDoc:=Insert string($strDoc;"_v2";Length("function2Rename")+$strPosition) -  -    TEXT TO BLOB($strDoc;$blobDoc;UTF8 text without length) -    BLOB TO DOCUMENT("C:\Scripts\MyScript.php";$blobDoc) -    If(OK#1) -       ALERT("Error on script creation") -    End if - End if -``` - -Se ejecuta el script: - -```4d - $err:=PHP Execute("C:\Scripts\MyScript.php";"function2Rename_v2";*) -``` - -## Ejemplo 6 - -Recuperación directa de un valor de tipo fecha y hora. Este es el contenido del script: - -```PHP - -``` - -Recepción de la fecha del lado 4D: - -```4d - var $phpResult_date : Date - $result :=PHP Execute("C:\php_scripts\ReturnDate.php";"";$phpResult_date) -  //$phpResult_date is !05/04/2009 ! -  - var $phpResult_time : Time - $result :=PHP Execute("C:\php_scripts\ReturnDate.php";"";$phpResult_time) -  //$phpResult_time is ?01 :02 :03 ? -``` - -## Ejemplo 7 - -Distribución de datos en arrays: - -```4d - ARRAY TEXT($arText ;0) - ARRAY LONGINT($arLong ;0) - $p1 :="," - $p2 :="11,22,33,44,55" - $phpok :=PHP Execute("";"explode";$arText;$p1;$p2) - $phpok :=PHP Execute("";"explode";$arLong;$p1;$p2) -  -  // $arText contiene los valores Alfa "11", "22", "33", etc. -  // $arLong contiene los números, 11, 22, 33, etc. -``` - -## Ejemplo 8 - -Inicialización de un array: - -```4d - ARRAY TEXT($arText ;0) - $phpok :=PHP Execute("";"array_pad";$arText;->$arText;50;"indefinido") -  // Ejecute en PHP: $arrTest = array_pad($arrTest, 50, ’indefinido’); -  // Llene el array $arText con 50 elementos "indefinido" -``` - -## Ejemplo 9 - -Paso de parámetros vía un array: - -```4d - ARRAY INTEGER($arInt;0) - $phpok :=PHP Execute("";"json_decode";$arInt;"[13,51,69,42,7]") -  // Ejecute en PHP: $arInt = json_decode(’[13,51,69,42,7]’); -  // Llene el array con los valores iniciales -``` - -## Ejemplo 10 - -Este es un ejemplo de la utilización básica de la función trim, para eliminar espacios adicionales y/o caracteres invisibles de principio a fin de una cadena: - -```4d - var $T_String : Text - $T_String:="   Hello  " - var $B : Boolean - $B:=PHP Execute("";"trim";$T_String;$T_String) -``` - -Para obtener más información acerca de la función trim, por favor, consulte la documentación de PHP. - -## Ver también - -*Ejecutar scripts PHP en 4D* -[PHP GET FULL RESPONSE](php-get-full-response.md) -[PHP SET OPTION](php-set-option.md) - -## Propiedades - -| | | -| --- | --- | -| Número de comando | 1058 | -| Hilo seguro | ✗ | - - diff --git a/i18n/es/docusaurus-plugin-content-docs/current/commands-legacy/php-get-full-response.md b/i18n/es/docusaurus-plugin-content-docs/current/commands-legacy/php-get-full-response.md deleted file mode 100644 index f7b450d20275f5..00000000000000 --- a/i18n/es/docusaurus-plugin-content-docs/current/commands-legacy/php-get-full-response.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -id: php-get-full-response -title: PHP GET FULL RESPONSE -slug: /commands/php-get-full-response -displayed_sidebar: docs ---- - - - -**PHP GET FULL RESPONSE** ( *stdOut* {; *etiquetasErr* ; *valoresErr*} {; *camposEncHttp* {; *valoresEncHttp*}} ) - -| Parámetro | Tipo | | Descripción | -| --- | --- | --- | --- | -| stdOut | Text, Blob | ← | Contenido del buffer stdOut | -| etiquetasErr | Text array | ← | Etiquetas de los errores | -| valoresErr | Text array | ← | Valores de los errores | -| camposEncHttp | Text array | ← | Nombres de los encabezados HTTP | -| valoresEncHttp | Text array | ← | Valores de los encabezados HTTP | - - - -:::info Compatibilidad - -**PHP es obsoleto en 4D**. Se recomienda utilizar la clase [`4D.SystemWorker class`](../API/SystemWorkerClass.md). - -::: - -## Descripción - -El comando PHP GET FULL RESPONSE permite obtener información adicional sobre la respuesta devuelta por el intérprete PHP. Este comando es especialmente útil en el caso de que ocurra un error durante la ejecución del script. - -El script PHP puede escribir datos en el buffer stdOut (eco, print, etc.) El comando devuelve directamente los datos en la variable *stdOut* y aplica los mismos principios de conversión descritos en el comando [PHP Execute](php-execute.md "PHP Execute"). - -Los arrays texto sincronizados *etiquetasErr* y *valoresErrV* se llenan cuando la ejecución de los scripts PHP provoca errores. Estos arrays, en particular, proporcionan información sobre el origen, el script y la línea de error. Estas dos arrays son inseparables: si se pasa *etiquetasErr*, se debe pasar también *valoresErr*. - -Dado que los intercambios entre 4D y el intérprete PHP se efectúan a través de FastCGI, el intérprete PHP funciona como si fuera llamado por un servidor HTTP y por tanto, envía encabezados HTTP. Puede recuperar estos encabezados y sus valores en los arrays *camposEncHttp* y *valoresEncHttp*. - -## Ver también - -[PHP Execute](php-execute.md) -[PHP GET OPTION](php-get-option.md) - -## Propiedades - -| | | -| --- | --- | -| Número de comando | 1061 | -| Hilo seguro | ✗ | - - diff --git a/i18n/es/docusaurus-plugin-content-docs/current/commands-legacy/php-get-option.md b/i18n/es/docusaurus-plugin-content-docs/current/commands-legacy/php-get-option.md deleted file mode 100644 index 2093a64b865f46..00000000000000 --- a/i18n/es/docusaurus-plugin-content-docs/current/commands-legacy/php-get-option.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -id: php-get-option -title: PHP GET OPTION -slug: /commands/php-get-option -displayed_sidebar: docs ---- - - - - -**PHP GET OPTION** ( *opcion* ; *valor* ) - -| Parámetro | Tipo | | Descripción | -| --- | --- | --- | --- | -| opcion | Integer | → | Opción a leer | -| valor | Boolean | ← | Valor actual de la opción | - - - -:::info Compatibilidad - -**PHP es obsoleto en 4D**. Se recomienda utilizar la clase [`4D.SystemWorker class`](../API/SystemWorkerClass.md). - -::: - -## Descripción - -El comando PHP GET OPTION puede ser utilizado para conocer el valor actual de una opción relativa a la ejecución de scripts PHP. - -Pase en el parámetro *opcion* una constante del tema "*PHP*" para designar la opción a leer. El comando devuelve el valor actual de la opción en el parámetro *valor*. - -| Constante | Tipo | Valor | Comentario | -| -------------- | ------------ | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| PHP raw result | Entero largo | 2 | Definición del modo de procesamiento de los encabezados HTTP devueltos por PHP en el resultado de la ejecución cuando este resultado es de tipo Texto (cuando el resultado es de tipo BLOB, los encabezados se mantienen siempre).
    **Valor(es) posible(s)**: Booleano. False (valor por defecto = eliminar los encabezados HTTP del resultado. True = conservar los encabezados HTTP. | - -## Ver también - -[PHP GET FULL RESPONSE](php-get-full-response.md) -[PHP SET OPTION](php-set-option.md) - -## Propiedades - -| | | -| --- | --- | -| Número de comando | 1060 | -| Hilo seguro | ✗ | - - diff --git a/i18n/es/docusaurus-plugin-content-docs/current/commands-legacy/php-set-option.md b/i18n/es/docusaurus-plugin-content-docs/current/commands-legacy/php-set-option.md deleted file mode 100644 index de55e1aa80d4e3..00000000000000 --- a/i18n/es/docusaurus-plugin-content-docs/current/commands-legacy/php-set-option.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -id: php-set-option -title: PHP SET OPTION -slug: /commands/php-set-option -displayed_sidebar: docs ---- - - - -**PHP SET OPTION** ( *opción* ; *valor* {; *} ) - -| Parámetro | Tipo | | Descripción | -| --- | --- | --- | --- | -| opción | Integer | → | Número de opción a definir | -| valor | Boolean | → | Nuevo valor de la opción | -| * | Operador | → | Si se pasa: la modificación no se aplica a la siguiente llamada | - - - -:::info Compatibilidad - -**PHP es obsoleto en 4D**. Se recomienda utilizar la clase [`4D.SystemWorker class`](../API/SystemWorkerClass.md). - -::: - -## Descripción - -El comando **PHP SET OPTION** se utiliza para definir opciones específicas antes de llamar el comando [PHP Execute](php-execute.md). El alcance de este comando es el proceso actual. - -Pase en el parámetro *opcion* una constante del tema "*PHP*" para designar la opción a modificar y en el parámetro *valor*, el nuevo valor de la opción. - -| Constante | Tipo | Valor | Comentario | -| -------------- | ------------ | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| PHP raw result | Entero largo | 2 | Definición del modo de procesamiento de los encabezados HTTP devueltos por PHP en el resultado de la ejecución cuando este resultado es de tipo Texto (cuando el resultado es de tipo BLOB, los encabezados se mantienen siempre).
    **Valor(es) posible(s)**: Booleano. False (valor por defecto = eliminar los encabezados HTTP del resultado. True = conservar los encabezados HTTP. | - -Por defecto, **PHP SET OPTION** define la opción para todas las llamadas posteriores a [PHP Execute](php-execute.md) del proceso. Si lo quiere definir para la próxima llamada únicamente pase el parámetro estrella (*\**). - -## Ver también - -[PHP Execute](php-execute.md) -[PHP GET OPTION](php-get-option.md) - -## Propiedades - -| | | -| --- | --- | -| Número de comando | 1059 | -| Hilo seguro | ✗ | - - diff --git a/i18n/es/docusaurus-plugin-content-docs/current/commands/command-index.md b/i18n/es/docusaurus-plugin-content-docs/current/commands/command-index.md index 16ae77a333a7b0..3bd6a376e57d1e 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/commands/command-index.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/commands/command-index.md @@ -846,10 +846,6 @@ title: Comandos por nombre [`Path to object`](../commands-legacy/path-to-object.md)
    [`PAUSE INDEXES`](../commands-legacy/pause-indexes.md)
    [`PAUSE PROCESS`](../commands-legacy/pause-process.md)
    -[`PHP Execute`](../commands-legacy/php-execute.md)
    -[`PHP GET FULL RESPONSE`](../commands-legacy/php-get-full-response.md)
    -[`PHP GET OPTION`](../commands-legacy/php-get-option.md)
    -[`PHP SET OPTION`](../commands-legacy/php-set-option.md)
    [`PICTURE CODEC LIST`](../commands-legacy/picture-codec-list.md)
    [`PICTURE LIBRARY LIST`](../commands-legacy/picture-library-list.md)
    [`PICTURE PROPERTIES`](../commands-legacy/picture-properties.md)
    diff --git a/i18n/es/docusaurus-plugin-content-docs/current/commands/theme/PHP.md b/i18n/es/docusaurus-plugin-content-docs/current/commands/theme/PHP.md deleted file mode 100644 index b70f3706c920ea..00000000000000 --- a/i18n/es/docusaurus-plugin-content-docs/current/commands/theme/PHP.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -id: PHP_theme -title: PHP -sidebar_label: PHP -slug: /commands/theme/PHP ---- - -| | -| --------------------------------------------------------------------------------------------------------------- | -| [](../../commands-legacy/php-execute.md)
    | -| [](../../commands-legacy/php-get-full-response.md)
    | -| [](../../commands-legacy/php-get-option.md)
    | -| [](../../commands-legacy/php-set-option.md)
    | diff --git a/i18n/es/docusaurus-plugin-content-docs/version-19/API/DataClassClass.md b/i18n/es/docusaurus-plugin-content-docs/version-19/API/DataClassClass.md index 4f3b2a35e251d5..06f70c81c58d10 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-19/API/DataClassClass.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-19/API/DataClassClass.md @@ -937,6 +937,7 @@ ds.People.query("places.locations[a].kind= :1 and places.locations[a].city= :2"; ... la búsqueda sólo devolverá "martin" porque tiene un elemento "locations" cuyo "kind" es "home" y cuyo "city" es "paris". La búsqueda no devolverá "smith" porque los valores "home" y "paris" no están en el mismo elemento de colección. + **parámetro formula** Como alternativa a la inserción de fórmulas dentro del parámetro *queryString* (ver arriba), puede pasar directamente un objeto fórmula como criterio de búsqueda booleano. La utilización de un objeto fórmula para las búsquedas es **recomendada** ya que se beneficia de la tokenización, y el código es más fácil de buscar/leer. @@ -1011,6 +1012,8 @@ queryPath: steps:[{steps:[{description:[index : Company.revenues ] > 10000000,time:0,recordsfounds:933}]}]}]}]} ``` +### Ejemplos + #### Ejemplo 1 Esta sección ofrece varios ejemplos de búsquedas. diff --git a/i18n/es/docusaurus-plugin-content-docs/version-20-R10/API/DataClassClass.md b/i18n/es/docusaurus-plugin-content-docs/version-20-R10/API/DataClassClass.md index 1ca2caf7d93e7c..6cc75cf9c6adfb 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-20-R10/API/DataClassClass.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-20-R10/API/DataClassClass.md @@ -1099,7 +1099,7 @@ ds.Class.query("info.coll[a].val != :1";0) Puede utilizar cualquier letra del alfabeto como notación `[a]`. -#### Vinculación de los argumentos de búsqueda y los atributos de colección +### Vinculación de los argumentos de búsqueda y los atributos de colección Para ello, es necesario vincular los argumentos de la búsqueda a los elementos de colección, de modo que sólo se encuentren los elementos únicos que contengan argumentos vinculados. Al buscar dentro de los atributos de objetos de clases de datos que contengan colecciones utilizando varios argumentos de consulta unidos por el operador AND, es posible que desee asegurarse de que sólo se devuelvan entidades que contengan elementos que coincidan con todos los argumentos, y no entidades en las que los argumentos puedan encontrarse en elementos diferentes. @@ -1254,6 +1254,8 @@ queryPath: steps:[{steps:[{description:[index : Company.revenues ] > 10000000,time:0,recordsfounds:933}]}]}]}]} ``` +### Ejemplos + #### Ejemplo 1 Esta sección ofrece varios ejemplos de búsquedas. diff --git a/i18n/es/docusaurus-plugin-content-docs/version-20-R10/aikit/Classes/OpenAIVisionHelper.md b/i18n/es/docusaurus-plugin-content-docs/version-20-R10/aikit/Classes/OpenAIVisionHelper.md index a810d60497882e..10830ea841702a 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-20-R10/aikit/Classes/OpenAIVisionHelper.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-20-R10/aikit/Classes/OpenAIVisionHelper.md @@ -17,7 +17,7 @@ title: OpenAIVisionHelper | *parámetros* | [OpenAIChatCompletionsParameters](OpenAIChatCompletionsParameters.md) | Parámetros opcionales para la solicitud de finalización del chat. | | Resultado | [OpenAIChatCompletionsResult](OpenAIChatCompletionsResult.md) | El resultado de la visión. | -Sends a prompt to the OpenAI chat API along with an associated image URL, and optionally accepts parameters for the chat completion. +Envía un mensaje a la API de chat OpenAI con una URL de imagen asociada, y opcionalmente acepta los parámetros para la finalización del chat. #### Ejemplo de Uso diff --git a/i18n/es/docusaurus-plugin-content-docs/version-20/API/DataClassClass.md b/i18n/es/docusaurus-plugin-content-docs/version-20/API/DataClassClass.md index 840c6d928a3aa8..0e2d857479e600 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-20/API/DataClassClass.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-20/API/DataClassClass.md @@ -1087,7 +1087,7 @@ ds.Class.query("info.coll[a].val != :1";0) Puede utilizar cualquier letra del alfabeto como notación `[a]`. -#### Vinculación de los argumentos de búsqueda y los atributos de colección +### Vinculación de los argumentos de búsqueda y los atributos de colección :::info @@ -1142,6 +1142,7 @@ ds.People.query("places.locations[a].kind= :1 and places.locations[a].city= :2"; ... la búsqueda sólo devolverá "martin" porque tiene un elemento "locations" cuyo "kind" es "home" y cuyo "city" es "paris". La búsqueda no devolverá "smith" porque los valores "home" y "paris" no están en el mismo elemento de colección. + #### Búsquedas en las relaciones Muchos a Muchos ORDA ofrece una sintaxis especial para facilitar las consultas en las relaciones de muchos a muchos. En este contexto, puede ser necesario buscar diferentes valores con un operador `AND` PERO en el mismo atributo. Por ejemplo, de una mirada a la siguiente estructura: @@ -1250,6 +1251,8 @@ queryPath: steps:[{steps:[{description:[index : Company.revenues ] > 10000000,time:0,recordsfounds:933}]}]}]}]} ``` +### Ejemplos + #### Ejemplo 1 Esta sección ofrece varios ejemplos de búsquedas. diff --git a/i18n/es/docusaurus-plugin-content-docs/version-20/ViewPro/classes.md b/i18n/es/docusaurus-plugin-content-docs/version-20/ViewPro/classes.md index 3d6a5e115053c8..5a29470cfe0196 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-20/ViewPro/classes.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-20/ViewPro/classes.md @@ -129,7 +129,7 @@ La propiedad `.tableColumns` es u La propiedad `.theme` define el tema de una tabla. También puede ser un texto (nombre de un tema nativo SpreadJS). -See the [native SpreadJS themes](https://developer.mescius.com/spreadjs/api/classes/GC.Spread.Sheets.Tables.TableThemes). +Consulte los [temas nativos de SpreadJS](https://developer.mescius.com/spreadjs/api/classes/GC.Spread.Sheets.Tables.TableThemes). ### .useFooterDropDownList @@ -362,7 +362,7 @@ La propiedad `.lastHeaderCellStyle` es la **.name** : Text -La propiedad `.name` es el name of a [native SpreadJS theme](https://developer.mescius.com/spreadjs/api/classes/GC.Spread.Sheets.Tables.TableThemes). +La propiedad `.name` es el nombre de un [tema nativo de SpreadJS](https://developer.mescius.com/spreadjs/api/classes/GC.Spread.Sheets.Tables.TableThemes). ### .secondColumnStripSize diff --git a/i18n/es/docusaurus-plugin-content-docs/version-21/API/DataClassClass.md b/i18n/es/docusaurus-plugin-content-docs/version-21/API/DataClassClass.md index d300006546e7b0..adf8acae4d7164 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-21/API/DataClassClass.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-21/API/DataClassClass.md @@ -1101,7 +1101,7 @@ ds.Class.query("info.coll[a].val != :1";0) Puede utilizar cualquier letra del alfabeto como notación `[a]`. -#### Vinculación de los argumentos de búsqueda y los atributos de colección +### Vinculación de los argumentos de búsqueda y los atributos de colección Para ello, es necesario vincular los argumentos de la búsqueda a los elementos de colección, de modo que sólo se encuentren los elementos únicos que contengan argumentos vinculados. Al buscar dentro de los atributos de objetos de clases de datos que contengan colecciones utilizando varios argumentos de consulta unidos por el operador AND, es posible que desee asegurarse de que sólo se devuelvan entidades que contengan elementos que coincidan con todos los argumentos, y no entidades en las que los argumentos puedan encontrarse en elementos diferentes. @@ -1295,6 +1295,8 @@ queryPath: steps:[{steps:[{description:[index : Company.revenues ] > 10000000,time:0,recordsfounds:933}]}]}]}]} ``` +### Ejemplos + #### Ejemplo 1 Esta sección ofrece varios ejemplos de búsquedas. diff --git a/i18n/es/docusaurus-plugin-content-docs/version-21/API/EntityClass.md b/i18n/es/docusaurus-plugin-content-docs/version-21/API/EntityClass.md index e5bb51f928f1e0..f9aeff8a3e81fa 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-21/API/EntityClass.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-21/API/EntityClass.md @@ -1283,7 +1283,7 @@ Los siguientes valores pueden ser devueltos en las propiedades `status`y `status | `dk status entity does not exist anymore` | 5 | La entidad ya no existe en los datos. Este error puede ocurrir en los siguientes casos:
  • la entidad ha sido eliminada (el marcador ha cambiado y ahora el espacio de memoria está libre)
  • la entidad ha sido eliminada y reemplazada por otra con otra clave primaria (el marcador ha cambiado y una nueva entidad ahora utiliza el espacio memoria). Cuando se utiliza `.drop()`, este error puede devolverse cuando se utiliza la opción `dk force drop if stamp changed`. Cuando se utiliza `.lock()`, este error puede ser devuelto cuando se utiliza la opción `dk reload if stamp changed`

  • **statusText asociado**: "Entity does not exist anymore" | | `dk status locked` | 3 | La entidad está bloqueada por un bloqueo pesimista. **statusText asociado**: "Already locked" | | `dk status validation failed` | 7 | Error no crítico enviado por el desarrollador para un [evento de validación](../ORDA/orda-events.md). **statusText asociado**: "Mild Validation Error" | -| `dk status serious error` | 4 | A serious error is a low-level database error (e.g. duplicated key), a hardware error, etc. **Associated statusText**: "Other error" | +| `dk status serious error` | 4 | Un error grave es un error de base de datos de bajo nivel (por ejemplo, una llave duplicada), un error de hardware, etc. **statusText asociado**: "Other error" | | `dk status serious validation error` | 8 | Error crítico enviado por el desarrollador para un [evento de validación](../ORDA/orda-events.md). **statusText asociado**: "Serious Validation Error" | | `dk status stamp has changed` | 2 | El valor del marcador interno (stamp) de la entidad no coincide con el de la entidad almacenada en los datos (bloqueo optimista).
  • with `.save()`: error only if the `dk auto merge` option is not used
  • with `.drop()`: error only if the `dk force drop if stamp changed` option is not used
  • with `.lock()`: error only if the `dk reload if stamp changed` option is not used

  • **Associated statusText**: "Stamp has changed" | | `dk status wrong permission` | 1 | Los privilegios actuales no permiten guardar la entidad. **Associated statusText**: "Permission Error" | diff --git a/i18n/es/docusaurus-plugin-content-docs/version-21/Notes/updates.md b/i18n/es/docusaurus-plugin-content-docs/version-21/Notes/updates.md index 3327e911a240f8..1889b7ee555b5a 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-21/Notes/updates.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-21/Notes/updates.md @@ -45,6 +45,7 @@ El [renderizado **Fluent UI** para los formularios 4D](../FormEditor/forms.md#fl - Servicios web (SOAP): cuando las [sesiones escalables](../WebServer/sessions.md#enabling-web-sessions) están activadas, los servicios web se ejecutan ahora en [**procesos apropiativos**](../Develop/preemptive.md) en modo compilado. Make sure that your SOAP code is thread-safe and that the session in which it runs has appropriate [privileges](../API/SessionClass.md#setprivileges). - Servidor web: se elimina la compatibilidad con las URL obsoletas `4DSYNC/` y `4DCGI/`. Ya no se realiza ningún tratamiento específico en estas URL. - Las sesiones usuario web ahora son devueltas por [`Process activity`](../commands/process-activity.md). +- PHP commands are now [deprecated](https://blog.4d.com/deprecation-of-php-commands-removal-of-4d-built-in-php-interpreter/) and should no longer be used in your developments. - El comando [`HIGHLIGHT TEXT`](../commands/highlight-text) es ahora compatible en el contexto de los subformularios. - En cliente/servidor, se elimina la noción de procesos locales. The "$" has no longer a specific meaning in process names and the \* parameter in [`REGISTER CLIENT`](../commands/register-client) is ignored. - **Componentes ya no integrados**: a partir de 4D 21, los componentes desarrollados por 4D (4D NetKit, 4D SVG..., ver [esta lista](../Extensions/overview.md#components-developed-by-4d)) ya no están integrados en la aplicación 4D. Cuando se actualiza un proyecto a 4D 21 o superior, se muestra un cuadro de diálogo:
    @@ -306,7 +307,6 @@ Si sus aplicaciones 4D utilizan conexiones TLS, se recomienda actualizar a 4D 20 | ngtcp2 | 1.16.0 | **21** | Utilizado para QUIC | | OpenSSL | 3.5.2 | **21** | | | PDFWriter | 4.7.0 | **21** | Utilizado para [`WP Export document`](../WritePro/commands/wp-export-document.md) y [`WP Export variable`](../WritePro/commands/wp-export-variable.md) | -| PHP | 8.2.4 | 20 | | | SpreadJS | 17.1.0 | 20 R7 | Consulte [esta entrada de blog](https://blog.4d.com/4d-view-pro-whats-new-in-4d-20-r7/) para obtener una visión general de las nuevas funciones | | webKit | WKWebView | 19 | | | Xerces | 3.3.0 | **21** | Utilizado para comandos XML | diff --git a/i18n/es/docusaurus-plugin-content-docs/version-21/WebServer/webServerConfig.md b/i18n/es/docusaurus-plugin-content-docs/version-21/WebServer/webServerConfig.md index 6c515cad28b161..1951b02acbcd6e 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-21/WebServer/webServerConfig.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-21/WebServer/webServerConfig.md @@ -605,7 +605,7 @@ Estado de validación de la dirección IP para las cookies de sesión. Por razon ### Usuario web genérico -This option allows you to designate a user, previously defined in the [4D password table](../Users/handling_users_groups.md), as a "Generic Web User". In this case, each browser allowed to connect to the database gets access authorizations and restrictions associated with this user. +This option allows you to designate a user, previously defined in the [4D password table](../Users/handling_users_groups.md), as a "Generic Web User". En este caso, cada navegador autorizado a conectarse a la base de datos obtiene las autorizaciones y restricciones de acceso asociadas a este usuario. #### Enviar directamente los caracteres extendidos diff --git a/i18n/es/docusaurus-plugin-content-docs/version-21/aikit/Classes/OpenAIVisionHelper.md b/i18n/es/docusaurus-plugin-content-docs/version-21/aikit/Classes/OpenAIVisionHelper.md index a810d60497882e..10830ea841702a 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-21/aikit/Classes/OpenAIVisionHelper.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-21/aikit/Classes/OpenAIVisionHelper.md @@ -17,7 +17,7 @@ title: OpenAIVisionHelper | *parámetros* | [OpenAIChatCompletionsParameters](OpenAIChatCompletionsParameters.md) | Parámetros opcionales para la solicitud de finalización del chat. | | Resultado | [OpenAIChatCompletionsResult](OpenAIChatCompletionsResult.md) | El resultado de la visión. | -Sends a prompt to the OpenAI chat API along with an associated image URL, and optionally accepts parameters for the chat completion. +Envía un mensaje a la API de chat OpenAI con una URL de imagen asociada, y opcionalmente acepta los parámetros para la finalización del chat. #### Ejemplo de Uso diff --git a/i18n/es/docusaurus-plugin-content-docs/version-21/commands-legacy/php-execute.md b/i18n/es/docusaurus-plugin-content-docs/version-21/commands-legacy/php-execute.md deleted file mode 100644 index 10a21b6b44889d..00000000000000 --- a/i18n/es/docusaurus-plugin-content-docs/version-21/commands-legacy/php-execute.md +++ /dev/null @@ -1,290 +0,0 @@ ---- -id: php-execute -title: PHP Execute -slug: /commands/php-execute -displayed_sidebar: docs ---- - - - -**PHP Execute** ( *rutaScript* {; *nomFuncion* {; *resultPHP* {; *param*} {; *param2* ; ... ; *paramN*}}} ) : Boolean - -| Parámetro | Tipo | | Descripción | -| --- | --- | --- | --- | -| rutaScript | Text | → | Ruta de acceso al script PHP o "" para ejecutar una función PHP | -| nomFuncion | Text | → | Función PHP a ejecutar | -| resultPHP | *, Variable, Field | ← | Resultado de ejecución de la función PHP o * para no recibir el resultado | -| param | Text, Boolean, Real, Integer, Date, Time | → | Parámetros de la función PHP | -| Resultado | Boolean | ← | True = ejecución correcta, False = error de ejecución | - - - -:::info Compatibilidad - -**PHP es obsoleto en 4D**. Se recomienda utilizar la clase [`4D.SystemWorker class`](../API/SystemWorkerClass.md). - -::: - -## Descripción - -El comando **PHP Execute** permite ejecutar un script o una función PHP. - -Pase en el parámetro *rutaScrip*t la ruta de acceso del archivo de script PHP a ejecutar. Puede ser una ruta de acceso relativa si el archivo está ubicado junto a la estructura de la base o de una ruta absoluta. La ruta de acceso puede expresarse en sintaxis sistema o POSIX. -Si quiere ejecutar directamente una función PHP estándar, pase una cadena vacía ("") en *rutaScript*. El nombre de la función debe pasarse en el segundo parámetro. - -Pase en el parámetro *nomFuncion* un nombre de función PHP si quiere ejecutar una función específica en el script *rutaScript*. Si pasa una cadena vacía u omite el parámetro *nomFuncion*, el script se ejecuta completamente. - -**Nota:** PHP tiene en cuenta las mayúsculas y minúsculas de los caracteres en el nombre de la función. No utilice paréntesis, introduzca únicamente el nombre de la función. - -El parámetro *resultPHP* recibe el resultado de la ejecución de la función PHP. Puede pasar: - -* una variable, un array o un campo para recibir el resultado, -* el carácter *\** si la función no devuelve ningún resultado o si no quiere recuperar el resultado. - -El parámetro *resultPHP* puede ser de tipo texto, entero largo, real, booleano o fecha así como también (excepto para arrays) BLOB u hora. 4D efectuará la conversión de los datos y los ajustes necesarios siguiendo los principios descritos en la sección a continuación. - -* si pasa un nombre de función en el parámetro *nomFuncion*, *resultPHP* recibirá lo que el desarrollador PHP devuelve con el comando return del cuerpo de la función. -* Si utiliza el comando sin pasar un nombre de función en el parámetro *nomFuncion*, *r* *esultPHP* recibirá lo que el desarrollador PHP devolvió con el comando echo ( o un comando similar). - - Si llama a una función PHP que espera argumentos, utilice los parámetros *param1...N* para pasar uno o varios valores. Los valores deben estar separados por punto y coma. Puede pasar valores de tipo alfa, texto, booleano, real, entero, entero largo, fecha u hora. Las imágenes y los BLOBs y objetos no se aceptan. Puede enviar un array; en este caso debe pasar un puntero en el array al comando **PHP Execute**, de lo contrario el índice actual del array se enviará como un entero (ver el ejemplo). El comando acepta todos los tipos de arrays excepto los arrays puntero, los arrays imagen y los arrays 2D. - -**Nota:** por razones técnicas, el tamaño de los parámetros pasados vía el protocolo FastCGI no debe pasar los 64 KB. Debe tener en cuenta esta limitación si utiliza parámetros de tipo Texto. - -El comando devuelve True si la ejecución se ha efectuado correctamente del lado de 4D, en otras palabras, si el lanzamiento del entorno de ejecución, la apertura del script y el establecimiento de la comunicación con el intérprete PHP fueron exitosos. De lo contrario, se genera un error, que puede interceptar con el comando [ON ERR CALL](on-err-call.md "ON ERR CALL") y analizar con [Last errors](../commands/last-errors.md). -Además, el script mismo puede generar errores PHP. En este caso, debe utilizar el comando [PHP GET FULL RESPONSE](php-get-full-response.md "PHP GET FULL RESPONSE") para analizar la fuente del error (ver ejemplo 4). - -**Nota:** PHP permite configurar la gestión de errores. Para mayor información, consulte por ejemplo la página: . - -### Conversión de los datos devueltos - -La siguiente tabla especifica cómo 4D interpreta y convierte los datos devueltos en función del tipo del parámetro *resultPHP*. - -| **Tipo del parámetro *resultPHP*** | **Proceso 4D** | **Ejemplo** | -| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------- | -| BLOB | 4D recupera los datos recibidos sin ninguna modificación(\*). | | -| Texto | 4D espera los datos codificados en UTF-8 (\*). El desarrollador PHP puede necesitar utilizar el comando PHP **utf8\_encode**. | Ejemplo de script PHP: echo utf8\_encode(miTexto) | -| Fecha | 4D espera una fecha enviada como una cadena en formato RFC 3339 (también llamado DATE\_ATOM en PHP). Este formato es de tipo "AAAA-MM-DDTHH:MM:SS", por ejemplo: 2005-08-15T15:52:01+00:00\. 4D ignora la parte hora y devuelve la fecha en UTC. | | -| Hora | 4D espera una hora enviada en forma de cadena en formato RFC 3339 (ver el tipo Fecha). 4D ignora la parte fecha y devuelve el número de segundos transcurridos desde la media noche considerando la fecha en la zona horaria local. | Ejemplo de script PHP para enviar 2h30'45": echo date( DATE\_ATOM, mktime( 2,30,45)) | -| Entero o Real | 4D interpreta el valor numérico expresado con números, signo + o - y/o el exponente con el prefijo 'e'. Todo carácter '.' o ',' se interpreta como un separador decimal. | Ejemplo de script PHP: echo -1.4e-16; | -| Booleano | 4D devuelve True si recibe la cadena "true" desde PHP o si la evaluación numérica da un valor no nulo. | Ejemplo de script PHP: echo (a==b); | -| Array | 4D considera que el array PHP fue devuelto en el formato JSON. | Ejemplo de script PHP para devolver un array de dos textos: echo json\_encode( array( "hola", "mundo")); | - -(\*) Por defecto, no se devuelven los encabezados HTTP: -\- Si utiliza [PHP Execute](php-execute.md) al pasar una función en el parámetro *nomFuncion*, los encabezados HTTP nunca se devuelven en *resultPHP*. Sólo están disponibles por medio del comando [PHP GET FULL RESPONSE](php-get-full-response.md). -\- Si utiliza [PHP Execute](php-execute.md) sin un nombre de función (el parámetro *nomFuncion* se omite o contiene una cadena vacía), puede devolver los encabezados HTTP fijando la opción PHP Raw result en True utilizando el comando [PHP SET OPTION](php-set-option.md). - -**Nota:** si debe recuperar grandes volúmenes de datos utilizando PHP, es más eficiente pasar por el canal del buffer *stdOut* (comando **echo** o similar) que por el retorno de función. Para mayor información, consulte la descripción del comando [PHP GET FULL RESPONSE](php-get-full-response.md). - -### Using environment variables - -Puede utilizar el comando [SET ENVIRONMENT VARIABLE](set-environment-variable.md "SET ENVIRONMENT VARIABLE") para definir las variables de entorno utilizadas por el script. Atención: después de llamar [LAUNCH EXTERNAL PROCESS](launch-external-process.md "LAUNCH EXTERNAL PROCESS") o PHP Execute, el conjunto de las variables entorno se borra. - -### Special functions - -4D ofrece las siguientes funciones especiales: - -* **quit\_4d\_php**: permite salir del intérprete PHP y de todos sus procesos hijos. Si al menos uno de los procesos hijo está ejecutando un script, el intérprete no sale y el comando PHP Execute devuelve False. -* **relaunch\_4d\_php**: permite relanzar el intérprete PHP. - -Note que el intérprete se relanza automáticamente cuando la primera petición se envía por PHP Execute. - -## Ejemplo 1 - -Llamada del script "myPhpFile.php" sin función. Este es el contenido del script: - -```PHP - -``` - -El siguiente código 4D: - -```4d - var $result : Text - var $isOK : Boolean - $isOK:=PHP Execute("C:\php\myPhpFile.php";"";$result) - ALERT($Result) -``` - -...mostrará la versión PHP actual. - -## Ejemplo 2 - -Llamada de la función *myPhpFunction* en el script "myNewScript.php" con parámetros. Este es el contenido del script: - -```PHP - -``` - -Llamada con función: - -```4d - var $result : Text - var $param1 : Text - var $param2 : Text - var $isOk : Boolean - $param1 :="¡Hola" - $param2 :="mundo 4D!" - $isOk:=PHP Execute("C:\MyFolder\myNewScript.php";"myPhpFunction";$result;$param1;$param2) - ALERT($result) // Muestra "¡Hola mundo 4D!" -``` - -## Ejemplo 3 - -Salir del intérprete PHP: - -```4d - $ifOk:=PHP Execute("";"quit_4d_php") -``` - -## Ejemplo 4 - -Gestión de errores: - -```4d -  // Instalación del método de gestión de errores - phpCommError:="" // Modificado por PHPErrorHandler - $T_saveErrorHandler :=Method called on error - ON ERR CALL("PHPErrorHandler") - - // Ejecución del script - var $T_result : Text - If(PHP Execute("C:\MyScripts\MiscInfos.php";"";$T_result)) -  // Ningún error, $T_Result contiene el resultado - Else -  // Se ha detectado un error, administrado por PHPErrorHandler -    If(phpCommError="") -       ... // error PHP, utilice PHP GET FULL RESPONSE -    Else -       ALERT(phpCommError) -    End if - End if -  -  // Desinstalación del método - ON ERR CALL($T_saveErrorHandler) - - -``` - -El método PHP\_errHandler es el siguiente: - -```4d - phpCommError:="" - GET LAST ERROR STACK(arrCodes;arrComps;arrLabels) - For($i;1;Size of array(arrCodes)) -    phpCommError:=phpCommError+String(arrCodes{$i})+" "+arrComps{$i}+" "+ -    arrLabels{$i}+Char(Carriage return) - End for -``` - -## Ejemplo 5 - -Creación dinámica por 4D de un script antes de su ejecución: - -```4d - DOCUMENT TO BLOB("C:\Scripts\MyScript.php";$blobDoc) - If(OK=1) -    $strDoc:=BLOB to text($blobDoc;UTF8 text without length) -  -    $strPosition:=Position("function2Rename";$strDoc) -  -    $strDoc:=Insert string($strDoc;"_v2";Length("function2Rename")+$strPosition) -  -    TEXT TO BLOB($strDoc;$blobDoc;UTF8 text without length) -    BLOB TO DOCUMENT("C:\Scripts\MyScript.php";$blobDoc) -    If(OK#1) -       ALERT("Error on script creation") -    End if - End if -``` - -Se ejecuta el script: - -```4d - $err:=PHP Execute("C:\Scripts\MyScript.php";"function2Rename_v2";*) -``` - -## Ejemplo 6 - -Recuperación directa de un valor de tipo fecha y hora. Este es el contenido del script: - -```PHP - -``` - -Recepción de la fecha del lado 4D: - -```4d - var $phpResult_date : Date - $result :=PHP Execute("C:\php_scripts\ReturnDate.php";"";$phpResult_date) -  //$phpResult_date is !05/04/2009 ! -  - var $phpResult_time : Time - $result :=PHP Execute("C:\php_scripts\ReturnDate.php";"";$phpResult_time) -  //$phpResult_time is ?01 :02 :03 ? -``` - -## Ejemplo 7 - -Distribución de datos en arrays: - -```4d - ARRAY TEXT($arText ;0) - ARRAY LONGINT($arLong ;0) - $p1 :="," - $p2 :="11,22,33,44,55" - $phpok :=PHP Execute("";"explode";$arText;$p1;$p2) - $phpok :=PHP Execute("";"explode";$arLong;$p1;$p2) -  -  // $arText contiene los valores Alfa "11", "22", "33", etc. -  // $arLong contiene los números, 11, 22, 33, etc. -``` - -## Ejemplo 8 - -Inicialización de un array: - -```4d - ARRAY TEXT($arText ;0) - $phpok :=PHP Execute("";"array_pad";$arText;->$arText;50;"indefinido") -  // Ejecute en PHP: $arrTest = array_pad($arrTest, 50, ’indefinido’); -  // Llene el array $arText con 50 elementos "indefinido" -``` - -## Ejemplo 9 - -Paso de parámetros vía un array: - -```4d - ARRAY INTEGER($arInt;0) - $phpok :=PHP Execute("";"json_decode";$arInt;"[13,51,69,42,7]") -  // Ejecute en PHP: $arInt = json_decode(’[13,51,69,42,7]’); -  // Llene el array con los valores iniciales -``` - -## Ejemplo 10 - -Este es un ejemplo de la utilización básica de la función trim, para eliminar espacios adicionales y/o caracteres invisibles de principio a fin de una cadena: - -```4d - var $T_String : Text - $T_String:="   Hello  " - var $B : Boolean - $B:=PHP Execute("";"trim";$T_String;$T_String) -``` - -Para obtener más información acerca de la función trim, por favor, consulte la documentación de PHP. - -## Ver también - -*Ejecutar scripts PHP en 4D* -[PHP GET FULL RESPONSE](php-get-full-response.md) -[PHP SET OPTION](php-set-option.md) - -## Propiedades - -| | | -| --- | --- | -| Número de comando | 1058 | -| Hilo seguro | ✗ | - - diff --git a/i18n/es/docusaurus-plugin-content-docs/version-21/commands-legacy/php-get-full-response.md b/i18n/es/docusaurus-plugin-content-docs/version-21/commands-legacy/php-get-full-response.md deleted file mode 100644 index f7b450d20275f5..00000000000000 --- a/i18n/es/docusaurus-plugin-content-docs/version-21/commands-legacy/php-get-full-response.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -id: php-get-full-response -title: PHP GET FULL RESPONSE -slug: /commands/php-get-full-response -displayed_sidebar: docs ---- - - - -**PHP GET FULL RESPONSE** ( *stdOut* {; *etiquetasErr* ; *valoresErr*} {; *camposEncHttp* {; *valoresEncHttp*}} ) - -| Parámetro | Tipo | | Descripción | -| --- | --- | --- | --- | -| stdOut | Text, Blob | ← | Contenido del buffer stdOut | -| etiquetasErr | Text array | ← | Etiquetas de los errores | -| valoresErr | Text array | ← | Valores de los errores | -| camposEncHttp | Text array | ← | Nombres de los encabezados HTTP | -| valoresEncHttp | Text array | ← | Valores de los encabezados HTTP | - - - -:::info Compatibilidad - -**PHP es obsoleto en 4D**. Se recomienda utilizar la clase [`4D.SystemWorker class`](../API/SystemWorkerClass.md). - -::: - -## Descripción - -El comando PHP GET FULL RESPONSE permite obtener información adicional sobre la respuesta devuelta por el intérprete PHP. Este comando es especialmente útil en el caso de que ocurra un error durante la ejecución del script. - -El script PHP puede escribir datos en el buffer stdOut (eco, print, etc.) El comando devuelve directamente los datos en la variable *stdOut* y aplica los mismos principios de conversión descritos en el comando [PHP Execute](php-execute.md "PHP Execute"). - -Los arrays texto sincronizados *etiquetasErr* y *valoresErrV* se llenan cuando la ejecución de los scripts PHP provoca errores. Estos arrays, en particular, proporcionan información sobre el origen, el script y la línea de error. Estas dos arrays son inseparables: si se pasa *etiquetasErr*, se debe pasar también *valoresErr*. - -Dado que los intercambios entre 4D y el intérprete PHP se efectúan a través de FastCGI, el intérprete PHP funciona como si fuera llamado por un servidor HTTP y por tanto, envía encabezados HTTP. Puede recuperar estos encabezados y sus valores en los arrays *camposEncHttp* y *valoresEncHttp*. - -## Ver también - -[PHP Execute](php-execute.md) -[PHP GET OPTION](php-get-option.md) - -## Propiedades - -| | | -| --- | --- | -| Número de comando | 1061 | -| Hilo seguro | ✗ | - - diff --git a/i18n/es/docusaurus-plugin-content-docs/version-21/commands-legacy/php-get-option.md b/i18n/es/docusaurus-plugin-content-docs/version-21/commands-legacy/php-get-option.md deleted file mode 100644 index 2093a64b865f46..00000000000000 --- a/i18n/es/docusaurus-plugin-content-docs/version-21/commands-legacy/php-get-option.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -id: php-get-option -title: PHP GET OPTION -slug: /commands/php-get-option -displayed_sidebar: docs ---- - - - - -**PHP GET OPTION** ( *opcion* ; *valor* ) - -| Parámetro | Tipo | | Descripción | -| --- | --- | --- | --- | -| opcion | Integer | → | Opción a leer | -| valor | Boolean | ← | Valor actual de la opción | - - - -:::info Compatibilidad - -**PHP es obsoleto en 4D**. Se recomienda utilizar la clase [`4D.SystemWorker class`](../API/SystemWorkerClass.md). - -::: - -## Descripción - -El comando PHP GET OPTION puede ser utilizado para conocer el valor actual de una opción relativa a la ejecución de scripts PHP. - -Pase en el parámetro *opcion* una constante del tema "*PHP*" para designar la opción a leer. El comando devuelve el valor actual de la opción en el parámetro *valor*. - -| Constante | Tipo | Valor | Comentario | -| -------------- | ------------ | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| PHP raw result | Entero largo | 2 | Definición del modo de procesamiento de los encabezados HTTP devueltos por PHP en el resultado de la ejecución cuando este resultado es de tipo Texto (cuando el resultado es de tipo BLOB, los encabezados se mantienen siempre).
    **Valor(es) posible(s)**: Booleano. False (valor por defecto = eliminar los encabezados HTTP del resultado. True = conservar los encabezados HTTP. | - -## Ver también - -[PHP GET FULL RESPONSE](php-get-full-response.md) -[PHP SET OPTION](php-set-option.md) - -## Propiedades - -| | | -| --- | --- | -| Número de comando | 1060 | -| Hilo seguro | ✗ | - - diff --git a/i18n/es/docusaurus-plugin-content-docs/version-21/commands-legacy/php-set-option.md b/i18n/es/docusaurus-plugin-content-docs/version-21/commands-legacy/php-set-option.md deleted file mode 100644 index de55e1aa80d4e3..00000000000000 --- a/i18n/es/docusaurus-plugin-content-docs/version-21/commands-legacy/php-set-option.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -id: php-set-option -title: PHP SET OPTION -slug: /commands/php-set-option -displayed_sidebar: docs ---- - - - -**PHP SET OPTION** ( *opción* ; *valor* {; *} ) - -| Parámetro | Tipo | | Descripción | -| --- | --- | --- | --- | -| opción | Integer | → | Número de opción a definir | -| valor | Boolean | → | Nuevo valor de la opción | -| * | Operador | → | Si se pasa: la modificación no se aplica a la siguiente llamada | - - - -:::info Compatibilidad - -**PHP es obsoleto en 4D**. Se recomienda utilizar la clase [`4D.SystemWorker class`](../API/SystemWorkerClass.md). - -::: - -## Descripción - -El comando **PHP SET OPTION** se utiliza para definir opciones específicas antes de llamar el comando [PHP Execute](php-execute.md). El alcance de este comando es el proceso actual. - -Pase en el parámetro *opcion* una constante del tema "*PHP*" para designar la opción a modificar y en el parámetro *valor*, el nuevo valor de la opción. - -| Constante | Tipo | Valor | Comentario | -| -------------- | ------------ | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| PHP raw result | Entero largo | 2 | Definición del modo de procesamiento de los encabezados HTTP devueltos por PHP en el resultado de la ejecución cuando este resultado es de tipo Texto (cuando el resultado es de tipo BLOB, los encabezados se mantienen siempre).
    **Valor(es) posible(s)**: Booleano. False (valor por defecto = eliminar los encabezados HTTP del resultado. True = conservar los encabezados HTTP. | - -Por defecto, **PHP SET OPTION** define la opción para todas las llamadas posteriores a [PHP Execute](php-execute.md) del proceso. Si lo quiere definir para la próxima llamada únicamente pase el parámetro estrella (*\**). - -## Ver también - -[PHP Execute](php-execute.md) -[PHP GET OPTION](php-get-option.md) - -## Propiedades - -| | | -| --- | --- | -| Número de comando | 1059 | -| Hilo seguro | ✗ | - - diff --git a/i18n/es/docusaurus-plugin-content-docs/version-21/commands/command-index.md b/i18n/es/docusaurus-plugin-content-docs/version-21/commands/command-index.md index 16ae77a333a7b0..3bd6a376e57d1e 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-21/commands/command-index.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-21/commands/command-index.md @@ -846,10 +846,6 @@ title: Comandos por nombre [`Path to object`](../commands-legacy/path-to-object.md)
    [`PAUSE INDEXES`](../commands-legacy/pause-indexes.md)
    [`PAUSE PROCESS`](../commands-legacy/pause-process.md)
    -[`PHP Execute`](../commands-legacy/php-execute.md)
    -[`PHP GET FULL RESPONSE`](../commands-legacy/php-get-full-response.md)
    -[`PHP GET OPTION`](../commands-legacy/php-get-option.md)
    -[`PHP SET OPTION`](../commands-legacy/php-set-option.md)
    [`PICTURE CODEC LIST`](../commands-legacy/picture-codec-list.md)
    [`PICTURE LIBRARY LIST`](../commands-legacy/picture-library-list.md)
    [`PICTURE PROPERTIES`](../commands-legacy/picture-properties.md)
    diff --git a/i18n/es/docusaurus-plugin-content-docs/version-21/commands/theme/PHP.md b/i18n/es/docusaurus-plugin-content-docs/version-21/commands/theme/PHP.md deleted file mode 100644 index b70f3706c920ea..00000000000000 --- a/i18n/es/docusaurus-plugin-content-docs/version-21/commands/theme/PHP.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -id: PHP_theme -title: PHP -sidebar_label: PHP -slug: /commands/theme/PHP ---- - -| | -| --------------------------------------------------------------------------------------------------------------- | -| [](../../commands-legacy/php-execute.md)
    | -| [](../../commands-legacy/php-get-full-response.md)
    | -| [](../../commands-legacy/php-get-option.md)
    | -| [](../../commands-legacy/php-set-option.md)
    | diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/API/DataClassClass.md b/i18n/fr/docusaurus-plugin-content-docs/current/API/DataClassClass.md index 61f05df1675a24..3c6426e8d0a674 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/current/API/DataClassClass.md +++ b/i18n/fr/docusaurus-plugin-content-docs/current/API/DataClassClass.md @@ -1095,7 +1095,7 @@ ds.Class.query("info.coll[a].val != :1";0) Vous pouvez utiliser n'importe quelle lettre de l'alphabet comme notation `[a]` . -#### Lier les critères de recherche pour les attributs de collections +### Lier les critères de recherche pour les attributs de collections Lorsque vous effectuez une recherche parmi des attributs objet de dataclass contenant des collections à l'aide de plusieurs critères de recherche reliés par l'opérateur AND, vous pouvez vouloir vous assurer que seules les entités contenant des éléments correspondant à tous les critères sont renvoyées, et non les entités où les critères peuvent être trouvés dans différents éléments. Pour ce faire, vous devez lier les critères de la recherche aux éléments de la collection, de sorte que seuls les éléments individuels contenant les critères liés soient trouvés. @@ -1303,6 +1303,8 @@ queryPath: steps:[{steps:[{description:[index : Company.revenues ] > 10000000,time:0,recordsfounds:933}]}]}]}]} ``` +### Exemples + #### Exemple 1 Cette section présente différents exemples de recherches. diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/Notes/updates.md b/i18n/fr/docusaurus-plugin-content-docs/current/Notes/updates.md index be4ca530e72ed2..c40dceeaacabd3 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/current/Notes/updates.md +++ b/i18n/fr/docusaurus-plugin-content-docs/current/Notes/updates.md @@ -35,7 +35,6 @@ Lisez [**Les nouveautés de 4D 21 R2**](https://blog.4d.com/fr-whats-new-in-4d-v | ngtcp2 | 1.16.0 | **21** | Utilisé pour QUIC | | OpenSSL | 3.5.2 | **21** | | | PDFWriter | 4.7.0 | **21** | Utilisé pour [`WP Export document`](../WritePro/commands/wp-export-document.md) et [`WP Export variable`](../WritePro/commands/wp-export-variable.md) | -| PHP | 8.2.4 | 20 | | | SpreadJS | 17.1.0 | 20 R7 | Voir [ce blog post](https://blog.4d.com/4d-view-pro-whats-new-in-4d-20-r7/) pour un aperçu des nouvelles fonctionnalités. | | webKit | WKWebView | 19 | | | Xerces | 3.3.0 | **21** | Utilisé pour les commandes XML | diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/commands-legacy/php-execute.md b/i18n/fr/docusaurus-plugin-content-docs/current/commands-legacy/php-execute.md deleted file mode 100644 index d9af50cad87026..00000000000000 --- a/i18n/fr/docusaurus-plugin-content-docs/current/commands-legacy/php-execute.md +++ /dev/null @@ -1,289 +0,0 @@ ---- -id: php-execute -title: PHP Execute -slug: /commands/php-execute -displayed_sidebar: docs ---- - - - -**PHP Execute** ( *cheminScript* {; *nomFonction* {; *résultatPHP* {; *param*} {; *param2* ; ... ; *paramN*}}} ) : Boolean - -| Paramètre | Type | | Description | -| --- | --- | --- | --- | -| cheminScript | Text | → | Chemin d’accès au script PHP ou "" pour exécuter une fonction PHP | -| nomFonction | Text | → | Fonction PHP à exécuter | -| résultatPHP | *, Variable, Field | ← | Résultat d’exécution de la fonction PHP ou * pour ne pas recevoir de résultat | -| param | Text, Boolean, Real, Integer, Date, Time | → | Paramètre(s) de la fonction PHP | -| Résultat | Boolean | ← | Vrai = exécution correcte, Faux = erreur d’exécution | - - - -:::info Compatibilité - -**PHP est obsolète dans 4D**. Il est désormais recommandé d'utiliser la classe [`4D.SystemWorker`](../API/SystemWorkerClass.md). - -::: - -## Description - -La commande **PHP Execute** permet d’exécuter un script ou une fonction PHP. - -Passez dans le paramètre *cheminScript* le chemin d’accès du fichier de script PHP à exécuter. Il peut s’agir d’un chemin d’accès relatif si le fichier est situé à côté de la structure de la base ou d’un chemin absolu. Le chemin d’accès peut être exprimé en syntaxe système ou Posix. -Si vous souhaitez exécuter directement une fonction PHP standard, passez une chaîne vide ("") dans *cheminScript*. Le nom de la fonction doit être passé en deuxième paramètre. - -Passez dans le paramètre *nomFonction* un nom de fonction PHP si vous souhaitez exécuter une fonction spécifique dans le script *cheminScript*. Si vous passez une chaîne vide ou omettez le paramètre *nomFonction*, le script est exécuté entièrement. - -**Note** : PHP tient compte de la casse des caractères dans le nom de la fonction. N’utilisez pas de parenthèses, saisissez uniquement le nom de la fonction. - -Le paramètre *résultatPHP* reçoit le résultat de l’exécution de la fonction PHP. Vous pouvez passer soit : - -* une variable, un tableau ou un champ afin de recevoir le résultat, -* le caractère \* si la fonction ne retourne pas de résultat ou si vous ne souhaitez pas le récupérer. - -*résultatPHP* peut être de type texte, entier long, réel, booléen, date ainsi que (hormis pour les tableaux) BLOB et heure. 4D effectuera la conversion des données et les ajustements nécessaires suivant les principes décrits dans le paragraphe *Conversion of data returned* ci-dessous. - -* Si vous avez passé un nom de fonction dans *nomFonction*, *résultatPHP* recevra ce que le développeur PHP a retourné avec la commande **return** depuis le corps de la fonction. -* Si vous utilisez la commande sans passer de nom de fonction dans *nomFonction*, *résultatPHP* recevra ce que le développeur PHP a retourné avec la commande **echo** (ou une commande similaire). - -Si vous appelez une fonction PHP qui attend des arguments, utilisez le(s) paramètre(s) *param1...N* pour passer une ou plusieurs valeur(s). Les valeurs doivent être séparées par des points-virgules. Vous pouvez passer des valeurs de type alpha, texte, booléen, réel, entier, entier long, date ou heure. Les images, BLOBs et objets ne sont pas admis. Vous pouvez envoyer un tableau, il est nécessaire dans ce cas de passer un pointeur sur le tableau à la commande [PHP Execute](php-execute.md), sinon c'est l'index courant du tableau qui est envoyé sous forme d'entier (cf. exemple). La commande accepte tous les types de tableaux sauf les tableaux pointeur, les tableaux image et les tableaux 2D. -Les paramètres *param1...N* sont envoyés au PHP au format JSON en utf-8\. Ils sont automatiquement décodés avec la commande PHP **json\_decode** avant d'être passés à la fonction PHP *nomFonction*. - -**Note :** Pour des raisons techniques, la taille des paramètres passés via le protocole fast cgi ne doit pas dépasser 64 Ko. Vous devez tenir compte de cette limitation si vous utilisez des paramètres de type Texte. - -La commande retourne Vrai si l’exécution s’est déroulée correctement côté 4D, c’est-à-dire si le lancement de l’environnement d’exécution, l’ouverture du script et l’établissement de la communication avec l’interpréteur PHP ont été réussis. Dans le cas contraire, une erreur est générée, que vous pouvez intercepter avec la commande [ON ERR CALL](on-err-call.md) et analyser avec [Last errors](../commands/last-errors.md) . -En outre, le script lui-même peut générer des erreurs PHP. Dans ce cas, vous devez utiliser la commande [PHP GET FULL RESPONSE](php-get-full-response.md) afin d’analyser la source de l’erreur (voir exemple 4). - -**Note :** PHP permet de configurer la gestion d’erreurs. Pour plus d’informations, reportez-vous par exemple à la page . - -### Conversion des données retournées - -Le tableau suivant précise comment 4D interprète et convertit les données retournées en fonction du type du paramètre *résultatPHP*. - -| **Type paramètre *résultatPHP*** | **Traitement 4D** | **Exemple** | -| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -| BLOB | 4D récupère les données reçues sans aucune modification (\*). | | -| Texte | 4D attend des données encodées en utf-8 (\*). Le développeur PHP peut avoir besoin d'utiliser la commande PHP **utf8\_encode**. | Exemple de script PHP : echo utf8\_encode(monTexte) | -| Date | 4D attend une date envoyée sous forme de chaîne au format RFC 3339 (appelé parfois DATE\_ATOM en PHP). Ce format est de type "AAAA-MM-JJTHH:MM:SS", par exemple : 2005-08-15T15:52:01+00:00\. 4D ignorera la partie heure et retournera la date en UTC. | | -| Heure | 4D attend une heure envoyée sous forme de chaîne au format RFC 3339 (cf. type Date). 4D ignorera la partie date et retournera le nombre de secondes écoulées depuis minuit en considérant la date dans la zone horaire locale. | Exemple de script PHP pour envoyer 2h30'45" : echo date( DATE\_ATOM, mktime( 2,30,45)) | -| Entier ou Réel | 4D interprète le numérique exprimé avec des chiffres, signe - ou +, exposant préfixé par 'e'. Tout caractère '.' ou ',' est interprété comme un séparateur décimal. | Exemple de script PHP : echo -1.4e-16; | -| Booléen | 4D retournera Vrai s'il reçoit la chaine "true" depuis PHP ou si l'évaluation sous forme de numérique donne une valeur non nulle. | Exemple de script PHP : echo (a==b); | -| Tableau | 4D considère que le tableau PHP a été retourné au format JSON. | Exemple de script PHP pour retourner un tableau de deux textes : echo json\_encode( array( "hello", "world")); | - -(\*) Par défaut, les en-têtes HTTP ne sont pas retournés : -\- si vous utilisez [PHP Execute](php-execute.md) en passant une fonction dans le paramètre *nomFonction*, les entêtes HTTP ne sont jamais retournés dans *résultatPHP*. Ils ne sont accessibles que via [PHP GET FULL RESPONSE](php-get-full-response.md). -\- si vous utilisez [PHP Execute](php-execute.md) sans nom de fonction (*nomFonction* omis ou contenant une chaîne vide), vous pouvez retourner les en-têtes HTTP en fixant l'option PHP raw result à Vrai à l'aide de la commande [PHP SET OPTION](php-set-option.md). - -**Note :** Si vous devez récupérer de gros volumes de données via PHP, il est généralement plus efficace de passer par le canal du buffer *stdOut* (commande **echo** ou similaire) que par le retour de fonction. Pour plus d'informations, reportez-vous à la description de la commande [PHP GET FULL RESPONSE](php-get-full-response.md). - -### Utiliser les variables d’environnement - -Vous pouvez utiliser la commande [SET ENVIRONMENT VARIABLE](set-environment-variable.md) pour définir des variables d’environment utilisées par le script. Attention : après un appel à [LAUNCH EXTERNAL PROCESS](launch-external-process.md) ou **PHP Execute**, l’ensemble des variables d’environment est effacé. - -### Fonctions spéciales - -4D propose les fonctions spéciales suivantes : - -* **quit\_4d\_php** : permet de quitter l’interpréteur PHP et tous ses process enfants. Si un process enfant au moins est en train d’exécuter un script, l’interpréteur ne quitte pas et la commande **PHP Execute** retourne Faux. -* **relaunch\_4d\_php** permet de relancer l’interpréteur PHP. - -A noter que l’interpréteur est relancé automatiquement à la première requête envoyée par **PHP Execute**. - -## Exemple 1 - -Appel du script "myPhpFile.php" sans fonction. Voici le contenu du script : - -```PHP -< -``` - -Le code 4D suivant : - -```4d - var $result : Text - var $isOK : Boolean - $isOK:=PHP Execute("C:\\php\\myPhpFile.php";"";$result) - ALERT($Result) -``` - -... affichera la version php courante. - -## Exemple 2 - -Appel de la fonction *myPhpFunction* dans le script "myNewScript.php" avec des paramètres. Voici le contenu du script : - -```PHP - -``` - -Appel avec fonction : - -```4d - var $result : Text - var $param1 : Text - var $param2 : Text - var $isOk : Boolean - $param1:="Hello" - $param2 :="4D world !" - $isOk:=PHP Execute("C:\\MonDossier\\myNewScript.php";"myPhpFunction";$result;$param1;$param2 ) - ALERT($result) // Affiche "Hello 4D world!" -``` - -## Exemple 3 - -Faire quitter l’interpréteur PHP : - -```4d - $ifOk:=PHP Execute("";"quit_4d_php") -``` - -## Exemple 4 - -Gestion des erreurs : - -```4d -    // Installation de la méthode de gestion d’erreurs - phpCommError:="" // Modifiée par PHPErrorHandler - $T_saveErrorHandler :=Method called on error - ON ERR CALL("PHPErrorHandler") -  -     // Exécution du script - var $T_result : Text - If(PHP Execute("C:\\MyScripts\\MiscInfos.php";"";$T_result)) -              // Pas d’erreur, $T_Result contient le résultat - Else -              // Une erreur a été détectée, gérée par PHPErrorHandler -          If(phpCommError="") -             ... // erreur PHP, utilisez PHP LIRE REPONSE COMPLETE -          Else -             ALERT(phpCommError) -          End if - End if -  -  // Désinstallation de la méthode - ON ERR CALL($T_saveErrorHandler) -``` - -La méthode PHP\_errHandler est la suivante : - -```4d - phpCommError:="" - GET LAST ERROR STACK(tabCodes;tabComps;tabLibellés) - For($i;1;Size of array(tabCodes)) -       phpCommError:=phpCommError+String(tabCodes{$i})+" "+tabComps{$i}+" "+tabLibellés{$i}+Caractere(Retour chariot) - End for -``` - -## Exemple 5 - -Création dynamique par 4D d’un script avant son exécution : - -```4d - DOCUMENT TO BLOB("C:\\Scripts\\MonScript.php";$blobDoc) - If(OK=1) -       $strDoc:=BLOB to text($blobDoc;UTF8 text without length) -        -       $strPosition:=Position("function2Rename";$strDoc) -        -       $strDoc:=Insert string($strDoc;"_v2";Length("function2Rename")+$strPosition) -        -       TEXT TO BLOB($strDoc;$blobDoc;UTF8 text without length) -       BLOB TO DOCUMENT("C:\\Scripts\\MonScript.php";$blobDoc) -       If(OK#1) -          ALERT("Erreur à la création du script") -       End if - End if -``` - -Le script est ensuite exécuté : - -```4d - $err:=PHP Execute("C:\\Scripts\\MonScript.php";"function2Rename_v2";*) -``` - -## Exemple 6 - -Récupération directe d’une valeur de type date et heure. Voici le contenu du script : - -```PHP - -``` - -Réception de la date côté 4D : - -```4d - var $phpResult_date : Date - $result :=PHP Execute("C:\php_scripts\ReturnDate.php";"";$phpResult_date) -     //$phpResult_date vaut !05/04/2009 ! -  - var $phpResult_time : Time - $result :=PHP Execute("C:\php_scripts\ReturnDate.php";"";$phpResult_time) -  -     //$phpResult_time vaut ?01 :02 :03 ? -``` - -## Exemple 7 - -Répartition de données dans des tableaux : - -```4d - ARRAY TEXT($arText ;0) - ARRAY LONGINT($arLong ;0) - $p1 :="," - $p2 :="11,22,33,44,55" - $phpok :=PHP Execute("";"explode";$arText;$p1;$p2) - $phpok :=PHP Execute("";"explode";$arLong;$p1;$p2) -  -        // $arText contient les valeurs alpha "11", "22", "33", etc. -        // $arLong contient les numériques, 11, 22, 33, etc. -``` - -## Exemple 8 - -Initialisation d’un tableau : - -```4d - ARRAY TEXT($arText ;0) - $phpok :=PHP Execute("";"array_pad";$arText;->$arText;50;"indéfini") -        // Exécute en php : $arrTest = array_pad($arrTest, 50, ’indéfini’); -        // Remplit le tableau $arText avec 50 éléments "indéfini" -``` - -## Exemple 9 - -Passage de paramètres via un tableau : - -```4d - ARRAY INTEGER($arInt;0) - $phpok :=PHP Execute("";"json_decode";$arInt;"[13,51,69,42,7]") -        // Exécute en php : $arInt = json_decode(’[13,51,69,42,7]’); -        // Remplit le tableau avec des valeurs initiales -``` - -## Exemple 10 - -Utilisation basique de la fonction *trim* de PHP permettant d'enlever les espaces et/ou caractères invisibles de part et d'autre d'une chaîne de caractères : - -```4d - var $T_String : Text - $T_String:="   Bonjour  " - var $B : Boolean - $B:=PHP Execute("";"trim";$T_String;$T_String) -``` - -Pour plus d'informations sur la fonction *trim*, veuillez vous reporter à la documentation PHP. - -## Voir aussi - -*Exécuter des scripts PHP dans 4D* -[PHP GET FULL RESPONSE](php-get-full-response.md) -[PHP SET OPTION](php-set-option.md) - -## Propriétés - -| | | -| --- | --- | -| Numéro de commande | 1058 | -| Thread safe | ✗ | - - diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/commands-legacy/php-get-full-response.md b/i18n/fr/docusaurus-plugin-content-docs/current/commands-legacy/php-get-full-response.md deleted file mode 100644 index 507d899ea9657e..00000000000000 --- a/i18n/fr/docusaurus-plugin-content-docs/current/commands-legacy/php-get-full-response.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -id: php-get-full-response -title: PHP GET FULL RESPONSE -slug: /commands/php-get-full-response -displayed_sidebar: docs ---- - - - -**PHP GET FULL RESPONSE** ( *stdOut* {; *libellésErr* ; *valeursErr*} {; *chpsEnteteHttp* {; *valeursEnteteHttp*}} ) - -| Paramètre | Type | | Description | -| --- | --- | --- | --- | -| stdOut | Text, Blob | ← | Contenu du buffer stdOut | -| libellésErr | Text array | ← | Libellés des erreurs | -| valeursErr | Text array | ← | Valeurs des erreurs | -| chpsEnteteHttp | Text array | ← | Noms des en-têtes HTTP | -| valeursEnteteHttp | Text array | ← | Valeurs des en-têtes HTTP | - - - -:::info Compatibilité - -**PHP est obsolète dans 4D**. Il est désormais recommandé d'utiliser la classe [`4D.SystemWorker`](../API/SystemWorkerClass.md). - -::: - -## Description - -La commande **PHP GET FULL RESPONSE** vous permet d’obtenir des informations supplémentaires sur la réponse retournée par l’interpréteur PHP. Cette commande est particulièrement utile en cas d’erreur survenant au cours de l’exécution du script. - -Le script PHP peut écrire des données dans le buffer stdOut (echo, print...). La commande retourne directement ces données dans la variable *stdOut* et applique les mêmes principes de conversion que ceux décrits dans la commande [PHP Execute](php-execute.md). - -Les tableaux texte synchronisés *libellésErr* et *valeursErr* sont remplis lorsque l’exécution des scripts PHP provoque des erreurs. Ces tableaux fournissent des informations notamment sur l’origine, le script et la ligne de l’erreur. Ces deux tableaux sont indissociables : si *libellésErr* est passé, *valeursErr* doit être passé également. - -Comme les échanges entre 4D et l’interpréteur PHP s’effectuent via FastCGI, l’interpréteur PHP fonctionne comme s’il était appelé par un serveur HTTP et envoie donc des en-têtes HTTP. Vous pouvez récupérer ces en-têtes et leurs valeurs dans les tableaux *champsEnteteHttp* et *valeursEnteteHttp*. - -## Voir aussi - -[PHP Execute](php-execute.md) -[PHP GET OPTION](php-get-option.md) - -## Propriétés - -| | | -| --- | --- | -| Numéro de commande | 1061 | -| Thread safe | ✗ | - - diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/commands-legacy/php-get-option.md b/i18n/fr/docusaurus-plugin-content-docs/current/commands-legacy/php-get-option.md deleted file mode 100644 index 056c689f312a88..00000000000000 --- a/i18n/fr/docusaurus-plugin-content-docs/current/commands-legacy/php-get-option.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -id: php-get-option -title: PHP GET OPTION -slug: /commands/php-get-option -displayed_sidebar: docs ---- - - - - -**PHP GET OPTION** ( *option* ; *valeur* ) - -| Paramètre | Type | | Description | -| --- | --- | --- | --- | -| option | Integer | → | Option à lire | -| valeur | Boolean | ← | Valeur courante de l’option | - - - -:::info Compatibilité - -**PHP est obsolète dans 4D**. Il est désormais recommandé d'utiliser la classe [`4D.SystemWorker`](../API/SystemWorkerClass.md). - -::: - -## Description - -La commande **PHP GET OPTION** permet de connaître la valeur courante d’une option relative à l’éxécution de scripts PHP. - -Passez dans le paramètre *option* une constante du thème *PHP* désignant l’option à lire. La commande retourne dans le paramètre *valeur* la valeur courante de l’option. Vous pouvez passer une des constantes suivantes : - -| Constante | Type | Valeur | Comment | -| ------------------- | ----------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| \_o\_PHP privileges | Entier long | 1 | *\*\*\*\* Sélecteur désactivé \*\*\*\** | -| PHP raw result | Entier long | 2 | Définition du mode de traitement des en-têtes HTTP renvoyés par PHP dans le résultat de l’exécution lorsque ce résultat est de type texte (lorsque le résultat est de type BLOB, les en-têtes sont toujours conservés).
    **Valeur(s) possible(s)** : Booléen. Faux (valeur par défaut) = supprimer les en-têtes HTTP du résultat. Vrai = conserver les en-têtes HTTP. | - -**Note :** Seul le compte utilisateur est retourné lorsque vous utilisez l'option PHP privileges avec la commande **PHP GET OPTION** (le mot de passe n'est pas retourné). - -## Voir aussi - -[PHP GET FULL RESPONSE](php-get-full-response.md) -[PHP SET OPTION](php-set-option.md) - -## Propriétés - -| | | -| --- | --- | -| Numéro de commande | 1060 | -| Thread safe | ✗ | - - diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/commands-legacy/php-set-option.md b/i18n/fr/docusaurus-plugin-content-docs/current/commands-legacy/php-set-option.md deleted file mode 100644 index b44d2b7630d61e..00000000000000 --- a/i18n/fr/docusaurus-plugin-content-docs/current/commands-legacy/php-set-option.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -id: php-set-option -title: PHP SET OPTION -slug: /commands/php-set-option -displayed_sidebar: docs ---- - - - -**PHP SET OPTION** ( *option* ; *valeur* {; *} ) - -| Paramètre | Type | | Description | -| --- | --- | --- | --- | -| option | Integer | → | Numéro d’option à définir | -| valeur | Boolean | → | Nouvelle valeur de l’option | -| * | Opérateur | → | Si passé : la modification ne s’applique qu’à l’appel suivant | - - - -:::info Compatibilité - -**PHP est obsolète dans 4D**. Il est désormais recommandé d'utiliser la classe [`4D.SystemWorker`](../API/SystemWorkerClass.md). - -::: - -## Description - -La commande **PHP SET OPTION** permet de définir des options spécifiques avant un appel à la commande [PHP Execute](php-execute.md). La portée de cette commande est le process courant. - -Passez dans le paramètre *option* une constante du thème *PHP* désignant l’option à modifier et dans le paramètre *valeur*, la nouvelle valeur de l’option. - -| Constante | Type | Valeur | Comment | -| -------------- | ----------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| PHP raw result | Entier long | 2 | Définition du mode de traitement des en-têtes HTTP renvoyés par PHP dans le résultat de l’exécution lorsque ce résultat est de type texte (lorsque le résultat est de type BLOB, les en-têtes sont toujours conservés).
    **Valeur(s) possible(s)** : Booléen. Faux (valeur par défaut) = supprimer les en-têtes HTTP du résultat. Vrai = conserver les en-têtes HTTP. | - -Par défaut, **PHP SET OPTION** définit l’option pour tous les appels à [PHP Execute](php-execute.md) ultérieurs du process. Si vous souhaitez la définir pour le prochain appel uniquement, passez le paramètre étoile (*\**). - -## Voir aussi - -[PHP Execute](php-execute.md) -[PHP GET OPTION](php-get-option.md) - -## Propriétés - -| | | -| --- | --- | -| Numéro de commande | 1059 | -| Thread safe | ✗ | - - diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/commands/command-index.md b/i18n/fr/docusaurus-plugin-content-docs/current/commands/command-index.md index d11e797ed66392..cc9758af6650d3 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/current/commands/command-index.md +++ b/i18n/fr/docusaurus-plugin-content-docs/current/commands/command-index.md @@ -846,10 +846,6 @@ title: Commandes par nom [`Path to object`](../commands-legacy/path-to-object.md)
    [`PAUSE INDEXES`](../commands-legacy/pause-indexes.md)
    [`PAUSE PROCESS`](../commands-legacy/pause-process.md)
    -[`PHP Execute`](../commands-legacy/php-execute.md)
    -[`PHP GET FULL RESPONSE`](../commands-legacy/php-get-full-response.md)
    -[`PHP GET OPTION`](../commands-legacy/php-get-option.md)
    -[`PHP SET OPTION`](../commands-legacy/php-set-option.md)
    [`PICTURE CODEC LIST`](../commands-legacy/picture-codec-list.md)
    [`PICTURE LIBRARY LIST`](../commands-legacy/picture-library-list.md)
    [`PICTURE PROPERTIES`](../commands-legacy/picture-properties.md)
    @@ -878,9 +874,9 @@ title: Commandes par nom [`Printing page`](../commands-legacy/printing-page.md)
    [`PROCESS 4D TAGS`](../commands-legacy/process-4d-tags.md)
    [`Process aborted`](../commands-legacy/process-aborted.md)
    -[`Process activity`](process-activity.md) - **modifié 4D 20 R7**
    -[`Process info`](process-info.md) - **nouveau 4D 20 R7**
    -[`Process number`](process-number.md) - **modifié 4D 20 R7**
    +[`Process activity`](process-activity.md) - **modified 4D 20 R7**
    +[`Process info`](process-info.md) - **new 4D 20 R7**
    +[`Process number`](process-number.md) - **modified 4D 20 R7**
    [`Process state`](../commands-legacy/process-state.md)
    [`PUSH RECORD`](../commands-legacy/push-record.md)
    diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/commands/theme/PHP.md b/i18n/fr/docusaurus-plugin-content-docs/current/commands/theme/PHP.md deleted file mode 100644 index b70f3706c920ea..00000000000000 --- a/i18n/fr/docusaurus-plugin-content-docs/current/commands/theme/PHP.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -id: PHP_theme -title: PHP -sidebar_label: PHP -slug: /commands/theme/PHP ---- - -| | -| --------------------------------------------------------------------------------------------------------------- | -| [](../../commands-legacy/php-execute.md)
    | -| [](../../commands-legacy/php-get-full-response.md)
    | -| [](../../commands-legacy/php-get-option.md)
    | -| [](../../commands-legacy/php-set-option.md)
    | diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-19/API/DataClassClass.md b/i18n/fr/docusaurus-plugin-content-docs/version-19/API/DataClassClass.md index ef9f96bc9c0191..297eb05611d197 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/version-19/API/DataClassClass.md +++ b/i18n/fr/docusaurus-plugin-content-docs/version-19/API/DataClassClass.md @@ -937,6 +937,7 @@ ds.People.query("places.locations[a].kind= :1 and places.locations[a].city= :2"; ... la recherche retournera uniquement "martin" car il possède un élément "locations" dont "kind" est "home" et dont "city" est "paris". La recherche ne retournera pas "smith" car les valeurs "home" et "paris" ne sont pas contenues dans le même élément de collection. + **Paramètre formula** Au lieu d'insérer une formule dans le paramètre *queryString* (voir ci-dessus), vous pouvez directement passer un objet formule en tant que critère de recherche booléen. L'utilisation d'un objet formule pour les recherches est **recommandée** car vous bénéficiez de la tokenisation et le code est plus facile à rechercher/lire. @@ -1011,6 +1012,8 @@ queryPath: steps:[{steps:[{description:[index : Company.revenues ] > 10000000,time:0,recordsfounds:933}]}]}]}]} ``` +### Exemples + #### Exemple 1 Cette section présente différents exemples de recherches. diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-20-R10/API/DataClassClass.md b/i18n/fr/docusaurus-plugin-content-docs/version-20-R10/API/DataClassClass.md index 833e8629f5469a..d17786bff6a814 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/version-20-R10/API/DataClassClass.md +++ b/i18n/fr/docusaurus-plugin-content-docs/version-20-R10/API/DataClassClass.md @@ -1093,7 +1093,7 @@ ds.Class.query("info.coll[a].val != :1";0) Vous pouvez utiliser n'importe quelle lettre de l'alphabet comme notation `[a]` . -#### Lier les critères de recherche pour les attributs de collections +### Lier les critères de recherche pour les attributs de collections Lorsque vous effectuez une recherche parmi des attributs objet de dataclass contenant des collections à l'aide de plusieurs critères de recherche reliés par l'opérateur AND, vous pouvez vouloir vous assurer que seules les entités contenant des éléments correspondant à tous les critères sont renvoyées, et non les entités où les critères peuvent être trouvés dans différents éléments. Pour ce faire, vous devez lier les critères de la recherche aux éléments de la collection, de sorte que seuls les éléments individuels contenant les critères liés soient trouvés. @@ -1248,6 +1248,8 @@ queryPath: steps:[{steps:[{description:[index : Company.revenues ] > 10000000,time:0,recordsfounds:933}]}]}]}]} ``` +### Exemples + #### Exemple 1 Cette section présente différents exemples de recherches. diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-20/API/DataClassClass.md b/i18n/fr/docusaurus-plugin-content-docs/version-20/API/DataClassClass.md index a6dd61bfbe4d57..9ec84d514d3174 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/version-20/API/DataClassClass.md +++ b/i18n/fr/docusaurus-plugin-content-docs/version-20/API/DataClassClass.md @@ -1087,7 +1087,7 @@ ds.Class.query("info.coll[a].val != :1";0) Vous pouvez utiliser n'importe quelle lettre de l'alphabet comme notation `[a]` . -#### Lier les critères de recherche pour les attributs de collections +### Lier les critères de recherche pour les attributs de collections :::info @@ -1142,6 +1142,7 @@ ds.People.query("places.locations[a].kind= :1 and places.locations[a].city= :2"; ... la recherche retournera uniquement "martin" car il possède un élément "locations" dont "kind" est "home" et dont "city" est "paris". La recherche ne retournera pas "smith" car les valeurs "home" et "paris" ne sont pas contenues dans le même élément de collection. + #### Recherches dans les relations N vers N ORDA propose une syntaxe spéciale pour faciliter les recherches dans les relations N vers N. Dans ce contexte, vous pouvez avoir besoin de rechercher des valeurs différentes à l'aide de l'opérateur `AND` MAIS dans le même attribut. Par exemple, considérez la structure suivante : @@ -1250,6 +1251,8 @@ queryPath: steps:[{steps:[{description:[index : Company.revenues ] > 10000000,time:0,recordsfounds:933}]}]}]}]} ``` +### Exemples + #### Exemple 1 Cette section présente différents exemples de recherches. diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-21/API/DataClassClass.md b/i18n/fr/docusaurus-plugin-content-docs/version-21/API/DataClassClass.md index d3ac3533b0ac74..ee58fe211563b5 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/version-21/API/DataClassClass.md +++ b/i18n/fr/docusaurus-plugin-content-docs/version-21/API/DataClassClass.md @@ -1095,7 +1095,7 @@ ds.Class.query("info.coll[a].val != :1";0) Vous pouvez utiliser n'importe quelle lettre de l'alphabet comme notation `[a]` . -#### Lier les critères de recherche pour les attributs de collections +### Lier les critères de recherche pour les attributs de collections Lorsque vous effectuez une recherche parmi des attributs objet de dataclass contenant des collections à l'aide de plusieurs critères de recherche reliés par l'opérateur AND, vous pouvez vouloir vous assurer que seules les entités contenant des éléments correspondant à tous les critères sont renvoyées, et non les entités où les critères peuvent être trouvés dans différents éléments. Pour ce faire, vous devez lier les critères de la recherche aux éléments de la collection, de sorte que seuls les éléments individuels contenant les critères liés soient trouvés. @@ -1289,6 +1289,8 @@ queryPath: steps:[{steps:[{description:[index : Company.revenues ] > 10000000,time:0,recordsfounds:933}]}]}]}]} ``` +### Exemples + #### Exemple 1 Cette section présente différents exemples de recherches. diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-21/Notes/updates.md b/i18n/fr/docusaurus-plugin-content-docs/version-21/Notes/updates.md index dfec26067fc6ec..b9f76a452f9cb8 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/version-21/Notes/updates.md +++ b/i18n/fr/docusaurus-plugin-content-docs/version-21/Notes/updates.md @@ -45,6 +45,7 @@ Le [rendu **Fluent UI** pour les formulaires 4D](../FormEditor/forms.md#fluent-u - Services web (SOAP) : lorsque les [sessions évolutives](../WebServer/sessions.md#enabling-web-sessions) sont activées, les services web s'exécutent désormais dans des [**process préemptifs**](../Develop/preemptive.md) en mode compilé. Make sure that your SOAP code is thread-safe and that the session in which it runs has appropriate [privileges](../API/SessionClass.md#setprivileges). - Serveur web : la prise en charge des URLs dépréciés `4DSYNC/` et `4DCGI/` est supprimée. Plus aucun traitement spécifique n'est effectué sur ces URLs. - Les sessions utilisateurs Web sont désormais renvoyées par [`Process activity`](../commands/process-activity.md). +- PHP commands are now [deprecated](https://blog.4d.com/deprecation-of-php-commands-removal-of-4d-built-in-php-interpreter/) and should no longer be used in your developments. - La commande [`HIGHLIGHT TEXT`](../commands/highlight-text) est maintenant prise en charge dans le contexte des sous-formulaires. - En client/serveur, la notion de process local est supprimée. Le "$" n'a plus de signification spécifique dans les noms de process et le paramètre \* dans [`REGISTER CLIENT`](../commands/register-client) est ignoré. - **Les composants ne sont plus intégrés** : à partir de 4D 21, les composants développés par 4D (4D NetKit, 4D SVG..., voir [cette liste](../Extensions/overview.md#components-developed-by-4d)) ne sont plus intégrés dans l'application 4D. Lors de la mise à jour d'un projet vers 4D 21 ou supérieur, une boîte de dialogue s'affiche :
    @@ -306,7 +307,6 @@ Si vos applications 4D utilisent des connexions TLS, il est recommandé de mettr | ngtcp2 | 1.16.0 | **21** | Utilisé pour QUIC | | OpenSSL | 3.5.2 | **21** | | | PDFWriter | 4.7.0 | **21** | Utilisé pour [`WP Export document`](../WritePro/commands/wp-export-document.md) et [`WP Export variable`](../WritePro/commands/wp-export-variable.md) | -| PHP | 8.2.4 | 20 | | | SpreadJS | 17.1.0 | 20 R7 | Voir [ce blog post](https://blog.4d.com/4d-view-pro-whats-new-in-4d-20-r7/) pour un aperçu des nouvelles fonctionnalités. | | webKit | WKWebView | 19 | | | Xerces | 3.3.0 | **21** | Utilisé pour les commandes XML | diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-21/commands-legacy/php-execute.md b/i18n/fr/docusaurus-plugin-content-docs/version-21/commands-legacy/php-execute.md deleted file mode 100644 index d9af50cad87026..00000000000000 --- a/i18n/fr/docusaurus-plugin-content-docs/version-21/commands-legacy/php-execute.md +++ /dev/null @@ -1,289 +0,0 @@ ---- -id: php-execute -title: PHP Execute -slug: /commands/php-execute -displayed_sidebar: docs ---- - - - -**PHP Execute** ( *cheminScript* {; *nomFonction* {; *résultatPHP* {; *param*} {; *param2* ; ... ; *paramN*}}} ) : Boolean - -| Paramètre | Type | | Description | -| --- | --- | --- | --- | -| cheminScript | Text | → | Chemin d’accès au script PHP ou "" pour exécuter une fonction PHP | -| nomFonction | Text | → | Fonction PHP à exécuter | -| résultatPHP | *, Variable, Field | ← | Résultat d’exécution de la fonction PHP ou * pour ne pas recevoir de résultat | -| param | Text, Boolean, Real, Integer, Date, Time | → | Paramètre(s) de la fonction PHP | -| Résultat | Boolean | ← | Vrai = exécution correcte, Faux = erreur d’exécution | - - - -:::info Compatibilité - -**PHP est obsolète dans 4D**. Il est désormais recommandé d'utiliser la classe [`4D.SystemWorker`](../API/SystemWorkerClass.md). - -::: - -## Description - -La commande **PHP Execute** permet d’exécuter un script ou une fonction PHP. - -Passez dans le paramètre *cheminScript* le chemin d’accès du fichier de script PHP à exécuter. Il peut s’agir d’un chemin d’accès relatif si le fichier est situé à côté de la structure de la base ou d’un chemin absolu. Le chemin d’accès peut être exprimé en syntaxe système ou Posix. -Si vous souhaitez exécuter directement une fonction PHP standard, passez une chaîne vide ("") dans *cheminScript*. Le nom de la fonction doit être passé en deuxième paramètre. - -Passez dans le paramètre *nomFonction* un nom de fonction PHP si vous souhaitez exécuter une fonction spécifique dans le script *cheminScript*. Si vous passez une chaîne vide ou omettez le paramètre *nomFonction*, le script est exécuté entièrement. - -**Note** : PHP tient compte de la casse des caractères dans le nom de la fonction. N’utilisez pas de parenthèses, saisissez uniquement le nom de la fonction. - -Le paramètre *résultatPHP* reçoit le résultat de l’exécution de la fonction PHP. Vous pouvez passer soit : - -* une variable, un tableau ou un champ afin de recevoir le résultat, -* le caractère \* si la fonction ne retourne pas de résultat ou si vous ne souhaitez pas le récupérer. - -*résultatPHP* peut être de type texte, entier long, réel, booléen, date ainsi que (hormis pour les tableaux) BLOB et heure. 4D effectuera la conversion des données et les ajustements nécessaires suivant les principes décrits dans le paragraphe *Conversion of data returned* ci-dessous. - -* Si vous avez passé un nom de fonction dans *nomFonction*, *résultatPHP* recevra ce que le développeur PHP a retourné avec la commande **return** depuis le corps de la fonction. -* Si vous utilisez la commande sans passer de nom de fonction dans *nomFonction*, *résultatPHP* recevra ce que le développeur PHP a retourné avec la commande **echo** (ou une commande similaire). - -Si vous appelez une fonction PHP qui attend des arguments, utilisez le(s) paramètre(s) *param1...N* pour passer une ou plusieurs valeur(s). Les valeurs doivent être séparées par des points-virgules. Vous pouvez passer des valeurs de type alpha, texte, booléen, réel, entier, entier long, date ou heure. Les images, BLOBs et objets ne sont pas admis. Vous pouvez envoyer un tableau, il est nécessaire dans ce cas de passer un pointeur sur le tableau à la commande [PHP Execute](php-execute.md), sinon c'est l'index courant du tableau qui est envoyé sous forme d'entier (cf. exemple). La commande accepte tous les types de tableaux sauf les tableaux pointeur, les tableaux image et les tableaux 2D. -Les paramètres *param1...N* sont envoyés au PHP au format JSON en utf-8\. Ils sont automatiquement décodés avec la commande PHP **json\_decode** avant d'être passés à la fonction PHP *nomFonction*. - -**Note :** Pour des raisons techniques, la taille des paramètres passés via le protocole fast cgi ne doit pas dépasser 64 Ko. Vous devez tenir compte de cette limitation si vous utilisez des paramètres de type Texte. - -La commande retourne Vrai si l’exécution s’est déroulée correctement côté 4D, c’est-à-dire si le lancement de l’environnement d’exécution, l’ouverture du script et l’établissement de la communication avec l’interpréteur PHP ont été réussis. Dans le cas contraire, une erreur est générée, que vous pouvez intercepter avec la commande [ON ERR CALL](on-err-call.md) et analyser avec [Last errors](../commands/last-errors.md) . -En outre, le script lui-même peut générer des erreurs PHP. Dans ce cas, vous devez utiliser la commande [PHP GET FULL RESPONSE](php-get-full-response.md) afin d’analyser la source de l’erreur (voir exemple 4). - -**Note :** PHP permet de configurer la gestion d’erreurs. Pour plus d’informations, reportez-vous par exemple à la page . - -### Conversion des données retournées - -Le tableau suivant précise comment 4D interprète et convertit les données retournées en fonction du type du paramètre *résultatPHP*. - -| **Type paramètre *résultatPHP*** | **Traitement 4D** | **Exemple** | -| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -| BLOB | 4D récupère les données reçues sans aucune modification (\*). | | -| Texte | 4D attend des données encodées en utf-8 (\*). Le développeur PHP peut avoir besoin d'utiliser la commande PHP **utf8\_encode**. | Exemple de script PHP : echo utf8\_encode(monTexte) | -| Date | 4D attend une date envoyée sous forme de chaîne au format RFC 3339 (appelé parfois DATE\_ATOM en PHP). Ce format est de type "AAAA-MM-JJTHH:MM:SS", par exemple : 2005-08-15T15:52:01+00:00\. 4D ignorera la partie heure et retournera la date en UTC. | | -| Heure | 4D attend une heure envoyée sous forme de chaîne au format RFC 3339 (cf. type Date). 4D ignorera la partie date et retournera le nombre de secondes écoulées depuis minuit en considérant la date dans la zone horaire locale. | Exemple de script PHP pour envoyer 2h30'45" : echo date( DATE\_ATOM, mktime( 2,30,45)) | -| Entier ou Réel | 4D interprète le numérique exprimé avec des chiffres, signe - ou +, exposant préfixé par 'e'. Tout caractère '.' ou ',' est interprété comme un séparateur décimal. | Exemple de script PHP : echo -1.4e-16; | -| Booléen | 4D retournera Vrai s'il reçoit la chaine "true" depuis PHP ou si l'évaluation sous forme de numérique donne une valeur non nulle. | Exemple de script PHP : echo (a==b); | -| Tableau | 4D considère que le tableau PHP a été retourné au format JSON. | Exemple de script PHP pour retourner un tableau de deux textes : echo json\_encode( array( "hello", "world")); | - -(\*) Par défaut, les en-têtes HTTP ne sont pas retournés : -\- si vous utilisez [PHP Execute](php-execute.md) en passant une fonction dans le paramètre *nomFonction*, les entêtes HTTP ne sont jamais retournés dans *résultatPHP*. Ils ne sont accessibles que via [PHP GET FULL RESPONSE](php-get-full-response.md). -\- si vous utilisez [PHP Execute](php-execute.md) sans nom de fonction (*nomFonction* omis ou contenant une chaîne vide), vous pouvez retourner les en-têtes HTTP en fixant l'option PHP raw result à Vrai à l'aide de la commande [PHP SET OPTION](php-set-option.md). - -**Note :** Si vous devez récupérer de gros volumes de données via PHP, il est généralement plus efficace de passer par le canal du buffer *stdOut* (commande **echo** ou similaire) que par le retour de fonction. Pour plus d'informations, reportez-vous à la description de la commande [PHP GET FULL RESPONSE](php-get-full-response.md). - -### Utiliser les variables d’environnement - -Vous pouvez utiliser la commande [SET ENVIRONMENT VARIABLE](set-environment-variable.md) pour définir des variables d’environment utilisées par le script. Attention : après un appel à [LAUNCH EXTERNAL PROCESS](launch-external-process.md) ou **PHP Execute**, l’ensemble des variables d’environment est effacé. - -### Fonctions spéciales - -4D propose les fonctions spéciales suivantes : - -* **quit\_4d\_php** : permet de quitter l’interpréteur PHP et tous ses process enfants. Si un process enfant au moins est en train d’exécuter un script, l’interpréteur ne quitte pas et la commande **PHP Execute** retourne Faux. -* **relaunch\_4d\_php** permet de relancer l’interpréteur PHP. - -A noter que l’interpréteur est relancé automatiquement à la première requête envoyée par **PHP Execute**. - -## Exemple 1 - -Appel du script "myPhpFile.php" sans fonction. Voici le contenu du script : - -```PHP -< -``` - -Le code 4D suivant : - -```4d - var $result : Text - var $isOK : Boolean - $isOK:=PHP Execute("C:\\php\\myPhpFile.php";"";$result) - ALERT($Result) -``` - -... affichera la version php courante. - -## Exemple 2 - -Appel de la fonction *myPhpFunction* dans le script "myNewScript.php" avec des paramètres. Voici le contenu du script : - -```PHP - -``` - -Appel avec fonction : - -```4d - var $result : Text - var $param1 : Text - var $param2 : Text - var $isOk : Boolean - $param1:="Hello" - $param2 :="4D world !" - $isOk:=PHP Execute("C:\\MonDossier\\myNewScript.php";"myPhpFunction";$result;$param1;$param2 ) - ALERT($result) // Affiche "Hello 4D world!" -``` - -## Exemple 3 - -Faire quitter l’interpréteur PHP : - -```4d - $ifOk:=PHP Execute("";"quit_4d_php") -``` - -## Exemple 4 - -Gestion des erreurs : - -```4d -    // Installation de la méthode de gestion d’erreurs - phpCommError:="" // Modifiée par PHPErrorHandler - $T_saveErrorHandler :=Method called on error - ON ERR CALL("PHPErrorHandler") -  -     // Exécution du script - var $T_result : Text - If(PHP Execute("C:\\MyScripts\\MiscInfos.php";"";$T_result)) -              // Pas d’erreur, $T_Result contient le résultat - Else -              // Une erreur a été détectée, gérée par PHPErrorHandler -          If(phpCommError="") -             ... // erreur PHP, utilisez PHP LIRE REPONSE COMPLETE -          Else -             ALERT(phpCommError) -          End if - End if -  -  // Désinstallation de la méthode - ON ERR CALL($T_saveErrorHandler) -``` - -La méthode PHP\_errHandler est la suivante : - -```4d - phpCommError:="" - GET LAST ERROR STACK(tabCodes;tabComps;tabLibellés) - For($i;1;Size of array(tabCodes)) -       phpCommError:=phpCommError+String(tabCodes{$i})+" "+tabComps{$i}+" "+tabLibellés{$i}+Caractere(Retour chariot) - End for -``` - -## Exemple 5 - -Création dynamique par 4D d’un script avant son exécution : - -```4d - DOCUMENT TO BLOB("C:\\Scripts\\MonScript.php";$blobDoc) - If(OK=1) -       $strDoc:=BLOB to text($blobDoc;UTF8 text without length) -        -       $strPosition:=Position("function2Rename";$strDoc) -        -       $strDoc:=Insert string($strDoc;"_v2";Length("function2Rename")+$strPosition) -        -       TEXT TO BLOB($strDoc;$blobDoc;UTF8 text without length) -       BLOB TO DOCUMENT("C:\\Scripts\\MonScript.php";$blobDoc) -       If(OK#1) -          ALERT("Erreur à la création du script") -       End if - End if -``` - -Le script est ensuite exécuté : - -```4d - $err:=PHP Execute("C:\\Scripts\\MonScript.php";"function2Rename_v2";*) -``` - -## Exemple 6 - -Récupération directe d’une valeur de type date et heure. Voici le contenu du script : - -```PHP - -``` - -Réception de la date côté 4D : - -```4d - var $phpResult_date : Date - $result :=PHP Execute("C:\php_scripts\ReturnDate.php";"";$phpResult_date) -     //$phpResult_date vaut !05/04/2009 ! -  - var $phpResult_time : Time - $result :=PHP Execute("C:\php_scripts\ReturnDate.php";"";$phpResult_time) -  -     //$phpResult_time vaut ?01 :02 :03 ? -``` - -## Exemple 7 - -Répartition de données dans des tableaux : - -```4d - ARRAY TEXT($arText ;0) - ARRAY LONGINT($arLong ;0) - $p1 :="," - $p2 :="11,22,33,44,55" - $phpok :=PHP Execute("";"explode";$arText;$p1;$p2) - $phpok :=PHP Execute("";"explode";$arLong;$p1;$p2) -  -        // $arText contient les valeurs alpha "11", "22", "33", etc. -        // $arLong contient les numériques, 11, 22, 33, etc. -``` - -## Exemple 8 - -Initialisation d’un tableau : - -```4d - ARRAY TEXT($arText ;0) - $phpok :=PHP Execute("";"array_pad";$arText;->$arText;50;"indéfini") -        // Exécute en php : $arrTest = array_pad($arrTest, 50, ’indéfini’); -        // Remplit le tableau $arText avec 50 éléments "indéfini" -``` - -## Exemple 9 - -Passage de paramètres via un tableau : - -```4d - ARRAY INTEGER($arInt;0) - $phpok :=PHP Execute("";"json_decode";$arInt;"[13,51,69,42,7]") -        // Exécute en php : $arInt = json_decode(’[13,51,69,42,7]’); -        // Remplit le tableau avec des valeurs initiales -``` - -## Exemple 10 - -Utilisation basique de la fonction *trim* de PHP permettant d'enlever les espaces et/ou caractères invisibles de part et d'autre d'une chaîne de caractères : - -```4d - var $T_String : Text - $T_String:="   Bonjour  " - var $B : Boolean - $B:=PHP Execute("";"trim";$T_String;$T_String) -``` - -Pour plus d'informations sur la fonction *trim*, veuillez vous reporter à la documentation PHP. - -## Voir aussi - -*Exécuter des scripts PHP dans 4D* -[PHP GET FULL RESPONSE](php-get-full-response.md) -[PHP SET OPTION](php-set-option.md) - -## Propriétés - -| | | -| --- | --- | -| Numéro de commande | 1058 | -| Thread safe | ✗ | - - diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-21/commands-legacy/php-get-full-response.md b/i18n/fr/docusaurus-plugin-content-docs/version-21/commands-legacy/php-get-full-response.md deleted file mode 100644 index 507d899ea9657e..00000000000000 --- a/i18n/fr/docusaurus-plugin-content-docs/version-21/commands-legacy/php-get-full-response.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -id: php-get-full-response -title: PHP GET FULL RESPONSE -slug: /commands/php-get-full-response -displayed_sidebar: docs ---- - - - -**PHP GET FULL RESPONSE** ( *stdOut* {; *libellésErr* ; *valeursErr*} {; *chpsEnteteHttp* {; *valeursEnteteHttp*}} ) - -| Paramètre | Type | | Description | -| --- | --- | --- | --- | -| stdOut | Text, Blob | ← | Contenu du buffer stdOut | -| libellésErr | Text array | ← | Libellés des erreurs | -| valeursErr | Text array | ← | Valeurs des erreurs | -| chpsEnteteHttp | Text array | ← | Noms des en-têtes HTTP | -| valeursEnteteHttp | Text array | ← | Valeurs des en-têtes HTTP | - - - -:::info Compatibilité - -**PHP est obsolète dans 4D**. Il est désormais recommandé d'utiliser la classe [`4D.SystemWorker`](../API/SystemWorkerClass.md). - -::: - -## Description - -La commande **PHP GET FULL RESPONSE** vous permet d’obtenir des informations supplémentaires sur la réponse retournée par l’interpréteur PHP. Cette commande est particulièrement utile en cas d’erreur survenant au cours de l’exécution du script. - -Le script PHP peut écrire des données dans le buffer stdOut (echo, print...). La commande retourne directement ces données dans la variable *stdOut* et applique les mêmes principes de conversion que ceux décrits dans la commande [PHP Execute](php-execute.md). - -Les tableaux texte synchronisés *libellésErr* et *valeursErr* sont remplis lorsque l’exécution des scripts PHP provoque des erreurs. Ces tableaux fournissent des informations notamment sur l’origine, le script et la ligne de l’erreur. Ces deux tableaux sont indissociables : si *libellésErr* est passé, *valeursErr* doit être passé également. - -Comme les échanges entre 4D et l’interpréteur PHP s’effectuent via FastCGI, l’interpréteur PHP fonctionne comme s’il était appelé par un serveur HTTP et envoie donc des en-têtes HTTP. Vous pouvez récupérer ces en-têtes et leurs valeurs dans les tableaux *champsEnteteHttp* et *valeursEnteteHttp*. - -## Voir aussi - -[PHP Execute](php-execute.md) -[PHP GET OPTION](php-get-option.md) - -## Propriétés - -| | | -| --- | --- | -| Numéro de commande | 1061 | -| Thread safe | ✗ | - - diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-21/commands-legacy/php-get-option.md b/i18n/fr/docusaurus-plugin-content-docs/version-21/commands-legacy/php-get-option.md deleted file mode 100644 index 056c689f312a88..00000000000000 --- a/i18n/fr/docusaurus-plugin-content-docs/version-21/commands-legacy/php-get-option.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -id: php-get-option -title: PHP GET OPTION -slug: /commands/php-get-option -displayed_sidebar: docs ---- - - - - -**PHP GET OPTION** ( *option* ; *valeur* ) - -| Paramètre | Type | | Description | -| --- | --- | --- | --- | -| option | Integer | → | Option à lire | -| valeur | Boolean | ← | Valeur courante de l’option | - - - -:::info Compatibilité - -**PHP est obsolète dans 4D**. Il est désormais recommandé d'utiliser la classe [`4D.SystemWorker`](../API/SystemWorkerClass.md). - -::: - -## Description - -La commande **PHP GET OPTION** permet de connaître la valeur courante d’une option relative à l’éxécution de scripts PHP. - -Passez dans le paramètre *option* une constante du thème *PHP* désignant l’option à lire. La commande retourne dans le paramètre *valeur* la valeur courante de l’option. Vous pouvez passer une des constantes suivantes : - -| Constante | Type | Valeur | Comment | -| ------------------- | ----------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| \_o\_PHP privileges | Entier long | 1 | *\*\*\*\* Sélecteur désactivé \*\*\*\** | -| PHP raw result | Entier long | 2 | Définition du mode de traitement des en-têtes HTTP renvoyés par PHP dans le résultat de l’exécution lorsque ce résultat est de type texte (lorsque le résultat est de type BLOB, les en-têtes sont toujours conservés).
    **Valeur(s) possible(s)** : Booléen. Faux (valeur par défaut) = supprimer les en-têtes HTTP du résultat. Vrai = conserver les en-têtes HTTP. | - -**Note :** Seul le compte utilisateur est retourné lorsque vous utilisez l'option PHP privileges avec la commande **PHP GET OPTION** (le mot de passe n'est pas retourné). - -## Voir aussi - -[PHP GET FULL RESPONSE](php-get-full-response.md) -[PHP SET OPTION](php-set-option.md) - -## Propriétés - -| | | -| --- | --- | -| Numéro de commande | 1060 | -| Thread safe | ✗ | - - diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-21/commands-legacy/php-set-option.md b/i18n/fr/docusaurus-plugin-content-docs/version-21/commands-legacy/php-set-option.md deleted file mode 100644 index b44d2b7630d61e..00000000000000 --- a/i18n/fr/docusaurus-plugin-content-docs/version-21/commands-legacy/php-set-option.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -id: php-set-option -title: PHP SET OPTION -slug: /commands/php-set-option -displayed_sidebar: docs ---- - - - -**PHP SET OPTION** ( *option* ; *valeur* {; *} ) - -| Paramètre | Type | | Description | -| --- | --- | --- | --- | -| option | Integer | → | Numéro d’option à définir | -| valeur | Boolean | → | Nouvelle valeur de l’option | -| * | Opérateur | → | Si passé : la modification ne s’applique qu’à l’appel suivant | - - - -:::info Compatibilité - -**PHP est obsolète dans 4D**. Il est désormais recommandé d'utiliser la classe [`4D.SystemWorker`](../API/SystemWorkerClass.md). - -::: - -## Description - -La commande **PHP SET OPTION** permet de définir des options spécifiques avant un appel à la commande [PHP Execute](php-execute.md). La portée de cette commande est le process courant. - -Passez dans le paramètre *option* une constante du thème *PHP* désignant l’option à modifier et dans le paramètre *valeur*, la nouvelle valeur de l’option. - -| Constante | Type | Valeur | Comment | -| -------------- | ----------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| PHP raw result | Entier long | 2 | Définition du mode de traitement des en-têtes HTTP renvoyés par PHP dans le résultat de l’exécution lorsque ce résultat est de type texte (lorsque le résultat est de type BLOB, les en-têtes sont toujours conservés).
    **Valeur(s) possible(s)** : Booléen. Faux (valeur par défaut) = supprimer les en-têtes HTTP du résultat. Vrai = conserver les en-têtes HTTP. | - -Par défaut, **PHP SET OPTION** définit l’option pour tous les appels à [PHP Execute](php-execute.md) ultérieurs du process. Si vous souhaitez la définir pour le prochain appel uniquement, passez le paramètre étoile (*\**). - -## Voir aussi - -[PHP Execute](php-execute.md) -[PHP GET OPTION](php-get-option.md) - -## Propriétés - -| | | -| --- | --- | -| Numéro de commande | 1059 | -| Thread safe | ✗ | - - diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-21/commands/command-index.md b/i18n/fr/docusaurus-plugin-content-docs/version-21/commands/command-index.md index d11e797ed66392..cc9758af6650d3 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/version-21/commands/command-index.md +++ b/i18n/fr/docusaurus-plugin-content-docs/version-21/commands/command-index.md @@ -846,10 +846,6 @@ title: Commandes par nom [`Path to object`](../commands-legacy/path-to-object.md)
    [`PAUSE INDEXES`](../commands-legacy/pause-indexes.md)
    [`PAUSE PROCESS`](../commands-legacy/pause-process.md)
    -[`PHP Execute`](../commands-legacy/php-execute.md)
    -[`PHP GET FULL RESPONSE`](../commands-legacy/php-get-full-response.md)
    -[`PHP GET OPTION`](../commands-legacy/php-get-option.md)
    -[`PHP SET OPTION`](../commands-legacy/php-set-option.md)
    [`PICTURE CODEC LIST`](../commands-legacy/picture-codec-list.md)
    [`PICTURE LIBRARY LIST`](../commands-legacy/picture-library-list.md)
    [`PICTURE PROPERTIES`](../commands-legacy/picture-properties.md)
    @@ -878,9 +874,9 @@ title: Commandes par nom [`Printing page`](../commands-legacy/printing-page.md)
    [`PROCESS 4D TAGS`](../commands-legacy/process-4d-tags.md)
    [`Process aborted`](../commands-legacy/process-aborted.md)
    -[`Process activity`](process-activity.md) - **modifié 4D 20 R7**
    -[`Process info`](process-info.md) - **nouveau 4D 20 R7**
    -[`Process number`](process-number.md) - **modifié 4D 20 R7**
    +[`Process activity`](process-activity.md) - **modified 4D 20 R7**
    +[`Process info`](process-info.md) - **new 4D 20 R7**
    +[`Process number`](process-number.md) - **modified 4D 20 R7**
    [`Process state`](../commands-legacy/process-state.md)
    [`PUSH RECORD`](../commands-legacy/push-record.md)
    diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-21/commands/theme/PHP.md b/i18n/fr/docusaurus-plugin-content-docs/version-21/commands/theme/PHP.md deleted file mode 100644 index b70f3706c920ea..00000000000000 --- a/i18n/fr/docusaurus-plugin-content-docs/version-21/commands/theme/PHP.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -id: PHP_theme -title: PHP -sidebar_label: PHP -slug: /commands/theme/PHP ---- - -| | -| --------------------------------------------------------------------------------------------------------------- | -| [](../../commands-legacy/php-execute.md)
    | -| [](../../commands-legacy/php-get-full-response.md)
    | -| [](../../commands-legacy/php-get-option.md)
    | -| [](../../commands-legacy/php-set-option.md)
    | diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/API/DataClassClass.md b/i18n/ja/docusaurus-plugin-content-docs/current/API/DataClassClass.md index 74e2b3e5e9b0da..a8d7efe93a6ba4 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/API/DataClassClass.md +++ b/i18n/ja/docusaurus-plugin-content-docs/current/API/DataClassClass.md @@ -1101,7 +1101,7 @@ ds.Class.query("info.coll[a].val != :1";0) `[a]` 表記には、どのローマ字でも使用可能です。 -#### コレクション要素とクエリ条件をリンクする +### コレクション要素とクエリ条件をリンクする コレクションを含むデータクラス属性を対象に、AND 演算子で結合された複数のクエリ条件を使用して検索するにあたって、検索条件に合致するプロパティが複数のコレクション要素にバラけているのではなく、一つのコレクション要素がすべてまとまっているエンティティを探したいとします。 これには、すべての条件に合致するコレクション要素のみが検出されるよう、クエリ条件をコレクション要素にリンクする必要があります。 @@ -1309,6 +1309,8 @@ queryPath: steps:[{steps:[{description:[index : Company.revenues ] > 10000000,time:0,recordsfounds:933}]}]}]}]} ``` +### 例題 + #### 例題 1 この例題では、様々なクエリの例を紹介します。 @@ -1659,13 +1661,13 @@ ds.VectorTable.query("embedding>:1 and embedding<:2";$vector1Comparison;$vector2 | timeout | Integer | タイムアウト (秒単位) | | maxEntries | Integer | エンティティの最大数 | -`timeout` は、データクラスの ORDAキャッシュのタイムアウトを設定します (デフォルトは 30秒)。 タイムアウトを過ぎると、キャッシュ内のデータクラスのエンティティは期限切れとみなされます。 これは、次のことを意味します: +`timeout` は、データクラスの ORDAキャッシュのタイムアウトを設定します (デフォルトは 30秒)。 タイムアウトを過ぎると、キャッシュ内のデータクラスのエンティティは期限切れとみなされます。 これは、次のことを意味します: タイムアウトを過ぎると、キャッシュ内のデータクラスのエンティティは期限切れとみなされます。 これは、次のことを意味します: - データはまだ存在します - 次にそのデータが必要になったときには、サーバーに要求します - エンティティの最大数に達すると、4D は期限切れのデータを自動的に削除します -`timeout` プロパティを設定すると、すでにキャッシュに存在するエンティティに新しいタイムアウトが設定されます。 これは頻繁に変更されないデータを扱う場合、つまり、サーバーへの新たな要求が必要ない場合に便利です。 +`timeout` プロパティを設定すると、すでにキャッシュに存在するエンティティに新しいタイムアウトが設定されます。 これは頻繁に変更されないデータを扱う場合、つまり、サーバーへの新たな要求が必要ない場合に便利です。 これは頻繁に変更されないデータを扱う場合、つまり、サーバーへの新たな要求が必要ない場合に便利です。 これは頻繁に変更されないデータを扱う場合、つまり、サーバーへの新たな要求が必要ない場合に便利です。 `maxEntries` は、ORDAキャッシュ内のエンティティの最大数を設定します。 デフォルトは 30,000 です。 diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/Notes/updates.md b/i18n/ja/docusaurus-plugin-content-docs/current/Notes/updates.md index 417772bfc32c86..31a94d14487fbe 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/Notes/updates.md +++ b/i18n/ja/docusaurus-plugin-content-docs/current/Notes/updates.md @@ -35,7 +35,6 @@ title: リリースノート | ngtcp2 | 1.16.0 | **21** | QUIC に使用 | | OpenSSL | 3.5.2 | **21** | | | PDFWriter | 4.7.0 | **21** | [`WP Export document`](../WritePro/commands/wp-export-document.md) および [`WP Export variable`](../WritePro/commands/wp-export-variable.md) において使用されます | -| PHP | 8.2.4 | 20 | | | SpreadJS | 17.1.0 | 20 R7 | 新機能の概要については、[このブログ記事](https://blog.4d.com/ja/4d-view-pro-whats-new-in-4d-20-r7/) を参照ください。 | | webKit | WKWebView | 19 | | | Xerces | 3.3.0 | **21** | XML コマンドにおいて使用されます | diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/commands-legacy/php-execute.md b/i18n/ja/docusaurus-plugin-content-docs/current/commands-legacy/php-execute.md deleted file mode 100644 index 71b1f5d1bcb531..00000000000000 --- a/i18n/ja/docusaurus-plugin-content-docs/current/commands-legacy/php-execute.md +++ /dev/null @@ -1,296 +0,0 @@ ---- -id: php-execute -title: PHP Execute -slug: /commands/php-execute -displayed_sidebar: docs ---- - - - -**PHP Execute** ( *scriptPath* {; *functionName* {; *phpResult* {; *param*} {; *param2* ; ... ; *paramN*}}} ) : Boolean - -| 引数 | 型 | | 説明 | -| --- | --- | --- | --- | -| scriptPath | Text | → | PHPスクリプトへのパスまたは
    "" でPHP関数を実行 | -| functionName | Text | → | 実行するPHP関数 | -| phpResult | *, Variable, Field | ← | PHP関数実行結果または結果を受け取らない場合* | -| param | Text, Boolean, Real, Integer, Date, Time | → | PHP関数の引数 | -| 戻り値 | Boolean | ← | True = 正しく実行された
    False = 実行時にエラーがあった | - - - -:::info 互換性 - -**4D のビルトインPHPインタープリターは削除されました**。[`4D.SystemWorkerクラス`](../API/SystemWorkerClass.md) を使用して外部PHPインタープリターをご利用ください。 - -::: - -## 説明 - -**PHP Execute**コマンドはPHPスクリプトや関数を実行するために使用します。. - -*scriptPath*引数には、実行するPHPスクリプトのパス名を渡します。ファイルがデータベースストラクチャと同階層に存在する場合、相対パス名を指定できます。そうでなければ完全パスです。パス名はシステムシンタックスあるいはPOSIXシンタックスで表現できます。 -標準のPHP関数を直接実行したい場合は、*scriptPath*に空の文字列 ("") を渡します。関数名は二番目の引数に渡さなければなりません。 - -*scriptPath*スクリプト内の特定の関数を実行したい場合、*functionName*引数にPHP関数名を渡します。この引数に空の文字列を渡したり*functionName*引数を省略した場合、スクリプト全体が実行されます。 - -**Note**: PHPの関数名は大文字小文字を区別します。括弧は使用せず、関数名のみを入力してください。 - -*phpResult*引数はPHP関数の実行結果を受け取ります。以下のいずれかを渡せます: - -* 結果を受け取る変数、配列、またはフィールド -* 関数が結果を返さないか、結果を受け取る必要がない場合、\* 文字。 - -*phpResult*にはテキスト、倍長整数、実数、ブール、または日付型、および (配列を除く) BLOBや時間型のフィールドを渡すことができます。4Dは後述の*返されるデータの変換*で説明する原則に基づき、データの変換と必要な調整を実行します。 - -* *functionName*引数に関数名を渡すと、*phpResult*はPHPの開発者が関数のコードから**return**コマンドで返す値を受け取ります。 -* *functionName*引数に関数名を渡さずにコマンドを使用した場合、*phpResult*はPHPの開発者がechoや類似のコマンドで返す値を受け取ります。 - -引数を期待するPHP関数を呼び出す場合、1つ以上の値を渡すために*param1...N*を使用します。値はセミコロンで分けられなければなりません。文字、テキスト、ブール、実数、整数、倍長整数、日付、時間タイプの値を渡すことができます。ピクチャとBLOBとオブジェクト型は渡せません。配列を送信することができます。この場合、[PHP Execute](php-execute.md)コマンドには配列へのポインタを渡さなければなりません。そうしない場合、配列のカレントのインデックスが整数として送信されます (例題参照)。コマンドはポインタ、ピクチャおよび2D配列を除き、すべてのタイプの配列へのポインタを受け入れます。 -*param1...N*引数はUTF-8のJSONフォーマットでPHPに送信されます。これらの引数はPHPの*functionName*関数に渡される前に、PHPの**json\_decode**コマンドで自動でデコードされます。 - -**注:** 技術的な理由で、FastCGIプロトコル経由で渡す引数のサイズは64KBを超えてはなりません。テキスト型の引数を使用する際にはこの制限を考慮にいれる必要があります。 - -4D側でコマンドが正しく実行できると、言い換えれば実行環境の起動、スクリプトのオープン、そしてPHPインタープリターとの通信に成功すると、コマンドからTrueが返されます。 そうでない場合、[ON ERR CALL](on-err-call.md)でとらえることができ、[Last errors](../commands/last-errors.md) で解析できるエラーが生成されます。 -さらにスクリプト自身がPHPエラーを生成するかもしれません。この場合[PHP GET FULL RESPONSE](php-get-full-response.md)コマンドを使用してエラーの発生元を解析しなければなりません (例題4参照)。 - -**注** **:** PHPを使用してエラー管理を設定できます。詳細は例えば以下のページを参照してください: . - -### 返されるデータの変換 - -以下の表は*phpResult*引数の型に基づき、返されるデータが4Dによりどのように解釈され変換されるかを説明しています。 - -| ***phpResult*引数の型** | **4Dによる処理** | **例** | -| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- | -| BLOB | 4Dは受信したデータを変更せずに取り出します(\*)。 | | -| テキスト | 4DはUTF-8でエンコードされたデータを期待します (\*)。PHPの開発者はPHPの**utf8\_encode**コマンドを使用する必要があるかもしれません。 | PHPスクリプトの例: echo utf8\_encode(myText) | -| 日付 | 4Dは (PHPでときにDATE\_ATOMと呼ばれる) RFC 3339フォーマットの文字列として送信される日付を期待します。このフォーマットは"YYYY-MM-DDTHH:MM:SS"という形式で、例えば2005-08-15T15:52:01+00:00のようになります。4Dは時間部を無視し、UTCの日付を返します。 | | -| Time | 4DはRFC 3339フォーマットの文字列として送信される時間を期待します (日付型参照)。4Dは日付部を無視し、ローカルタイムゾーンの日付を考慮した上で、0時からの経過秒数を返します。 | 2時間30分45秒を送信するPHPスクリプトの例: echo date( DATE\_ATOM, mktime( 2,30,45)) | -| 整数または実数 | 4Dは数字や+、-、およびeに続く指数で表現された数値を解釈します。'.'や','文字はすべて小数区切り文字として解釈されます。 | PHPスクリプトの例: echo -1.4e-16; | -| ブール | PHPから文字列"true"または非ヌルと数値評価される値を受け取ると4DはTrueを返します。 | PHPスクリプトの例: echo (a==b); | -| 配列 | 4Dは、PHP配列がJSONフォーマットで返されるものと見なします。 | 2つのテキストを返すPHPスクリプトの例: echo json\_encode( array( "hello", "world")); | - -(\*) デフォルトでHTTPヘッダーは返されません: -\- *functionName*引数に関数名を渡して[PHP Execute](php-execute.md)を使用すると、*phpResult*にHTTPヘッダーが返されることはありません。ヘッダーは[PHP GET FULL RESPONSE](php-get-full-response.md)コマンドを使用してのみ取得できます。 -\- 関数名なし (*functionName*引数を省略するかからの文字列を渡す) で[PHP Execute](php-execute.md)を使用するとき、[PHP SET OPTION](php-set-option.md)コマンドを使用してPHP Raw resultオプションをTrueに設定することでHTTPヘッダーを返すことができます。 - -**注:** PHPを使用して大量のデータを取得する必要がある場合、通常関数の戻り値を使用するよりも、(**echo**や同等のコマンドを使用して) *stdOut*バッファーを経由した方が効率的です。詳細は[PHP GET FULL RESPONSE](php-get-full-response.md)コマンドの説明を参照してください。 - -### 環境変数を使用する - -[SET ENVIRONMENT VARIABLE](set-environment-variable.md)コマンドを使用してスクリプトが使用する環境変数を指定できます。警告: [LAUNCH EXTERNAL PROCESS](launch-external-process.md) や**PHP Execute** を呼出した後、一連の環境変数は消去されます。 - -### 特別な関数 - -4Dは以下の特別な関数を提供します: - -* **quit\_4d\_php**: PHPインタープリターとそのすべての子プロセスを終了するために使用します。スクリプトを実行中の子プロセスが一つでも存在していると、インタープリターは終了せず、**PHP Execute**コマンドはFalseを返します。 -* **relaunch\_4d\_php**: PHPインタープリターを再起動するために使用します。 - -**PHP Execute**から最初のリクエストが送信されると、インタープリターが自動で再起動されることに留意してください。 - -## 例題 1 - -"myPhpFile.php"スクリプトを関数指定なしで呼び出します。スクリプトは以下の通りです: - -```PHP - -``` - -以下の4Dコードを実行すると: - -```4d - var $result : Text - var $isOK : Boolean - $isOK:=PHP Execute("C:\\php\\myPhpFile.php";"";$result) - ALERT($Result) -``` - -カレントのPHP バージョンが表示されます。 - -## 例題 2 - -"myNewScript.php"内のmyPhpFunction関数を引数付きで呼び出します。スクリプトは以下の通りです: - -```PHP - -``` - -関数を呼び出します: - -```4d - var $result : Text - var $param1 : Text - var $param2 : Text - var $isOk : Boolean - $param1 :="Hello" - $param2 :="4D world!" - $isOk:=PHP Execute("C:\\MyFolder\\myNewScript.php";"myPhpFunction";$result;$param1;$param2) - ALERT($result) // "Hello 4D world!"が表示される -``` - -## 例題 3 - -PHPインタープリターを終了します: - -```4d - $ifOk:=PHP Execute("";"quit_4d_php") -``` - -## 例題 4 - -エラー管理: - -```4d -  // エラー管理メソッドをインストール - phpCommError:="" // PHPErrorHandler内で更新される - $T_saveErrorHandler :=Method called on error - ON ERR CALL("PHPErrorHandler") - - // スクリプトを実行 - var $T_result : Text - If(PHP Execute("C:\\MyScripts\\MiscInfos.php";"";$T_result)) -  // エラーなし, $T_Resultには結果が返される - Else -  // エラーが検知された, PHPErrorHandlerメソッドにより管理 -    If(phpCommError="") -       ... // PHPエラー, PHP GET FULL RESPONSEを使用する -    Else -       ALERT(phpCommError) -    End if - End if -  -  // エラー管理メソッドをアンインストール - ON ERR CALL($T_saveErrorHandler) - - -``` - -PHP\_errHandlerメソッドは以下の通りです : - -```4d - phpCommError:="" - GET LAST ERROR STACK(arrCodes;arrComps;arrLabels) - For($i;1;Size of array(arrCodes)) -    phpCommError:=phpCommError+String(arrCodes{$i})+" "+arrComps{$i}+" "+ -    arrLabels{$i}+"\r" - End for -``` - -## 例題 5 - -実行前に4Dで動的にスクリプトを作成します: - -```4d - DOCUMENT TO BLOB("C:\\Scripts\\MyScript.php";$blobDoc) - If(OK=1) -    $strDoc:=BLOB to text($blobDoc;UTF8 text without length) -  -    $strPosition:=Position("function2Rename";$strDoc) -  -    $strDoc:=Insert string($strDoc;"_v2";Length("function2Rename")+$strPosition) -  -    TEXT TO BLOB($strDoc;$blobDoc;UTF8 text without length) -    BLOB TO DOCUMENT("C:\\Scripts\\MyScript.php";$blobDoc) -    If(OK#1) -       ALERT("スクリプトの作成中にエラーが発生しました。") -    End if - End if -``` - -その後スクリプトを実行します: - -```4d - $err:=PHP Execute("C:\\Scripts\\MyScript.php";"function2Rename_v2";*) -``` - -## 例題 6 - -日付と時間タイプの値を直接受け取ります。スクリプトは以下の通りです: - -```PHP - -``` - -4D側で日付を受け取ります: - -```4d - var $phpResult_date : Date - $result :=PHP Execute("C:\php_scripts\ReturnDate.php";"";$phpResult_date) -  //$phpResult_date は !2009/05/04! - -4D側で時間を受け取ります: -  - var $phpResult_time : Time - $result :=PHP Execute("C:\php_scripts\ReturnDate.php";"";$phpResult_time) -  -  //$phpResult_time は ?01 :02 :03? - - -``` - -## 例題 7 - -配列にデータを配分します: - -```4d - ARRAY TEXT($arText ;0) - ARRAY LONGINT($arLong ;0) - $p1 :="," - $p2 :="11,22,33,44,55" - $phpok :=PHP Execute("";"explode";$arText;$p1;$p2) - $phpok :=PHP Execute("";"explode";$arLong;$p1;$p2) -  -  // $arTextには文字値 "11", "22", "33",... が格納されます。 -  // $arLongには数値 11, 22, 33,... が格納されます。 -``` - -## 例題 8 - -配列を初期化します: - -```4d - ARRAY TEXT($arText ;0) - $phpok :=PHP Execute("";"array_pad";$arText;->$arText;50;"undefined") -  // PHPで以下を実行: $arrTest = array_pad($arrTest, 50, ’undefined’); -  // $arTextは50 要素の"undefined"で埋められます。 -``` - -## 例題 9 - -配列を使用して引数を渡します: - -```4d - ARRAY INTEGER($arInt;0) - $phpok :=PHP Execute("";"json_decode";$arInt;"[13,51,69,42,7]") -  // PHPで以下を実行: $arInt = json_decode(’[13,51,69,42,7]’); -  // 配列に初期値が設定されます -``` - -## 例題 10 - -以下の例は、文字列の始めと終わりの余分なスペースまたは不可視の文字を除去するtrimファンクションの基本的な使用法です: - -```4d - var $T_String : Text - $T_String:="   Hello  " - var $B : Boolean - $B:=PHP Execute("";"trim";$T_String;$T_String) -``` - -trimファンクションについてのより詳細な情報については、PHPドキュメントを参照して下さい。 - -## 参照 - -*4DでPHPスクリプトを実行する* -[PHP GET FULL RESPONSE](php-get-full-response.md) -[PHP SET OPTION](php-set-option.md) - -## プロパティ - -| | | -| --- | --- | -| コマンド番号 | 1058 | -| スレッドセーフである | ✗ | - - diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/commands-legacy/php-get-full-response.md b/i18n/ja/docusaurus-plugin-content-docs/current/commands-legacy/php-get-full-response.md deleted file mode 100644 index ef445804ee4d8a..00000000000000 --- a/i18n/ja/docusaurus-plugin-content-docs/current/commands-legacy/php-get-full-response.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -id: php-get-full-response -title: PHP GET FULL RESPONSE -slug: /commands/php-get-full-response -displayed_sidebar: docs ---- - - - -**PHP GET FULL RESPONSE** ( *stdOut* {; *errLabels* ; *errValues*} {; *httpHeaderFields* {; *httpHeaderValues*}} ) - -| 引数 | 型 | | 説明 | -| --- | --- | --- | --- | -| stdOut | Text, Blob | ← | stdoutバッファーの内容 | -| errLabels | Text array | ← | エラーのラベル | -| errValues | Text array | ← | エラーの値 | -| httpHeaderFields | Text array | ← | HTTPヘッダーの名前 | -| httpHeaderValues | Text array | ← | HTTPヘッダーの値 | - - - -:::info 互換性 - -**4D のビルトインPHPインタープリターは削除されました**。[`4D.SystemWorkerクラス`](../API/SystemWorkerClass.md) を使用して外部PHPインタープリターをご利用ください。 - -::: - -## 説明 - -PHP GET FULL RESPONSE コマンドを使用して PHPインタープリターから返されるレスポンスに関する追加の情報を取得できます。 このコマンドは特にスクリプトの実行中にエラーが発生したときに有効です。 - -PHPスクリプトはstdoutバッファーにデータを書き込むことがあります (echo, print等)。このコマンドはデータを直接*stdout*変数に返します。そして[PHP Execute](php-execute.md)コマンドで説明されている原則と同じ変換を適用します。 - -同期される*errLabels*と*errValues*テキスト配列は、PHPスクリプトの実行がエラーの原因であるときに値が返されます。これらの配列には特に、エラーのもと、スクリプト、そして行などの情報が提供されます。これら2つの配列はともに使用します。*errLabels*を渡すときは合わせて*errValues*も渡さなければなりません。 - -4DとPHP間の交換はFastCGI経由で実行されるため、PHPインタープリターは、それがHTTPサーバから呼び出されたかのように機能し、したがってHTTPヘッダを送信します。*httpHeaderFields*と*httpHeaderValues*配列を使用してこれらのヘッダを取得できます。 - -## 参照 - -[PHP Execute](php-execute.md) -[PHP GET OPTION](php-get-option.md) - -## プロパティ - -| | | -| --- | --- | -| コマンド番号 | 1061 | -| スレッドセーフである | ✗ | - - diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/commands-legacy/php-get-option.md b/i18n/ja/docusaurus-plugin-content-docs/current/commands-legacy/php-get-option.md deleted file mode 100644 index e7ec51f8350bbf..00000000000000 --- a/i18n/ja/docusaurus-plugin-content-docs/current/commands-legacy/php-get-option.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -id: php-get-option -title: PHP GET OPTION -slug: /commands/php-get-option -displayed_sidebar: docs ---- - - - - -**PHP GET OPTION** ( *option* ; *value* ) - -| 引数 | 型 | | 説明 | -| --- | --- | --- | --- | -| option | Integer | → | 取得するオプション | -| value | Boolean | ← | オプションの現在値 | - - - -:::info 互換性 - -**4D のビルトインPHPインタープリターは削除されました**。[`4D.SystemWorkerクラス`](../API/SystemWorkerClass.md) を使用して外部PHPインタープリターをご利用ください。 - -::: - -## 説明 - -PHP GET OPTION コマンドを使用して、PHPスクリプトの実行に関連するオプションの現在値を取得できます。 - -*option*引数には読み出したいオプションを指定する"*PHP*"テーマの定数を渡します。コマンドは*value*引数にオプションのカレントの値を返します。以下のいずれかの定数を渡すことができます: - -| 定数 | 型 | 値 | コメント | -| -------------- | ---- | - | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | -| PHP raw result | 倍長整数 | 2 | 結果がテキスト型のときに実行結果中にPHPから返されるHTTPヘッダに関する処理モードの定義 (結果がBLOB型のときヘッダは常に保持されます)。
    **とりうる値**: ブール。False (デフォルト値) = HTTPヘッダを結果から取り除く、True = HTTPヘッダを保持する | - -## 参照 - -[PHP GET FULL RESPONSE](php-get-full-response.md) -[PHP SET OPTION](php-set-option.md) - -## プロパティ - -| | | -| --- | --- | -| コマンド番号 | 1060 | -| スレッドセーフである | ✗ | - - diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/commands-legacy/php-set-option.md b/i18n/ja/docusaurus-plugin-content-docs/current/commands-legacy/php-set-option.md deleted file mode 100644 index d5e1689780110a..00000000000000 --- a/i18n/ja/docusaurus-plugin-content-docs/current/commands-legacy/php-set-option.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -id: php-set-option -title: PHP SET OPTION -slug: /commands/php-set-option -displayed_sidebar: docs ---- - - - -**PHP SET OPTION** ( *option* ; *value* {; *} ) - -| 引数 | 型 | | 説明 | -| --- | --- | --- | --- | -| option | Integer | → | 設定するオプション | -| value | Boolean | → | オプションの新しい値 | -| * | 演算子 | → | 指定時: 変更は次の呼び出し時にのみ適用 | - - - -:::info 互換性 - -**4D のビルトインPHPインタープリターは削除されました**。[`4D.SystemWorkerクラス`](../API/SystemWorkerClass.md) を使用して外部PHPインタープリターをご利用ください。 - -::: - -## 説明 - -**PHP SET OPTION** コマンドを使用して、[PHP Execute](php-execute.md) コマンド呼び出し前に、特定のオプションを設定することができます。このコマンドのスコープはカレントプロセスです。 - -option引数には、変更するオプションを指定する"*PHP*"テーマの定数を渡します。 *value*引数には*option*の新しい値を渡します。 - -| 定数 | 型 | 値 | コメント | -| -------------- | ---- | - | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | -| PHP raw result | 倍長整数 | 2 | 結果がテキスト型のときに実行結果中にPHPから返されるHTTPヘッダに関する処理モードの定義 (結果がBLOB型のときヘッダは常に保持されます)。
    **とりうる値**: ブール。False (デフォルト値) = HTTPヘッダを結果から取り除く、True = HTTPヘッダを保持する | - -デフォルトで**PHP SET OPTION** はプロセス内で後に続くすべての[PHP Execute](php-execute.md) のオプションを設定します。 次の呼び出しにのみ有効なオプションを設定するためには、アスタリスク (*\**) 引数を渡します。 - -## 参照 - -[PHP Execute](php-execute.md) -[PHP GET OPTION](php-get-option.md) - -## プロパティ - -| | | -| --- | --- | -| コマンド番号 | 1059 | -| スレッドセーフである | ✗ | - - diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/commands/command-index.md b/i18n/ja/docusaurus-plugin-content-docs/current/commands/command-index.md index 263bfb90e2d372..7942b77cb18811 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/commands/command-index.md +++ b/i18n/ja/docusaurus-plugin-content-docs/current/commands/command-index.md @@ -846,10 +846,6 @@ title: コマンド(名前順) [`Path to object`](../commands-legacy/path-to-object.md)
    [`PAUSE INDEXES`](../commands-legacy/pause-indexes.md)
    [`PAUSE PROCESS`](../commands-legacy/pause-process.md)
    -[`PHP Execute`](../commands-legacy/php-execute.md)
    -[`PHP GET FULL RESPONSE`](../commands-legacy/php-get-full-response.md)
    -[`PHP GET OPTION`](../commands-legacy/php-get-option.md)
    -[`PHP SET OPTION`](../commands-legacy/php-set-option.md)
    [`PICTURE CODEC LIST`](../commands-legacy/picture-codec-list.md)
    [`PICTURE LIBRARY LIST`](../commands-legacy/picture-library-list.md)
    [`PICTURE PROPERTIES`](../commands-legacy/picture-properties.md)
    diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/commands/theme/PHP.md b/i18n/ja/docusaurus-plugin-content-docs/current/commands/theme/PHP.md deleted file mode 100644 index b70f3706c920ea..00000000000000 --- a/i18n/ja/docusaurus-plugin-content-docs/current/commands/theme/PHP.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -id: PHP_theme -title: PHP -sidebar_label: PHP -slug: /commands/theme/PHP ---- - -| | -| --------------------------------------------------------------------------------------------------------------- | -| [](../../commands-legacy/php-execute.md)
    | -| [](../../commands-legacy/php-get-full-response.md)
    | -| [](../../commands-legacy/php-get-option.md)
    | -| [](../../commands-legacy/php-set-option.md)
    | diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/commands/web-event.md b/i18n/ja/docusaurus-plugin-content-docs/current/commands/web-event.md index c1d03563807c61..b2acd2c446f9d5 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/commands/web-event.md +++ b/i18n/ja/docusaurus-plugin-content-docs/current/commands/web-event.md @@ -8,48 +8,48 @@ displayed_sidebar: docs -| 引数 | 型 | | 説明 | -| --- | ------ | :-------------------------: | ---------------------------------- | -| 戻り値 | Object | ← | Information on the triggered event | +| 引数 | 型 | | 説明 | +| --- | ------ | :-------------------------: | ----------------- | +| 戻り値 | Object | ← | トリガーされたイベントに関する情報 | ## 説明 -`Web Event` returns an object with information on a triggered event linked to a web page component. +`Web Event` は、Web ページコンポーネントにリンクされた、トリガーされたイベントに関する情報を格納したオブジェクトを返します。 -The command must be called in the context of a web page handled by the 4D web server. +このコマンドは、4D Web サーバーによって管理されるWeb ページのコンテキスト内から呼び出さなければなりません。 **戻り値** 戻り値のオブジェクトには、以下のプロパティが格納されています: -| プロパティ | | 型 | 説明 | -| --------- | ----- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| caller | | string | [Server-side reference](https://developer.4d.com/qodly/4DQodlyPro/pageLoaders/pageLoaderOverview#data-access-category) of the component triggering the event | -| eventType | | string | Type of event:
  • onblur
  • onfocus
  • onclick
  • onauxclick
  • onmouseenter
  • onmouseleave
  • onkeyup
  • onkeydown
  • onchange
  • unload
  • onload - triggered when the `Page` loads
  • | -| data | | object | Additional information depending on the involved component | -| | index | number |
  • Tabs component: index of the tab (indexing starts at 0)
  • Data Table component: column number
  • | -| | row | number | Data Table component: row number | -| | name | string | Data Table component: qodlysource name of the column (e.g. "firstname", "address.city") | +| プロパティ | | 型 | 説明 | +| --------- | ----- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| caller | | string | イベントをトリガーしたコンポーネントの[サーバー側参照](https://developer.4d.com/qodly/4DQodlyPro/pageLoaders/pageLoaderOverview#data-access-category) | +| eventType | | string | イベントの種類:
  • onblur
  • onfocus
  • onclick
  • onauxclick
  • onmouseenter
  • onmouseleave
  • onkeyup
  • onkeydown
  • onchange
  • unload
  • onload - `Page` がロードされたときにトリガーされます
  • | +| data | | object | 関連するコンポーネントに応じた追加の情報 | +| | index | number |
  • タブコンポーネント: タブのインデックス(インデックスは 0 から始まります)
  • データテーブルコンポーネント: カラムの番号
  • | +| | row | number | データテーブルコンポーネント: 行番号 | +| | name | string | データテーブルコンポーネント: カラムの qodlyソース名(例: "firstname"、 "address.city") | #### 例題 -The objective is to display/hide a help text when the user hovers over the component: +ここでの目的は、ユーザーがコンポーネント上をホバーした際にヘルプテキストを表示/非表示することです: ![](../assets/en/commands/web-event1.png) -This is done by attaching `onmouseenter` and `onmouseleave` events to a **Text input** component that displays the information stored in a **Text** component (displaying "This is the help text"). +これは、("これはヘルプテキストです"というテキストを表示する)**Text** コンポーネントに保存された情報を表示する **Text input** コンポーネントに `onmouseenter` および `onmouseleave` イベントを割り当てることで可能になります。 ![](../assets/en/commands/web-event2.png) -In this scenario: +このシナリオでは以下のような前提があります: -- The Text input component has `orderNumber` as Server side reference. +- Text input コンポーネントは、 `orderNumber` というサーバー側参照を持ちます。 ![](../assets/en/commands/web-event3.png) -- The Text component has `helpOn_orderNumber` as Server side reference. +- Text コンポーネントは `helpOn_orderNumber` というサーバー側参照を持ちます。 ![](../assets/en/commands/web-event4.png) -- The [exposed](../ORDA/ordaClasses.md#exposed-vs-non-exposed-functions) function `help()` is attached to both the `onmouseenter` and `onmouseleave` events and contains the following code: +- `onmouseenter` および `onmouseleave` イベントの両方には[公開された](../ORDA/ordaClasses.md#exposed-vs-non-exposed-functions) `help()` 関数が割り当てられており、そこには以下のようなコードが書かれています: ```4d shared singleton Class constructor() diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-19/API/DataClassClass.md b/i18n/ja/docusaurus-plugin-content-docs/version-19/API/DataClassClass.md index 8184f6054f8368..6efcc82eb2f3d8 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-19/API/DataClassClass.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-19/API/DataClassClass.md @@ -937,6 +937,7 @@ ds.People.query("places.locations[a].kind= :1 and places.locations[a].city= :2"; ... クエリは、"kind=home" かつ "city=paris" である "locations" 要素を持つエンティティ "martin" のみを返します。 "home" と "paris" が同じコレクション要素内にない "smith" は、クエリの結果に含まれません。 + **formula 引数** *queryString* 引数にフォーミュラを挿入 (上記参照) する代わりに、formula オブジェクトをブール検索条件として直接渡すことができます。 トークナイズの利点を生かせる、コードが検索しやすく読みやすい、などといった面から、クエリにおけるフォーミュラオブジェクトの使用は **推奨されています**。 @@ -1011,6 +1012,8 @@ queryPath: steps:[{steps:[{description:[index : Company.revenues ] > 10000000,time:0,recordsfounds:933}]}]}]}]} ``` +### 例題 + #### 例題 1 この例題では、様々なクエリの例を紹介します。 diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/API/DataClassClass.md b/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/API/DataClassClass.md index bded8598825499..4be9bc8d33e425 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/API/DataClassClass.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/API/DataClassClass.md @@ -1099,7 +1099,7 @@ ds.Class.query("info.coll[a].val != :1";0) `[a]` 表記には、どのローマ字でも使用可能です。 -#### コレクション要素とクエリ条件をリンクする +### コレクション要素とクエリ条件をリンクする コレクションを含むデータクラス属性を対象に、AND 演算子で結合された複数のクエリ条件を使用して検索するにあたって、検索条件に合致するプロパティが複数のコレクション要素にバラけているのではなく、一つのコレクション要素がすべてまとまっているエンティティを探したいとします。 これには、すべての条件に合致するコレクション要素のみが検出されるよう、クエリ条件をコレクション要素にリンクする必要があります。 @@ -1254,6 +1254,8 @@ queryPath: steps:[{steps:[{description:[index : Company.revenues ] > 10000000,time:0,recordsfounds:933}]}]}]}]} ``` +### 例題 + #### 例題 1 この例題では、様々なクエリの例を紹介します。 @@ -1568,13 +1570,13 @@ softwares:{ | timeout | Integer | タイムアウト (秒単位) | | maxEntries | Integer | エンティティの最大数 | -`timeout` は、データクラスの ORDAキャッシュのタイムアウトを設定します (デフォルトは 30秒)。 タイムアウトを過ぎると、キャッシュ内のデータクラスのエンティティは期限切れとみなされます。 これは、次のことを意味します: +`timeout` は、データクラスの ORDAキャッシュのタイムアウトを設定します (デフォルトは 30秒)。 タイムアウトを過ぎると、キャッシュ内のデータクラスのエンティティは期限切れとみなされます。 これは、次のことを意味します: タイムアウトを過ぎると、キャッシュ内のデータクラスのエンティティは期限切れとみなされます。 これは、次のことを意味します: - データはまだ存在します - 次にそのデータが必要になったときには、サーバーに要求します - エンティティの最大数に達すると、4D は期限切れのデータを自動的に削除します -`timeout` プロパティを設定すると、すでにキャッシュに存在するエンティティに新しいタイムアウトが設定されます。 これは頻繁に変更されないデータを扱う場合、つまり、サーバーへの新たな要求が必要ない場合に便利です。 +`timeout` プロパティを設定すると、すでにキャッシュに存在するエンティティに新しいタイムアウトが設定されます。 これは頻繁に変更されないデータを扱う場合、つまり、サーバーへの新たな要求が必要ない場合に便利です。 これは頻繁に変更されないデータを扱う場合、つまり、サーバーへの新たな要求が必要ない場合に便利です。 これは頻繁に変更されないデータを扱う場合、つまり、サーバーへの新たな要求が必要ない場合に便利です。 `maxEntries` は、ORDAキャッシュ内のエンティティの最大数を設定します。 デフォルトは 30,000 です。 diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20/API/DataClassClass.md b/i18n/ja/docusaurus-plugin-content-docs/version-20/API/DataClassClass.md index 5c26f0e33a732f..64fa8707ee7b9f 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-20/API/DataClassClass.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-20/API/DataClassClass.md @@ -1087,7 +1087,7 @@ ds.Class.query("info.coll[a].val != :1";0) `[a]` 表記には、どのローマ字でも使用可能です。 -#### コレクション要素とクエリ条件をリンクする +### コレクション要素とクエリ条件をリンクする :::info @@ -1142,6 +1142,7 @@ ds.People.query("places.locations[a].kind= :1 and places.locations[a].city= :2"; ... クエリは、"kind=home" かつ "city=paris" である "locations" 要素を持つエンティティ "martin" のみを返します。 "home" と "paris" が同じコレクション要素内にない "smith" は、クエリの結果に含まれません。 + #### N対Nリレーションのクエリ ORDA は、N対Nリレーションにおけるクエリを容易にするための特別な構文を提供します。 このような場合には `AND` 演算子を使って、同じ属性内に格納されている異なる値を検索する必要があるかもしれません。 たとえば、以下のようなストラクチャーの場合を考えます: @@ -1250,6 +1251,8 @@ queryPath: steps:[{steps:[{description:[index : Company.revenues ] > 10000000,time:0,recordsfounds:933}]}]}]}]} ``` +### 例題 + #### 例題 1 この例題では、様々なクエリの例を紹介します。 diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-21/API/DataClassClass.md b/i18n/ja/docusaurus-plugin-content-docs/version-21/API/DataClassClass.md index 6a4ff91bad10f4..dbd4c2580d5c3a 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-21/API/DataClassClass.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-21/API/DataClassClass.md @@ -1101,7 +1101,7 @@ ds.Class.query("info.coll[a].val != :1";0) `[a]` 表記には、どのローマ字でも使用可能です。 -#### コレクション要素とクエリ条件をリンクする +### コレクション要素とクエリ条件をリンクする コレクションを含むデータクラス属性を対象に、AND 演算子で結合された複数のクエリ条件を使用して検索するにあたって、検索条件に合致するプロパティが複数のコレクション要素にバラけているのではなく、一つのコレクション要素がすべてまとまっているエンティティを探したいとします。 これには、すべての条件に合致するコレクション要素のみが検出されるよう、クエリ条件をコレクション要素にリンクする必要があります。 @@ -1295,6 +1295,8 @@ queryPath: steps:[{steps:[{description:[index : Company.revenues ] > 10000000,time:0,recordsfounds:933}]}]}]}]} ``` +### 例題 + #### 例題 1 この例題では、様々なクエリの例を紹介します。 @@ -1645,13 +1647,13 @@ ds.VectorTable.query("embedding>:1 and embedding<:2";$vector1Comparison;$vector2 | timeout | Integer | タイムアウト (秒単位) | | maxEntries | Integer | エンティティの最大数 | -`timeout` は、データクラスの ORDAキャッシュのタイムアウトを設定します (デフォルトは 30秒)。 タイムアウトを過ぎると、キャッシュ内のデータクラスのエンティティは期限切れとみなされます。 これは、次のことを意味します: +`timeout` は、データクラスの ORDAキャッシュのタイムアウトを設定します (デフォルトは 30秒)。 タイムアウトを過ぎると、キャッシュ内のデータクラスのエンティティは期限切れとみなされます。 これは、次のことを意味します: タイムアウトを過ぎると、キャッシュ内のデータクラスのエンティティは期限切れとみなされます。 これは、次のことを意味します: - データはまだ存在します - 次にそのデータが必要になったときには、サーバーに要求します - エンティティの最大数に達すると、4D は期限切れのデータを自動的に削除します -`timeout` プロパティを設定すると、すでにキャッシュに存在するエンティティに新しいタイムアウトが設定されます。 これは頻繁に変更されないデータを扱う場合、つまり、サーバーへの新たな要求が必要ない場合に便利です。 +`timeout` プロパティを設定すると、すでにキャッシュに存在するエンティティに新しいタイムアウトが設定されます。 これは頻繁に変更されないデータを扱う場合、つまり、サーバーへの新たな要求が必要ない場合に便利です。 これは頻繁に変更されないデータを扱う場合、つまり、サーバーへの新たな要求が必要ない場合に便利です。 これは頻繁に変更されないデータを扱う場合、つまり、サーバーへの新たな要求が必要ない場合に便利です。 `maxEntries` は、ORDAキャッシュ内のエンティティの最大数を設定します。 デフォルトは 30,000 です。 diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-21/Notes/updates.md b/i18n/ja/docusaurus-plugin-content-docs/version-21/Notes/updates.md index 3fcf4224eebe8d..b5b6604193089a 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-21/Notes/updates.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-21/Notes/updates.md @@ -45,6 +45,7 @@ title: リリースノート - Web サービス(SOAP): [スケーラブルセッション](../WebServer/sessions.md#webセッションの有効化) が有効化されている場合、コンパイルモードにおいてはWeb サービスは[**プリエンプティブプロセス**](../Develop/preemptive.md) で実行されます。 Make sure that your SOAP code is thread-safe and that the session in which it runs has appropriate [privileges](../API/SessionClass.md#setprivileges). - Web サーバー: 廃止予定だった`4DSYNC/` および `4DCGI/` URL のサポートが削除されました。 これらのURL に関しては今後は何も特殊な処理は行われません。 - Web ユーザーセッションは今後[`Process activity`](../commands/process-activity.md) コマンドで返されるようになります。 +- PHP commands are now [deprecated](https://blog.4d.com/deprecation-of-php-commands-removal-of-4d-built-in-php-interpreter/) and should no longer be used in your developments. - [`HIGHLIGHT TEXT`](../commands/highlight-text) コマンドは今後サブフォームのコンテキストでサポートされるようになりました。 - クライアント/サーバーでは、ローカルプロセスという概念が削除されました。 プロセス名に置いて"$"記号をつけることは今後何も特別な意味を持たなくなり、また[`REGISTER CLIENT`](../commands/register-client) コマンドの \* 引数は無視されます。 - **コンポーネントは埋め込まれなくなりました**: 4D 21 以降、4D によって開発されたコンポーネント(4D NetKit、4D SVG、など。詳細は[こちらの一覧](../Extensions/overview.md#4dによって開発されたコンポーネント)を参照) は4Dアプリケーションには埋め込まれなくなりました。 プロジェクトを4D 21 以降にアップグレードする場合、以下のようなダイアログボックスが表示されます:
    @@ -307,7 +308,6 @@ title: リリースノート | ngtcp2 | 1.16.0 | **21** | QUIC に使用 | | OpenSSL | 3.5.2 | **21** | | | PDFWriter | 4.7.0 | **21** | [`WP Export document`](../WritePro/commands/wp-export-document.md) および [`WP Export variable`](../WritePro/commands/wp-export-variable.md) において使用されます | -| PHP | 8.2.4 | 20 | | | SpreadJS | 17.1.0 | 20 R7 | 新機能の概要については、[このブログ記事](https://blog.4d.com/ja/4d-view-pro-whats-new-in-4d-20-r7/) を参照ください。 | | webKit | WKWebView | 19 | | | Xerces | 3.3.0 | **21** | XML コマンドにおいて使用されます | diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-21/commands-legacy/php-execute.md b/i18n/ja/docusaurus-plugin-content-docs/version-21/commands-legacy/php-execute.md deleted file mode 100644 index 71b1f5d1bcb531..00000000000000 --- a/i18n/ja/docusaurus-plugin-content-docs/version-21/commands-legacy/php-execute.md +++ /dev/null @@ -1,296 +0,0 @@ ---- -id: php-execute -title: PHP Execute -slug: /commands/php-execute -displayed_sidebar: docs ---- - - - -**PHP Execute** ( *scriptPath* {; *functionName* {; *phpResult* {; *param*} {; *param2* ; ... ; *paramN*}}} ) : Boolean - -| 引数 | 型 | | 説明 | -| --- | --- | --- | --- | -| scriptPath | Text | → | PHPスクリプトへのパスまたは
    "" でPHP関数を実行 | -| functionName | Text | → | 実行するPHP関数 | -| phpResult | *, Variable, Field | ← | PHP関数実行結果または結果を受け取らない場合* | -| param | Text, Boolean, Real, Integer, Date, Time | → | PHP関数の引数 | -| 戻り値 | Boolean | ← | True = 正しく実行された
    False = 実行時にエラーがあった | - - - -:::info 互換性 - -**4D のビルトインPHPインタープリターは削除されました**。[`4D.SystemWorkerクラス`](../API/SystemWorkerClass.md) を使用して外部PHPインタープリターをご利用ください。 - -::: - -## 説明 - -**PHP Execute**コマンドはPHPスクリプトや関数を実行するために使用します。. - -*scriptPath*引数には、実行するPHPスクリプトのパス名を渡します。ファイルがデータベースストラクチャと同階層に存在する場合、相対パス名を指定できます。そうでなければ完全パスです。パス名はシステムシンタックスあるいはPOSIXシンタックスで表現できます。 -標準のPHP関数を直接実行したい場合は、*scriptPath*に空の文字列 ("") を渡します。関数名は二番目の引数に渡さなければなりません。 - -*scriptPath*スクリプト内の特定の関数を実行したい場合、*functionName*引数にPHP関数名を渡します。この引数に空の文字列を渡したり*functionName*引数を省略した場合、スクリプト全体が実行されます。 - -**Note**: PHPの関数名は大文字小文字を区別します。括弧は使用せず、関数名のみを入力してください。 - -*phpResult*引数はPHP関数の実行結果を受け取ります。以下のいずれかを渡せます: - -* 結果を受け取る変数、配列、またはフィールド -* 関数が結果を返さないか、結果を受け取る必要がない場合、\* 文字。 - -*phpResult*にはテキスト、倍長整数、実数、ブール、または日付型、および (配列を除く) BLOBや時間型のフィールドを渡すことができます。4Dは後述の*返されるデータの変換*で説明する原則に基づき、データの変換と必要な調整を実行します。 - -* *functionName*引数に関数名を渡すと、*phpResult*はPHPの開発者が関数のコードから**return**コマンドで返す値を受け取ります。 -* *functionName*引数に関数名を渡さずにコマンドを使用した場合、*phpResult*はPHPの開発者がechoや類似のコマンドで返す値を受け取ります。 - -引数を期待するPHP関数を呼び出す場合、1つ以上の値を渡すために*param1...N*を使用します。値はセミコロンで分けられなければなりません。文字、テキスト、ブール、実数、整数、倍長整数、日付、時間タイプの値を渡すことができます。ピクチャとBLOBとオブジェクト型は渡せません。配列を送信することができます。この場合、[PHP Execute](php-execute.md)コマンドには配列へのポインタを渡さなければなりません。そうしない場合、配列のカレントのインデックスが整数として送信されます (例題参照)。コマンドはポインタ、ピクチャおよび2D配列を除き、すべてのタイプの配列へのポインタを受け入れます。 -*param1...N*引数はUTF-8のJSONフォーマットでPHPに送信されます。これらの引数はPHPの*functionName*関数に渡される前に、PHPの**json\_decode**コマンドで自動でデコードされます。 - -**注:** 技術的な理由で、FastCGIプロトコル経由で渡す引数のサイズは64KBを超えてはなりません。テキスト型の引数を使用する際にはこの制限を考慮にいれる必要があります。 - -4D側でコマンドが正しく実行できると、言い換えれば実行環境の起動、スクリプトのオープン、そしてPHPインタープリターとの通信に成功すると、コマンドからTrueが返されます。 そうでない場合、[ON ERR CALL](on-err-call.md)でとらえることができ、[Last errors](../commands/last-errors.md) で解析できるエラーが生成されます。 -さらにスクリプト自身がPHPエラーを生成するかもしれません。この場合[PHP GET FULL RESPONSE](php-get-full-response.md)コマンドを使用してエラーの発生元を解析しなければなりません (例題4参照)。 - -**注** **:** PHPを使用してエラー管理を設定できます。詳細は例えば以下のページを参照してください: . - -### 返されるデータの変換 - -以下の表は*phpResult*引数の型に基づき、返されるデータが4Dによりどのように解釈され変換されるかを説明しています。 - -| ***phpResult*引数の型** | **4Dによる処理** | **例** | -| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- | -| BLOB | 4Dは受信したデータを変更せずに取り出します(\*)。 | | -| テキスト | 4DはUTF-8でエンコードされたデータを期待します (\*)。PHPの開発者はPHPの**utf8\_encode**コマンドを使用する必要があるかもしれません。 | PHPスクリプトの例: echo utf8\_encode(myText) | -| 日付 | 4Dは (PHPでときにDATE\_ATOMと呼ばれる) RFC 3339フォーマットの文字列として送信される日付を期待します。このフォーマットは"YYYY-MM-DDTHH:MM:SS"という形式で、例えば2005-08-15T15:52:01+00:00のようになります。4Dは時間部を無視し、UTCの日付を返します。 | | -| Time | 4DはRFC 3339フォーマットの文字列として送信される時間を期待します (日付型参照)。4Dは日付部を無視し、ローカルタイムゾーンの日付を考慮した上で、0時からの経過秒数を返します。 | 2時間30分45秒を送信するPHPスクリプトの例: echo date( DATE\_ATOM, mktime( 2,30,45)) | -| 整数または実数 | 4Dは数字や+、-、およびeに続く指数で表現された数値を解釈します。'.'や','文字はすべて小数区切り文字として解釈されます。 | PHPスクリプトの例: echo -1.4e-16; | -| ブール | PHPから文字列"true"または非ヌルと数値評価される値を受け取ると4DはTrueを返します。 | PHPスクリプトの例: echo (a==b); | -| 配列 | 4Dは、PHP配列がJSONフォーマットで返されるものと見なします。 | 2つのテキストを返すPHPスクリプトの例: echo json\_encode( array( "hello", "world")); | - -(\*) デフォルトでHTTPヘッダーは返されません: -\- *functionName*引数に関数名を渡して[PHP Execute](php-execute.md)を使用すると、*phpResult*にHTTPヘッダーが返されることはありません。ヘッダーは[PHP GET FULL RESPONSE](php-get-full-response.md)コマンドを使用してのみ取得できます。 -\- 関数名なし (*functionName*引数を省略するかからの文字列を渡す) で[PHP Execute](php-execute.md)を使用するとき、[PHP SET OPTION](php-set-option.md)コマンドを使用してPHP Raw resultオプションをTrueに設定することでHTTPヘッダーを返すことができます。 - -**注:** PHPを使用して大量のデータを取得する必要がある場合、通常関数の戻り値を使用するよりも、(**echo**や同等のコマンドを使用して) *stdOut*バッファーを経由した方が効率的です。詳細は[PHP GET FULL RESPONSE](php-get-full-response.md)コマンドの説明を参照してください。 - -### 環境変数を使用する - -[SET ENVIRONMENT VARIABLE](set-environment-variable.md)コマンドを使用してスクリプトが使用する環境変数を指定できます。警告: [LAUNCH EXTERNAL PROCESS](launch-external-process.md) や**PHP Execute** を呼出した後、一連の環境変数は消去されます。 - -### 特別な関数 - -4Dは以下の特別な関数を提供します: - -* **quit\_4d\_php**: PHPインタープリターとそのすべての子プロセスを終了するために使用します。スクリプトを実行中の子プロセスが一つでも存在していると、インタープリターは終了せず、**PHP Execute**コマンドはFalseを返します。 -* **relaunch\_4d\_php**: PHPインタープリターを再起動するために使用します。 - -**PHP Execute**から最初のリクエストが送信されると、インタープリターが自動で再起動されることに留意してください。 - -## 例題 1 - -"myPhpFile.php"スクリプトを関数指定なしで呼び出します。スクリプトは以下の通りです: - -```PHP - -``` - -以下の4Dコードを実行すると: - -```4d - var $result : Text - var $isOK : Boolean - $isOK:=PHP Execute("C:\\php\\myPhpFile.php";"";$result) - ALERT($Result) -``` - -カレントのPHP バージョンが表示されます。 - -## 例題 2 - -"myNewScript.php"内のmyPhpFunction関数を引数付きで呼び出します。スクリプトは以下の通りです: - -```PHP - -``` - -関数を呼び出します: - -```4d - var $result : Text - var $param1 : Text - var $param2 : Text - var $isOk : Boolean - $param1 :="Hello" - $param2 :="4D world!" - $isOk:=PHP Execute("C:\\MyFolder\\myNewScript.php";"myPhpFunction";$result;$param1;$param2) - ALERT($result) // "Hello 4D world!"が表示される -``` - -## 例題 3 - -PHPインタープリターを終了します: - -```4d - $ifOk:=PHP Execute("";"quit_4d_php") -``` - -## 例題 4 - -エラー管理: - -```4d -  // エラー管理メソッドをインストール - phpCommError:="" // PHPErrorHandler内で更新される - $T_saveErrorHandler :=Method called on error - ON ERR CALL("PHPErrorHandler") - - // スクリプトを実行 - var $T_result : Text - If(PHP Execute("C:\\MyScripts\\MiscInfos.php";"";$T_result)) -  // エラーなし, $T_Resultには結果が返される - Else -  // エラーが検知された, PHPErrorHandlerメソッドにより管理 -    If(phpCommError="") -       ... // PHPエラー, PHP GET FULL RESPONSEを使用する -    Else -       ALERT(phpCommError) -    End if - End if -  -  // エラー管理メソッドをアンインストール - ON ERR CALL($T_saveErrorHandler) - - -``` - -PHP\_errHandlerメソッドは以下の通りです : - -```4d - phpCommError:="" - GET LAST ERROR STACK(arrCodes;arrComps;arrLabels) - For($i;1;Size of array(arrCodes)) -    phpCommError:=phpCommError+String(arrCodes{$i})+" "+arrComps{$i}+" "+ -    arrLabels{$i}+"\r" - End for -``` - -## 例題 5 - -実行前に4Dで動的にスクリプトを作成します: - -```4d - DOCUMENT TO BLOB("C:\\Scripts\\MyScript.php";$blobDoc) - If(OK=1) -    $strDoc:=BLOB to text($blobDoc;UTF8 text without length) -  -    $strPosition:=Position("function2Rename";$strDoc) -  -    $strDoc:=Insert string($strDoc;"_v2";Length("function2Rename")+$strPosition) -  -    TEXT TO BLOB($strDoc;$blobDoc;UTF8 text without length) -    BLOB TO DOCUMENT("C:\\Scripts\\MyScript.php";$blobDoc) -    If(OK#1) -       ALERT("スクリプトの作成中にエラーが発生しました。") -    End if - End if -``` - -その後スクリプトを実行します: - -```4d - $err:=PHP Execute("C:\\Scripts\\MyScript.php";"function2Rename_v2";*) -``` - -## 例題 6 - -日付と時間タイプの値を直接受け取ります。スクリプトは以下の通りです: - -```PHP - -``` - -4D側で日付を受け取ります: - -```4d - var $phpResult_date : Date - $result :=PHP Execute("C:\php_scripts\ReturnDate.php";"";$phpResult_date) -  //$phpResult_date は !2009/05/04! - -4D側で時間を受け取ります: -  - var $phpResult_time : Time - $result :=PHP Execute("C:\php_scripts\ReturnDate.php";"";$phpResult_time) -  -  //$phpResult_time は ?01 :02 :03? - - -``` - -## 例題 7 - -配列にデータを配分します: - -```4d - ARRAY TEXT($arText ;0) - ARRAY LONGINT($arLong ;0) - $p1 :="," - $p2 :="11,22,33,44,55" - $phpok :=PHP Execute("";"explode";$arText;$p1;$p2) - $phpok :=PHP Execute("";"explode";$arLong;$p1;$p2) -  -  // $arTextには文字値 "11", "22", "33",... が格納されます。 -  // $arLongには数値 11, 22, 33,... が格納されます。 -``` - -## 例題 8 - -配列を初期化します: - -```4d - ARRAY TEXT($arText ;0) - $phpok :=PHP Execute("";"array_pad";$arText;->$arText;50;"undefined") -  // PHPで以下を実行: $arrTest = array_pad($arrTest, 50, ’undefined’); -  // $arTextは50 要素の"undefined"で埋められます。 -``` - -## 例題 9 - -配列を使用して引数を渡します: - -```4d - ARRAY INTEGER($arInt;0) - $phpok :=PHP Execute("";"json_decode";$arInt;"[13,51,69,42,7]") -  // PHPで以下を実行: $arInt = json_decode(’[13,51,69,42,7]’); -  // 配列に初期値が設定されます -``` - -## 例題 10 - -以下の例は、文字列の始めと終わりの余分なスペースまたは不可視の文字を除去するtrimファンクションの基本的な使用法です: - -```4d - var $T_String : Text - $T_String:="   Hello  " - var $B : Boolean - $B:=PHP Execute("";"trim";$T_String;$T_String) -``` - -trimファンクションについてのより詳細な情報については、PHPドキュメントを参照して下さい。 - -## 参照 - -*4DでPHPスクリプトを実行する* -[PHP GET FULL RESPONSE](php-get-full-response.md) -[PHP SET OPTION](php-set-option.md) - -## プロパティ - -| | | -| --- | --- | -| コマンド番号 | 1058 | -| スレッドセーフである | ✗ | - - diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-21/commands-legacy/php-get-full-response.md b/i18n/ja/docusaurus-plugin-content-docs/version-21/commands-legacy/php-get-full-response.md deleted file mode 100644 index ef445804ee4d8a..00000000000000 --- a/i18n/ja/docusaurus-plugin-content-docs/version-21/commands-legacy/php-get-full-response.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -id: php-get-full-response -title: PHP GET FULL RESPONSE -slug: /commands/php-get-full-response -displayed_sidebar: docs ---- - - - -**PHP GET FULL RESPONSE** ( *stdOut* {; *errLabels* ; *errValues*} {; *httpHeaderFields* {; *httpHeaderValues*}} ) - -| 引数 | 型 | | 説明 | -| --- | --- | --- | --- | -| stdOut | Text, Blob | ← | stdoutバッファーの内容 | -| errLabels | Text array | ← | エラーのラベル | -| errValues | Text array | ← | エラーの値 | -| httpHeaderFields | Text array | ← | HTTPヘッダーの名前 | -| httpHeaderValues | Text array | ← | HTTPヘッダーの値 | - - - -:::info 互換性 - -**4D のビルトインPHPインタープリターは削除されました**。[`4D.SystemWorkerクラス`](../API/SystemWorkerClass.md) を使用して外部PHPインタープリターをご利用ください。 - -::: - -## 説明 - -PHP GET FULL RESPONSE コマンドを使用して PHPインタープリターから返されるレスポンスに関する追加の情報を取得できます。 このコマンドは特にスクリプトの実行中にエラーが発生したときに有効です。 - -PHPスクリプトはstdoutバッファーにデータを書き込むことがあります (echo, print等)。このコマンドはデータを直接*stdout*変数に返します。そして[PHP Execute](php-execute.md)コマンドで説明されている原則と同じ変換を適用します。 - -同期される*errLabels*と*errValues*テキスト配列は、PHPスクリプトの実行がエラーの原因であるときに値が返されます。これらの配列には特に、エラーのもと、スクリプト、そして行などの情報が提供されます。これら2つの配列はともに使用します。*errLabels*を渡すときは合わせて*errValues*も渡さなければなりません。 - -4DとPHP間の交換はFastCGI経由で実行されるため、PHPインタープリターは、それがHTTPサーバから呼び出されたかのように機能し、したがってHTTPヘッダを送信します。*httpHeaderFields*と*httpHeaderValues*配列を使用してこれらのヘッダを取得できます。 - -## 参照 - -[PHP Execute](php-execute.md) -[PHP GET OPTION](php-get-option.md) - -## プロパティ - -| | | -| --- | --- | -| コマンド番号 | 1061 | -| スレッドセーフである | ✗ | - - diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-21/commands-legacy/php-get-option.md b/i18n/ja/docusaurus-plugin-content-docs/version-21/commands-legacy/php-get-option.md deleted file mode 100644 index e7ec51f8350bbf..00000000000000 --- a/i18n/ja/docusaurus-plugin-content-docs/version-21/commands-legacy/php-get-option.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -id: php-get-option -title: PHP GET OPTION -slug: /commands/php-get-option -displayed_sidebar: docs ---- - - - - -**PHP GET OPTION** ( *option* ; *value* ) - -| 引数 | 型 | | 説明 | -| --- | --- | --- | --- | -| option | Integer | → | 取得するオプション | -| value | Boolean | ← | オプションの現在値 | - - - -:::info 互換性 - -**4D のビルトインPHPインタープリターは削除されました**。[`4D.SystemWorkerクラス`](../API/SystemWorkerClass.md) を使用して外部PHPインタープリターをご利用ください。 - -::: - -## 説明 - -PHP GET OPTION コマンドを使用して、PHPスクリプトの実行に関連するオプションの現在値を取得できます。 - -*option*引数には読み出したいオプションを指定する"*PHP*"テーマの定数を渡します。コマンドは*value*引数にオプションのカレントの値を返します。以下のいずれかの定数を渡すことができます: - -| 定数 | 型 | 値 | コメント | -| -------------- | ---- | - | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | -| PHP raw result | 倍長整数 | 2 | 結果がテキスト型のときに実行結果中にPHPから返されるHTTPヘッダに関する処理モードの定義 (結果がBLOB型のときヘッダは常に保持されます)。
    **とりうる値**: ブール。False (デフォルト値) = HTTPヘッダを結果から取り除く、True = HTTPヘッダを保持する | - -## 参照 - -[PHP GET FULL RESPONSE](php-get-full-response.md) -[PHP SET OPTION](php-set-option.md) - -## プロパティ - -| | | -| --- | --- | -| コマンド番号 | 1060 | -| スレッドセーフである | ✗ | - - diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-21/commands-legacy/php-set-option.md b/i18n/ja/docusaurus-plugin-content-docs/version-21/commands-legacy/php-set-option.md deleted file mode 100644 index d5e1689780110a..00000000000000 --- a/i18n/ja/docusaurus-plugin-content-docs/version-21/commands-legacy/php-set-option.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -id: php-set-option -title: PHP SET OPTION -slug: /commands/php-set-option -displayed_sidebar: docs ---- - - - -**PHP SET OPTION** ( *option* ; *value* {; *} ) - -| 引数 | 型 | | 説明 | -| --- | --- | --- | --- | -| option | Integer | → | 設定するオプション | -| value | Boolean | → | オプションの新しい値 | -| * | 演算子 | → | 指定時: 変更は次の呼び出し時にのみ適用 | - - - -:::info 互換性 - -**4D のビルトインPHPインタープリターは削除されました**。[`4D.SystemWorkerクラス`](../API/SystemWorkerClass.md) を使用して外部PHPインタープリターをご利用ください。 - -::: - -## 説明 - -**PHP SET OPTION** コマンドを使用して、[PHP Execute](php-execute.md) コマンド呼び出し前に、特定のオプションを設定することができます。このコマンドのスコープはカレントプロセスです。 - -option引数には、変更するオプションを指定する"*PHP*"テーマの定数を渡します。 *value*引数には*option*の新しい値を渡します。 - -| 定数 | 型 | 値 | コメント | -| -------------- | ---- | - | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | -| PHP raw result | 倍長整数 | 2 | 結果がテキスト型のときに実行結果中にPHPから返されるHTTPヘッダに関する処理モードの定義 (結果がBLOB型のときヘッダは常に保持されます)。
    **とりうる値**: ブール。False (デフォルト値) = HTTPヘッダを結果から取り除く、True = HTTPヘッダを保持する | - -デフォルトで**PHP SET OPTION** はプロセス内で後に続くすべての[PHP Execute](php-execute.md) のオプションを設定します。 次の呼び出しにのみ有効なオプションを設定するためには、アスタリスク (*\**) 引数を渡します。 - -## 参照 - -[PHP Execute](php-execute.md) -[PHP GET OPTION](php-get-option.md) - -## プロパティ - -| | | -| --- | --- | -| コマンド番号 | 1059 | -| スレッドセーフである | ✗ | - - diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-21/commands/command-index.md b/i18n/ja/docusaurus-plugin-content-docs/version-21/commands/command-index.md index 096a41339563e1..cba205c59646fe 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-21/commands/command-index.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-21/commands/command-index.md @@ -846,10 +846,6 @@ title: Commands by name [`Path to object`](../commands-legacy/path-to-object.md)
    [`PAUSE INDEXES`](../commands-legacy/pause-indexes.md)
    [`PAUSE PROCESS`](../commands-legacy/pause-process.md)
    -[`PHP Execute`](../commands-legacy/php-execute.md)
    -[`PHP GET FULL RESPONSE`](../commands-legacy/php-get-full-response.md)
    -[`PHP GET OPTION`](../commands-legacy/php-get-option.md)
    -[`PHP SET OPTION`](../commands-legacy/php-set-option.md)
    [`PICTURE CODEC LIST`](../commands-legacy/picture-codec-list.md)
    [`PICTURE LIBRARY LIST`](../commands-legacy/picture-library-list.md)
    [`PICTURE PROPERTIES`](../commands-legacy/picture-properties.md)
    diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-21/commands/theme/PHP.md b/i18n/ja/docusaurus-plugin-content-docs/version-21/commands/theme/PHP.md deleted file mode 100644 index b70f3706c920ea..00000000000000 --- a/i18n/ja/docusaurus-plugin-content-docs/version-21/commands/theme/PHP.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -id: PHP_theme -title: PHP -sidebar_label: PHP -slug: /commands/theme/PHP ---- - -| | -| --------------------------------------------------------------------------------------------------------------- | -| [](../../commands-legacy/php-execute.md)
    | -| [](../../commands-legacy/php-get-full-response.md)
    | -| [](../../commands-legacy/php-get-option.md)
    | -| [](../../commands-legacy/php-set-option.md)
    | diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-21/commands/web-event.md b/i18n/ja/docusaurus-plugin-content-docs/version-21/commands/web-event.md index c1d03563807c61..b2acd2c446f9d5 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-21/commands/web-event.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-21/commands/web-event.md @@ -8,48 +8,48 @@ displayed_sidebar: docs -| 引数 | 型 | | 説明 | -| --- | ------ | :-------------------------: | ---------------------------------- | -| 戻り値 | Object | ← | Information on the triggered event | +| 引数 | 型 | | 説明 | +| --- | ------ | :-------------------------: | ----------------- | +| 戻り値 | Object | ← | トリガーされたイベントに関する情報 | ## 説明 -`Web Event` returns an object with information on a triggered event linked to a web page component. +`Web Event` は、Web ページコンポーネントにリンクされた、トリガーされたイベントに関する情報を格納したオブジェクトを返します。 -The command must be called in the context of a web page handled by the 4D web server. +このコマンドは、4D Web サーバーによって管理されるWeb ページのコンテキスト内から呼び出さなければなりません。 **戻り値** 戻り値のオブジェクトには、以下のプロパティが格納されています: -| プロパティ | | 型 | 説明 | -| --------- | ----- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| caller | | string | [Server-side reference](https://developer.4d.com/qodly/4DQodlyPro/pageLoaders/pageLoaderOverview#data-access-category) of the component triggering the event | -| eventType | | string | Type of event:
  • onblur
  • onfocus
  • onclick
  • onauxclick
  • onmouseenter
  • onmouseleave
  • onkeyup
  • onkeydown
  • onchange
  • unload
  • onload - triggered when the `Page` loads
  • | -| data | | object | Additional information depending on the involved component | -| | index | number |
  • Tabs component: index of the tab (indexing starts at 0)
  • Data Table component: column number
  • | -| | row | number | Data Table component: row number | -| | name | string | Data Table component: qodlysource name of the column (e.g. "firstname", "address.city") | +| プロパティ | | 型 | 説明 | +| --------- | ----- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| caller | | string | イベントをトリガーしたコンポーネントの[サーバー側参照](https://developer.4d.com/qodly/4DQodlyPro/pageLoaders/pageLoaderOverview#data-access-category) | +| eventType | | string | イベントの種類:
  • onblur
  • onfocus
  • onclick
  • onauxclick
  • onmouseenter
  • onmouseleave
  • onkeyup
  • onkeydown
  • onchange
  • unload
  • onload - `Page` がロードされたときにトリガーされます
  • | +| data | | object | 関連するコンポーネントに応じた追加の情報 | +| | index | number |
  • タブコンポーネント: タブのインデックス(インデックスは 0 から始まります)
  • データテーブルコンポーネント: カラムの番号
  • | +| | row | number | データテーブルコンポーネント: 行番号 | +| | name | string | データテーブルコンポーネント: カラムの qodlyソース名(例: "firstname"、 "address.city") | #### 例題 -The objective is to display/hide a help text when the user hovers over the component: +ここでの目的は、ユーザーがコンポーネント上をホバーした際にヘルプテキストを表示/非表示することです: ![](../assets/en/commands/web-event1.png) -This is done by attaching `onmouseenter` and `onmouseleave` events to a **Text input** component that displays the information stored in a **Text** component (displaying "This is the help text"). +これは、("これはヘルプテキストです"というテキストを表示する)**Text** コンポーネントに保存された情報を表示する **Text input** コンポーネントに `onmouseenter` および `onmouseleave` イベントを割り当てることで可能になります。 ![](../assets/en/commands/web-event2.png) -In this scenario: +このシナリオでは以下のような前提があります: -- The Text input component has `orderNumber` as Server side reference. +- Text input コンポーネントは、 `orderNumber` というサーバー側参照を持ちます。 ![](../assets/en/commands/web-event3.png) -- The Text component has `helpOn_orderNumber` as Server side reference. +- Text コンポーネントは `helpOn_orderNumber` というサーバー側参照を持ちます。 ![](../assets/en/commands/web-event4.png) -- The [exposed](../ORDA/ordaClasses.md#exposed-vs-non-exposed-functions) function `help()` is attached to both the `onmouseenter` and `onmouseleave` events and contains the following code: +- `onmouseenter` および `onmouseleave` イベントの両方には[公開された](../ORDA/ordaClasses.md#exposed-vs-non-exposed-functions) `help()` 関数が割り当てられており、そこには以下のようなコードが書かれています: ```4d shared singleton Class constructor() diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/API/DataClassClass.md b/i18n/pt/docusaurus-plugin-content-docs/current/API/DataClassClass.md index 8bad6f70bd3115..ad758a82c18dcc 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/current/API/DataClassClass.md +++ b/i18n/pt/docusaurus-plugin-content-docs/current/API/DataClassClass.md @@ -1098,7 +1098,7 @@ ds.Class.query("info.coll[a].val := :1";0) Você pode usar qualquer letra do alfabeto como a notação `[a]`. -#### Linkar os argumentos de pesquisa com os atributos de coleção +### Linkar os argumentos de pesquisa com os atributos de coleção Ao pesquisar nos atributos de objetos de classe de dados que contêm coleções usando vários argumentos de consulta unidos pelo operador AND, você pode querer garantir que somente as entidades que contêm elementos que correspondem a todos os argumentos sejam retornadas, e não as entidades em que os argumentos podem ser encontrados em elementos diferentes. Para tal, é necessário ligar argumentos de consulta a elementos de coleção, de modo a que apenas sejam encontrados elementos individuais que contenham argumentos ligados. @@ -1304,6 +1304,8 @@ queryPath: steps:[{steps:[{description:[index : Company.revenues ] > 10000000,time:0,recordsfounds:933}]}]}]}]} ``` +### Exemplos + #### Exemplo 1 Esta seção oferece vários exemplos de pesquisas. @@ -1642,7 +1644,7 @@ ds.VectorTable.query("embedding>:1 and embedding<:2";$vector1Comparison;$vector2 -> **Modo avançado:** essa função é destinada a desenvolvedores que precisam personalizar os recursos padrão do ORDA para configurações específicas. Na maioria dos casos, não necessitará de o utilizar. +> **Modo avançado:** Essa função é destinada a desenvolvedores que precisam personalizar os recursos padrão do ORDA para configurações específicas. Na maioria dos casos, não necessitará de o utilizar. #### Descrição diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/Notes/updates.md b/i18n/pt/docusaurus-plugin-content-docs/current/Notes/updates.md index 06797832a33621..a8a8ecc351ffcd 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/current/Notes/updates.md +++ b/i18n/pt/docusaurus-plugin-content-docs/current/Notes/updates.md @@ -35,7 +35,6 @@ Leia [**O que há de novo no 4D v21 R2**](https://blog.4d.com/en-whats-new-in-4d | ngtcp2 | 1.16.0 | **21** | Usado para QUIC | | OpenSSL | 3.5.2 | **21** | | | PDFWriter | 4.7.0 | **21** | Used for [`WP Export document`](../WritePro/commands/wp-export-document.md) and [`WP Export variable`](../WritePro/commands/wp-export-variable.md) | -| PHP | 8.2.4 | 20 | | | SpreadJS | 17.1.0 | 20 R7 | Veja [este post de blog](https://blog.4d.com/4d-view-pro-whats-new-in-4d-20-r7/) para uma visão geral dos novos recursos | | webKit | WKWebView | 19 | | | Xerces | 3.3.0 | **21** | Used for XML commands | diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/commands-legacy/php-execute.md b/i18n/pt/docusaurus-plugin-content-docs/current/commands-legacy/php-execute.md deleted file mode 100644 index a65f7c99bd195c..00000000000000 --- a/i18n/pt/docusaurus-plugin-content-docs/current/commands-legacy/php-execute.md +++ /dev/null @@ -1,292 +0,0 @@ ---- -id: php-execute -title: PHP Execute -slug: /commands/php-execute -displayed_sidebar: docs ---- - - - -**PHP Execute** ( *rotaScript* {; *nomeFuncao* {; *resultadoPHP* {; *param*} {; *param2* ; ... ; *paramN*}}} ) : Boolean - -| Parâmetro | Tipo | | Descrição | -| --- | --- | --- | --- | -| rotaScript | Text | → | Rota de acesso ao script PHP ou "" para executar a função PHP | -| nomeFuncao | Text | → | Função PHP a ser executada | -| resultadoPHP | *, Variable, Field | ← | Resultado da função PHP executada ou * para não receber nenhum resultado | -| param | Text, Boolean, Real, Integer, Date, Time | → | Parâmetros da função PHP | -| Resultado | Boolean | ← | True =execução correta; False = erro de execução | - - - -:::info Compatibilidade - -**PHP está obsoleto em 4D**. Recomenda-se usar a classe [`4D.SystemWorker class`](../API/SystemWorkerClass.md). - -::: - - -## Descrição - -O comando PHP Execute permite executar um script ou uma função PHP. - -Passe no parâmetro *rutaScrip*t a rota de acesso do arquivo de script PHP a executar. Pode ser uma rota de acesso relativa se o arquivo está localizado junto à estrutura do banco ou de uma rota absoluta. A rota de acesso pode ser expressa em sintaxe sistema ou POSIX. -Se deseja executar diretamente uma função PHP padrão, passe uma string vazia ("") em *rotaScript*. O nome da função deve ser passada no segundo parâmetro. - -Passe no parâmetro *nomFunção* um nome de função PHP se quer executar uma função específica no script *rotaScript*. Se passa uma string vazia ou omite o parâmetro *nomFunção*, o script se executa completamente. - -**Nota:** PHP considera as maiúsculas e minúsculas dos caracteres no nome da função. Não utilize parênteses, introduza unicamente o nome da função. - -O parâmetro *resultPHP* recebe o resultado da execução da função PHP. Pode passar: - -* uma variável, um array ou um campo para receber o resultado, -* o caractere \* se a função não devolve nenhum resultado ou se não quer recuperar o resultado. - -O parâmetro *resultPHP* pode ser de tipo texto, inteiro longo, real, booleano ou data assim como também (exceto para arrays) BLOB ou hora. 4D efetuará a conversão dos dados e os ajustes necessários seguindo os princípios descritos na seção a continuação. - -* se passa um nome de função no parâmetro *nomFuncao*, *resultPHP* receberá o que o desenvolvedor PHP devolve com o comando return do corpo da função. -* Se utiliza o comando sem passar um nome de função no parâmetro *nomFuncao*, *r* *esultPHP* receberá o que o desenvolvedor PHP devolveu com o comando echo ( ou um comando similar). - - Se chama a uma função PHP que espera argumentos, utilize os parâmetros *param1...N* para passar um ou vários valores. Os valores devem estar separados por ponto e vírgula. Pode passar valores de tipo alfa, texto, booleano, real, inteiro, inteiro longo, data ou hora. As imagens e os BLOBs não são aceitos. Pode enviar um array; neste caso deve passar um ponteiro no array ao comando PHP Execute, do contrário o índice atual do array se enviará como um inteiro (ver o exemplo). O comando aceita todos os tipos de arrays exceto os arrays ponteiro, os arrays imagem e os arrays 2D. -Os parâmetros *param1...N* são enviados em PHP no formato JSON em UTF-8\. Eles são codificados automaticamente com o comando PHP **json\_decode** antes de ser enviados à função PHP *nomeFunçao*. - -**Nota:** por razões técnicas, o tamanho dos parâmetros passados através do protocolo FastCGI não deve passar os 64 KB. Deve considerar esta limitação se utiliza parâmetros de tipo Texto. - -O comando devolve True se a execução for realizada corretamente do lado de 4D, em outras palavras, se o lançamento do ambiente de execução, a abertura do script e o estabelecimento da comunicação com o intérprete PHP foram exitosos. Do contrário, se gera um erro, que pode interceptar com o comando [ON ERR CALL](on-err-call.md "ON ERR CALL") e analizar com [Last errors](../commands/last-errors.md). -Além disso, o script mesmo pode gerar erros PHP. Neste caso, deve utilizar o comando [PHP GET FULL RESPONSE](php-get-full-response.md "PHP GET FULL RESPONSE") para analizar a fonte do erro (ver exemplo 4). - -**Nota:** PHP permite configurar a gestão de erros. Para maior informação, consulte por exemplo a página: . - -### Conversão dos dados devolvidos - -A tabela a seguir especifica como 4D interpreta e converte os dados devolvidos em função do tipo do parâmetro *resultPHP*. - -| **Tipo do parâmetro *resultPHP*** | **Processo 4D** | **Exemplo** | -| --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| BLOB | 4D recupera os dados recebidos sem nenhuma modificação(\*). | | -| Texto | 4D espera os dados codificados em UTF-8 (\*). O desenvolvedor PHP pode necessitar utilizar o comando PHP **utf8\_encode**. | Exemplo de script PHP: echo utf8\_encode(meuTexto) | -| Data | 4D espera uma data enviada como uma string em formato RFC 3339 (também chamado DATE\_ATOM em PHP). Este formato é de tipo "AAAA-MM-DDTHH:MM:SS", por exemplo: 2005-08-15T15:52:01+00:00\. 4D ignora a parte hora e devolve a data em UTC. | | -| Hora | 4D espera uma hora enviada em forma de string em formato RFC 3339 (ver o tipo Data). 4D ignora a parte data e devolve o número de segundos transcorridos desde a meia noite considerando a data na zona horária local. | Exemplo de script PHP para enviar 2h30'45": echo date( DATE\_ATOM, mktime( 2,30,45)) | -| Inteiro ou Real | 4D interpreta o valor numérico expresso com números, signo + ou - e/ou o exponente com o prefixo 'e'. Todo carácter '.' ou ',' se interpreta como um separador decimal. | Exemplo de script PHP: echo -1.4e-16; | -| Booleano | 4D devolve True se recebe a string "true" desde PHP ou se a avaliação numérica dá um valor não nulo. | Exemplo de script PHP: echo (a==b); | -| Array | 4D considera que o array PHP foi devolvido no formato JSON. | Exemplo de script PHP para devolver um array dos textos: echo json\_encode( array( "ola", "mundo")); | - -(\*) Por padrão, não são devolvidos os cabeçalhos HTTP: -\- Se utiliza [PHP Execute](php-execute.md) ao passar uma função no parâmetro *nomFuncao*, os cabeçalhos HTTP nunca são devolvidos em *resultPHP*. Só estão disponíveis através do comando [PHP GET FULL RESPONSE](php-get-full-response.md). -\- Se utiliza [PHP Execute](php-execute.md) sem um nome de função (o parâmetro *nomFunçao* se omite ou contém uma string vazia), pode devolver os cabeçalhos HTTP fixando a opção PHP Raw result em True utilizando o comando [PHP SET OPTION](php-set-option.md). - -**Nota:** se precisar recuperar grandes volumes de dados utilizando PHP, é mais eficiente passar pelo canal do buffer *stdOut* (comando **echo** ou similar) que pelo retorno de função. Para maior informação, consulte a descrição do comando [PHP GET FULL RESPONSE](php-get-full-response.md). - -### Usar variáveis de ambiente - -Pode utilizar o comando [SET ENVIRONMENT VARIABLE](set-environment-variable.md "SET ENVIRONMENT VARIABLE") para definir as variáveis de ambiente utilizadas pelo script. Atenção: depois de chamar [LAUNCH EXTERNAL PROCESS](launch-external-process.md "LAUNCH EXTERNAL PROCESS") ou PHP Execute, o conjunto das variáveis de ambiente se apaga. - -### Funções especiais - -4D oferece as seguintes funções especiais: - -* **quit\_4d\_php**: permite sair do intérprete PHP e de todos seus processos filhos. Se ao menos um dos processos filho está executando um script, o intérprete não sai e o comando PHP Execute devolve False. -* **relaunch\_4d\_php**: permite relançar o intérprete PHP. - -Note que o intérprete é relançado automaticamente quando a primeira petição é enviada por PHP Execute. - -## Exemplo 1 - -Chamada do script "myPhpFile.php" sem função. Este é o conteúdo do script: - -```PHP - -``` - -O código 4D a seguir: - -```4d - var $result : Text - var $isOK : Boolean - $isOK:=PHP Execute("C:\php\myPhpFile.php";"";$result) - ALERT($Result) -``` - -... mostrará a versão atual do PHP. - -## Exemplo 2 - -Chamada da função *myPhpFunction* no script "myNewScript.php" com parâmetros. Este é o conteúdo do script: - -```PHP - -``` - -Chamada com função: - -```4d - var $result : Text - var $param1 : Text - var $param2 : Text - var $isOk : Boolean - $param1 :="Olá" - $param2 :="mundo 4D!" - $isOk:=PHP Execute("C:\MyFolder\myNewScript.php";"myPhpFunction";$result;$param1;$param2) - ALERT($result) // Mostra "Olá mundo 4D!" -``` - -## Exemplo 3 - -Sair do intérprete PHP: - -```4d - $ifOk:=PHP Execute("";"quit_4d_php") -``` - -## Exemplo 4 - -Gestão de erros: - -```4d -  // Instalação do método de gestão de erros - phpCommError:="" // Modificado por PHPErrorHandler - $T_saveErrorHandler :=Method called on error - ON ERR CALL("PHPErrorHandler") - - // Execução do script - var $T_result : Text - If(PHP Execute("C:\MyScripts\MiscInfos.php";"";$T_result)) -  // Nenhum erro, $T_Result contém o resultado - Else -  // Se detectou um erro, administrado por PHPErrorHandler -    If(phpCommError="") -       ... // error PHP, utilize PHP GET FULL RESPONSE -    Else -       ALERT(phpCommError) -    End if - End if -  -  // Desinstalação do método - ON ERR CALL($T_saveErrorHandler) - - -``` - -O método PHP\_errHandler é o seguinte: - -```4d - phpCommError:="" - GET LAST ERROR STACK(arrCodes;arrComps;arrLabels) - For($i;1;Size of array(arrCodes)) -    phpCommError:=phpCommError+String(arrCodes{$i})+" "+arrComps{$i}+" "+ -    arrLabels{$i}+Char(Carriage return) - End for -``` - -## Exemplo 5 - -Criação dinâmica por 4D de um script antes de sua execução: - -```4d - DOCUMENT TO BLOB("C:\Scripts\MyScript.php";$blobDoc) - If(OK=1) -    $strDoc:=BLOB to text($blobDoc;UTF8 text without length) -  -    $strPosition:=Position("function2Rename";$strDoc) -  -    $strDoc:=Insert string($strDoc;"_v2";Length("function2Rename")+$strPosition) -  -    TEXT TO BLOB($strDoc;$blobDoc;UTF8 text without length) -    BLOB TO DOCUMENT("C:\Scripts\MyScript.php";$blobDoc) -    If(OK#1) -       ALERT("Error on script creation") -    End if - End if -``` - -Se executa o script: - -```4d - $err:=PHP Execute("C:\Scripts\MyScript.php";"function2Rename_v2";*) -``` - -## Exemplo 6 - -Recuperação direta de um valor de tipo data e hora. Este é o conteúdo do script: - -```PHP - -``` - -Recepção da data do lado 4D: - -```4d - var $phpResult_date : Date - $result :=PHP Execute("C:\php_scripts\ReturnDate.php";"";$phpResult_date) -  //$phpResult_date is !05/04/2009 ! -  - var $phpResult_time : Time - $result :=PHP Execute("C:\php_scripts\ReturnDate.php";"";$phpResult_time) -  //$phpResult_time is ?01 :02 :03 ? -``` - -## Exemplo 7 - -Distribuição de dados em arrays: - -```4d - ARRAY TEXT($arText ;0) - ARRAY LONGINT($arLong ;0) - $p1 :="," - $p2 :="11,22,33,44,55" - $phpok :=PHP Execute("";"explode";$arText;$p1;$p2) - $phpok :=PHP Execute("";"explode";$arLong;$p1;$p2) -  -  // $arText contém os valores Alfa "11", "22", "33", etc. -  // $arLong contém os números, 11, 22, 33, etc. -``` - -## Exemplo 8 - -Inicialização de um array: - -```4d - ARRAY TEXT($arText ;0) - $phpok :=PHP Execute("";"array_pad";$arText;->$arText;50;"indefinido") -  // Execute em PHP: $arrTest = array_pad($arrTest, 50, ’indefinido’); -  // Preencher o array $arText com 50 elementos "indefinido" -``` - -## Exemplo 9 - -Passo de parâmetros através de um array: - -```4d - ARRAY INTEGER($arInt;0) - $phpok :=PHP Execute("";"json_decode";$arInt;"[13,51,69,42,7]") -  // Execute en PHP: $arInt = json_decode(’[13,51,69,42,7]’); -  // Preencha o array com os valores iniciais -``` - -## Exemplo 10 - -Este é um exemplo da utilização básica da função trim, para eliminar espaços adicionais e/ou caracteres invisíveis de princípio a fim de uma cadeia: - -```4d - var $T_String : Text - $T_String:="   Hello  " - var $B : Boolean - $B:=PHP Execute("";"trim";$T_String;$T_String) -``` - -Para obter mais informação sobre a função trim, por favor, consulte a documentação de PHP. - -## Ver também - -*Executar scripts PHP em 4D* -[PHP GET FULL RESPONSE](php-get-full-response.md) -[PHP SET OPTION](php-set-option.md) - -## Propriedades - -| | | -| --- | --- | -| Número do comando | 1058 | -| Thread-seguro | ✗ | - - diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/commands-legacy/php-get-full-response.md b/i18n/pt/docusaurus-plugin-content-docs/current/commands-legacy/php-get-full-response.md deleted file mode 100644 index 2cc5c7419100f2..00000000000000 --- a/i18n/pt/docusaurus-plugin-content-docs/current/commands-legacy/php-get-full-response.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -id: php-get-full-response -title: PHP GET FULL RESPONSE -slug: /commands/php-get-full-response -displayed_sidebar: docs ---- - - - -**PHP GET FULL RESPONSE** ( *stdOut* {; *etiquetaErr* ; *valoresErr*} {; *camposCabHttp* {; *valoresCabHttp*}} ) - -| Parâmetro | Tipo | | Descrição | -| --- | --- | --- | --- | -| stdOut | Text, Blob | ← | Conteúdo do buffer stdOut | -| etiquetaErr | Text array | ← | Etiquetas dos erros | -| valoresErr | Text array | ← | Valores dos erros | -| camposCabHttp | Text array | ← | Nome dos cabeçalhos HTTP | -| valoresCabHttp | Text array | ← | Valores dos cabeçalhos HTTP | - - - -:::info Compatibilidade - -**PHP está obsoleto em 4D**. Recomenda-se usar a classe [`4D.SystemWorker class`](../API/SystemWorkerClass.md). - -::: - -## Descrição - -O comando PHP GET FULL RESPONSE permite obter informação adicional sobre a resposta devolvida pelo intérprete PHP. Este comando é especialmente útil no caso de que ocorra um erro durante a execução do script. - -O script PHP pode escrever dados no buffer stdOut (eco, print, etc.) O comando devolvido diretamente os dados na variável *stdOut* e aplica os mesmos princípios de conversão descritos no comando [PHP Execute](php-execute.md "PHP Execute"). - -Os arrays texto sincronizados *etiquetasErr* e *valoresErr* se preenchem quando a execução dos scripts PHP provoca erros. Estes arrays, em particular, proporcionam informação sobre a origem, o script e a línha de erro. Estes dois arrays são inseparáveis: se for passado *etiquetasErr*, se deve passar também *valoresErr*. - -Dado que os intercâmbios entre 4D e o intérprete PHP se realizam através de FastCGI, o intérprete PHP funciona como se fosse chamado por um servidor HTTP e portanto, envia cabeçalhos HTTP. Pode recuperar estes cabeçalhos e seus valores nos arrays *camposCabHttp* e *valoresCabHttp*. - -## Ver também - -[PHP Execute](php-execute.md) -[PHP GET OPTION](php-get-option.md) - -## Propriedades - -| | | -| --- | --- | -| Número do comando | 1061 | -| Thread-seguro | ✗ | - - diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/commands-legacy/php-get-option.md b/i18n/pt/docusaurus-plugin-content-docs/current/commands-legacy/php-get-option.md deleted file mode 100644 index d0d661c3b4861b..00000000000000 --- a/i18n/pt/docusaurus-plugin-content-docs/current/commands-legacy/php-get-option.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -id: php-get-option -title: PHP GET OPTION -slug: /commands/php-get-option -displayed_sidebar: docs ---- - - - - -**PHP GET OPTION** ( *opção* ; *valor* ) - -| Parâmetro | Tipo | | Descrição | -| --- | --- | --- | --- | -| opção | Integer | → | Opção a conseguir | -| valor | Boolean | ← | Valor atual da opção | - - - -:::info Compatibilidade - -**PHP está obsoleto em 4D**. Recomenda-se usar a classe [`4D.SystemWorker class`](../API/SystemWorkerClass.md). - -::: - -## Descrição - -O comando PHP GET OPTION permite conhecer o valor atual de uma opção relativa à execução de scripts PHP. - -Passe no parâmetro *opção* uma constante do tema "*PHP*" para designar a opção a ler. O comando devolve o valor atual da opção no parâmetro *valor*. P - -| Constante | Tipo | Valor | Comentário | -| -------------- | ------------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| PHP raw result | Inteiro longo | 2 | Definição do modo de processamento dos cabeçalhos HTTP devolvidos por PHP no resultado da execução quando este resultado for do tipo Texto (quando o resultado for do tipo BLOB, os cabeçalhos são mantidos sempre).
    Valores possíveis: Booleano: False (valor padrão = eliminar os cabeçalhos HTTP do resultado. True = conservar os cabeçalhos HTTP. | - -## Ver também - -[PHP GET FULL RESPONSE](php-get-full-response.md) -[PHP SET OPTION](php-set-option.md) - -## Propriedades - -| | | -| --- | --- | -| Número do comando | 1060 | -| Thread-seguro | ✗ | - - diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/commands-legacy/php-set-option.md b/i18n/pt/docusaurus-plugin-content-docs/current/commands-legacy/php-set-option.md deleted file mode 100644 index 666d69703c55cc..00000000000000 --- a/i18n/pt/docusaurus-plugin-content-docs/current/commands-legacy/php-set-option.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -id: php-set-option -title: PHP SET OPTION -slug: /commands/php-set-option -displayed_sidebar: docs ---- - - - -**PHP SET OPTION** ( *opçao* ; *valor* {; *} ) - -| Parâmetro | Tipo | | Descrição | -| --- | --- | --- | --- | -| opçao | Integer | → | Opção a ser estabelecida | -| valor | Boolean | → | Novo valor da opção | -| * | Operador | → | Se passado: modificação apenas se aplica à próxima chamada | - - - -:::info Compatibilidade - -**PHP está obsoleto em 4D**. Recomenda-se usar a classe [`4D.SystemWorker class`](../API/SystemWorkerClass.md). - -::: - - -## Descrição - -O comando PHP SET OPTION se utiliza para definir opções específicas antes de chamar o comando [PHP Execute](php-execute.md). O escopo deste comando é o processo atual. - -Passe no parâmetro *opção* uma constante do tema "*PHP*" para designar a opção a modificar e no parâmetro *valor*, o novo valor da opção. Esta é uma descrição das opções: - -| Constante | Tipo | Valor | Comentário | -| -------------- | ------------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| PHP raw result | Inteiro longo | 2 | Definição do modo de processamento dos cabeçalhos HTTP devolvidos por PHP no resultado da execução quando este resultado for do tipo Texto (quando o resultado for do tipo BLOB, os cabeçalhos são mantidos sempre).
    Valores possíveis: Booleano: False (valor padrão = eliminar os cabeçalhos HTTP do resultado. True = conservar os cabeçalhos HTTP. | - -Como padrão, PHP SET OPTION define a opção para todas as chamadas a [PHP Execute](php-execute.md) posteriores do processo. Se quiser definir para a próxima chamada unicamente passe o parâmetro estrela (*\**). - -## Ver também - -[PHP Execute](php-execute.md) -[PHP GET OPTION](php-get-option.md) - -## Propriedades - -| | | -| --- | --- | -| Número do comando | 1059 | -| Thread-seguro | ✗ | - - diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/commands/command-index.md b/i18n/pt/docusaurus-plugin-content-docs/current/commands/command-index.md index 09fd01c7c3101f..a9cbf55451d04c 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/current/commands/command-index.md +++ b/i18n/pt/docusaurus-plugin-content-docs/current/commands/command-index.md @@ -846,10 +846,6 @@ title: Commands by name [`Path to object`](../commands-legacy/path-to-object.md)
    [`PAUSE INDEXES`](../commands-legacy/pause-indexes.md)
    [`PAUSE PROCESS`](../commands-legacy/pause-process.md)
    -[`PHP Execute`](../commands-legacy/php-execute.md)
    -[`PHP GET FULL RESPONSE`](../commands-legacy/php-get-full-response.md)
    -[`PHP GET OPTION`](../commands-legacy/php-get-option.md)
    -[`PHP SET OPTION`](../commands-legacy/php-set-option.md)
    [`PICTURE CODEC LIST`](../commands-legacy/picture-codec-list.md)
    [`PICTURE LIBRARY LIST`](../commands-legacy/picture-library-list.md)
    [`PICTURE PROPERTIES`](../commands-legacy/picture-properties.md)
    diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/commands/theme/PHP.md b/i18n/pt/docusaurus-plugin-content-docs/current/commands/theme/PHP.md deleted file mode 100644 index b70f3706c920ea..00000000000000 --- a/i18n/pt/docusaurus-plugin-content-docs/current/commands/theme/PHP.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -id: PHP_theme -title: PHP -sidebar_label: PHP -slug: /commands/theme/PHP ---- - -| | -| --------------------------------------------------------------------------------------------------------------- | -| [](../../commands-legacy/php-execute.md)
    | -| [](../../commands-legacy/php-get-full-response.md)
    | -| [](../../commands-legacy/php-get-option.md)
    | -| [](../../commands-legacy/php-set-option.md)
    | diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-19/API/DataClassClass.md b/i18n/pt/docusaurus-plugin-content-docs/version-19/API/DataClassClass.md index 4e7cefffeb6d6f..e03295cc68de13 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-19/API/DataClassClass.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-19/API/DataClassClass.md @@ -933,6 +933,7 @@ ds. People.query("places.locations[a].kind= :1 and places.locations[a].city= :2" ... a consulta só devolverá "martin" porque tem um elemento "locations" cujo "kind" é "home" e cuja "city" é "paris". A consulta não devolverá "smith" porque os valores "home" e "paris" não estão no mesmo elemento de coleção. + **Parâmetro formula** Como alternativa à inserção de fórmulas dentro do parâmetro *queryString* (ver acima), pode passar diretamente um objeto fórmula como critério de pesquisa booleano. A utilizaçã de um objeto fórmula para as pesquisas é **recomendada** já que se beneficia da tokenização, e o código é mais fácil de pesquisar/ler. @@ -1007,6 +1008,8 @@ queryPath: steps:[{steps:[{description:[index : Company.revenues ] > 10000000,time:0,recordsfounds:933}]}]}]}]} ``` +### Exemplos + #### Exemplo 1 Esta seção oferece vários exemplos de pesquisas. diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-20-R10/API/DataClassClass.md b/i18n/pt/docusaurus-plugin-content-docs/version-20-R10/API/DataClassClass.md index 2ae2fe7dbe70d7..77697f342a40f4 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-20-R10/API/DataClassClass.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-20-R10/API/DataClassClass.md @@ -1096,7 +1096,7 @@ ds.Class.query("info.coll[a].val := :1";0) Você pode usar qualquer letra do alfabeto como a notação `[a]`. -#### Linkar os argumentos de pesquisa com os atributos de coleção +### Linkar os argumentos de pesquisa com os atributos de coleção Ao pesquisar nos atributos de objetos de classe de dados que contêm coleções usando vários argumentos de consulta unidos pelo operador AND, você pode querer garantir que somente as entidades que contêm elementos que correspondem a todos os argumentos sejam retornadas, e não as entidades em que os argumentos podem ser encontrados em elementos diferentes. Para tal, é necessário ligar argumentos de consulta a elementos de coleção, de modo a que apenas sejam encontrados elementos individuais que contenham argumentos ligados. @@ -1249,6 +1249,8 @@ queryPath: steps:[{steps:[{description:[index : Company.revenues ] > 10000000,time:0,recordsfounds:933}]}]}]}]} ``` +### Exemplos + #### Exemplo 1 Esta seção oferece vários exemplos de pesquisas. diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-20/API/DataClassClass.md b/i18n/pt/docusaurus-plugin-content-docs/version-20/API/DataClassClass.md index b0f0399ac97f3b..a7fecfc84cb22b 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-20/API/DataClassClass.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-20/API/DataClassClass.md @@ -1081,7 +1081,7 @@ ds.Class.query("info.coll[a].val := :1";0) Pode utilizar qualquer letra do alfabeto como notação `[a]` . -#### Linkar os argumentos de pesquisa com os atributos de coleção +### Linkar os argumentos de pesquisa com os atributos de coleção :::info @@ -1134,6 +1134,7 @@ ds. People.query("places.locations[a].kind= :1 and places.locations[a].city= :2" ... a consulta só devolverá "martin" porque tem um elemento "locations" cujo "kind" é "home" e cuja "city" é "paris". A consulta não devolverá "smith" porque os valores "home" e "paris" não estão no mesmo elemento de coleção. + #### Consultas em relações Muitos para Muitos O ORDA oferece uma sintaxe especial para facilitar as consultas em relações muitos-para-muitos. Neste contexto, pode ser necessário procurar valores diferentes com um operador `AND` mas no mesmo atributo. Por exemplo, veja a seguinte estrutura: @@ -1242,6 +1243,8 @@ queryPath: steps:[{steps:[{description:[index : Company.revenues ] > 10000000,time:0,recordsfounds:933}]}]}]}]} ``` +### Exemplos + #### Exemplo 1 Esta seção oferece vários exemplos de pesquisas. diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-21/API/DataClassClass.md b/i18n/pt/docusaurus-plugin-content-docs/version-21/API/DataClassClass.md index 53d16f66e9a596..2ab0840ec6d747 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-21/API/DataClassClass.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-21/API/DataClassClass.md @@ -1098,7 +1098,7 @@ ds.Class.query("info.coll[a].val := :1";0) Você pode usar qualquer letra do alfabeto como a notação `[a]`. -#### Linkar os argumentos de pesquisa com os atributos de coleção +### Linkar os argumentos de pesquisa com os atributos de coleção Ao pesquisar nos atributos de objetos de classe de dados que contêm coleções usando vários argumentos de consulta unidos pelo operador AND, você pode querer garantir que somente as entidades que contêm elementos que correspondem a todos os argumentos sejam retornadas, e não as entidades em que os argumentos podem ser encontrados em elementos diferentes. Para tal, é necessário ligar argumentos de consulta a elementos de coleção, de modo a que apenas sejam encontrados elementos individuais que contenham argumentos ligados. @@ -1290,6 +1290,8 @@ queryPath: steps:[{steps:[{description:[index : Company.revenues ] > 10000000,time:0,recordsfounds:933}]}]}]}]} ``` +### Exemplos + #### Exemplo 1 Esta seção oferece vários exemplos de pesquisas. diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-21/Notes/updates.md b/i18n/pt/docusaurus-plugin-content-docs/version-21/Notes/updates.md index 926d07e92f6642..57c737124d2177 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-21/Notes/updates.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-21/Notes/updates.md @@ -45,6 +45,7 @@ Leia [**O que há de novo no 4D 21**](https://blog.4d.com/en-whats-new-in-4d-21/ - Web services (SOAP): when [scalable sessions](../WebServer/sessions.md#enabling-web-sessions) are enabled, web services now run in [**preemptive processes**](../Develop/preemptive.md) in compiled mode. Make sure that your SOAP code is thread-safe and that the session in which it runs has appropriate [privileges](../API/SessionClass.md#setprivileges). - Web server: the support of deprecated `4DSYNC/` and `4DCGI/` URLs is removed. No specific processing is done on these URLs anymore. - Web user sessions are now returned by [`Process activity`](../commands/process-activity.md). +- PHP commands are now [deprecated](https://blog.4d.com/deprecation-of-php-commands-removal-of-4d-built-in-php-interpreter/) and should no longer be used in your developments. - The [`HIGHLIGHT TEXT`](../commands/highlight-text) command is now supported in the context of subforms. - In client/server, the concept of local processes is removed. The "$" has no longer a specific meaning in process names and the \* parameter in [`REGISTER CLIENT`](../commands/register-client) is ignored. - **Components no longer embedded**: starting with 4D 21, components developed by 4D (4D NetKit, 4D SVG..., see [this list](../Extensions/overview.md#components-developed-by-4d)) are no longer embedded in the 4D application. When upgrading a project to 4D 21 or higher, a dialog box is displayed:
    @@ -306,7 +307,6 @@ Se suas aplicações 4D utilizam conexões TLS, é recomendado que você faça a | ngtcp2 | 1.16.0 | **21** | Usado para QUIC | | OpenSSL | 3.5.2 | **21** | | | PDFWriter | 4.7.0 | **21** | Used for [`WP Export document`](../WritePro/commands/wp-export-document.md) and [`WP Export variable`](../WritePro/commands/wp-export-variable.md) | -| PHP | 8.2.4 | 20 | | | SpreadJS | 17.1.0 | 20 R7 | Veja [este post de blog](https://blog.4d.com/4d-view-pro-whats-new-in-4d-20-r7/) para uma visão geral dos novos recursos | | webKit | WKWebView | 19 | | | Xerces | 3.3.0 | **21** | Used for XML commands | diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-21/commands-legacy/php-execute.md b/i18n/pt/docusaurus-plugin-content-docs/version-21/commands-legacy/php-execute.md deleted file mode 100644 index a65f7c99bd195c..00000000000000 --- a/i18n/pt/docusaurus-plugin-content-docs/version-21/commands-legacy/php-execute.md +++ /dev/null @@ -1,292 +0,0 @@ ---- -id: php-execute -title: PHP Execute -slug: /commands/php-execute -displayed_sidebar: docs ---- - - - -**PHP Execute** ( *rotaScript* {; *nomeFuncao* {; *resultadoPHP* {; *param*} {; *param2* ; ... ; *paramN*}}} ) : Boolean - -| Parâmetro | Tipo | | Descrição | -| --- | --- | --- | --- | -| rotaScript | Text | → | Rota de acesso ao script PHP ou "" para executar a função PHP | -| nomeFuncao | Text | → | Função PHP a ser executada | -| resultadoPHP | *, Variable, Field | ← | Resultado da função PHP executada ou * para não receber nenhum resultado | -| param | Text, Boolean, Real, Integer, Date, Time | → | Parâmetros da função PHP | -| Resultado | Boolean | ← | True =execução correta; False = erro de execução | - - - -:::info Compatibilidade - -**PHP está obsoleto em 4D**. Recomenda-se usar a classe [`4D.SystemWorker class`](../API/SystemWorkerClass.md). - -::: - - -## Descrição - -O comando PHP Execute permite executar um script ou uma função PHP. - -Passe no parâmetro *rutaScrip*t a rota de acesso do arquivo de script PHP a executar. Pode ser uma rota de acesso relativa se o arquivo está localizado junto à estrutura do banco ou de uma rota absoluta. A rota de acesso pode ser expressa em sintaxe sistema ou POSIX. -Se deseja executar diretamente uma função PHP padrão, passe uma string vazia ("") em *rotaScript*. O nome da função deve ser passada no segundo parâmetro. - -Passe no parâmetro *nomFunção* um nome de função PHP se quer executar uma função específica no script *rotaScript*. Se passa uma string vazia ou omite o parâmetro *nomFunção*, o script se executa completamente. - -**Nota:** PHP considera as maiúsculas e minúsculas dos caracteres no nome da função. Não utilize parênteses, introduza unicamente o nome da função. - -O parâmetro *resultPHP* recebe o resultado da execução da função PHP. Pode passar: - -* uma variável, um array ou um campo para receber o resultado, -* o caractere \* se a função não devolve nenhum resultado ou se não quer recuperar o resultado. - -O parâmetro *resultPHP* pode ser de tipo texto, inteiro longo, real, booleano ou data assim como também (exceto para arrays) BLOB ou hora. 4D efetuará a conversão dos dados e os ajustes necessários seguindo os princípios descritos na seção a continuação. - -* se passa um nome de função no parâmetro *nomFuncao*, *resultPHP* receberá o que o desenvolvedor PHP devolve com o comando return do corpo da função. -* Se utiliza o comando sem passar um nome de função no parâmetro *nomFuncao*, *r* *esultPHP* receberá o que o desenvolvedor PHP devolveu com o comando echo ( ou um comando similar). - - Se chama a uma função PHP que espera argumentos, utilize os parâmetros *param1...N* para passar um ou vários valores. Os valores devem estar separados por ponto e vírgula. Pode passar valores de tipo alfa, texto, booleano, real, inteiro, inteiro longo, data ou hora. As imagens e os BLOBs não são aceitos. Pode enviar um array; neste caso deve passar um ponteiro no array ao comando PHP Execute, do contrário o índice atual do array se enviará como um inteiro (ver o exemplo). O comando aceita todos os tipos de arrays exceto os arrays ponteiro, os arrays imagem e os arrays 2D. -Os parâmetros *param1...N* são enviados em PHP no formato JSON em UTF-8\. Eles são codificados automaticamente com o comando PHP **json\_decode** antes de ser enviados à função PHP *nomeFunçao*. - -**Nota:** por razões técnicas, o tamanho dos parâmetros passados através do protocolo FastCGI não deve passar os 64 KB. Deve considerar esta limitação se utiliza parâmetros de tipo Texto. - -O comando devolve True se a execução for realizada corretamente do lado de 4D, em outras palavras, se o lançamento do ambiente de execução, a abertura do script e o estabelecimento da comunicação com o intérprete PHP foram exitosos. Do contrário, se gera um erro, que pode interceptar com o comando [ON ERR CALL](on-err-call.md "ON ERR CALL") e analizar com [Last errors](../commands/last-errors.md). -Além disso, o script mesmo pode gerar erros PHP. Neste caso, deve utilizar o comando [PHP GET FULL RESPONSE](php-get-full-response.md "PHP GET FULL RESPONSE") para analizar a fonte do erro (ver exemplo 4). - -**Nota:** PHP permite configurar a gestão de erros. Para maior informação, consulte por exemplo a página: . - -### Conversão dos dados devolvidos - -A tabela a seguir especifica como 4D interpreta e converte os dados devolvidos em função do tipo do parâmetro *resultPHP*. - -| **Tipo do parâmetro *resultPHP*** | **Processo 4D** | **Exemplo** | -| --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| BLOB | 4D recupera os dados recebidos sem nenhuma modificação(\*). | | -| Texto | 4D espera os dados codificados em UTF-8 (\*). O desenvolvedor PHP pode necessitar utilizar o comando PHP **utf8\_encode**. | Exemplo de script PHP: echo utf8\_encode(meuTexto) | -| Data | 4D espera uma data enviada como uma string em formato RFC 3339 (também chamado DATE\_ATOM em PHP). Este formato é de tipo "AAAA-MM-DDTHH:MM:SS", por exemplo: 2005-08-15T15:52:01+00:00\. 4D ignora a parte hora e devolve a data em UTC. | | -| Hora | 4D espera uma hora enviada em forma de string em formato RFC 3339 (ver o tipo Data). 4D ignora a parte data e devolve o número de segundos transcorridos desde a meia noite considerando a data na zona horária local. | Exemplo de script PHP para enviar 2h30'45": echo date( DATE\_ATOM, mktime( 2,30,45)) | -| Inteiro ou Real | 4D interpreta o valor numérico expresso com números, signo + ou - e/ou o exponente com o prefixo 'e'. Todo carácter '.' ou ',' se interpreta como um separador decimal. | Exemplo de script PHP: echo -1.4e-16; | -| Booleano | 4D devolve True se recebe a string "true" desde PHP ou se a avaliação numérica dá um valor não nulo. | Exemplo de script PHP: echo (a==b); | -| Array | 4D considera que o array PHP foi devolvido no formato JSON. | Exemplo de script PHP para devolver um array dos textos: echo json\_encode( array( "ola", "mundo")); | - -(\*) Por padrão, não são devolvidos os cabeçalhos HTTP: -\- Se utiliza [PHP Execute](php-execute.md) ao passar uma função no parâmetro *nomFuncao*, os cabeçalhos HTTP nunca são devolvidos em *resultPHP*. Só estão disponíveis através do comando [PHP GET FULL RESPONSE](php-get-full-response.md). -\- Se utiliza [PHP Execute](php-execute.md) sem um nome de função (o parâmetro *nomFunçao* se omite ou contém uma string vazia), pode devolver os cabeçalhos HTTP fixando a opção PHP Raw result em True utilizando o comando [PHP SET OPTION](php-set-option.md). - -**Nota:** se precisar recuperar grandes volumes de dados utilizando PHP, é mais eficiente passar pelo canal do buffer *stdOut* (comando **echo** ou similar) que pelo retorno de função. Para maior informação, consulte a descrição do comando [PHP GET FULL RESPONSE](php-get-full-response.md). - -### Usar variáveis de ambiente - -Pode utilizar o comando [SET ENVIRONMENT VARIABLE](set-environment-variable.md "SET ENVIRONMENT VARIABLE") para definir as variáveis de ambiente utilizadas pelo script. Atenção: depois de chamar [LAUNCH EXTERNAL PROCESS](launch-external-process.md "LAUNCH EXTERNAL PROCESS") ou PHP Execute, o conjunto das variáveis de ambiente se apaga. - -### Funções especiais - -4D oferece as seguintes funções especiais: - -* **quit\_4d\_php**: permite sair do intérprete PHP e de todos seus processos filhos. Se ao menos um dos processos filho está executando um script, o intérprete não sai e o comando PHP Execute devolve False. -* **relaunch\_4d\_php**: permite relançar o intérprete PHP. - -Note que o intérprete é relançado automaticamente quando a primeira petição é enviada por PHP Execute. - -## Exemplo 1 - -Chamada do script "myPhpFile.php" sem função. Este é o conteúdo do script: - -```PHP - -``` - -O código 4D a seguir: - -```4d - var $result : Text - var $isOK : Boolean - $isOK:=PHP Execute("C:\php\myPhpFile.php";"";$result) - ALERT($Result) -``` - -... mostrará a versão atual do PHP. - -## Exemplo 2 - -Chamada da função *myPhpFunction* no script "myNewScript.php" com parâmetros. Este é o conteúdo do script: - -```PHP - -``` - -Chamada com função: - -```4d - var $result : Text - var $param1 : Text - var $param2 : Text - var $isOk : Boolean - $param1 :="Olá" - $param2 :="mundo 4D!" - $isOk:=PHP Execute("C:\MyFolder\myNewScript.php";"myPhpFunction";$result;$param1;$param2) - ALERT($result) // Mostra "Olá mundo 4D!" -``` - -## Exemplo 3 - -Sair do intérprete PHP: - -```4d - $ifOk:=PHP Execute("";"quit_4d_php") -``` - -## Exemplo 4 - -Gestão de erros: - -```4d -  // Instalação do método de gestão de erros - phpCommError:="" // Modificado por PHPErrorHandler - $T_saveErrorHandler :=Method called on error - ON ERR CALL("PHPErrorHandler") - - // Execução do script - var $T_result : Text - If(PHP Execute("C:\MyScripts\MiscInfos.php";"";$T_result)) -  // Nenhum erro, $T_Result contém o resultado - Else -  // Se detectou um erro, administrado por PHPErrorHandler -    If(phpCommError="") -       ... // error PHP, utilize PHP GET FULL RESPONSE -    Else -       ALERT(phpCommError) -    End if - End if -  -  // Desinstalação do método - ON ERR CALL($T_saveErrorHandler) - - -``` - -O método PHP\_errHandler é o seguinte: - -```4d - phpCommError:="" - GET LAST ERROR STACK(arrCodes;arrComps;arrLabels) - For($i;1;Size of array(arrCodes)) -    phpCommError:=phpCommError+String(arrCodes{$i})+" "+arrComps{$i}+" "+ -    arrLabels{$i}+Char(Carriage return) - End for -``` - -## Exemplo 5 - -Criação dinâmica por 4D de um script antes de sua execução: - -```4d - DOCUMENT TO BLOB("C:\Scripts\MyScript.php";$blobDoc) - If(OK=1) -    $strDoc:=BLOB to text($blobDoc;UTF8 text without length) -  -    $strPosition:=Position("function2Rename";$strDoc) -  -    $strDoc:=Insert string($strDoc;"_v2";Length("function2Rename")+$strPosition) -  -    TEXT TO BLOB($strDoc;$blobDoc;UTF8 text without length) -    BLOB TO DOCUMENT("C:\Scripts\MyScript.php";$blobDoc) -    If(OK#1) -       ALERT("Error on script creation") -    End if - End if -``` - -Se executa o script: - -```4d - $err:=PHP Execute("C:\Scripts\MyScript.php";"function2Rename_v2";*) -``` - -## Exemplo 6 - -Recuperação direta de um valor de tipo data e hora. Este é o conteúdo do script: - -```PHP - -``` - -Recepção da data do lado 4D: - -```4d - var $phpResult_date : Date - $result :=PHP Execute("C:\php_scripts\ReturnDate.php";"";$phpResult_date) -  //$phpResult_date is !05/04/2009 ! -  - var $phpResult_time : Time - $result :=PHP Execute("C:\php_scripts\ReturnDate.php";"";$phpResult_time) -  //$phpResult_time is ?01 :02 :03 ? -``` - -## Exemplo 7 - -Distribuição de dados em arrays: - -```4d - ARRAY TEXT($arText ;0) - ARRAY LONGINT($arLong ;0) - $p1 :="," - $p2 :="11,22,33,44,55" - $phpok :=PHP Execute("";"explode";$arText;$p1;$p2) - $phpok :=PHP Execute("";"explode";$arLong;$p1;$p2) -  -  // $arText contém os valores Alfa "11", "22", "33", etc. -  // $arLong contém os números, 11, 22, 33, etc. -``` - -## Exemplo 8 - -Inicialização de um array: - -```4d - ARRAY TEXT($arText ;0) - $phpok :=PHP Execute("";"array_pad";$arText;->$arText;50;"indefinido") -  // Execute em PHP: $arrTest = array_pad($arrTest, 50, ’indefinido’); -  // Preencher o array $arText com 50 elementos "indefinido" -``` - -## Exemplo 9 - -Passo de parâmetros através de um array: - -```4d - ARRAY INTEGER($arInt;0) - $phpok :=PHP Execute("";"json_decode";$arInt;"[13,51,69,42,7]") -  // Execute en PHP: $arInt = json_decode(’[13,51,69,42,7]’); -  // Preencha o array com os valores iniciais -``` - -## Exemplo 10 - -Este é um exemplo da utilização básica da função trim, para eliminar espaços adicionais e/ou caracteres invisíveis de princípio a fim de uma cadeia: - -```4d - var $T_String : Text - $T_String:="   Hello  " - var $B : Boolean - $B:=PHP Execute("";"trim";$T_String;$T_String) -``` - -Para obter mais informação sobre a função trim, por favor, consulte a documentação de PHP. - -## Ver também - -*Executar scripts PHP em 4D* -[PHP GET FULL RESPONSE](php-get-full-response.md) -[PHP SET OPTION](php-set-option.md) - -## Propriedades - -| | | -| --- | --- | -| Número do comando | 1058 | -| Thread-seguro | ✗ | - - diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-21/commands-legacy/php-get-full-response.md b/i18n/pt/docusaurus-plugin-content-docs/version-21/commands-legacy/php-get-full-response.md deleted file mode 100644 index 2cc5c7419100f2..00000000000000 --- a/i18n/pt/docusaurus-plugin-content-docs/version-21/commands-legacy/php-get-full-response.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -id: php-get-full-response -title: PHP GET FULL RESPONSE -slug: /commands/php-get-full-response -displayed_sidebar: docs ---- - - - -**PHP GET FULL RESPONSE** ( *stdOut* {; *etiquetaErr* ; *valoresErr*} {; *camposCabHttp* {; *valoresCabHttp*}} ) - -| Parâmetro | Tipo | | Descrição | -| --- | --- | --- | --- | -| stdOut | Text, Blob | ← | Conteúdo do buffer stdOut | -| etiquetaErr | Text array | ← | Etiquetas dos erros | -| valoresErr | Text array | ← | Valores dos erros | -| camposCabHttp | Text array | ← | Nome dos cabeçalhos HTTP | -| valoresCabHttp | Text array | ← | Valores dos cabeçalhos HTTP | - - - -:::info Compatibilidade - -**PHP está obsoleto em 4D**. Recomenda-se usar a classe [`4D.SystemWorker class`](../API/SystemWorkerClass.md). - -::: - -## Descrição - -O comando PHP GET FULL RESPONSE permite obter informação adicional sobre a resposta devolvida pelo intérprete PHP. Este comando é especialmente útil no caso de que ocorra um erro durante a execução do script. - -O script PHP pode escrever dados no buffer stdOut (eco, print, etc.) O comando devolvido diretamente os dados na variável *stdOut* e aplica os mesmos princípios de conversão descritos no comando [PHP Execute](php-execute.md "PHP Execute"). - -Os arrays texto sincronizados *etiquetasErr* e *valoresErr* se preenchem quando a execução dos scripts PHP provoca erros. Estes arrays, em particular, proporcionam informação sobre a origem, o script e a línha de erro. Estes dois arrays são inseparáveis: se for passado *etiquetasErr*, se deve passar também *valoresErr*. - -Dado que os intercâmbios entre 4D e o intérprete PHP se realizam através de FastCGI, o intérprete PHP funciona como se fosse chamado por um servidor HTTP e portanto, envia cabeçalhos HTTP. Pode recuperar estes cabeçalhos e seus valores nos arrays *camposCabHttp* e *valoresCabHttp*. - -## Ver também - -[PHP Execute](php-execute.md) -[PHP GET OPTION](php-get-option.md) - -## Propriedades - -| | | -| --- | --- | -| Número do comando | 1061 | -| Thread-seguro | ✗ | - - diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-21/commands-legacy/php-get-option.md b/i18n/pt/docusaurus-plugin-content-docs/version-21/commands-legacy/php-get-option.md deleted file mode 100644 index d0d661c3b4861b..00000000000000 --- a/i18n/pt/docusaurus-plugin-content-docs/version-21/commands-legacy/php-get-option.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -id: php-get-option -title: PHP GET OPTION -slug: /commands/php-get-option -displayed_sidebar: docs ---- - - - - -**PHP GET OPTION** ( *opção* ; *valor* ) - -| Parâmetro | Tipo | | Descrição | -| --- | --- | --- | --- | -| opção | Integer | → | Opção a conseguir | -| valor | Boolean | ← | Valor atual da opção | - - - -:::info Compatibilidade - -**PHP está obsoleto em 4D**. Recomenda-se usar a classe [`4D.SystemWorker class`](../API/SystemWorkerClass.md). - -::: - -## Descrição - -O comando PHP GET OPTION permite conhecer o valor atual de uma opção relativa à execução de scripts PHP. - -Passe no parâmetro *opção* uma constante do tema "*PHP*" para designar a opção a ler. O comando devolve o valor atual da opção no parâmetro *valor*. P - -| Constante | Tipo | Valor | Comentário | -| -------------- | ------------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| PHP raw result | Inteiro longo | 2 | Definição do modo de processamento dos cabeçalhos HTTP devolvidos por PHP no resultado da execução quando este resultado for do tipo Texto (quando o resultado for do tipo BLOB, os cabeçalhos são mantidos sempre).
    Valores possíveis: Booleano: False (valor padrão = eliminar os cabeçalhos HTTP do resultado. True = conservar os cabeçalhos HTTP. | - -## Ver também - -[PHP GET FULL RESPONSE](php-get-full-response.md) -[PHP SET OPTION](php-set-option.md) - -## Propriedades - -| | | -| --- | --- | -| Número do comando | 1060 | -| Thread-seguro | ✗ | - - diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-21/commands-legacy/php-set-option.md b/i18n/pt/docusaurus-plugin-content-docs/version-21/commands-legacy/php-set-option.md deleted file mode 100644 index 666d69703c55cc..00000000000000 --- a/i18n/pt/docusaurus-plugin-content-docs/version-21/commands-legacy/php-set-option.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -id: php-set-option -title: PHP SET OPTION -slug: /commands/php-set-option -displayed_sidebar: docs ---- - - - -**PHP SET OPTION** ( *opçao* ; *valor* {; *} ) - -| Parâmetro | Tipo | | Descrição | -| --- | --- | --- | --- | -| opçao | Integer | → | Opção a ser estabelecida | -| valor | Boolean | → | Novo valor da opção | -| * | Operador | → | Se passado: modificação apenas se aplica à próxima chamada | - - - -:::info Compatibilidade - -**PHP está obsoleto em 4D**. Recomenda-se usar a classe [`4D.SystemWorker class`](../API/SystemWorkerClass.md). - -::: - - -## Descrição - -O comando PHP SET OPTION se utiliza para definir opções específicas antes de chamar o comando [PHP Execute](php-execute.md). O escopo deste comando é o processo atual. - -Passe no parâmetro *opção* uma constante do tema "*PHP*" para designar a opção a modificar e no parâmetro *valor*, o novo valor da opção. Esta é uma descrição das opções: - -| Constante | Tipo | Valor | Comentário | -| -------------- | ------------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| PHP raw result | Inteiro longo | 2 | Definição do modo de processamento dos cabeçalhos HTTP devolvidos por PHP no resultado da execução quando este resultado for do tipo Texto (quando o resultado for do tipo BLOB, os cabeçalhos são mantidos sempre).
    Valores possíveis: Booleano: False (valor padrão = eliminar os cabeçalhos HTTP do resultado. True = conservar os cabeçalhos HTTP. | - -Como padrão, PHP SET OPTION define a opção para todas as chamadas a [PHP Execute](php-execute.md) posteriores do processo. Se quiser definir para a próxima chamada unicamente passe o parâmetro estrela (*\**). - -## Ver também - -[PHP Execute](php-execute.md) -[PHP GET OPTION](php-get-option.md) - -## Propriedades - -| | | -| --- | --- | -| Número do comando | 1059 | -| Thread-seguro | ✗ | - - diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-21/commands/command-index.md b/i18n/pt/docusaurus-plugin-content-docs/version-21/commands/command-index.md index 09fd01c7c3101f..a9cbf55451d04c 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-21/commands/command-index.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-21/commands/command-index.md @@ -846,10 +846,6 @@ title: Commands by name [`Path to object`](../commands-legacy/path-to-object.md)
    [`PAUSE INDEXES`](../commands-legacy/pause-indexes.md)
    [`PAUSE PROCESS`](../commands-legacy/pause-process.md)
    -[`PHP Execute`](../commands-legacy/php-execute.md)
    -[`PHP GET FULL RESPONSE`](../commands-legacy/php-get-full-response.md)
    -[`PHP GET OPTION`](../commands-legacy/php-get-option.md)
    -[`PHP SET OPTION`](../commands-legacy/php-set-option.md)
    [`PICTURE CODEC LIST`](../commands-legacy/picture-codec-list.md)
    [`PICTURE LIBRARY LIST`](../commands-legacy/picture-library-list.md)
    [`PICTURE PROPERTIES`](../commands-legacy/picture-properties.md)
    diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-21/commands/theme/PHP.md b/i18n/pt/docusaurus-plugin-content-docs/version-21/commands/theme/PHP.md deleted file mode 100644 index b70f3706c920ea..00000000000000 --- a/i18n/pt/docusaurus-plugin-content-docs/version-21/commands/theme/PHP.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -id: PHP_theme -title: PHP -sidebar_label: PHP -slug: /commands/theme/PHP ---- - -| | -| --------------------------------------------------------------------------------------------------------------- | -| [](../../commands-legacy/php-execute.md)
    | -| [](../../commands-legacy/php-get-full-response.md)
    | -| [](../../commands-legacy/php-get-option.md)
    | -| [](../../commands-legacy/php-set-option.md)
    | diff --git a/sidebars.js b/sidebars.js index 8d495945d7a13b..e9f0b0dfec607f 100644 --- a/sidebars.js +++ b/sidebars.js @@ -1156,20 +1156,6 @@ module.exports = "commands-legacy/variance" ] }, - { - "type": "category", - "label": "PHP", - "link": { - "type": "doc", - "id": "commands/theme/PHP_theme" - }, - "items": [ - "commands-legacy/php-execute", - "commands-legacy/php-get-full-response", - "commands-legacy/php-get-option", - "commands-legacy/php-set-option" - ] - }, { "type": "category", "label": "Pasteboard", diff --git a/versioned_docs/version-19/API/DataClassClass.md b/versioned_docs/version-19/API/DataClassClass.md index 4e92efbe504acc..005ce67172a40f 100644 --- a/versioned_docs/version-19/API/DataClassClass.md +++ b/versioned_docs/version-19/API/DataClassClass.md @@ -927,7 +927,8 @@ With the above entities, if you write: ds.People.query("places.locations[a].kind= :1 and places.locations[a].city= :2";"home";"paris") ``` -... the query will only return "martin" because it has a "locations" element whose "kind" is "home" and whose "city" is "paris". The query will not return "smith" because the values "home" and "paris" are not in the same collection element. +... the query will only return "martin" because it has a "locations" element whose "kind" is "home" and whose "city" is "paris". The query will not return "smith" because the values "home" and "paris" are not in the same collection element. + **formula parameter** @@ -1004,6 +1005,8 @@ queryPath: steps:[{steps:[{description:[index : Company.revenues ] > 10000000,time:0,recordsfounds:933}]}]}]}]} ``` +### Examples + #### Example 1 This section provides various examples of queries. diff --git a/versioned_docs/version-20-R10/API/DataClassClass.md b/versioned_docs/version-20-R10/API/DataClassClass.md index baad33fd1e32e1..e4e7cf018c907c 100644 --- a/versioned_docs/version-20-R10/API/DataClassClass.md +++ b/versioned_docs/version-20-R10/API/DataClassClass.md @@ -1090,7 +1090,7 @@ ds.Class.query("info.coll[a].val != :1";0) You can use any letter from the alphabet as the `[a]` notation. -#### Linking collection attribute query arguments +### Linking collection attribute query arguments When searching within dataclass object attributes containing collections using multiple query arguments joined by the AND operator, you may want to make sure that only entities containing elements that match all arguments are returned, and not entities where arguments can be found in different elements. To do this, you need to link query arguments to collection elements, so that only single elements containing linked arguments are found. @@ -1137,7 +1137,8 @@ With the above entities, if you write: ds.People.query("places.locations[a].kind= :1 and places.locations[a].city= :2";"home";"paris") ``` -... the query will only return "martin" because it has a "locations" element whose "kind" is "home" and whose "city" is "paris". The query will not return "smith" because the values "home" and "paris" are not in the same collection element. +... the query will only return "martin" because it has a "locations" element whose "kind" is "home" and whose "city" is "paris". The query will not return "smith" because the values "home" and "paris" are not in the same collection element. + @@ -1250,6 +1251,8 @@ queryPath: steps:[{steps:[{description:[index : Company.revenues ] > 10000000,time:0,recordsfounds:933}]}]}]}]} ``` +### Examples + #### Example 1 This section provides various examples of queries. diff --git a/versioned_docs/version-20-R10/commands-legacy/dom-parse-xml-source.md b/versioned_docs/version-20-R10/commands-legacy/dom-parse-xml-source.md index ca139512b79213..07ce527eea8126 100644 --- a/versioned_docs/version-20-R10/commands-legacy/dom-parse-xml-source.md +++ b/versioned_docs/version-20-R10/commands-legacy/dom-parse-xml-source.md @@ -25,9 +25,11 @@ The document can be located on the disk or on the Internet/Intranet. In the *document* parameter, you can pass: -* either a standard complete pathname (of the type C:\\\\Folder\\\\File\\\\... under Windows and MacintoshHD:Folder:File under Mac OS), -* or a Unix path under Mac OS (which must start with /). +* either a standard complete pathname (of the type C:\\\\Folder\\\\File\\\\... under Windows and MacintoshHD:Folder:File under macOS), +* or a Unix path under macOS (which must start with /). * or a network path of the type http://www.site.com/File or ftp://public.ftp.com... +* or an empty string to display an Open File dialog box. + The Boolean parameter *validation* indicates whether or not to validate the structure. diff --git a/versioned_docs/version-20-R10/commands-legacy/xml-get-options.md b/versioned_docs/version-20-R10/commands-legacy/xml-get-options.md index 506b9f29426c61..d267d6e682ba76 100644 --- a/versioned_docs/version-20-R10/commands-legacy/xml-get-options.md +++ b/versioned_docs/version-20-R10/commands-legacy/xml-get-options.md @@ -5,7 +5,7 @@ slug: /commands/xml-get-options displayed_sidebar: docs --- -**XML GET OPTIONS** ( *elementRef* ; *selector* ; *value* {; *selector2* ; *value2* ; ... ; *selectorN* ; *valueN*} )
    **XML GET OPTIONS** ( *document ; *selector* ; *value* {; *selector2* ; *value2* ; ... ; *selectorN* ; *valueN*} ) +**XML GET OPTIONS** ( *elementRef* ; *selector* ; *value* {; *selector2* ; *value2* ; ... ; *selectorN* ; *valueN*} )
    **XML GET OPTIONS** ( *document* ; *selector* ; *value* {; *selector2* ; *value2* ; ... ; *selectorN* ; *valueN*} ) | Parameter | Type | | Description | | --- | --- | --- | --- | diff --git a/versioned_docs/version-20/API/DataClassClass.md b/versioned_docs/version-20/API/DataClassClass.md index 9ae72d783f9de1..fb30050af91e46 100644 --- a/versioned_docs/version-20/API/DataClassClass.md +++ b/versioned_docs/version-20/API/DataClassClass.md @@ -1075,7 +1075,7 @@ ds.Class.query("info.coll[a].val != :1";0) You can use any letter from the alphabet as the `[a]` notation. -#### Linking collection attribute query arguments +### Linking collection attribute query arguments :::info @@ -1127,7 +1127,8 @@ With the above entities, if you write: ds.People.query("places.locations[a].kind= :1 and places.locations[a].city= :2";"home";"paris") ``` -... the query will only return "martin" because it has a "locations" element whose "kind" is "home" and whose "city" is "paris". The query will not return "smith" because the values "home" and "paris" are not in the same collection element. +... the query will only return "martin" because it has a "locations" element whose "kind" is "home" and whose "city" is "paris". The query will not return "smith" because the values "home" and "paris" are not in the same collection element. + #### Queries in many-to-many relations @@ -1239,6 +1240,8 @@ queryPath: steps:[{steps:[{description:[index : Company.revenues ] > 10000000,time:0,recordsfounds:933}]}]}]}]} ``` +### Examples + #### Example 1 This section provides various examples of queries. diff --git a/versioned_docs/version-21/API/DataClassClass.md b/versioned_docs/version-21/API/DataClassClass.md index edcd003a94a757..ab4833fe60ad6c 100644 --- a/versioned_docs/version-21/API/DataClassClass.md +++ b/versioned_docs/version-21/API/DataClassClass.md @@ -1092,7 +1092,7 @@ ds.Class.query("info.coll[a].val != :1";0) You can use any letter from the alphabet as the `[a]` notation. -#### Linking collection attribute query arguments +### Linking collection attribute query arguments When searching within dataclass object attributes containing collections using multiple query arguments joined by the AND operator, you may want to make sure that only entities containing elements that match all arguments are returned, and not entities where arguments can be found in different elements. To do this, you need to link query arguments to collection elements, so that only single elements containing linked arguments are found. @@ -1139,7 +1139,8 @@ With the above entities, if you write: ds.People.query("places.locations[a].kind= :1 and places.locations[a].city= :2";"home";"paris") ``` -... the query will only return "martin" because it has a "locations" element whose "kind" is "home" and whose "city" is "paris". The query will not return "smith" because the values "home" and "paris" are not in the same collection element. +... the query will only return "martin" because it has a "locations" element whose "kind" is "home" and whose "city" is "paris". The query will not return "smith" because the values "home" and "paris" are not in the same collection element. + @@ -1290,6 +1291,8 @@ queryPath: steps:[{steps:[{description:[index : Company.revenues ] > 10000000,time:0,recordsfounds:933}]}]}]}]} ``` +### Examples + #### Example 1 This section provides various examples of queries. diff --git a/versioned_docs/version-21/Notes/updates.md b/versioned_docs/version-21/Notes/updates.md index 540ac33b9a0381..52533ad8f7281c 100644 --- a/versioned_docs/version-21/Notes/updates.md +++ b/versioned_docs/version-21/Notes/updates.md @@ -46,6 +46,7 @@ Read [**What’s new in 4D 21**](https://blog.4d.com/en-whats-new-in-4d-21/), th - Web services (SOAP): when [scalable sessions](../WebServer/sessions.md#enabling-web-sessions) are enabled, web services now run in [**preemptive processes**](../Develop/preemptive.md) in compiled mode. Make sure that your SOAP code is thread-safe and that the session in which it runs has appropriate [privileges](../API/SessionClass.md#setprivileges). - Web server: the support of deprecated `4DSYNC/` and `4DCGI/` URLs is removed. No specific processing is done on these URLs anymore. - Web user sessions are now returned by [`Process activity`](../commands/process-activity.md). +- PHP commands are now [deprecated](https://blog.4d.com/deprecation-of-php-commands-removal-of-4d-built-in-php-interpreter/) and should no longer be used in your developments. - The [`HIGHLIGHT TEXT`](../commands/highlight-text) command is now supported in the context of subforms. - In client/server, the concept of local processes is removed. The "$" has no longer a specific meaning in process names and the \* parameter in [`REGISTER CLIENT`](../commands/register-client) is ignored. - **Components no longer embedded**: starting with 4D 21, components developed by 4D (4D NetKit, 4D SVG..., see [this list](../Extensions/overview.md#components-developed-by-4d)) are no longer embedded in the 4D application. When upgrading a project to 4D 21 or higher, a dialog box is displayed:
    @@ -339,7 +340,6 @@ If your 4D applications use TLS connections, it is recommended that you upgrade |ngtcp2|1.16.0|**21**|Used for QUIC| |OpenSSL|3.5.2|**21**|| |PDFWriter|4.7.0|**21**|Used for [`WP Export document`](../WritePro/commands/wp-export-document.md) and [`WP Export variable`](../WritePro/commands/wp-export-variable.md) | -|PHP|8.2.4|20|| |SpreadJS|17.1.0|20 R7|See [this blog post](https://blog.4d.com/4d-view-pro-whats-new-in-4d-20-r7/) for an overview of the new features| |webKit|WKWebView|19|| |Xerces|3.3.0|**21**|Used for XML commands| diff --git a/versioned_docs/version-21/commands-legacy/dom-parse-xml-source.md b/versioned_docs/version-21/commands-legacy/dom-parse-xml-source.md index ca139512b79213..07ce527eea8126 100644 --- a/versioned_docs/version-21/commands-legacy/dom-parse-xml-source.md +++ b/versioned_docs/version-21/commands-legacy/dom-parse-xml-source.md @@ -25,9 +25,11 @@ The document can be located on the disk or on the Internet/Intranet. In the *document* parameter, you can pass: -* either a standard complete pathname (of the type C:\\\\Folder\\\\File\\\\... under Windows and MacintoshHD:Folder:File under Mac OS), -* or a Unix path under Mac OS (which must start with /). +* either a standard complete pathname (of the type C:\\\\Folder\\\\File\\\\... under Windows and MacintoshHD:Folder:File under macOS), +* or a Unix path under macOS (which must start with /). * or a network path of the type http://www.site.com/File or ftp://public.ftp.com... +* or an empty string to display an Open File dialog box. + The Boolean parameter *validation* indicates whether or not to validate the structure. diff --git a/versioned_docs/version-21/commands-legacy/php-execute.md b/versioned_docs/version-21/commands-legacy/php-execute.md deleted file mode 100644 index 0cc3e5a002c0c9..00000000000000 --- a/versioned_docs/version-21/commands-legacy/php-execute.md +++ /dev/null @@ -1,291 +0,0 @@ ---- -id: php-execute -title: PHP Execute -slug: /commands/php-execute -displayed_sidebar: docs ---- - - - -**PHP Execute** ( *scriptPath* {; *functionName* {; *phpResult* {; *param*} {; *param2* ; ... ; *paramN*}}} ) : Boolean - -| Parameter | Type | | Description | -| --- | --- | --- | --- | -| scriptPath | Text | → | Pathname to PHP script or
    "" to execute a PHP function | -| functionName | Text | → | PHP function to be executed | -| phpResult | *, Variable, Field | ← | Result of PHP function execution or * to not receive any result | -| param | Text, Boolean, Real, Integer, Date, Time | → | Parameter(s) of PHP function | -| Function result | Boolean | ← | True = execution correct
    False = execution error | - - - -:::info Compatibility - -**PHP is deprecated in 4D**. It is now recommended to use the [`4D.SystemWorker class`](../API/SystemWorkerClass.md). - -::: - -## Description - -The **PHP Execute** command can be used to execute a PHP script or function. - -Pass the pathname of the PHP script to be executed in the *scriptPath* parameter. This can be a relative pathname if the file is located next to the database structure or an absolute path. The pathname can be expressed in either the system syntax or POSIX syntax. -If you want to execute a standard PHP function directly, pass an empty string ("") in *scriptPath*. The function name must be passed in the second parameter - -Pass a PHP function name in the *functionName* parameter if you want to execute a specific function in the *scriptPath* script. If you pass an empty string or omit the *functionName* parameter, the script is entirely executed. - -**Note:** PHP is case sensitive for function names. Do not use parentheses, just enter the function name only. - -The *phpResult* parameter receives the result of the execution of the PHP function. You can pass either: - -* a variable, an array or a field in order to receive the result, -* the \* character if the function does not return any result or if you do not want to retrieve it. - -The *phpResult* parameter can be of the Text, Longint, Real, Boolean, or Date type as well as (except for arrays) a field of the BLOB or Time type. 4D will carry out the conversion of the data and any adjustments needed according to the principles described in the *Conversion of data returned* section below. - -* If you passed a function name in the *functionName* parameter, *phpResult* will receive what the PHP developer returned with the **return** command from the body of the function. -* If you use the command without passing a function name in the *functionName* parameter, *phpResult* will receive what the PHP developer returned with the **echo** command (or a similar command). - -If you call a PHP function that expects arguments, use the *param1...N* parameters to pass one or more values. The values must be separated by semi-colons. You can pass values of the Alpha, Text, Boolean, Real, Integer, Longint, Date or Time type. Pictures, BLOBs and Objects are not accepted. You can send an array; in this case, you must pass a pointer to the array to the [PHP Execute](php-execute.md) command, otherwise the current index of the array will be sent as an integer (see the example). The command accepts all types of arrays except for pointer, picture and 2D arrays. -The *param1...N* parameters are sent in PHP in the JSON format in UTF-8\. They are automatically decoded with the PHP **json\_decode** command before being sent to the PHP *functionName* function. - -**Note:** For technical reasons, the size of parameters passed via the FastCGI protocol must not exceed 64 KB. You need to take this limitation into account if you use parameters of the Text type. - -The command returns True if the execution has been carried out correctly on the 4D side, in other words, if the launching of the execution environment, the opening of the script and the establishing of the communication with the PHP interpreter were successful. Otherwise, an error is generated, which you can intercept with the [ON ERR CALL](on-err-call.md) command and analyze with [Last errors](../commands/last-errors.md) . -In addition, the script itself may generate PHP errors. In this case, you must use the [PHP GET FULL RESPONSE](php-get-full-response.md) command in order to analyze the source of the error (see example 4). - -**Note:** PHP can be used to configure error management. For more information, please refer, for example, to the following page: . - -### Conversion of data returned - -The following table specifies how 4D interprets and converts data that is returned according to the type of the *phpResult* parameter. - -| **Type of *phpResult parameter*** | **Processing by 4D** | **Example** | -| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------- | -| BLOB | 4D recovers the data received without any modifications(\*). | | -| Text | 4D expects data encoded in UTF-8 (\*). The PHP developer may need to use the PHP **utf8\_encode** command. | Example of PHP script: echo utf8\_encode(myText) | -| Date | 4D expects a date sent as a string in the RFC 3339 format (sometimes called DATE\_ATOM in PHP). This format is of the type "YYYY-MM-DDTHH:MM:SS", for example: 2005-08-15T15:52:01+00:00\. 4D ignores the time part and returns the date in UTC. | | -| Time | 4D expects a time sent as a string in the RFC 3339 format (see the Date type). 4D ignores the date part and returns the number of seconds elapsed since midnight while considering the date in the local time zone. | Example of PHP script for sending 2h30'45": echo date( DATE\_ATOM, mktime( 2,30,45)) | -| Integer or Real | 4D interprets the numerical value expressed with numbers, the + or - sign and/or the exponent prefixed by 'e'. Any '.' or ',' character is interpreted as a decimal separator. | Example of PHP script: echo -1.4e-16; | -| Boolean | 4D returns True if it receives the string "true" from PHP or if the numerical evaluation gives a value that is not Null. | Example of PHP script: echo (a==b); | -| Array | 4D considers that the PHP array was returned in the JSON format. | Example of PHP script for returning an array of two texts: echo json\_encode( array( "hello", "world")); | - -(\*) By default, HTTP headers are not returned: -\- If you use [PHP Execute](php-execute.md) by passing a function in the *functionName* parameter, HTTP headers are never returned in *phpResult*. They are only available through the [PHP GET FULL RESPONSE](php-get-full-response.md) command. -\- If you use [PHP Execute](php-execute.md) without a function name (the *functionName* parameter is omitted or contains an empty string), you can return HTTP headers by setting the PHP raw result option to True using the [PHP SET OPTION](php-set-option.md) command. - -**Note:** If you need to recover large volumes of data using PHP, it is usually more efficient to pass by the *stdOut* buffer (**echo** command or similar) rather than by the function return. For more information, refer to the description of the [PHP GET FULL RESPONSE](php-get-full-response.md) command. - -### Using environment variables - -You can use the [SET ENVIRONMENT VARIABLE](set-environment-variable.md) command to specify the environment variables used by the script. Warning: after calling [LAUNCH EXTERNAL PROCESS](launch-external-process.md) or **PHP Execute**, the set of environment variables is erased. - -### Special functions - -4D provides the following special functions: - -* **quit\_4d\_php**: used to quit the PHP interpreter and all its child processes. If at least one child process is executing a script, the interpreter does not quit and the PHP Execute command returns False. -* **relaunch\_4d\_php**: used to relaunch the PHP interpreter. - -Note that the interpreter is relaunched automatically when the first request is sent by PHP Execute. - -## Example 1 - -Calling the "myPhpFile.php" script without any function. Here are the contents of the script: - -```PHP - -``` - -The following 4D code: - -```4d - var $result : Text - var $isOK : Boolean - $isOK:=PHP Execute("C:\\php\\myPhpFile.php";"";$result) - ALERT($Result) -``` - -... will display the current PHP version. - -## Example 2 - -Calling the *myPhpFunction* function in the "myNewScript.php" script with parameters. Here are the contents of the script: - -```PHP - -``` - -Calling with function: - -```4d - var $result : Text - var $param1 : Text - var $param2 : Text - var $isOk : Boolean - $param1 :="Hello" - $param2 :="4D world!" - $isOk:=PHP Execute("C:\\MyFolder\\myNewScript.php";"myPhpFunction";$result;$param1;$param2) - ALERT($result) // Displays "Hello 4D world!" -``` - -## Example 3 - -Quitting the PHP interpreter: - -```4d - $ifOk:=PHP Execute("";"quit_4d_php") -``` - -## Example 4 - -Error management: - -```4d -  // Installation of the error-management method - phpCommError:="" // Modified by PHPErrorHandler - $T_saveErrorHandler :=Method called on error - ON ERR CALL("PHPErrorHandler") - - // Execution of script - var $T_result : Text - If(PHP Execute("C:\\MyScripts\\MiscInfos.php";"";$T_result)) -  // No error, $T_Result contains the result - Else -  // An error is detected, managed by PHPErrorHandler -    If(phpCommError="") -       ... // PHP error, use PHP GET FULL RESPONSE -    Else -       ALERT(phpCommError) -    End if - End if -  -  // Uninstalling method - ON ERR CALL($T_saveErrorHandler) - - -``` - -The PHP\_errHandler method is as follows: - -```4d - phpCommError:="" - GET LAST ERROR STACK(arrCodes;arrComps;arrLabels) - For($i;1;Size of array(arrCodes)) -    phpCommError:=phpCommError+String(arrCodes{$i})+" "+arrComps{$i}+" "+ -    arrLabels{$i}+Char(Carriage return) - End for -``` - -## Example 5 - -Dynamic creation by 4D of a script before its execution: - -```4d - DOCUMENT TO BLOB("C:\\Scripts\\MyScript.php";$blobDoc) - If(OK=1) -    $strDoc:=BLOB to text($blobDoc;UTF8 text without length) -  -    $strPosition:=Position("function2Rename";$strDoc) -  -    $strDoc:=Insert string($strDoc;"_v2";Length("function2Rename")+$strPosition) -  -    TEXT TO BLOB($strDoc;$blobDoc;UTF8 text without length) -    BLOB TO DOCUMENT("C:\\Scripts\\MyScript.php";$blobDoc) -    If(OK#1) -       ALERT("Error on script creation") -    End if - End if -``` - -The script is then executed: - -```4d - $err:=PHP Execute("C:\\Scripts\\MyScript.php";"function2Rename_v2";*) -``` - -## Example 6 - -Direct retrieval of a Date and Time type value. Here are the contents of the script: - -```PHP - -``` - -Receiving the date on the 4D side: - -```4d - var $phpResult_date : Date - $result :=PHP Execute("C:\php_scripts\ReturnDate.php";"";$phpResult_date) -  //$phpResult_date is !05/04/2009 ! -  - var $phpResult_time : Time - $result :=PHP Execute("C:\php_scripts\ReturnDate.php";"";$phpResult_time) -  //$phpResult_time is ?01 :02 :03 ? -``` - -## Example 7 - -Distribution of data in arrays: - -```4d - ARRAY TEXT($arText ;0) - ARRAY LONGINT($arLong ;0) - $p1 :="," - $p2 :="11,22,33,44,55" - $phpok :=PHP Execute("";"explode";$arText;$p1;$p2) - $phpok :=PHP Execute("";"explode";$arLong;$p1;$p2) -  -  // $arText contains the Alpha values "11", "22", "33", etc. -  // $arLong contains the numbers, 11, 22, 33, etc. -``` - -## Example 8 - -Initialization of an array: - -```4d - ARRAY TEXT($arText ;0) - $phpok :=PHP Execute("";"array_pad";$arText;->$arText;50;"undefined") -  // Execute in PHP: $arrTest = array_pad($arrTest, 50, ’undefined’); -  // Fills the $arText array with 50 "undefined" elements -``` - -## Example 9 - -Passing of parameters via an array: - -```4d - ARRAY INTEGER($arInt;0) - $phpok :=PHP Execute("";"json_decode";$arInt;"[13,51,69,42,7]") -  // Execute in PHP: $arInt = json_decode(’[13,51,69,42,7]’); -  // Fills the array with the initial values -``` - -## Example 10 - -Here is an example of the basic use of the trim function, to remove extra spaces and/or invisible characters from the beginning and end of a string: - -```4d - var $T_String : Text - $T_String:="   Hello  " - var $B : Boolean - $B:=PHP Execute("";"trim";$T_String;$T_String) -``` - -For more information concerning the trim function, please refer to the PHP documentation. - -## See also - -*Executing PHP scripts in 4D* -[PHP GET FULL RESPONSE](php-get-full-response.md) -[PHP SET OPTION](php-set-option.md) - -## Properties - -| | | -| --- | --- | -| Command number | 1058 | -| Thread safe | ✗ | - - diff --git a/versioned_docs/version-21/commands-legacy/php-get-full-response.md b/versioned_docs/version-21/commands-legacy/php-get-full-response.md deleted file mode 100644 index 620128ae9e1595..00000000000000 --- a/versioned_docs/version-21/commands-legacy/php-get-full-response.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -id: php-get-full-response -title: PHP GET FULL RESPONSE -slug: /commands/php-get-full-response -displayed_sidebar: docs ---- - - - -**PHP GET FULL RESPONSE** ( *stdOut* {; *errLabels* ; *errValues*} {; *httpHeaderFields* {; *httpHeaderValues*}} ) - -| Parameter | Type | | Description | -| --- | --- | --- | --- | -| stdOut | Text, Blob | ← | Contents of stdOut buffer | -| errLabels | Text array | ← | Labels of errors | -| errValues | Text array | ← | Values of errors | -| httpHeaderFields | Text array | ← | Names of HTTP headers | -| httpHeaderValues | Text array | ← | Values of HTTP headers | - - - -:::info Compatibility - -**PHP is deprecated in 4D**. It is now recommended to use the [`4D.SystemWorker class`](../API/SystemWorkerClass.md). - -::: - - -## Description - -The PHP GET FULL RESPONSE command lets you obtain additional information about the response returned by the PHP interpreter. This command is particularly useful in the case of an error occurring during execution of the script. - -The PHP script can write data in the stdOut buffer (echo, print, etc.). The command returns the data directly in the *stdOut* variable and applies the same conversion principles as described in the [PHP Execute](php-execute.md) command. - -The synchronized *errLabels* and *errValues* text arrays are filled when the execution of the PHP scripts causes errors. These arrays provide information in particular on the error origin, script and line. These two arrays are inseparable: if *errLabels* is passed, *errValues* must be passed as well. - -Since exchanges between 4D and the PHP interpreter are carried out via FastCGI, the PHP interpreter functions as if it were called by an HTTP server and therefore sends HTTP headers. You can recover these headers and their values in the *httpHeaderFields* and *httpHeaderValues* arrays. - -## See also - -[PHP Execute](php-execute.md) -[PHP GET OPTION](php-get-option.md) - -## Properties - -| | | -| --- | --- | -| Command number | 1061 | -| Thread safe | ✗ | - - diff --git a/versioned_docs/version-21/commands-legacy/php-get-option.md b/versioned_docs/version-21/commands-legacy/php-get-option.md deleted file mode 100644 index 4ec0b9ed3c2a88..00000000000000 --- a/versioned_docs/version-21/commands-legacy/php-get-option.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -id: php-get-option -title: PHP GET OPTION -slug: /commands/php-get-option -displayed_sidebar: docs ---- - - - - -**PHP GET OPTION** ( *option* ; *value* ) - -| Parameter | Type | | Description | -| --- | --- | --- | --- | -| option | Integer | → | Option to get | -| value | Boolean | ← | Current value of option | - - - -:::info Compatibility - -**PHP is deprecated in 4D**. It is now recommended to use the [`4D.SystemWorker class`](../API/SystemWorkerClass.md). - -::: - - -## Description - -The PHP GET OPTION command can be used to find out the current value of an option relating to the execution of PHP scripts. - -Pass a constant from the "*PHP*" theme in the *option* parameter to designate the option to be read. The command returns the current value of the option in the *value* parameter. - -| Constant | Type | Value | Comment | -| -------------- | ------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| PHP raw result | Integer | 2 | Definition of processing mode for HTTP headers returned by PHP in the execution result when this result is of the Text type (when the result is of the BLOB type, headers are always kept).
    **Possible value(s)**: Boolean. False (default value = remove HTTP headers from result. True = keep HTTP headers. | - -## See also - -[PHP GET FULL RESPONSE](php-get-full-response.md) -[PHP SET OPTION](php-set-option.md) - -## Properties - -| | | -| --- | --- | -| Command number | 1060 | -| Thread safe | ✗ | - - diff --git a/versioned_docs/version-21/commands-legacy/php-set-option.md b/versioned_docs/version-21/commands-legacy/php-set-option.md deleted file mode 100644 index a6a8505f9b4a52..00000000000000 --- a/versioned_docs/version-21/commands-legacy/php-set-option.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -id: php-set-option -title: PHP SET OPTION -slug: /commands/php-set-option -displayed_sidebar: docs ---- - - - -**PHP SET OPTION** ( *option* ; *value* {; *} ) - -| Parameter | Type | | Description | -| --- | --- | --- | --- | -| option | Integer | → | Option to be set | -| value | Boolean | → | New value of option | -| * | Operator | → | If passed: modification only applied to next call | - - - -:::info Compatibility - -**PHP is deprecated in 4D**. It is now recommended to use the [`4D.SystemWorker class`](../API/SystemWorkerClass.md). - -::: - -## Description - -The **PHP SET OPTION** command is used to set specific options before calling the [PHP Execute](php-execute.md) command. The scope of this command is the current process. - -Pass a constant from the "*PHP*" theme in the *option* parameter to designate the option to be modified and pass the new value for the option in the *value* parameter. - -| Constant | Type | Value | Comment | -| -------------- | ------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| PHP raw result | Integer | 2 | Definition of processing mode for HTTP headers returned by PHP in the execution result when this result is of the Text type (when the result is of the BLOB type, headers are always kept).
    **Possible value(s)**: Boolean. False (default value = remove HTTP headers from result. True = keep HTTP headers. | - -By default, **PHP SET OPTION** sets the option for all subsequent calls to [PHP Execute](php-execute.md) of the process. If you want to set it for the next call only, pass the star (*\**) parameter. - -## See also - -[PHP Execute](php-execute.md) -[PHP GET OPTION](php-get-option.md) - -## Properties - -| | | -| --- | --- | -| Command number | 1059 | -| Thread safe | ✗ | - - diff --git a/versioned_docs/version-21/commands-legacy/xml-get-options.md b/versioned_docs/version-21/commands-legacy/xml-get-options.md index 506b9f29426c61..d267d6e682ba76 100644 --- a/versioned_docs/version-21/commands-legacy/xml-get-options.md +++ b/versioned_docs/version-21/commands-legacy/xml-get-options.md @@ -5,7 +5,7 @@ slug: /commands/xml-get-options displayed_sidebar: docs --- -**XML GET OPTIONS** ( *elementRef* ; *selector* ; *value* {; *selector2* ; *value2* ; ... ; *selectorN* ; *valueN*} )
    **XML GET OPTIONS** ( *document ; *selector* ; *value* {; *selector2* ; *value2* ; ... ; *selectorN* ; *valueN*} ) +**XML GET OPTIONS** ( *elementRef* ; *selector* ; *value* {; *selector2* ; *value2* ; ... ; *selectorN* ; *valueN*} )
    **XML GET OPTIONS** ( *document* ; *selector* ; *value* {; *selector2* ; *value2* ; ... ; *selectorN* ; *valueN*} ) | Parameter | Type | | Description | | --- | --- | --- | --- | diff --git a/versioned_docs/version-21/commands/command-index.md b/versioned_docs/version-21/commands/command-index.md index 361980267b1377..b800ed9edb113f 100644 --- a/versioned_docs/version-21/commands/command-index.md +++ b/versioned_docs/version-21/commands/command-index.md @@ -848,10 +848,6 @@ title: Commands by name [`Path to object`](../commands-legacy/path-to-object.md)
    [`PAUSE INDEXES`](../commands-legacy/pause-indexes.md)
    [`PAUSE PROCESS`](../commands-legacy/pause-process.md)
    -[`PHP Execute`](../commands-legacy/php-execute.md)
    -[`PHP GET FULL RESPONSE`](../commands-legacy/php-get-full-response.md)
    -[`PHP GET OPTION`](../commands-legacy/php-get-option.md)
    -[`PHP SET OPTION`](../commands-legacy/php-set-option.md)
    [`PICTURE CODEC LIST`](../commands-legacy/picture-codec-list.md)
    [`PICTURE LIBRARY LIST`](../commands-legacy/picture-library-list.md)
    [`PICTURE PROPERTIES`](../commands-legacy/picture-properties.md)
    diff --git a/versioned_docs/version-21/commands/theme/PHP.md b/versioned_docs/version-21/commands/theme/PHP.md deleted file mode 100644 index be037190fc4b0f..00000000000000 --- a/versioned_docs/version-21/commands/theme/PHP.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -id: PHP_theme -title: PHP -sidebar_label: PHP -slug: /commands/theme/PHP ---- - - -|| -|---| -|[](../../commands-legacy/php-execute.md)
    | -|[](../../commands-legacy/php-get-full-response.md)
    | -|[](../../commands-legacy/php-get-option.md)
    | -|[](../../commands-legacy/php-set-option.md)
    | diff --git a/versioned_sidebars/version-21-sidebars.json b/versioned_sidebars/version-21-sidebars.json index 093086f95cee9d..6b4ed77f199a1a 100644 --- a/versioned_sidebars/version-21-sidebars.json +++ b/versioned_sidebars/version-21-sidebars.json @@ -1154,20 +1154,6 @@ "commands-legacy/variance" ] }, - { - "type": "category", - "label": "PHP", - "link": { - "type": "doc", - "id": "commands/theme/PHP_theme" - }, - "items": [ - "commands-legacy/php-execute", - "commands-legacy/php-get-full-response", - "commands-legacy/php-get-option", - "commands-legacy/php-set-option" - ] - }, { "type": "category", "label": "Pasteboard",