php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
sync-constants.php File Reference

Go to the source code of this file.

Data Structures

class  AsciiTable
 

Functions

if($notInPHP) if( $notInCurl) if($outdated) if( $allGood) getCurlConstants ()
 
 getSourceConstants ()
 
 getHexVersion (string $version)
 

Variables

const CURL_DOC_FILE = 'https://curl.se/libcurl/c/symbols-in-versions.html'
 
const SOURCE_FILE = __DIR__ . '/curl_arginfo.h'
 
const MIN_SUPPORTED_CURL_VERSION = '7.61.0'
 
const IGNORED_CURL_CONSTANTS
 
const IGNORED_PHP_CONSTANTS
 
const CONSTANTS_REGEX_PATTERN = '~^CURL(?:E|INFO|OPT|_VERSION|_HTTP)_[A-Z0-9_]+$~'
 
 $curlConstants = getCurlConstants()
 
 $sourceConstants = getSourceConstants()
 
 $notInPHP = []
 
 $notInCurl = []
 
 $outdated = []
 
foreach( $curlConstants as $name=>[ $introduced, $deprecated, $removed]) foreach($sourceConstants as $name$allGood = true
 

Function Documentation

◆ getCurlConstants()

if( $notInPHP) if($notInCurl) if( $outdated) if($allGood) getCurlConstants ( )

Loads and parses the cURL constants from the online documentation.

The result is an associative array where the key is the constant name, and the value is a numeric array with:

  • the introduced version
  • the deprecated version (nullable)
  • the removed version (nullable)
Returns
array

Parse the cURL constant lines. Possible formats:

Name Introduced Deprecated Removed CURLOPT_CRLFILE 7.19.0 CURLOPT_DNS_USE_GLOBAL_CACHE 7.9.3 7.11.1 CURLOPT_FTPASCII 7.1 7.11.1 7.15.5 CURLOPT_HTTPREQUEST 7.1 - 7.15.5

Definition at line 208 of file sync-constants.php.

◆ getHexVersion()

getHexVersion ( string $version)

Converts a version number to its hex representation as used in the extension source code.

Example: 7.25.1 => 0x071901

Parameters
string$version
Returns
string
Exceptions

RuntimeException

Definition at line 293 of file sync-constants.php.

◆ getSourceConstants()

getSourceConstants ( )

Parses the defined cURL constants from the PHP extension source code.

The result is a numeric array whose values are the constant names.

Returns
array

Definition at line 258 of file sync-constants.php.

Variable Documentation

◆ $allGood

foreach($curlConstants as $name=>[$introduced, $deprecated, $removed]) foreach ( $sourceConstants as $name) $allGood = true

Definition at line 136 of file sync-constants.php.

◆ $curlConstants

$curlConstants = getCurlConstants()

Definition at line 96 of file sync-constants.php.

◆ $notInCurl

$notInCurl = []

Definition at line 100 of file sync-constants.php.

◆ $notInPHP

$notInPHP = []

Definition at line 99 of file sync-constants.php.

◆ $outdated

$outdated = []

Definition at line 101 of file sync-constants.php.

◆ $sourceConstants

$sourceConstants = getSourceConstants()

Definition at line 97 of file sync-constants.php.

◆ CONSTANTS_REGEX_PATTERN

const CONSTANTS_REGEX_PATTERN = '~^CURL(?:E|INFO|OPT|_VERSION|_HTTP)_[A-Z0-9_]+$~'

Definition at line 30 of file sync-constants.php.

◆ CURL_DOC_FILE

const CURL_DOC_FILE = 'https://curl.se/libcurl/c/symbols-in-versions.html'

This script checks the constants defined in the curl PHP extension, against those documented on the cURL website: https://curl.se/libcurl/c/symbols-in-versions.html

See the discussion at: https://github.com/php/php-src/pull/2961

Definition at line 11 of file sync-constants.php.

◆ IGNORED_CURL_CONSTANTS

const IGNORED_CURL_CONSTANTS
Initial value:
= [
'CURLOPT_PROGRESSDATA',
'CURLOPT_XFERINFODATA',
'CURLOPT_PREREQDATA',
'CURLOPT_DEBUGDATA',
]

Definition at line 17 of file sync-constants.php.

◆ IGNORED_PHP_CONSTANTS

const IGNORED_PHP_CONSTANTS
Initial value:
= [
'CURLOPT_BINARYTRANSFER',
'CURLOPT_RETURNTRANSFER',
'CURLOPT_SAFE_UPLOAD',
]

Definition at line 24 of file sync-constants.php.

◆ MIN_SUPPORTED_CURL_VERSION

const MIN_SUPPORTED_CURL_VERSION = '7.61.0'

Definition at line 15 of file sync-constants.php.

◆ SOURCE_FILE

const SOURCE_FILE = __DIR__ . '/curl_arginfo.h'

Definition at line 13 of file sync-constants.php.