diff --git a/appendices/comparisons.xml b/appendices/comparisons.xml new file mode 100644 index 000000000..1849557ba --- /dev/null +++ b/appendices/comparisons.xml @@ -0,0 +1,649 @@ + + + + + PHP tabelle di comparazione dei tipi + + Le seguanti tabelle mostrano i comportamenti dei + tipi di PHP e + degli operatori + di confronto, per entrambi i casi di confronto stretto o flessibile. + Questo capitolo è anche in relazione al supplemento del manuale alla voce: + conversione dei tipi. + L'ispirazione è stata generata dai commenti di diversi utilizzatori + e dal lavoro su + BlueShoes. + + + Prima di utilizzare queste tabelle, è importante capire i tipi e il + loro significato. Ad esempio, "42" è uno string + mentre 42 è un int. &false; è un + bool mentre "false" è uno + string. + + + + I forms di HTML non passano integers, floats, o booleans; passano strings. + Per capire se una stringa è un valore numerico è possibile usare la funzione + is_numeric. + + + + + Facendo semplicemente if ($x) mentre $x è + indefinita si genererà un errore di tipo E_NOTICE. + Dovremmo invece usare empty o + isset e/o inizializzare le nostre variabili. + + + + + Alcuni operatori numerici possono trovarsi in uno stato rappresentato dalla costante + NAN. Alcune comparazioni ristrette o allargate di questa costante + con qualunque altro valore, incluso se stesso, ma ad eccezione di &true;, daranno come risultato &false;. + (ad esempio: NAN != NAN and NAN !== NAN) + Esempi di operazioni che producono NAN includono + sqrt(-1), asin(2), e + acosh(0). + + + + + Confronto di <varname>$x</varname> con le funzioni di PHP + + + + Espressione + gettype + empty + is_null + isset + bool : if($x) + + + + + $x = ""; + string + &true; + &false; + &true; + &false; + + + $x = null; + NULL + &true; + &true; + &false; + &false; + + + var $x; + NULL + &true; + &true; + &false; + &false; + + + $x is undefined + NULL + &true; + &true; + &false; + &false; + + + $x = array(); + array + &true; + &false; + &true; + &false; + + + $x = array('a', 'b'); + array + &false; + &false; + &true; + &true; + + + $x = false; + bool + &true; + &false; + &true; + &false; + + + $x = true; + bool + &false; + &false; + &true; + &true; + + + $x = 1; + int + &false; + &false; + &true; + &true; + + + $x = 42; + int + &false; + &false; + &true; + &true; + + + $x = 0; + int + &true; + &false; + &true; + &false; + + + $x = -1; + int + &false; + &false; + &true; + &true; + + + $x = "1"; + string + &false; + &false; + &true; + &true; + + + $x = "0"; + string + &true; + &false; + &true; + &false; + + + $x = "-1"; + string + &false; + &false; + &true; + &true; + + + $x = "php"; + string + &false; + &false; + &true; + &true; + + + $x = "true"; + string + &false; + &false; + &true; + &true; + + + $x = "false"; + string + &false; + &false; + &true; + &true; + + + +
+
+ + + + Confronto allargato con <literal>==</literal> + + + + + &true; + &false; + 1 + 0 + -1 + "1" + "0" + "-1" + &null; + array() + "php" + "" + + + + + &true; + &true; + &false; + &true; + &false; + &true; + &true; + &false; + &true; + &false; + &false; + &true; + &false; + + + &false; + &false; + &true; + &false; + &true; + &false; + &false; + &true; + &false; + &true; + &true; + &false; + &true; + + + 1 + &true; + &false; + &true; + &false; + &false; + &true; + &false; + &false; + &false; + &false; + &false; + &false; + + + 0 + &false; + &true; + &false; + &true; + &false; + &false; + &true; + &false; + &true; + &false; + &true; + &true; + + + -1 + &true; + &false; + &false; + &false; + &true; + &false; + &false; + &true; + &false; + &false; + &false; + &false; + + + "1" + &true; + &false; + &true; + &false; + &false; + &true; + &false; + &false; + &false; + &false; + &false; + &false; + + + "0" + &false; + &true; + &false; + &true; + &false; + &false; + &true; + &false; + &false; + &false; + &false; + &false; + + + "-1" + &true; + &false; + &false; + &false; + &true; + &false; + &false; + &true; + &false; + &false; + &false; + &false; + + + &null; + &false; + &true; + &false; + &true; + &false; + &false; + &false; + &false; + &true; + &true; + &false; + &true; + + + array() + &false; + &true; + &false; + &false; + &false; + &false; + &false; + &false; + &true; + &true; + &false; + &false; + + + "php" + &true; + &false; + &false; + &true; + &false; + &false; + &false; + &false; + &false; + &false; + &true; + &false; + + + "" + &false; + &true; + &false; + &true; + &false; + &false; + &false; + &false; + &true; + &false; + &false; + &true; + + + +
+
+ + + + Confronto ristretto con <literal>===</literal> + + + + + &true; + &false; + 1 + 0 + -1 + "1" + "0" + "-1" + &null; + array() + "php" + "" + + + + + &true; + &true; + &false; + &false; + &false; + &false; + &false; + &false; + &false; + &false; + &false; + &false; + &false; + + + &false; + &false; + &true; + &false; + &false; + &false; + &false; + &false; + &false; + &false; + &false; + &false; + &false; + + + 1 + &false; + &false; + &true; + &false; + &false; + &false; + &false; + &false; + &false; + &false; + &false; + &false; + + + 0 + &false; + &false; + &false; + &true; + &false; + &false; + &false; + &false; + &false; + &false; + &false; + &false; + + + -1 + &false; + &false; + &false; + &false; + &true; + &false; + &false; + &false; + &false; + &false; + &false; + &false; + + + "1" + &false; + &false; + &false; + &false; + &false; + &true; + &false; + &false; + &false; + &false; + &false; + &false; + + + "0" + &false; + &false; + &false; + &false; + &false; + &false; + &true; + &false; + &false; + &false; + &false; + &false; + + + "-1" + &false; + &false; + &false; + &false; + &false; + &false; + &false; + &true; + &false; + &false; + &false; + &false; + + + &null; + &false; + &false; + &false; + &false; + &false; + &false; + &false; + &false; + &true; + &false; + &false; + &false; + + + array() + &false; + &false; + &false; + &false; + &false; + &false; + &false; + &false; + &false; + &true; + &false; + &false; + + + "php" + &false; + &false; + &false; + &false; + &false; + &false; + &false; + &false; + &false; + &false; + &true; + &false; + + + "" + &false; + &false; + &false; + &false; + &false; + &false; + &false; + &false; + &false; + &false; + &false; + &true; + + + +
+
+
+ + + diff --git a/appendices/extensions.xml b/appendices/extensions.xml new file mode 100644 index 000000000..93533d781 --- /dev/null +++ b/appendices/extensions.xml @@ -0,0 +1,459 @@ + + + + + &extcat.intro; + +
+ &extcat.alphabetical; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ &extcat.membership; + +
+ &extcat.membership.core; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ &extcat.membership.bundled; + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ &extcat.membership.external; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ &extcat.membership.pecl; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ &extcat.state; + +
+ &extcat.state.deprecated; + + + + +
+ +
+ &extcat.state.experimental; + + + + + + + + + + + + + +
+
+ +
+ diff --git a/appendices/filters.xml b/appendices/filters.xml new file mode 100644 index 000000000..9e110181e --- /dev/null +++ b/appendices/filters.xml @@ -0,0 +1,705 @@ + + + + + Elenco dei filtri disponibili + + Quello che segue � un elenco di alcuni stream filters del linguaggio da usare con + stream_filter_append. + La tua versione di PHP potrebbe avere un numero diverso di filtri di + quelli elencati qui. + + + + C'� una piccola differenza di comportamento tra + stream_filter_append + e stream_filter_prepend. + Ogni stream di PHP contiene un piccolo read buffer + dove archivia i blocchi di dati ricevuti dal + filesystem o altre risorse in modo tale di processare i dati + nel modo pi� efficiente possibile. cos� come i dati sono inseriti + dalla risorsa nel buffer interno allo stream, essi + vengono immediatamente processati attraverso i filtri attaccati + indipendentemente dal fatto che PHP sia pronto per ricevere + altri dati oppure no. + Se i dati si trovano nel read buffer quando un filtro � + appended, questi dati vengono immediatamente + processati attraverso questo filtro facendo si che il fatto + che fossero nel buffer sia trasparente. Diversamente, se i dati + si trovano nel read buffer quando un filtro � + prepended, questi dati NON + saranno processati dal filtro. Resteranno in attesa + che il successivo blocco di dati sia disponibile prima di essere processati. + + + + Per ottenere una lista dei filtri installati sul tuo sistema + � possibile usare la funzione stream_get_filters. + + +
+ String Filters + + + Ognuno di questi filtri fa precisamente ci� che implica il suo nome e + corrisponde al comportamento di una funzione di php per maneggiare le stringhe. + Per ulteriori informazioni riguardo un filtro, far riferimento alla pagina del + manuale della funzione corrispondente. + + +
+ string.rot13 + + L'uso di questo filtro � equivalente a processare i dati dello stream + attraverso la funzione str_rot13. + + + string.rot13 + + +]]> + + +
+ +
+ string.toupper + + L'uso di questo filtro � equivalente a processare i dati dello stream + attraverso la funzione strtoupper. + + + string.toupper + + +]]> + + +
+ +
+ string.tolower + + L'uso di questo filtro � equivalente a processare i dati dello stream + attraverso la funzione strtolower. + + + string.tolower + + +]]> + + +
+ +
+ string.strip_tags + + L'uso di questo filtro � equivalente a processare i dati dello stream + attraverso la funzione strip_tags. + Accetta uno o due parametri in due forme diverse: + O come una stringa contenente una lista di tags simili al secondo parametro + della funzione strip_tags, + o come un array di nomi di tags. + + + &warn.deprecated.feature-7-3-0; + + + string.strip_tags + +"); +fwrite($fp, "bolded text enlarged to a

level 1 heading

\n"); +fclose($fp); +/* Outputs: bolded text enlarged to a level 1 heading */ + +$fp = fopen('php://output', 'w'); +stream_filter_append($fp, 'string.strip_tags', STREAM_FILTER_WRITE, array('b','i','u')); +fwrite($fp, "bolded text enlarged to a

level 1 heading

\n"); +fclose($fp); +/* Outputs: bolded text enlarged to a level 1 heading */ +?> +]]> +
+
+
+
+ +
+ Conversion Filters + + + Cos� come gli string.* filters, i convert.* filters eseguono azioni + simili ai loro nomi. + Per ulteriori informazioni riguardo un filtro, far riferimento alla pagina del + manuale della funzione corrispondente. + + +
+ convert.base64-encode and convert.base64-decode + + L'uso di questo filtro � equivalente a processare i dati dello stream + attraverso le funzioni base64_encode e base64_decode + rispettivamente. + convert.base64-encode supporta parametri passati come + un array associativo. Se line-length � dato, l'output + di base64 verr� suddiviso nel numero di caratteri di line-length. + Se line-break-chars � dato, ogni + elemento verr� delimitato dal acarattere del parametro. + Questi parametri generano lo stesso effetto dell'uso + di base64_encode con chunk_split. + + + + convert.base64-encode & + convert.base64-decode + + + 8, 'line-break-chars' => "\r\n"); +$fp = fopen('php://output', 'w'); +stream_filter_append($fp, 'convert.base64-encode', STREAM_FILTER_WRITE, $param); +fwrite($fp, "This is a test.\n"); +fclose($fp); +/* Outputs: VGhpcyBp + : cyBhIHRl + : c3QuCg== */ + +$fp = fopen('php://output', 'w'); +stream_filter_append($fp, 'convert.base64-decode'); +fwrite($fp, "VGhpcyBpcyBhIHRlc3QuCg=="); +fclose($fp); +/* Outputs: This is a test. */ +?> +]]> + + +
+ +
+ convert.quoted-printable-encode e convert.quoted-printable-decode + + L'uso della versione decode di questo filtro � equivalente a processare + i dati dell stream attraverso la funzione quoted_printable_decode. + Non ci sono funzioni equivalenti per convert.quoted-printable-encode. + convert.quoted-printable-encode supporta parametri passati + come un array associativo. Oltre ai parametri supportati da + convert.base64-encode, convert.quoted-printable-encode + supporta anche argomenti booleani: binary e + force-encode-first. + convert.base64-decode supporta solo + line-break-chars come parametro + per suddividere l'input codificato. + + + + convert.quoted-printable-encode & + convert.quoted-printable-decode + + + +]]> + + +
+ +
+ convert.iconv.* + + I filtri convert.iconv.* sono disponibili se + il supporto iconv � abilitato, e il + loro uso � equivalente a processare tutti i dati dello stream con iconv. + Questi filtri non supportano parametri, ma si aspettano che la codifica dell'input + e dell'outputoutput siano passate come una parte del nome del filtro, ad esempio + entrambi come + convert.iconv.<input-encoding>.<output-encoding> o + convert.iconv.<input-encoding>/<output-encoding> + (entrambe le annotazioni sono semanticamente equivalenti). + + + + convert.iconv.* + + +]]> + + +
+
+ +
+ Compression Filters + + + Mentre i Compression Wrappers + fanno in modo di generare files + gzip e bz2 compatibili con il filesystem locale, non permettono + una generica decompressione sui network streams, e non permettono neppure, + a partire da uno stream non compresso, di passare a uno compresso. + Per questo uso un compression filter pu� essere applicato ad ogni stream ogni volta che si vuole. + + + + + I compression filters not generano headers e chiusure + usate da utilit� a riga di comando come gzip. Esclusivamente + comprimono e decomprimono le porzioni caricate dei dati dello stream. + + + +
+ zlib.deflate and zlib.inflate + + zlib.deflate (compressione) e + zlib.inflate (decompressione) sono implementazioni + dei metodi di compressione decritti in RFC 1951. + Il filtro deflate parte da tre parametri passati come + un array associativo. + + level l'intensit� della compressione + in una scala da 1 a 9. I numeri pi� alti generano pacchetti pi� piccoli + al costo di un pi� lungo processo di elaborazione. Esistono due + livelli speciali di compressione: 0 (per non eseguire nessuna compressione), + e -1 (valore interno di default per zlib), 6 � un valore predefinito. + + window � il logaritmo in base -2 del ciclo di compressione della finestra?. + I valori pi� alti (da 15 a 32768 bytes) ottengono una maggiore + compressione usando pi� memoria di calcolo, + mentre i valori pi� bassi (da 9 -- 512 bytes) ottengono una minore compressione + con meno dispendio di memoria di calcolo. + Il valore di default di window � attualmente 15. + + memory � una scala che indica quanta memoria dovr� essere allocata + per la compressione (o decompressione). + I valori validi vanno da 1 (minima allocazione) a 9 (massima allocazione). + Allocare pi� o meno memoria impatta sulla velocit� del processo e non + sulle dimensioni dei pacchetti generati. + + + + + Siccome il livello di compressione � il parametro di uso + pi� comune, pu� essere passato come unico valore (piuttosto che come elemento di un array). + + + + + i filtri di compressione zlib.* sono disponibili se il + supporto a zlib � abilitato. + + + + + <literal>zlib.deflate</literal> e + <literal>zlib.inflate</literal> + + + 6, 'window' => 15, 'memory' => 9); + +$original_text = "This is a test.\nThis is only a test.\nThis is not an important string.\n"; +echo "The original text is " . strlen($original_text) . " characters long.\n"; + +$fp = fopen('test.deflated', 'w'); +stream_filter_append($fp, 'zlib.deflate', STREAM_FILTER_WRITE, $params); +fwrite($fp, $original_text); +fclose($fp); + +echo "The compressed file is " . filesize('test.deflated') . " bytes long.\n"; +echo "The original text was:\n"; +/* Use readfile and zlib.inflate to decompress on the fly */ +readfile('php://filter/zlib.inflate/resource=test.deflated'); + +/* Generates output: + +The original text is 70 characters long. +The compressed file is 56 bytes long. +The original text was: +This is a test. +This is only a test. +This is not an important string. + + */ +?> +]]> + + + + + + <literal>zlib.deflate</literal> simple + + + +]]> + + +
+ +
+ bzip2.compress e bzip2.decompress + + bzip2.compress e + bzip2.decompress + lavorano allo stesso modo dei filtri zlib descritti prima. + + Il fitro bzip2.compress accetta due parametri + passati come elementi di un array associativo: + + blocks � un valore intero + da 1 a 9 che specifica il numero di blocchi da 100kbyte di memoria + da allocare per il processo. + + work � anch'esso un valore intero compreso tra + 0 e 250 che indica quante risorse usare per portare a termine il lavoro + con un rapporto di compressione normale prima di recedere ad uno minore + ma pi� sostenibile per il sistema. La modifica di questo parametro + ha effetti solo sulla velocit� del processo. Ne la dimensione dell'output + ne l'uso di memoria sono condizionati da questo parametro. + Un fattore di work di 0 fa usare alla libreria bzip il valore di default + per il sistema in uso. + + Il filtro bzip2.decompress accetta solo un parametro, + che pu� essere passato o come un valore booleano, o come + small elemento di un array associativo. + + small, quando � impostato a &true; istruisce + la libreria bzip di eseguire la decompressione col minimo dispendio + di memoria a discapito della velocit�. + + + + I filtri bzip2.* sono disponibili se il supporto + bz2 � abilitato. + + + + + <literal>bzip2.compress</literal> e + <literal>bzip2.decompress</literal> + + + 9, 'work' => 0); + +echo "The original file is " . filesize('LICENSE') . " bytes long.\n"; + +$fp = fopen('LICENSE.compressed', 'w'); +stream_filter_append($fp, 'bzip2.compress', STREAM_FILTER_WRITE, $param); +fwrite($fp, file_get_contents('LICENSE')); +fclose($fp); + +echo "The compressed file is " . filesize('LICENSE.compressed') . " bytes long.\n"; + +/* Generates output: + +The original text is 3288 characters long. +The compressed file is 1488 bytes long. + + */ +?> +]]> + + +
+
+ +
+ Encryption Filters + + + I filtri Encryption hanno un uso familiare per la crittografia di file o stream. + + +
+ mcrypt.* e mdecrypt.* + + &warn.deprecated.feature-7-1-0; + + + + mcrypt.* e mdecrypt.* + Eseguono una criptazione e decriptazione simmetrica usando libmcrypt. + Entrambi questi set di filtri supportano gli stessi algoritmi + disponibili a mcrypt extension nella forma di + mcrypt.ciphername dove ciphername + � il nome della cifratura come deve essere passato a + mcrypt_module_open. + I seguenti cinque parametri per i filtri sono disponibili: + + + + + mcrypt filter parameters + + + + Parameter + Required? + Default + Sample Values + + + + + mode + Optional + cbc + cbc, cfb, ecb, nofb, ofb, stream + + + algorithms_dir + Optional + ini_get('mcrypt.algorithms_dir') + Location of algorithms modules + + + modes_dir + Optional + ini_get('mcrypt.modes_dir') + Location of modes modules + + + iv + Required + N/A + Typically 8, 16, or 32 bytes of binary data. Depends on cipher + + + key + Required + N/A + Typically 8, 16, or 32 bytes of binary data. Depends on cipher + + + +
+
+ + + Criptazione/decriptazione con Blowfish + +'cbc','iv'=>$iv, 'key'=>$key); +stream_filter_append($fp, 'mcrypt.blowfish', STREAM_FILTER_WRITE, $opts); +fwrite($fp, 'message to encrypt'); +fclose($fp); + +//decriptazione... +$fp = fopen('encrypted-file.enc', 'rb'); +$iv = fread($fp, $iv_size = mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_CBC)); +$opts = array('mode'=>'cbc','iv'=>$iv, 'key'=>$key) +stream_filter_append($fp, 'mdecrypt.blowfish', STREAM_FILTER_READ, $opts); +$data = rtrim(stream_get_contents($fp));//trims off null padding +fclose($fp); +echo $data; +?> +]]> + + + + Criptare un file usando AES-128 CBC with SHA256 HMAC + +16,'AES-192'=>24,'AES-256'=>32); + protected static function key_size() { return self::$KEY_SIZES['AES-128']; } //default AES-128 + public static function encryptFile($password, $input_stream, $aes_filename){ + $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC); + $fin = fopen($input_stream, "rb"); + $fc = fopen($aes_filename, "wb+"); + if (!empty($fin) && !empty($fc)) { + fwrite($fc, str_repeat("_", 32) );//il segnaposto, SHA256 HMAC andr� qui pi� tardi + fwrite($fc, $hmac_salt = mcrypt_create_iv($iv_size, MCRYPT_DEV_URANDOM)); + fwrite($fc, $esalt = mcrypt_create_iv($iv_size, MCRYPT_DEV_URANDOM)); + fwrite($fc, $iv = mcrypt_create_iv($iv_size, MCRYPT_DEV_URANDOM)); + $ekey = hash_pbkdf2("sha256", $password, $esalt, $it=1000, self::key_size(), $raw=true); + $opts = array('mode'=>'cbc', 'iv'=>$iv, 'key'=>$ekey); + stream_filter_append($fc, 'mcrypt.rijndael-128', STREAM_FILTER_WRITE, $opts); + $infilesize = 0; + while (!feof($fin)) { + $block = fread($fin, 8192); + $infilesize+=strlen($block); + fwrite($fc, $block); + } + $block_size = mcrypt_get_block_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC); + $padding = $block_size - ($infilesize % $block_size);//$padding � un numero da 1-16 + fwrite($fc, str_repeat(chr($padding), $padding) );//esegue il riempimento di PKCS7 + fclose($fin); + fclose($fc); + $hmac_raw = self::calculate_hmac_after_32bytes($password, $hmac_salt, $aes_filename); + $fc = fopen($aes_filename, "rb+"); + fwrite($fc, $hmac_raw);//overwrite placeholder + fclose($fc); + } + } + public static function decryptFile($password, $aes_filename, $out_stream) { + $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC); + $hmac_raw = file_get_contents($aes_filename, false, NULL, 0, 32); + $hmac_salt = file_get_contents($aes_filename, false, NULL, 32, $iv_size); + $hmac_calc = self::calculate_hmac_after_32bytes($password, $hmac_salt, $aes_filename); + $fc = fopen($aes_filename, "rb"); + $fout = fopen($out_stream, 'wb'); + if (!empty($fout) && !empty($fc) && self::hash_equals($hmac_raw,$hmac_calc)) { + fread($fc, 32+$iv_size);//skip sha256 hmac and salt + $esalt = fread($fc, $iv_size); + $iv = fread($fc, $iv_size); + $ekey = hash_pbkdf2("sha256", $password, $esalt, $it=1000, self::key_size(), $raw=true); + $opts = array('mode'=>'cbc', 'iv'=>$iv, 'key'=>$ekey); + stream_filter_append($fc, 'mdecrypt.rijndael-128', STREAM_FILTER_READ, $opts); + while (!feof($fc)) { + $block = fread($fc, 8192); + if (feof($fc)) { + $padding = ord($block[strlen($block) - 1]);//assume PKCS7 padding + $block = substr($block, 0, 0-$padding); + } + fwrite($fout, $block); + } + fclose($fout); + fclose($fc); + } + } + private static function hash_equals($str1, $str2) { + if(strlen($str1) == strlen($str2)) { + $res = $str1 ^ $str2; + for($ret=0,$i = strlen($res) - 1; $i >= 0; $i--) $ret |= ord($res[$i]); + return !$ret; + } + return false; + } + private static function calculate_hmac_after_32bytes($password, $hsalt, $filename) { + static $init=0; + $init or $init = stream_filter_register("user-filter.skipfirst32bytes", "FileSkip32Bytes"); + $stream = 'php://filter/read=user-filter.skipfirst32bytes/resource=' . $filename; + $hkey = hash_pbkdf2("sha256", $password, $hsalt, $iterations=1000, 24, $raw=true); + return hash_hmac_file('sha256', $stream, $hkey, $raw=true); + } +} +class FileSkip32Bytes extends php_user_filter +{ + private $skipped=0; + function filter($in, $out, &$consumed, $closing) { + while ($bucket = stream_bucket_make_writeable($in)) { + $outlen = $bucket->datalen; + if ($this->skipped<32){ + $outlen = min($bucket->datalen,32-$this->skipped); + $bucket->data = substr($bucket->data, $outlen); + $bucket->datalen = $bucket->datalen-$outlen; + $this->skipped+=$outlen; + } + $consumed += $outlen; + stream_bucket_append($out, $bucket); + } + return PSFS_PASS_ON; + } +} +class AES_128_CBC extends AES_CBC { + protected static function key_size() { return self::$KEY_SIZES['AES-128']; } +} +class AES_192_CBC extends AES_CBC { + protected static function key_size() { return self::$KEY_SIZES['AES-192']; } +} +class AES_256_CBC extends AES_CBC { + protected static function key_size() { return self::$KEY_SIZES['AES-256']; } +} +]]> + + +
+
+ +
+ + diff --git a/appendices/history.xml b/appendices/history.xml new file mode 100644 index 000000000..4e08228cd --- /dev/null +++ b/appendices/history.xml @@ -0,0 +1,400 @@ + + + + + + Storia di PHP e dei progetti correlati + + PHP ha fatto molta strada dalla sua nascita alla metà degli anni '90. + Dalle umili origini fino a diventare uno dei principali + linguaggi che fanno funzionare il web, l'evoluzione di PHP è un'incantevole + storia fatata. Ricorda però, una crescita così esplosiva non è stata facile da + gestire. Perciò se sei interessato a vedere brevemente come PHP + è diventato quello che è oggi continua a leggere. Se ti farà piacere toccare + con mano un pezzo della storia di internet, puoi trovare le vecchie releases di + PHP al PHP Museum. + + + + Storia di PHP + + + PHP Tools, FI, Construction Kit, and PHP/FI + + PHP così com'è conosciuto oggi è il successore di un + prodotto chiamato PHP/FI. Creato nel 1994 da Rasmus Lerdorf, + la prima vera incarnazione di PHP era una semplice raccolta di + Common Gateway Interface (CGI) binari scritti in linguaggio C. + Originariamente usati per tracciare le visite al sito + del suo curriculum online, nominò la raccolta di scripts "Personal + Home Page Tools," più frequentemente ricordata come "PHP Tools." + Nel tempo, crebbe il desiderio di altre funzionalità e Rasmus riscrisse + PHP Tools, producendone un'implementazione allargata e arricchita. + Questo nuovo modello era in grado di interagire con i database e altro ancora, + provvedere un framework su cui gli utenti potevano sviluppare semplici + applicazioni web dinamiche come un libro degli ospiti. + Nel giugno del 1995, Rasmus + rilasciò + il codice di PHP Tools al pubblico, ciò permise agli sviluppatori + di usarlo così come di visionarlo. Questo permise anche - + ed incoraggiò - gli utenti a consolidare e analizzare i bug del codice, + e in generale di sperimentarlo. + + + Nel settembre dello stesso anno, Rasmus si concentrò su PHP e - in + un breve periodo - si risolse per il nome di PHP. Ora riferito agli + strumenti come FI (Forms Interpreter), la nuova implementazione + incluse alcune funzionalità di base di PHP così come le conosciamo + oggi. Aggiunse variabili Perl-like, l'interpretazione automatica + delle variabili dei form, e incluse la sintassi HTML nel linguaggio. + La sintassi per se stessa era simile a quella di Perl, anche se + molto più limitata, semplice e per certi versi inconsistente + Infatti per incapsulare il codice in un file HTML + i programmatori devono usare i commenti di HTML. Anche se questo + metodo all'inizio non fu ben accetto, FI continuò ad aumentare allegramente + i suoi consensi come un CGI tool --- ma non ancora come un linguaggio. + Comunque, questo iniziò a cambiare il mese successivo, nell' ottobre del 1995, + Rasmus rilasciò una riscrittura completa del codice. Riportando il nome a + PHP, fu così nominato (brevemente) "Personal Home Page Construction + Kit," e fu la prima release a potersi vantare di tale nome, a quel tempo, + considerata un'interfaccia di scripting avanzata. Il linguaggio era + deliberatamente disegnato per assomigliare a C nella sua struttura, + rendendolo così di facile adozione per gli sviluppatori che avevano + familiarità con il C, Perl e linguaggi simili. + Evitando così alcune lontane limitazioni con i sistemi di compilazione + UNIX and POSIX, il potenziale per le implementazioni di Windows NT + era già stato esplorato. + + + Il codice subì un'altra completa riscrittura nell'aprile del 1996, + combinando i nomi delle passate releases, Rasmus introdusse PHP/FI. + Questa implementazione di seconda generazione iniziava veramente ad evolvere PHP + da raccolta di strumenti in un linguaggio di programmazione vero e proprio. + Incluse il supporto nativo per i database DBM, mySQL e Postgres95, + i cookies, supporto per le funzioni definite dall'utente, e molto altro. + A giugno, PHP/FI aveva una sua versione 2.0. un fatto interessante + a proposito di questo, comunque, è che ci fu solo una singola versione + di PHP 2.0. Quando finalmente passò dallo stato di versione beta + nel novembre del 1997, il motore di parsing che girava a basso livello + era già stato interamente riscritto. + + + Anche se visse una carriera di sviluppo molto breve, continua a riscontrare + una crescente popolarità nel sempre giovane mondo della programmazione web. + Nel 1997 e 1998, PHP/FI fu un culto per molte migliaia di utenti in + tutto il mondo. Un sondaggio di Netcraft del maggio 1998 indicò che + quasi 60.000 domini ispezionati avevano nel loro header la parola + "PHP", indicando che il loro host server aveva installato tale protocollo. + Questo numero rappresentava approssimativamente l'1% di tutti i domini di + Internet in quel periodo. Nonostante questi numeri impressionanti la maturazione + di PHP/FI era condannata da delle limitazioni: mentre c'erano molti aiutanti + minori, era ancora essenzialmente sviluppato da un solo individuo. + + + + Esempio di codice PHP/FI + + + + + + Hey, you are using Netscape!

+ + + + + Sorry, that record does not exist

+ + Welcome !

+ You have credits left in your account.

+ + +]]> + + + + + + + PHP 3 + + PHP 3.0 fu la prima versione che riassemblò PHP così + come esiste oggi. Trovando PHP/FI 2.0 ancora inefficiente + e carente di metodi necessari ad implementare un'applicazione di e-commerce, + furono sviluppate da un progetto universitario. Andi Gutmans e + Zeev Suraski di Tel Aviv, Israel, iniziarono di nuovo, un'altra completa + riscrittura dell' underlyng parser nel 1997. Avvicinarono Rasmus + online, discussero vari aspetti della corrente + implementazione e della loro riprogrammazione di PHP. + Concentrandosi sull'ottimizzazione dell' engine e iniziando a costruire + sulle basi esistenti di PHP/FI. Andi, Rasmus, and Zeev decisero di collaborare + nello sviluppo di un nuovo, indipendente linguaggio di programmazione. + Questo completo nuovo linguaggio rimuoveva le implicazioni di + un uso personale e limitato che il nome PHP/FI 2.0 si portava appresso. + Fu rinominato semplicemente 'PHP', con l'intento iniziale che + fosse un acronimo ricorsivo, PHP: Hypertext Preprocessor. + + + Uno dei punti di forza di PHP 3.0 era l'enorme estensibilità + delle sue features. Oltre a ciò provvide gli utenti finali + di un'interfaccia matura per molti protocolli di database, + e APIs, la facilità con cui era possibile estendere il linguaggio + attirò decine di sviluppatori che sottoscrissero molti moduli. + Discutere, questa era la chiave del tremendo successo di PHP 3.0. + Altre features essenziali introdotte in PHP 3.0 includevano + il supporto per la programmazione orientata agli oggetti (OOP) + emolte altre consistenti modifiche alla sintassi del linguaggio. + + + Nel giugno del 1998, con molti altri sviluppatori di tutto il mondo + che si unirono al progetto PHP 3.0 fu annunciato dalla nuova squadra + di sviluppatori di PHP come il successore ufficiale di PHP/FI 2.0. + Lo sviluppo attivo di PHP/FI 2.0 che cessò di fatto nel novembre + dell'anno precedente, era ufficiosamente terminato. + Dopo appena nove mesi di test aperti al pubblico, quando arrivò + l'annuncio ufficiale del rilascio di PHP 3.0, era già installato su + oltre 70.000 domini al mondo, e non fu pi limitato a lungo dai + compilatori dei sistemi operativi POSIX. Una relativamente piccola + quantità di domini riportavano che PHP era installato su servers + che giravano sotto Windows 95, 98, NT, e Macintosh. Al suo punto più + alto, PHP 3.0 era installato approssimativamente sul 10% dei web servers + di Internet. + + + + + PHP 4 + + Nell'inverno del 1998, poco dopo il rilascio ufficiale di + PHP 3.0, Andi Gutmans e Zeev Suraski iniziarono a lavorare + sulla riscrittura del cuore di PHP. L'obiettivo del progetto + era di testare le prestazioni di applicazioni complesse + e testare la modularità del codice di base di PHP. + Quali applicazioni era possibile fare con PHP 3.0 le + sue nuove features e il supporto per una moltitudine + di database e API di terze parti. Ma PHP 3.0 non + era pensato per maneggiare applicazioni complesse in + maniera efficiente. + + + Il nuovo motore, soprannominato 'Zend Engine' (compressione dei loro + nomi, Zeev e Andi), raggiunse questi obiettivi con successo, + e fu introdotto alla metà del 1999. PHP 4.0, + si basava su questo motore, assieme a una vasta scelta + di nuove features, fu ufficialmente rilasciato nel maggio del + 2000, quasi due anni dopo il suo predecessore. In aggiunta + alle notevoli performance testate, PHP 4.0 + includeva altre features chiave come il supporto per molti altri + web servers, sessioni HTTP, output buffering, metodi più sicuri + per maneggiare l'input degli utenti e molti nuovi costrutti + del linguaggio. + + + + + PHP 5 + + PHP 5 fu rilasciato nel luglio del 2004 dopo un lungo + lavoro di sviluppo e numerose pre-versioni. E' più che altro + ispirato al suo core, lo Zend Engine 2.0 con + un nuvo object model e molte altre nuove features. + + + La squadra di sviluppatori di PHP include decine di persone, + così come decine di altre persone lavorano su progetti correlati a PHP + come PEAR, PECL, e sulla documentazione, e una struttura di network + sottostante basata su oltre un centinaio di web servers individuali + su sei dei sette continenti del pianeta. Anche se è solo una stima + basata su statistiche dello scorso anno è ragionevole pensare che + PHP sia ora installato su decine e forse centinaia di milioni di + domini in tutto il mondo. + + + + + + Storia di PHP e dei progetti correlati + + + PEAR + + PEAR, PHP Extension and + Application Repository (originariamente, PHP Extension and Add-on + Repository) è la versione PHP delle classi fondamentali, e potrebbe crescere + in futuro per essere una delle chiavi di distribuzione delle estensioni di + PHP tra i programmatori. + + + PEAR da una discussione iniziata al PHP Developers' + Meeting (PDM) del gennaio dell'anno 2000 a Tel Aviv. + Fu creata da Stig S. Bakken, e dedicata al suo primo figlio, Malin Bakken. + + + Fin dall'inizio del 2000, PEAR è cresciuto per essere grande, + un progetto significativo con un gran numero di programmatori + che lavorano per implementazioni comuni, funzionalità riutilizzabili + per il bene dell'intera comunità PHP. + PEAR oggi include una grande varietà di infrastrutture e classi + fondamentali per l'accesso ai database, archiviazione dei contenuti, + funzioni matematiche, dedicate all'eCommerce e molto altro. + + + Altre informazioni riguardo a PEAR possono essere trovate nel manuale. + + + + + PHP Quality Assurance Initiative + + La PHP Quality Assurance + Initiative è stata avviata nell'estate del 2000 in + risposta a criticità che le releases di PHP non avevano + potuto testare abbastanza bene per gli ambienti di produzione. + La squadra ora consiste di un gruppo di sviluppatori + con una buona comprensione del codice di base di PHP. + Questi sviluppatori spendono molto del loro tempo + a localizzare e fissare bugs interni a PHP. + Inoltre ci sono molti altri elementi della squadra + che testano e forniscono suggerimenti su questi lavori + usando una grande varietà di piattaforme. + + + + + PHP-GTK + + PHP-GTK è la soluzione + di PHP per scrivere applicazioni grafiche sul lato client. + Andrei Zmievski ricorda il processo di pianificazione e + creazione di PHP-GTK: + +

+ + La programmazione di interfacce grafiche per utenti (GUI) + è sempre stata uno dei miei interessi, e trovai che + Gtk+ era un bel kit di strumenti, eccetto che per il fatto + che programmarlo in C era piuttosto tedioso. + Dopo aver testimoniato per le implementazioni di PyGtk e + GTK-Perl, decisi di scoprire se PHP fosse in grado di costruire + interfacce con Gtk+, anche essenziali. Partiti nell'agosto + del 2000, iniziai ad avere un po più di tempo libero così + fu che inizia la sperimentazione. La mia linea guida fu + l'implementazione PyGtk, era una feature abbastanza completa + ed aveva una bella interfaccia orientata agli oggetti. + James Henstridge, l'autore di PyGtk, ci fornì dei preziosi + consigli durante questa fase iniziale. + + + Scrivere a mano le interfacce per tutte le funzioni di Gtk+ era + fuori discussione, così afferrai l'idea di un generatore di codice + in modo simile a quello che fu fatto per PyGtk. + Un generatore di codice è un programma PHP che legge un set + di .defs file contenenti informazioni sulle + classi Gtk+, costanti, e metodi e genera del codice "C" che interfaccia + PHP con esse. + Quello che non può essere generato automaticamente può essere + scritto a mano in .overrides file. + + + Lavorare sul generatore di codice e le infrastrutture prese + del tempo perciò potei spendere poco tempo su PHP-GTK durante + l'autunno del 2000. Poi mostrai PHP-GTK a Frank Kromann, lui + se ne interessò ed iniziò ad aiutarmi con il generatore di codice + e l'implementazione win32. Quando scrivemmo il primo programma + Hello World e lo accendemmo fu veramente eccitante. Ci prese un + altro paio di mesi per rendere il progetto presentabile e la + versione iniziale fu rilasciata il primo marzo 2001. La storia + prontamente crebbe. + + + Sentivamo che PHP-GTK poteva essere esteso, preparai + mailing lists separate e CVS repositories per il PHP-GTK, + così come il sito di gtk.php.net con l'aiuto di Colin Viebrock. + Anche la documentazione doveva essere fatta e James Moore + ci venne in aiuto per questa. + + + Fin dal suo rilascio PHP-GTK è stato popolare. Abbiamo + la nostra squadra per la documentazione, il manuale si + mantiene in forma, e la gente inizia a scrivere estensioni per + PHP-GTK, e altre e altre ancora eccitanti applicazioni con esso. + +
+
+
+ + + Libri su PHP + + Come PHP crebbe, iniziò ad essere riconosciuto come piattaforma + di programmazione popolare per il web. Uno dei più interessanti + modi di osservare questo trend era osservare i libri su PHP che + uscivano nel corso degli anni. + + + Il meglio delle nostre conoscenze, il primo libro dedicato a PHP fu: + 'PHP - tvorba interaktivních internetových aplikací' (PHP + - Creare Applicazioni Interattive per Internet) - un + libro Ceco pubblicato nell'aprile del 1999, autore: Jirka Kosek. il + mese successivo seguì un libro in tedesco, autori: Egon Schmid, + Christian Cartus and Richard Blume. Il primo libro in inglese su PHP + fu pubblicato in breve e fu: 'Core PHP Programming' by + Leon Atkinson. Questi libri riguardavano PHP 3.0. + + + Mentre questi libri erano i primi del loro genere furono seguiti + da un grande numero di libri da una moltitudine di autori ed editori. + Ci sono oltre 400 libri in inglese, oltre 100 libri in tedesco, e + oltre 50 libri in francese o spagnolo! Inoltre si possono trovare + libri su PHP in diverse altre lingue, incluso il coreano, il giapponese + e l'ebraico. + + + Chiaramente questo grande numero di libri scritti da tanti differenti + autori e pubblicati da differenti editori e la loro disponibilità in tutte + queste lingue sono una forte testimonianza del successo planetario di PHP. + + + + + Pubblicazioni su PHP + + Per il meglio della nostra conoscenza, il primo articolo su PHP su + una rivista a larga diffusione fu pubblicato nella repubblica Ceca + intitolato: mutation of Computerworld nella primavera del 1998, + parlando di PHP 3.0. Come per i libri questo fu il primo di una + serie di molti articoli pubblicati su PHP in varie importanti riviste. + + + Articoli su PHP apparsero in Dr. Dobbs, Linux Enterprise, + Linux Magazine e molte altre. Articoli sulla migrazione da + applicazioni basate su ASP verso PHP sotto Windows apparirono + anche su Microsoft's + veramente MSDN! + + + +
+ + diff --git a/appendices/license.xml b/appendices/license.xml new file mode 100644 index 000000000..6800d01ad --- /dev/null +++ b/appendices/license.xml @@ -0,0 +1,393 @@ + + + + + + + Creative Commons Attribution 3.0 + + + THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC + LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER + APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR + COPYRIGHT LAW IS PROHIBITED. + + + BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY + THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A + CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR + ACCEPTANCE OF SUCH TERMS AND CONDITIONS. + + + 1. Definitions + + + + "Adaptation" means a work based upon the Work, or upon the Work + and other pre-existing works, such as a translation, adaptation, derivative work, + arrangement of music or other alterations of a literary or artistic work, or phonogram + or performance and includes cinematographic adaptations or any other form in which the + Work may be recast, transformed, or adapted including in any form recognizably derived + from the original, except that a work that constitutes a Collection will not be + considered an Adaptation for the purpose of this License. For the avoidance of doubt, + where the Work is a musical work, performance or phonogram, the synchronization of the + Work in timed-relation with a moving image ("synching") will be considered an + Adaptation for the purpose of this License. + + + + + + "Collection" means a collection of literary or artistic works, + such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or + other works or subject matter other than works listed in Section 1(f) below, which, by + reason of the selection and arrangement of their contents, constitute intellectual + creations, in which the Work is included in its entirety in unmodified form along with + one or more other contributions, each constituting separate and independent works in + themselves, which together are assembled into a collective whole. A work that + constitutes a Collection will not be considered an Adaptation (as defined above) for + the purposes of this License. + + + + + + "Distribute" means to make available to the public the original + and copies of the Work or Adaptation, as appropriate, through sale or other transfer + of ownership. + + + + + + "Licensor" means the individual, individuals, entity or entities + that offer(s) the Work under the terms of this License. + + + + + + "Work" means the literary and/or artistic work offered under the + terms of this License including without limitation any production in the literary, + scientific and artistic domain, whatever may be the mode or form of its expression + including digital form, such as a book, pamphlet and other writing; a lecture, + address, sermon or other work of the same nature; a dramatic or dramatico-musical + work; a choreographic work or entertainment in dumb show; a musical composition with + or without words; a cinematographic work to which are assimilated works expressed by a + process analogous to cinematography; a work of drawing, painting, architecture, + sculpture, engraving or lithography; a photographic work to which are assimilated + works expressed by a process analogous to photography; a work of applied art; an + illustration, map, plan, sketch or three-dimensional work relative to geography, + topography, architecture or science; a performance; a broadcast; a phonogram; a + compilation of data to the extent it is protected as a copyrightable work; or a work + performed by a variety or circus performer to the extent it is not otherwise + considered a literary or artistic work. + + + + + + "You" means an individual or entity exercising rights under this + License who has not previously violated the terms of this License with respect to the + Work, or who has received express permission from the Licensor to exercise rights + under this License despite a previous violation. + + + + + + "Publicly Perform" means to perform public recitations of the + Work and to communicate to the public those public recitations, by any means or + process, including by wire or wireless means or public digital performances; to make + available to the public Works in such a way that members of the public may access + these Works from a place and at a place individually chosen by them; to perform the + Work to the public by any means or process and the communication to the public of the + performances of the Work, including by public digital performance; to broadcast and + rebroadcast the Work by any means including signs, sounds or images. + + + + + + "Reproduce" means to make copies of the Work by any means + including without limitation by sound or visual recordings and the right of fixation + and reproducing fixations of the Work, including storage of a protected performance or + phonogram in digital form or other electronic medium. + + + + + + 2. Fair Dealing Rights. Nothing in this License is intended to + reduce, limit, or restrict any uses free from copyright or rights arising from + limitations or exceptions that are provided for in connection with the copyright + protection under copyright law or other applicable laws. + + + + 3. License Grant. Subject to the terms and conditions of this + License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual + (for the duration of the applicable copyright) license to exercise the rights in the + Work as stated below: + + + + + to Reproduce the Work, to incorporate the Work into one or more Collections, and to + Reproduce the Work as incorporated in the Collections; + + + + + + to create and Reproduce Adaptations provided that any such Adaptation, including any + translation in any medium, takes reasonable steps to clearly label, demarcate or + otherwise identify that changes were made to the original Work. For example, a + translation could be marked "The original work was translated from English to + Spanish," or a modification could indicate "The original work has been modified."; + + + + + + to Distribute and Publicly Perform the Work including as incorporated in Collections; + and, + + + + + + to Distribute and Publicly Perform Adaptations. + + + + + + For the avoidance of doubt: + + + + Non-waivable Compulsory License Schemes. In those + jurisdictions in which the right to collect royalties through any statutory or + compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive + right to collect such royalties for any exercise by You of the rights granted under + this License; + + + + + + Waivable Compulsory License Schemes. In those jurisdictions in + which the right to collect royalties through any statutory or compulsory licensing + scheme can be waived, the Licensor waives the exclusive right to collect such + royalties for any exercise by You of the rights granted under this License; and, + + + + + + Voluntary License Schemes. The Licensor waives the right to + collect royalties, whether individually or, in the event that the Licensor is a + member of a collecting society that administers voluntary licensing schemes, via + that society, from any exercise by You of the rights granted under this License. + + + + + + + + The above rights may be exercised in all media and formats whether now known or + hereafter devised. The above rights include the right to make such modifications as are + technically necessary to exercise the rights in other media and formats. Subject to + Section 8(f), all rights not expressly granted by Licensor are hereby reserved. + + + + 4. Restrictions. The license granted in Section 3 above is + expressly made subject to and limited by the following restrictions: + + + + + + You may Distribute or Publicly Perform the Work only under the terms of this License. + You must include a copy of, or the Uniform Resource Identifier (URI) for, this License + with every copy of the Work You Distribute or Publicly Perform. You may not offer or + impose any terms on the Work that restrict the terms of this License or the ability of + the recipient of the Work to exercise the rights granted to that recipient under the + terms of the License. You may not sublicense the Work. You must keep intact all + notices that refer to this License and to the disclaimer of warranties with every copy + of the Work You Distribute or Publicly Perform. When You Distribute or Publicly + Perform the Work, You may not impose any effective technological measures on the Work + that restrict the ability of a recipient of the Work from You to exercise the rights + granted to that recipient under the terms of the License. This Section 4(a) applies to + the Work as incorporated in a Collection, but this does not require the Collection + apart from the Work itself to be made subject to the terms of this License. If You + create a Collection, upon notice from any Licensor You must, to the extent + practicable, remove from the Collection any credit as required by Section 4(b), as + requested. If You create an Adaptation, upon notice from any Licensor You must, to the + extent practicable, remove from the Adaptation any credit as required by Section 4(b), + as requested. + + + + + + If You Distribute, or Publicly Perform the Work or any Adaptations or Collections, You + must, unless a request has been made pursuant to Section 4(a), keep intact all + copyright notices for the Work and provide, reasonable to the medium or means You are + utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if + supplied, and/or if the Original Author and/or Licensor designate another party or + parties (e.g., a sponsor institute, publishing entity, journal) for attribution + ("Attribution Parties") in Licensor's copyright notice, terms of service or by other + reasonable means, the name of such party or parties; (ii) the title of the Work if + supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor + specifies to be associated with the Work, unless such URI does not refer to the + copyright notice or licensing information for the Work; and (iv) , consistent with + Section 3(b), in the case of an Adaptation, a credit identifying the use of the Work + in the Adaptation (e.g., "French translation of the Work by Original Author," or + "Screenplay based on original Work by Original Author"). The credit required by this + Section 4 (b) may be implemented in any reasonable manner; provided, however, that in + the case of a Adaptation or Collection, at a minimum such credit will appear, if a + credit for all contributing authors of the Adaptation or Collection appears, then as + part of these credits and in a manner at least as prominent as the credits for the + other contributing authors. For the avoidance of doubt, You may only use the credit + required by this Section for the purpose of attribution in the manner set out above + and, by exercising Your rights under this License, You may not implicitly or + explicitly assert or imply any connection with, sponsorship or endorsement by the + Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your + use of the Work, without the separate, express prior written permission of the + Original Author, Licensor and/or Attribution Parties. + + + + + + Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted + by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by + itself or as part of any Adaptations or Collections, You must not distort, mutilate, + modify or take other derogatory action in relation to the Work which would be + prejudicial to the Original Author's honor or reputation. Licensor agrees that in + those jurisdictions (e.g. Japan), in which any exercise of the right granted in + Section 3(b) of this License (the right to make Adaptations) would be deemed to be a + distortion, mutilation, modification or other derogatory action prejudicial to the + Original Author's honor and reputation, the Licensor will waive or not assert, as + appropriate, this Section, to the fullest extent permitted by the applicable national + law, to enable You to reasonably exercise Your right under Section 3(b) of this + License (right to make Adaptations) but not otherwise. + + + + + 5. Representations, Warranties and Disclaimer + + UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK + AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, + EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF + TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE + ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, + WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED + WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU. + + + + 6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY + APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY + SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS + LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF + SUCH DAMAGES. + + + 7. Termination. + + + + + This License and the rights granted hereunder will terminate automatically upon any + breach by You of the terms of this License. Individuals or entities who have received + Adaptations or Collections from You under this License, however, will not have their + licenses terminated provided such individuals or entities remain in full compliance + with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of + this License. + + + + + + Subject to the above terms and conditions, the license granted here is perpetual (for + the duration of the applicable copyright in the Work). Notwithstanding the above, + Licensor reserves the right to release the Work under different license terms or to + stop distributing the Work at any time; provided, however that any such election will + not serve to withdraw this License (or any other license that has been, or is required + to be, granted under the terms of this License), and this License will continue in + full force and effect unless terminated as stated above. + + + + + 8. Miscellaneous + + + + Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor + offers to the recipient a license to the Work on the same terms and conditions as the + license granted to You under this License. + + + + + + Each time You Distribute or Publicly Perform an Adaptation, Licensor offers to the + recipient a license to the original Work on the same terms and conditions as the + license granted to You under this License. + + + + + + If any provision of this License is invalid or unenforceable under applicable law, it + shall not affect the validity or enforceability of the remainder of the terms of this + License, and without further action by the parties to this agreement, such provision + shall be reformed to the minimum extent necessary to make such provision valid and + enforceable. + + + + + + No term or provision of this License shall be deemed waived and no breach consented to + unless such waiver or consent shall be in writing and signed by the party to be + charged with such waiver or consent + + + + + + This License constitutes the entire agreement between the parties with respect to the + Work licensed here. There are no understandings, agreements or representations with + respect to the Work not specified here. Licensor shall not be bound by any additional + provisions that may appear in any communication from You. This License may not be + modified without the mutual written agreement of the Licensor and You. + + + + + + The rights granted under, and the subject matter referenced, in this License were + drafted utilizing the terminology of the Berne Convention for the Protection of + Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of + 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty + of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These + rights and subject matter take effect in the relevant jurisdiction in which the + License terms are sought to be enforced according to the corresponding provisions of + the implementation of those treaty provisions in the applicable national law. If the + standard suite of rights granted under applicable copyright law includes additional + rights not granted under this License, such additional rights are deemed to be + included in the License; this License is not intended to restrict the license of any + rights under applicable law. + + + + + diff --git a/appendices/migration56.xml b/appendices/migration56.xml new file mode 100644 index 000000000..8dd6c174f --- /dev/null +++ b/appendices/migration56.xml @@ -0,0 +1,57 @@ + + + + + + + Migrazione da PHP 5.5.x a PHP 5.6.x + + &appendices.migration56.incompatible; + &appendices.migration56.new-features; + &appendices.migration56.deprecated; + &appendices.migration56.changed-functions; + &appendices.migration56.new-functions; + &appendices.migration56.openssl; + &appendices.migration56.extensions; + &appendices.migration56.constants; + + + + La gran parte dei miglioramenti di PHP 5.6.x non hanno effetti sul codice preesistente. + ci sono alcune incompatibilità + e nuove features che possono + essere prese in considerazione, e il codice dovrebbe essere testato prima di + passare le nuove versioni di PHP in ambienti di produzione. + + + + + + diff --git a/appendices/migration70.xml b/appendices/migration70.xml new file mode 100644 index 000000000..f626a8655 --- /dev/null +++ b/appendices/migration70.xml @@ -0,0 +1,57 @@ + + + + + + + Migrazione da PHP 5.6.x a PHP 7.0.x + + &appendices.migration70.incompatible; + &appendices.migration70.new-features; + &appendices.migration70.deprecated; + &appendices.migration70.changed-functions; + &appendices.migration70.new-functions; + &appendices.migration70.classes; + &appendices.migration70.constants; + &appendices.migration70.sapi-changes; + &appendices.migration70.removed-exts-sapis; + &appendices.migration70.other-changes; + + + + Nonostante il fatto che PHP 7.0 sia una nuova verione del linguaggio, + molti sforzi sono stati fatti perchè la migrazione avvenga in modo indolore. + Questo rilascio si focalizza sulla rimozione delle funzionalità deprecate + delle precedenti versioni migliorando la consistenza del linguaggio. + + + Ci sono alcune incompatibilità + e nuove features che devono + essere considerate, e il codice dovrebbe essere testato prima di cambiare + versioni di PHP in ambienti di produzione. + + + + + diff --git a/appendices/migration71.xml b/appendices/migration71.xml new file mode 100644 index 000000000..7bf795a18 --- /dev/null +++ b/appendices/migration71.xml @@ -0,0 +1,53 @@ + + + + + + Migrazione da PHP 7.0.x a PHP 7.1.x + + &appendices.migration71.new-features; + &appendices.migration71.new-functions; + &appendices.migration71.constants; + &appendices.migration71.incompatible; + &appendices.migration71.deprecated; + &appendices.migration71.changed-functions; + &appendices.migration71.other-changes; + &appendices.migration71.windows-support; + + + + Questa nuova minor version porta con se un certo numero di + nuove features e + alcune incompatibilità + che devono essere considerate, e il codice dovrebbe essere + testato prima di cambiare + versioni di PHP in ambienti di produzione.. + + + + &manual.migration.seealso; + 7.0.x. + + + + + diff --git a/appendices/migration72.xml b/appendices/migration72.xml new file mode 100644 index 000000000..658b820a8 --- /dev/null +++ b/appendices/migration72.xml @@ -0,0 +1,53 @@ + + + + + + Migrazione da PHP 7.1.x a PHP 7.2.x + + &appendices.migration72.new-features; + &appendices.migration72.new-functions; + &appendices.migration72.constants; + &appendices.migration72.incompatible; + &appendices.migration72.deprecated; + &appendices.migration72.other-changes; + + + + Questa nuova minor version porta con se un certo numero di + nuove features e + alcune incompatibilità + che devono essere considerate, e il codice dovrebbe essere + testato prima di cambiare + versioni di PHP in ambienti di produzione.. + < + + + + &manual.migration.seealso; + 7.0.x e + 7.1.x. + + + + + diff --git a/appendices/migration73.xml b/appendices/migration73.xml new file mode 100644 index 000000000..ba08fd8cf --- /dev/null +++ b/appendices/migration73.xml @@ -0,0 +1,54 @@ + + + + + + Migrazione da PHP 7.2.x a PHP 7.3.x + + &appendices.migration73.new-features; + &appendices.migration73.new-functions; + &appendices.migration73.constants; + &appendices.migration73.incompatible; + &appendices.migration73.deprecated; + &appendices.migration73.other-changes; + &appendices.migration73.windows-support; + + + + Questa nuova minor version porta con se un certo numero di + nuove features e + alcune incompatibilità + che devono essere considerate, e il codice dovrebbe essere + testato prima di cambiare + versioni di PHP in ambienti di produzione. + + + + &manual.migration.seealso; + 7.0.x, + 7.1.x e + 7.2.x. + + + + + diff --git a/appendices/migration74.xml b/appendices/migration74.xml new file mode 100644 index 000000000..0927cec1a --- /dev/null +++ b/appendices/migration74.xml @@ -0,0 +1,57 @@ + + + + + + Migrazione da PHP 7.3.x a PHP 7.4.x + + &appendices.migration74.new-features; + &appendices.migration74.new-classes; + &appendices.migration74.new-functions; + &appendices.migration74.constants; + &appendices.migration74.incompatible; + &appendices.migration74.deprecated; + &appendices.migration74.removed-extensions; + &appendices.migration74.other-changes; + &appendices.migration74.windows-support; + + + + Questa nuova minor version porta con se un certo numero di + nuove features e + alcune incompatibilità + che devono essere considerate, e il codice dovrebbe essere + testato prima di cambiare + versioni di PHP in ambienti di produzione. + + + + &manual.migration.seealso; + 7.0.x, + 7.1.x, + 7.2.x and + 7.3.x. + + + + + diff --git a/appendices/migration80.xml b/appendices/migration80.xml new file mode 100644 index 000000000..8744d02f2 --- /dev/null +++ b/appendices/migration80.xml @@ -0,0 +1,53 @@ + + + + + + Migrazione da PHP 7.4.x a PHP 8.0.x + + &appendices.migration80.new-features; + &appendices.migration80.incompatible; + &appendices.migration80.deprecated; + &appendices.migration80.other-changes; + + + + Questa nuova major version porta con se un certo numero di + nuove features e + diverse incompatibilità + che devono essere considerate, e il codice dovrebbe essere + testato prima di cambiare + versioni di PHP in ambienti di produzione. + + + + &manual.migration.seealso; + 7.0.x, + 7.1.x, + 7.2.x, + 7.3.x. + 7.4.x. + + + + + diff --git a/appendices/reserved.constants.core.xml b/appendices/reserved.constants.core.xml new file mode 100644 index 000000000..678586e1b --- /dev/null +++ b/appendices/reserved.constants.core.xml @@ -0,0 +1,710 @@ + + + + Core Predefined Constants + + These constants are defined by the PHP core. This includes PHP, + the Zend engine, and SAPI modules. + + + + + PHP_VERSION + (string) + + + + The current PHP version as a string in + "major.minor.release[extra]" notation. + + + + + + PHP_MAJOR_VERSION + (int) + + + + The current PHP "major" version as an integer (e.g., int(5) + from version "5.2.7-extra"). Available since PHP 5.2.7. + + + + + + PHP_MINOR_VERSION + (int) + + + + The current PHP "minor" version as an integer (e.g., int(2) + from version "5.2.7-extra"). Available since PHP 5.2.7. + + + + + + PHP_RELEASE_VERSION + (int) + + + + The current PHP "release" version as an integer (e.g., int(7) + from version "5.2.7-extra"). Available since PHP 5.2.7. + + + + + + PHP_VERSION_ID + (int) + + + + The current PHP version as an integer, useful for + version comparisons (e.g., int(50207) from version "5.2.7-extra"). + Available since PHP 5.2.7. + + + + + + PHP_EXTRA_VERSION + (string) + + + + The current PHP "extra" version as a string (e.g., '-extra' + from version "5.2.7-extra"). Often used by distribution + vendors to indicate a package version. Available since + PHP 5.2.7. + + + + + + PHP_ZTS + (int) + + + + Available since PHP 5.2.7. + + + + + + PHP_DEBUG + (int) + + + + Available since PHP 5.2.7. + + + + + + PHP_MAXPATHLEN + (int) + + + + The maximum length of filenames (including path) supported + by this build of PHP. Available since PHP 5.3.0. + + + + + + PHP_OS + (string) + + + + The operating system PHP was built for. + + + + + + PHP_OS_FAMILY + (string) + + + + The operating system family PHP was built for. One of + 'Windows', 'BSD', + 'Darwin', 'Solaris', + 'Linux' or 'Unknown'. + Available as of PHP 7.2.0. + + + + + + PHP_SAPI + (string) + + + + The Server API for this build of PHP. + See also php_sapi_name. + + + + + + PHP_EOL + (string) + + + + The correct 'End Of Line' symbol for this platform. + Available since PHP 5.0.2 + + + + + + PHP_INT_MAX + (int) + + + + The largest integer supported in this build of PHP. Usually int(2147483647) + in 32 bit systems and int(9223372036854775807) in 64 bit systems. + Available since PHP 5.0.5 + + + + + + PHP_INT_MIN + (int) + + + + The smallest integer supported in this build of PHP. Usually int(-2147483648) in 32 bit systems and + int(-9223372036854775808) in 64 bit systems. Available since PHP 7.0.0. + Usually, PHP_INT_MIN === ~PHP_INT_MAX. + + + + + + PHP_INT_SIZE + (int) + + + + The size of an integer in bytes in this build of PHP. Available since PHP 5.0.5 + + + + + + PHP_FLOAT_DIG + (int) + + + + Number of decimal digits that can be rounded into a float and back + without precision loss. + Available as of PHP 7.2.0. + + + + + + PHP_FLOAT_EPSILON + (float) + + + + Smallest representable positive number x, so that x + 1.0 != + 1.0. + Available as of PHP 7.2.0. + + + + + + PHP_FLOAT_MIN + (float) + + + + Smallest representable positive floating point number. + If you need the smallest representable negative floating point number, use - PHP_FLOAT_MAX. + Available as of PHP 7.2.0. + + + + + + PHP_FLOAT_MAX + (float) + + + + Largest representable floating point number. + Available as of PHP 7.2.0. + + + + + + DEFAULT_INCLUDE_PATH + (string) + + + + + + + + + + PEAR_INSTALL_DIR + (string) + + + + + + + + + + PEAR_EXTENSION_DIR + (string) + + + + + + + + + + PHP_EXTENSION_DIR + (string) + + + + + + + + + + PHP_PREFIX + (string) + + + + The value was set to at configure. + On Windows, it is the value + was set to at configure. + + + + + + PHP_BINDIR + (string) + + + + The value was set to at configure. + On Windows, it is the value + was set to at configure. + + + + + + PHP_BINARY + (string) + + + + Specifies the PHP binary path during script execution. + + + + + + PHP_MANDIR + (string) + + + + Specifies where the manpages were installed into. + Available since PHP 5.3.7. + + + + + + PHP_LIBDIR + (string) + + + + + + + + + + PHP_DATADIR + (string) + + + + + + + + + + PHP_SYSCONFDIR + (string) + + + + + + + + + + PHP_LOCALSTATEDIR + (string) + + + + + + + + + + PHP_CONFIG_FILE_PATH + (string) + + + + + + + + + + PHP_CONFIG_FILE_SCAN_DIR + (string) + + + + + + + + + + PHP_SHLIB_SUFFIX + (string) + + + + The build-platform's shared library suffix, such as "so" (most Unixes) + or "dll" (Windows). + + + + + + PHP_FD_SETSIZE + (string) + + + + The maximum number of file descriptors for select system calls. Available + as of PHP 7.1.0. + + + + + + E_ERROR + (int) + + + + Error reporting constant + + + + + + E_WARNING + (int) + + + + Error reporting constant + + + + + + E_PARSE + (int) + + + + Error reporting constant + + + + + + E_NOTICE + (int) + + + + Error reporting constant + + + + + + E_CORE_ERROR + (int) + + + + Error reporting constant + + + + + + E_CORE_WARNING + (int) + + + + Error reporting constant + + + + + + E_COMPILE_ERROR + (int) + + + + Error reporting constant + + + + + + E_COMPILE_WARNING + (int) + + + + Error reporting constant + + + + + + E_USER_ERROR + (int) + + + + Error reporting constant + + + + + + E_USER_WARNING + (int) + + + + Error reporting constant + + + + + + E_USER_NOTICE + (int) + + + + Error reporting constant + + + + + + E_RECOVERABLE_ERROR + (int) + + + + Error reporting constant. + Available since PHP 5.2.0 + + + + + + E_DEPRECATED + (int) + + + + Error reporting constant. + Available since PHP 5.3.0 + + + + + + E_USER_DEPRECATED + (int) + + + + Error reporting constant. + Available since PHP 5.3.0 + + + + + + E_ALL + (int) + + + + Error reporting constant + + + + + + E_STRICT + (int) + + + + Error reporting constant + + + + + + __COMPILER_HALT_OFFSET__ + (int) + + + + Available since PHP 5.1.0 + + + + + + &true; + (bool) + + + + See Booleans. + + + + + + &false; + (bool) + + + + See Booleans. + + + + + + &null; + (null) + + + + See Null. + + + + + + PHP_WINDOWS_EVENT_CTRL_C + (int) + + + + A Windows CTRL+C event. + Available as of PHP 7.4.0 (Windows only). + + + + + + PHP_WINDOWS_EVENT_CTRL_BREAK + (int) + + + + A Windows CTRL+BREAK event. + Available as of PHP 7.4.0 (Windows only). + + + + + + See also: Magic + constants. + + + + diff --git a/appendices/reserved.constants.xml b/appendices/reserved.constants.xml new file mode 100644 index 000000000..9842536fd --- /dev/null +++ b/appendices/reserved.constants.xml @@ -0,0 +1,32 @@ + + + + + + + &ReservedConstants; + &appendices.reserved.constants.core; + &appendices.reserved.constants.standard; + + + diff --git a/appendices/reserved.xml b/appendices/reserved.xml new file mode 100644 index 000000000..cf00441eb --- /dev/null +++ b/appendices/reserved.xml @@ -0,0 +1,629 @@ + + + + + List of Reserved Words + + The following is a listing of predefined identifiers in PHP. None + of the identifiers listed here should be used as identifiers in any of + your scripts unless explicitly noted otherwise. These lists include keywords and predefined variables, + constant, and class names. These lists are neither exhaustive nor + complete. + + + + List of Keywords + + These words have special meaning in PHP. Some of them represent things + which look like functions, some look like constants, and so on - but + they're not, really: they are language constructs. You cannot use any + of the following words as constants, class names, function or method names. + Using them as variable names is generally OK, but could lead to confusion. + + + As of PHP 7.0.0 these keywords are allowed as property, constant, and + method names of classes, interfaces and traits, except that + class may not be used as constant name. + + + + PHP Keywords + + + + + __halt_compiler + + + abstract + + + and + + + array + + + as + + + + + break + + + callable (as of PHP 5.4) + + + case + + + catch + + + class + + + + + clone + + + const + + + continue + + + declare + + + default + + + + + die + + + do + + + echo + + + else + + + elseif + + + + + empty + + + enddeclare + + + endfor + + + endforeach + + + endif + + + + + endswitch + + + endwhile + + + eval + + + exit + + + extends + + + + + final + + + finally (as of PHP 5.5) + + + fn (as of PHP 7.4) + + + for + + + &foreach; + + + + + function + + + global + + + goto (as of PHP 5.3) + + + if + + + implements + + + + + include + + + include_once + + + instanceof + + + insteadof (as of PHP 5.4) + + + interface + + + + + isset + + + list + + + match (as of PHP 8.0) + + + namespace (as of PHP 5.3) + + + new + + + + + or + + + print + + + private + + + protected + + + public + + + + + require + + + require_once + + + return + + + static + + + switch + + + + + throw + + + trait (as of PHP 5.4) + + + try + + + unset + + + use + + + + + var + + + while + + + xor + + + yield (as of PHP 5.5) + + + yield from (as of PHP 7.0) + + + + +
+ + + Compile-time constants + + + + + __CLASS__ + + + __DIR__ (as of PHP 5.3) + + + __FILE__ + + + __FUNCTION__ + + + __LINE__ + + + __METHOD__ + + + + + __NAMESPACE__ (as of PHP 5.3) + + + __TRAIT__ (as of PHP 5.4) + + + + + + + + + + + + +
+
+ + + Predefined Classes + + This section lists standard predefined classes. Miscellaneous extensions + define other classes which are described in their reference. + + + + Standard Defined Classes + + + These classes are defined in the standard set of functions included + in the PHP build. + + + + + Directory + + + Created by dir. + + + + + stdClass + + + Created by typecasting + to object. + + + + + __PHP_Incomplete_Class + + + Possibly created by unserialize. + + + + + + + + Predefined classes as of PHP 5 + + + These additional predefined classes were introduced in + PHP 5.0.0. + + + + + Exception + + + + + + + ErrorException + + + Available since PHP 5.1.0. + + + + + php_user_filter + + + + + + + + + + Closure + + + The predefined final class Closure was introduced + in PHP 5.3.0. It is used for representing anonymous functions. + + + For more information, see its class + page. + + + + + Generator + + + The predefined final class Generator was introduced + in PHP 5.5.0. It is used for representing generators. + + + For more information, see its class + page. + + + + + Predefined interfaces and classes as of PHP 7 + + + These additional predefined interfaces and classes were introduced in + PHP 7.0.0. + + + + + ArithmeticError + + + + + + + AssertionError + + + + + + + DivisionByZeroError + + + + + + + Error + + + + + + + Throwable + + + + + + + ParseError + + + + + + + TypeError + + + + + + + + + + Special classes + + + Following identifiers may not be used as a class name as they have + special purpose. + + + + + self + + + Current + class. + + + + + static + + + Current class in + runtime. + + + + + parent + + + Parent + class. + + + + + + + + &appendices.reserved.constants; + + List of other reserved words + + The following words cannot be used to name a class, interface or trait, and + they are also prohibited from being used in namespaces. + + + + Reserved words + + + + + int (as of PHP 7) + + + float (as of PHP 7) + + + bool (as of PHP 7) + + + string (as of PHP 7) + + + + + true (as of PHP 7) + + + false (as of PHP 7) + + + null (as of PHP 7) + + + void (as of PHP 7.1) + + + + + iterable (as of PHP 7.1) + + + object (as of PHP 7.2) + + + + +
+
+ + The following list of words have had soft reservations placed on them. + Whilst they may still be used as class, interface, and trait names (as well + as in namespaces), usage of them is highly discouraged since they may be + used in future versions of PHP. + + + + Soft reserved words + + + + + resource (as of PHP 7) + + + mixed (as of PHP 7) + + + numeric (as of PHP 7) + + + + + + +
+
+
+
+ + diff --git a/appendices/resources.xml b/appendices/resources.xml new file mode 100644 index 000000000..e470e0bbe --- /dev/null +++ b/appendices/resources.xml @@ -0,0 +1,1920 @@ + + + + List of Resource Types + + The following is a list of functions which create, use or destroy + PHP resources. The function is_resource can be + used to determine if a variable is a resource and + get_resource_type will return the type of + resource it is. + + Resource Types + + + + + + + + + Resource Type Name + Created By + Used By + Destroyed By + Definition + + + + + AddressInfo + + socket_addrinfo_lookup + + + socket_addrinfo_bind, + socket_addrinfo_connect, + socket_addrinfo_explain, + + + None + + AddressInfo (sockets extension) + + + bzip2 + + bzopen + + + bzerrno, + bzerror, + bzerrstr, + bzflush, + bzread, + bzwrite + + + bzclose + + Bzip2 file + + + cubrid connection + + cubrid_connect + cubrid_connect_with_url + + + cubrid_col_get + cubrid_col_size + cubrid_commit + cubrid_drop + cubrid_execute + cubrid_get_autocommit + cubrid_get_charset + cubrid_get_class_name + cubrid_get_db_parameter + cubrid_get_server_info + cubrid_get + cubrid_insert_id + cubrid_is_instance + cubrid_lob_export + cubrid_lob_get + cubrid_lob_send + cubrid_lock_read + cubrid_lock_write + cubrid_prepare + cubrid_put + cubrid_rollback + cubrid_schema + cubrid_seq_drop + cubrid_seq_insert + cubrid_seq_put + cubrid_set_add + cubrid_set_autocommit + cubrid_set_db_parameter + cubrid_set_drop + cubrid_affected_rows + cubrid_client_encoding + cubrid_errno + cubrid_error + cubrid_list_dbs + cubrid_ping + cubrid_query + cubrid_real_escape_string + + + cubrid_close + cubrid_disconnect + + Connection to CUBRID database + + + persistent cubrid connection + + cubrid_pconnect + cubrid_pconnect_with_url + + + cubrid_col_get + cubrid_col_size + cubrid_commit + cubrid_drop + cubrid_execute + cubrid_get_autocommit + cubrid_get_charset + cubrid_get_class_name + cubrid_get_db_parameter + cubrid_get_server_info + cubrid_get + cubrid_insert_id + cubrid_is_instance + cubrid_lob_export + cubrid_lob_get + cubrid_lob_send + cubrid_lock_read + cubrid_lock_write + cubrid_prepare + cubrid_put + cubrid_rollback + cubrid_schema + cubrid_seq_drop + cubrid_seq_insert + cubrid_seq_put + cubrid_set_add + cubrid_set_autocommit + cubrid_set_db_parameter + cubrid_set_drop + cubrid_affected_rows + cubrid_client_encoding + cubrid_errno + cubrid_error + cubrid_list_dbs + cubrid_ping + cubrid_query + cubrid_real_escape_string + cubrid_lob2_new + + + Persistent connection to CUBRID database + + + cubrid request + + cubrid_prepare + cubrid_execute + cubrid_query + cubrid_unbuffered_query + + + cubrid_bind + cubrid_column_names + cubrid_column_types + cubrid_current_oid + cubrid_execute + cubrid_free_result + cubrid_get_query_timeout + cubrid_move_cursor + cubrid_next_result + cubrid_num_cols + cubrid_num_rows + cubrid_set_query_timeout + cubrid_data_seek + cubrid_fetch_array + cubrid_fetch_assoc + cubrid_fetch_field + cubrid_fetch_lengths + cubrid_fetch_object + cubrid_fetch_row + cubrid_field_flags + cubrid_field_len + cubrid_field_name + cubrid_field_seek + cubrid_field_table + cubrid_field_type + cubrid_num_fields + cubrid_result + cubrid_lob2_bind + + + cubrid_close_prepare + cubrid_close_request + + CUBRID request + + + cubrid lob + + cubrid_lob_get + + + cubrid_lob_export + cubrid_lob_send + cubrid_lob_size + + + cubrid_lob_close + + + None + + + + cubrid lob2 + + cubrid_lob2_new + cubrid_fetch + cubrid_fetch_row + cubrid_fetch_array + cubrid_fetch_assoc + cubrid_fetch_object + + + cubrid_lob2_export + cubrid_lob2_import + cubrid_lob2_read + cubrid_lob2_write + cubrid_lob2_tell + cubrid_lob2_tell64 + cubrid_lob2_seek + cubrid_lob2_seek64 + cubrid_lob2_size + cubrid_lob2_size64 + + + cubrid_lob2_close + + + None + + + + curl + + curl_copy_handle, + curl_init + + + curl_copy_handle, + curl_errno, + curl_error, + curl_exec, + curl_getinfo, + curl_setopt + + + curl_close + + cURL handle + + + curl_multi + + curl_multi_init + + + curl_multi_errno, + curl_multi_exec, + curl_multi_info_read, + curl_multi_remove_handle, + curl_multi_select, + curl_multi_setopt + + + curl_multi_close + + cURL multi handle + + + curl_share + + curl_share_init + + + curl_share_errno, + curl_share_setopt + + + curl_share_close + + cURL share handle + + + dba + + dba_open + + + dba_delete, + dba_exists, + dba_fetch, + dba_firstkey, + dba_insert, + dba_nextkey, + dba_optimize, + dba_replace, + dba_sync + + + dba_close + + Link to DBA database + + + dba persistent + + dba_popen + + + dba_delete, + dba_exists, + dba_fetch, + dba_firstkey, + dba_insert, + dba_nextkey, + dba_optimize, + dba_replace, + dba_sync + + + None + + Persistent link to DBA database + + + dbase + + dbase_open + + + dbase_pack, + dbase_add_record, + dbase_replace_record, + dbase_delete_record, + dbase_get_record, + dbase_get_record_with_names, + dbase_numfields, + dbase_numrecords + + + dbase_close + + Link to Dbase database + + + dbx_link_object + + dbx_connect + + + dbx_query + + + dbx_close + + dbx connection + + + dbx_result_object + + dbx_query + + + + + None + + dbx result + + + enchant_broker + + enchant_broker_init + + + enchant_broker_describe, + enchant_broker_dict_exists, + enchant_broker_get_dict_path, + enchant_broker_get_error, + enchant_broker_list_dicts, + enchant_broker_set_dict_path, + enchant_broker_set_ordering + + + enchant_broker_free + + Enchant broker (prior to PHP 8.0.0) + + + enchant_dict + + enchant_broker_request_dict + enchant_broker_request_pwl_dict + + + enchant_dict_add_to_personal, + enchant_dict_add_to_session, + enchant_dict_check, + enchant_dict_describe, + enchant_dict_get_error, + enchant_dict_is_in_session, + enchant_dict_store_replacement, + enchant_dict_suggest + + + enchant_broker_free_dict + + Enchant dictionary (prior to PHP 8.0.0) + + + fbsql link + + fbsql_change_user, + fbsql_connect + + + fbsql_autocommit, + fbsql_blob_size, + fbsql_clob_size, + fbsql_commit, + fbsql_change_user, + fbsql_create_blob, + fbsql_create_db, + fbsql_create_clob, + fbsql_data_seek, + fbsql_database_password, + fbsql_database, + fbsql_db_query, + fbsql_db_status, + fbsql_drop_db, + fbsql_errno, + fbsql_error, + fbsql_get_autostart_info, + fbsql_hostname, + fbsql_insert_id, + fbsql_list_dbs, + fbsql_password, + fbsql_read_blob, + fbsql_read_clob, + fbsql_rollback, + fbsql_select_db, + fbsql_set_password, + fbsql_set_transaction, + fbsql_start_db, + fbsql_stop_db, + fbsql_username + + + fbsql_close + + Link to fbsql database + + + fbsql plink + + fbsql_change_user, + fbsql_pconnect + + + fbsql_autocommit, + fbsql_change_user, + fbsql_create_db, + fbsql_data_seek, + fbsql_db_query, + fbsql_drop_db, + fbsql_select_db, + fbsql_errno, + fbsql_error, + fbsql_insert_id, + fbsql_list_dbs + + + None + + Persistent link to fbsql database + + + fbsql result + + fbsql_db_query, + fbsql_list_dbs, + fbsql_query, + fbsql_list_fields, + fbsql_list_tables, + fbsql_tablename + + + fbsql_affected_rows, + fbsql_fetch_array, + fbsql_fetch_assoc, + fbsql_fetch_field, + fbsql_fetch_lengths, + fbsql_fetch_object, + fbsql_fetch_row, + fbsql_field_flags, + fbsql_field_name, + fbsql_field_len, + fbsql_field_seek, + fbsql_field_table, + fbsql_field_type, + fbsql_next_result, + fbsql_num_fields, + fbsql_num_rows, + fbsql_result, + fbsql_num_rows + + + fbsql_free_result + + fbsql result + + + fdf + + fdf_open + + + fdf_create, + fdf_save, + fdf_get_value, + fdf_set_value, + fdf_next_field_name, + fdf_set_ap, + fdf_set_status, + fdf_get_status, + fdf_set_file, + fdf_get_file, + fdf_set_flags, + fdf_set_opt, + fdf_set_submit_form_action, + fdf_set_javascript_action + + + fdf_close + + FDF File + + + ftp + + ftp_connect, + ftp_ssl_connect + + + ftp_login, + ftp_pwd, + ftp_cdup, + ftp_chdir, + ftp_mkdir, + ftp_rmdir, + ftp_nlist, + ftp_rawlist, + ftp_systype, + ftp_pasv, + ftp_get, + ftp_fget, + ftp_put, + ftp_fput, + ftp_size, + ftp_mdtm, + ftp_rename, + ftp_delete, + ftp_site, + ftp_alloc, + ftp_chmod, + ftp_exec, + ftp_get_option, + ftp_nb_continue, + ftp_nb_fget, + ftp_nb_fput, + ftp_nb_get, + ftp_nb_put, + ftp_raw, + ftp_set_option + + + ftp_close + + FTP stream + + + gd + + imagecreate, + imagecreatefromgd, + imagecreatefromgd2, + imagecreatefromgd2part, + imagecreatefromgif, + imagecreatefromjpeg, + imagecreatefrompng, + imagecreatefromwbmp, + imagecreatefromstring, + imagecreatefromxbm, + imagecreatefromxpm, + imagecreatetruecolor, + imagerotate + + + imagearc, + imagechar, + imagecharup, + imagecolorallocate, + imagecolorat, + imagecolorclosest, + imagecolorexact, + imagecolorresolve, + imagegammacorrect, + imagegammacorrect, + imagecolorset, + imagecolorsforindex, + imagecolorstotal, + imagecolortransparent, + imagecopy, + imagecopyresized, + imagedashedline, + imagefill, + imagefilledpolygon, + imagefilledrectangle, + imagefilltoborder, + imagegif, + imagepng, + imagejpeg, + imagewbmp, + imageinterlace, + imageline, + imagepolygon, + imagepstext, + imagerectangle, + imagerotate, + imagesetpixel, + imagestring, + imagestringup, + imagesx, + imagesy, + imagettftext, + imagefilledarc, + imageellipse, + imagefilledellipse, + imagecolorclosestalpha, + imagecolorexactalpha, + imagecolorresolvealpha, + imagecopymerge, + imagecopymergegray, + imagecopyresampled, + imagetruecolortopalette, + imagesetbrush, + imagesettile, + imagesetthickness, + image2wbmp, + imagealphablending, + imageantialias, + imagecolorallocatealpha, + imagecolorclosesthwb, + imagecolordeallocate, + imagecolormatch, + imagefilter, + imagefttext, + imagegd, + imagegd2, + imageistruecolor, + imagelayereffect, + imagepalettecopy, + imagesavealpha, + imagesetstyle, + imagexbm + + + imagedestroy + + GD Image + + + gd font + + imageloadfont + + + imagechar, + imagecharup, + imagefontheight + + + None + + Font for GD + + + GMP integer + + gmp_init + + + gmp_intval, + gmp_strval, + gmp_add, + gmp_sub, + gmp_mul, + gmp_div_q, + gmp_div_r, + gmp_div_qr, + gmp_div, + gmp_mod, + gmp_divexact, + gmp_cmp, + gmp_neg, + gmp_abs, + gmp_sign, + gmp_fact, + gmp_sqrt, + gmp_sqrtrm, + gmp_perfect_square, + gmp_pow, + gmp_powm, + gmp_prob_prime, + gmp_gcd, + gmp_gcdext, + gmp_invert, + gmp_legendre, + gmp_jacobi, + gmp_random, + gmp_and, + gmp_or, + gmp_xor, + gmp_setbit, + gmp_clrbit, + gmp_scan0, + gmp_scan1, + gmp_popcount, + gmp_hamdist + + + None + + GMP Number + + + imap + + imap_open + + + imap_append, + imap_body, + imap_check, + imap_createmailbox, + imap_delete, + imap_deletemailbox, + imap_expunge, + imap_fetchbody, + imap_fetchstructure, + imap_headerinfo, + imap_header, + imap_headers, + imap_listmailbox, + imap_getmailboxes, + imap_get_quota, + imap_status, + imap_listsubscribed, + imap_set_quota, + imap_set_quota, + imap_getsubscribed, + imap_mail_copy, + imap_mail_move, + imap_num_msg, + imap_num_recent, + imap_ping, + imap_renamemailbox, + imap_reopen, + imap_subscribe, + imap_undelete, + imap_unsubscribe, + imap_scanmailbox, + imap_mailboxmsginfo, + imap_fetchheader, + imap_uid, + imap_msgno, + imap_search, + imap_fetch_overview + + + imap_close + + Link to IMAP, POP3 server + + + ingres + + ingres_connect + + + ingres_query, + ingres_num_rows, + ingres_num_fields, + ingres_field_name, + ingres_field_type, + ingres_field_nullable, + ingres_field_length, + ingres_field_precision, + ingres_field_scale, + ingres_fetch_array, + ingres_fetch_row, + ingres_fetch_object, + ingres_rollback, + ingres_commit, + ingres_autocommit + + + ingres_close + + Link to ingresII base + + + ingres persistent + + ingres_pconnect + + + ingres_query, + ingres_num_rows, + ingres_num_fields, + ingres_field_name, + ingres_field_type, + ingres_field_nullable, + ingres_field_length, + ingres_field_precision, + ingres_field_scale, + ingres_fetch_array, + ingres_fetch_row, + ingres_fetch_object, + ingres_rollback, + ingres_commit, + ingres_autocommit + + + None + + Persistent link to ingresII base + + + interbase blob + + ibase_blob_create, + ibase_blob_import, + ibase_blob_open + + + ibase_blob_add, + ibase_blob_cancel, + ibase_blob_echo, + ibase_blob_get, + ibase_blob_info + + + ibase_blob_close + + + + + + + + interbase link + + ibase_connect + + + ibase_query, + ibase_prepare, + ibase_trans + + + ibase_close + + Link to Interbase database + + + interbase link persistent + + ibase_pconnect + + + ibase_query, + ibase_prepare, + ibase_trans + + + None + + Persistent link to Interbase database + + + interbase query + + ibase_prepare + + + ibase_execute + + + ibase_free_query + + Interbase query + + + interbase result + + ibase_query + + + ibase_fetch_row, + ibase_fetch_object, + ibase_field_info, + ibase_num_fields + + + ibase_free_result + + Interbase Result + + + interbase transaction + + ibase_trans + + + ibase_commit + + + ibase_rollback + + Interbase transaction + + + ldap link + + ldap_connect, + ldap_search + + + ldap_count_entries, + ldap_first_attribute, + ldap_first_entry, + ldap_get_attributes, + ldap_get_dn, + ldap_get_entries, + ldap_get_values, + ldap_get_values_len, + ldap_next_attribute, + ldap_next_entry + + + ldap_close + + ldap connection + + + ldap result + + ldap_read + + + ldap_add, + ldap_compare, + ldap_bind, + ldap_count_entries, + ldap_delete, + ldap_errno, + ldap_error, + ldap_first_attribute, + ldap_first_entry, + ldap_get_attributes, + ldap_get_dn, + ldap_get_entries, + ldap_get_values, + ldap_get_values_len, + ldap_get_option, + ldap_list, + ldap_modify, + ldap_mod_add, + ldap_mod_replace, + ldap_next_attribute, + ldap_next_entry, + ldap_mod_del, + ldap_set_option, + ldap_unbind + + + ldap_free_result + + ldap search result + + + ldap result entry + + + + + + + mysql link + + mysql_connect + + + mysql_affected_rows, + mysql_change_user, + mysql_create_db, + mysql_data_seek, + mysql_db_name, + mysql_db_query, + mysql_drop_db, + mysql_errno, + mysql_error, + mysql_insert_id, + mysql_list_dbs, + mysql_list_fields, + mysql_list_tables, + mysql_query, + mysql_result, + mysql_select_db, + mysql_tablename, + mysql_get_host_info, + mysql_get_proto_info, + mysql_get_server_info + + + mysql_close + + Link to MySQL database + + + mysql link persistent + + mysql_pconnect + + + mysql_affected_rows, + mysql_change_user, + mysql_create_db, + mysql_data_seek, + mysql_db_name, + mysql_db_query, + mysql_drop_db, + mysql_errno, + mysql_error, + mysql_insert_id, + mysql_list_dbs, + mysql_list_fields, + mysql_list_tables, + mysql_query, + mysql_result, + mysql_select_db, + mysql_tablename, + mysql_get_host_info, + mysql_get_proto_info, + mysql_get_server_info + + + None + + Persistent link to MySQL database + + + mysql result + + mysql_db_query, + mysql_list_dbs, + mysql_list_fields, + mysql_list_processes, + mysql_list_tables, + mysql_query, + mysql_unbuffered_query + + + mysql_data_seek, + mysql_db_name, + mysql_fetch_array, + mysql_fetch_assoc, + mysql_fetch_field, + mysql_fetch_lengths, + mysql_fetch_object, + mysql_fetch_row, + mysql_fetch_row, + mysql_field_flags, + mysql_field_name, + mysql_field_len, + mysql_field_seek, + mysql_field_table, + mysql_field_type, + mysql_num_fields, + mysql_num_rows, + mysql_result, + mysql_tablename + + + mysql_free_result + + MySQL result + + + oci8 collection + + oci_new_collection + + + OCICollection::append, + OCICollection::assign, + OCICollection::assignElem, + OCICollection::getElem, + OCICollection::max, + OCICollection::size, + OCICollection::trim + + + OCICollection::free + + Oracle Collection + + + oci8 connection + + oci_connect, + oci_pconnect, + oci_new_connect + + + oci_commit, + oci_error, + oci_new_cursor, + oci_parse, + oci_password_change, + oci_rollback, + oci_server_version, + oci_set_action, + oci_set_client_identifier, + oci_set_client_info, + oci_set_module_name + + + oci_close + + Connection to Oracle Database + + + oci8 lob + + oci_new_descriptor + + + OCILob::append, + OCILob::close, + OCILob::eof, + OCILob::erase, + OCILob::export, + OCILob::flush, + OCILob::getBuffering, + OCILob::import, + OCILob::load, + OCILob::read, + OCILob::rewind, + OCILob::save, + OCILob::saveFile, + OCILob::seek, + OCILob::setBuffering, + OCILob::size, + OCILob::tell, + OCILob::truncate, + OCILob::write, + OCILob::writeTemporary, + OCILob::writeToFile, + oci_lob_copy, + oci_lob_is_equal + + + OCILob::free + + Oracle large objects + + + oci8 statement + + oci_parse, + oci_new_cursor + + + oci_bind_array_by_name, + oci_bind_by_name, + oci_cancel, + oci_define_by_name, + oci_error + oci_execute, + oci_fetch_all, + oci_fetch_array, + oci_fetch_assoc, + oci_fetch_object, + oci_fetch_row, + oci_fetch, + oci_field_is_null, + oci_field_name, + oci_field_precision, + oci_field_scale, + oci_field_size, + oci_field_type_raw, + oci_field_type, + oci_num_fields, + oci_num_rows, + oci_result, + oci_set_prefetch, + oci_statement_type + + + oci_free_statement + + Oracle cursor + + + odbc link + + odbc_connect + + + odbc_autocommit, + odbc_commit, + odbc_error, + odbc_errormsg, + odbc_exec, + odbc_tables, + odbc_tableprivileges, + odbc_do, + odbc_prepare, + odbc_columns, + odbc_columnprivileges, + odbc_procedurecolumns, + odbc_specialcolumns, + odbc_rollback, + odbc_setoption, + odbc_gettypeinfo, + odbc_primarykeys, + odbc_foreignkeys, + odbc_procedures, + odbc_statistics + + + odbc_close + + Link to ODBC database + + + odbc link persistent + + odbc_pconnect + + + odbc_autocommit, + odbc_commit, + odbc_error, + odbc_errormsg, + odbc_exec, + odbc_tables, + odbc_tableprivileges, + odbc_do, + odbc_prepare, + odbc_columns, + odbc_columnprivileges, + odbc_procedurecolumns, + odbc_specialcolumns, + odbc_rollback, + odbc_setoption, + odbc_gettypeinfo, + odbc_primarykeys, + odbc_foreignkeys, + odbc_procedures, + odbc_statistics + + + None + + Persistent link to ODBC database + + + odbc result + + odbc_prepare + + + odbc_binmode, + odbc_cursor, + odbc_execute, + odbc_fetch_into, + odbc_fetch_row, + odbc_field_name, + odbc_field_num, + odbc_field_type, + odbc_field_len, + odbc_field_precision, + odbc_field_scale, + odbc_longreadlen, + odbc_num_fields, + odbc_num_rows, + odbc_result, + odbc_result_all, + odbc_setoption + + + odbc_free_result + + ODBC result + + + birdstep link + + + + Link to Birdstep database (prior to PHP 7.3.0) + + + birdstep result + + + + Birdstep result (prior to PHP 7.3.0) + + + OpenSSL key + + openssl_get_privatekey, + openssl_get_publickey + + + openssl_sign, + openssl_seal, + openssl_open, + openssl_verify + + + openssl_free_key + + OpenSSL key + + + OpenSSL X.509 + + openssl_x509_read + + + openssl_x509_parse, + openssl_x509_checkpurpose + + + openssl_x509_free + + Public Key + + + pgsql large object + + pg_lo_open + + + pg_lo_open, + pg_lo_create, + pg_lo_read, + pg_lo_read_all, + pg_lo_seek, + pg_lo_tell, + pg_lo_unlink, + pg_lo_write + + + pg_lo_close + + PostgreSQL Large Object + + + pgsql link + + pg_connect + + + pg_affected_rows, + pg_query, + pg_send_query, + pg_get_result, + pg_connection_busy, + pg_connection_reset, + pg_connection_status, + pg_last_error, + pg_last_notice, + pg_lo_create, + pg_lo_export, + pg_lo_import, + pg_lo_open, + pg_lo_unlink, + pg_host, + pg_port, + pg_dbname, + pg_options, + pg_copy_from, + pg_copy_to, + pg_end_copy, + pg_put_line, + pg_tty, + pg_trace, + pg_untrace, + pg_set_client_encoding, + pg_client_encoding, + pg_metadata, + pg_convert, + pg_insert, + pg_select, + pg_delete, + pg_update + + + pg_close + + Link to PostgreSQL database + + + pgsql link persistent + + pg_pconnect + + + pg_affected_rows, + pg_query, + pg_send_query, + pg_get_result, + pg_connection_busy, + pg_connection_reset, + pg_connection_status, + pg_last_error, + pg_last_notice, + pg_lo_create, + pg_lo_export, + pg_lo_import, + pg_lo_open, + pg_lo_unlink, + pg_host, + pg_port, + pg_dbname, + pg_options, + pg_copy_from, + pg_copy_to, + pg_end_copy, + pg_put_line, + pg_tty, + pg_trace, + pg_untrace, + pg_set_client_encoding, + pg_client_encoding, + pg_metadata, + pg_convert, + pg_insert, + pg_select, + pg_delete, + pg_update + + + None + + Persistent link to PostgreSQL database + + + pgsql result + + pg_execute, + pg_query, + pg_query_params, + pg_get_result + + + pg_fetch_array, + pg_fetch_object, + pg_fetch_result, + pg_fetch_row, + pg_field_is_null, + pg_field_name, + pg_field_num, + pg_field_prtlen, + pg_field_size, + pg_field_type, + pg_last_oid, + pg_num_fields, + pg_num_rows, + pg_result_error, + pg_result_status + + + pg_free_result + + PostgreSQL result + + + pgsql string + + + + + + + pspell + + pspell_new, + pspell_new_config, + pspell_new_personal + + + pspell_add_to_personal, + pspell_add_to_session, + pspell_check, + pspell_clear_session, + pspell_config_ignore, + pspell_config_mode, + pspell_config_personal, + pspell_config_repl, + pspell_config_runtogether, + pspell_config_save_repl, + pspell_save_wordlist, + pspell_store_replacement, + pspell_suggest + + + None + + pspell dictionary + + + pspell config + + pspell_config_create + + + pspell_new_config + + + None + + pspell configuration + + + shmop + + shmop_open + + + shmop_read, + shmop_write, + shmop_size, + shmop_delete + + + shmop_close + + Shared memory block handle (prior to PHP 8.0.0) + + + Socket + + socket_accept, + socket_addrinfo_bind, + socket_addrinfo_connect, + socket_create, + socket_create_listen, + socket_import_stream, + socket_wsaprotocol_info_import + + + socket_accept, + socket_bind, + socket_clear_error, + socket_connect, + socket_get_option, + socket_getpeername, + socket_getsockname, + socket_last_error, + socket_listen, + socket_read, + socket_recv, + socket_recvfrom, + socket_recvmsg, + socket_select, + socket_send, + socket_sendmsg, + socket_sendto, + socket_set_block, + socket_set_nonblock, + socket_set_option, + socket_shutdown, + socket_write, + socket_wsaprotocol_info_export, + socket_wsaprotocol_info_release + + + socket_close + + Socket (sockets extension) + + + stream + + opendir + + + readdir, + rewinddir + + + closedir + + Dir handle + + + stream + + fopen, + tmpfile + + + feof, + fflush, + fgetc, + fgetcsv, + fgets, + fgetss, + flock, + fpassthru, + fputs, + fwrite, + fread, + fseek, + ftell, + fstat, + ftruncate, + set_file_buffer, + rewind + + + fclose + + File handle + + + stream + + popen, + fsockopen, + pfsockopen + + + feof, + fflush, + fgetc, + fgetcsv, + fgets, + fgetss, + fpassthru, + fputs, + fwrite, + fread + + + pclose + + Process handle + + + socket + + + + fflush, + fgetc, + fgetcsv, + fgets, + fgetss, + fpassthru, + fputs, + fwrite, + fread + + + fclose + + Socket handle + + + SSH2 Session + + ssh2_connect + + + + + ssh2_disconnect + + + + + SSH2 Listener + + ssh2_forward_listen + + + + + + + + + + SSH2 SFTP + + ssh2_sftp + + + + + + + + + + SSH2 Publickey Subsystem + + ssh2_publickey_init + + + + + + + + + + sysvmsg queue + + msg_get_queue + + + msg_queue_exists, + msg_receive, + msg_send, + msg_set_queue, + msg_stat_queue + + + msg_remove_queue + + System V Message Queue + + + sysvsem + + sem_get + + + sem_acquire + + + sem_release + + System V Semaphore + + + sysvshm + + shm_attach + + + shm_remove, + shm_put_var, + shm_get_var, + shm_remove_var + + + shm_detach + + System V Shared Memory + + + wddx + + wddx_packet_start + + + wddx_add_vars + + + wddx_packet_end + + WDDX packet + + + xml + + xml_parser_create, + xml_parser_create_ns + + + xml_set_object, + xml_set_element_handler, + xml_set_character_data_handler, + xml_set_processing_instruction_handler, + xml_set_default_handler, + xml_set_unparsed_entity_decl_handler, + xml_set_notation_decl_handler, + xml_set_external_entity_ref_handler, + xml_parse, + xml_get_error_code, + xml_error_string, + xml_get_current_line_number, + xml_get_current_column_number, + xml_get_current_byte_index, + xml_parse_into_struct, + xml_parser_set_option, + xml_parser_get_option + + + xml_parser_free + + XML parser (prior to PHP 8.0.0) + + + zlib + + gzopen + + + gzeof, + gzgetc, + gzgets, + gzgetss, + gzpassthru, + gzputs, + gzread, + gzrewind, + gzseek, + gztell, + gzwrite + + + gzclose + + gz-compressed file + + + zlib.deflate + + deflate_init + + + deflate_add + + + None + + incremental deflate context (prior to PHP 8.0.0) + + + zlib.inflate + + inflate_init + + + inflate_add, + inflate_get_read_len, + inflate_get_status + + + None + + incremental inflate context (prior to PHP 8.0.0) + + + +
+
+
+ + diff --git a/appendices/tokens.xml b/appendices/tokens.xml new file mode 100644 index 000000000..f22474a11 --- /dev/null +++ b/appendices/tokens.xml @@ -0,0 +1,846 @@ + + + + + List of Parser Tokens + + Various parts of the PHP language are represented internally by types like + T_SR. PHP outputs identifiers like this one in parse errors, like + "Parse error: unexpected T_SR, expecting ',' or ';' in script.php on line 10." + + + You're supposed to know what T_SR means. For everybody who doesn't + know that, here is a table with those identifiers, PHP-syntax and + references to the appropriate places in the manual. + + + + Usage of T_* constants + + All tokens listed below are also defined as PHP constants. Their value is + automatically generated based on PHP's underlying parser infrastructure. + This means that the concrete value of a token may change between two PHP + versions. For example the T_FILE constant is + 365 in PHP 5.3, while the same value refers now to + T_TRAIT in PHP 5.4 and the value of T_FILE + is 369. This means that your code should never rely directly + on the original T_* values taken from PHP version X.Y.Z, to provide some compatibility + across multiple PHP versions. Instead your code should utilize custom values + (using big numbers like 10000) and an appropriate strategy that + will work with both PHP versions and T_* values. + + + + + Tokens + + + + Token + Syntax + Reference + + + + + T_ABSTRACT + abstract + + + + T_AND_EQUAL + &= + assignment + operators + + + T_ARRAY + array() + array, array syntax + + + T_ARRAY_CAST + (array) + type-casting + + + T_AS + as + &foreach; + + + T_BAD_CHARACTER + + + anything below ASCII 32 except \t (0x09), \n (0x0a) and \r (0x0d) + (available since PHP 7.4.0) + + + + T_BOOLEAN_AND + && + logical operators + + + T_BOOLEAN_OR + || + logical operators + + + T_BOOL_CAST + (bool) or (boolean) + type-casting + + + T_BREAK + break + break + + + T_CALLABLE + callable + callable + + + T_CASE + case + switch + + + T_CATCH + catch + + + + T_CLASS + class + classes and objects + + + T_CLASS_C + __CLASS__ + + magic constants + + + + T_CLONE + clone + + classes and objects + + + + T_CLOSE_TAG + ?> or %> + escaping + from HTML + + + T_COALESCE + ?? + + comparison operators + + + + T_COALESCE_EQUAL + ??= + + assignment operators + (available since PHP 7.4.0) + + + + T_COMMENT + // or #, and /* */ + comments + + + T_CONCAT_EQUAL + .= + assignment + operators + + + T_CONST + const + class constants + + + T_CONSTANT_ENCAPSED_STRING + "foo" or 'bar' + string syntax + + + T_CONTINUE + continue + continue + + + T_CURLY_OPEN + {$ + complex + variable parsed syntax + + + T_DEC + -- + incrementing/decrementing + operators + + + T_DECLARE + declare + declare + + + T_DEFAULT + default + switch + + + T_DIR + __DIR__ + magic constants + + + T_DIV_EQUAL + /= + assignment + operators + + + T_DNUMBER + 0.12, etc. + floating point numbers + + + T_DO + do + do..while + + + T_DOC_COMMENT + /** */ + + PHPDoc style comments + + + + T_DOLLAR_OPEN_CURLY_BRACES + ${ + complex + variable parsed syntax + + + T_DOUBLE_ARROW + => + array syntax + + + T_DOUBLE_CAST + (real), (double) or (float) + type-casting + + + T_DOUBLE_COLON + :: + see T_PAAMAYIM_NEKUDOTAYIM below + + + T_ECHO + echo + echo + + + T_ELLIPSIS + ... + + function arguments + + + + T_ELSE + else + else + + + T_ELSEIF + elseif + elseif + + + T_EMPTY + empty + empty + + + T_ENCAPSED_AND_WHITESPACE + " $a" + constant part of + string with variables + + + T_ENDDECLARE + enddeclare + declare, alternative syntax + + + T_ENDFOR + endfor + for, alternative syntax + + + T_ENDFOREACH + endforeach + &foreach;, alternative syntax + + + T_ENDIF + endif + if, alternative syntax + + + T_ENDSWITCH + endswitch + switch, alternative syntax + + + T_ENDWHILE + endwhile + while, alternative syntax + + + T_END_HEREDOC + + heredoc + syntax + + + T_EVAL + eval() + eval + + + T_EXIT + exit or die + exit, die + + + T_EXTENDS + extends + extends, classes and objects + + + T_FILE + __FILE__ + magic constants + + + T_FINAL + final + + + + T_FINALLY + finally + + + + T_FN + fn + + arrow functions + (available since PHP 7.4.0) + + + + T_FOR + for + for + + + T_FOREACH + foreach + &foreach; + + + T_FUNCTION + function + functions + + + T_FUNC_C + __FUNCTION__ + + magic constants + + + + T_GLOBAL + global + variable scope + + + T_GOTO + goto + goto + + + T_HALT_COMPILER + __halt_compiler() + + + + T_IF + if + if + + + T_IMPLEMENTS + implements + + + + T_INC + ++ + incrementing/decrementing + operators + + + T_INCLUDE + include() + include + + + T_INCLUDE_ONCE + include_once() + include_once + + + T_INLINE_HTML + + text outside PHP + + + T_INSTANCEOF + instanceof + + type operators + + + + T_INSTEADOF + insteadof + + + + T_INTERFACE + interface + + + + T_INT_CAST + (int) or (integer) + type-casting + + + T_ISSET + isset() + isset + + + T_IS_EQUAL + == + comparison operators + + + T_IS_GREATER_OR_EQUAL + >= + comparison operators + + + T_IS_IDENTICAL + === + comparison operators + + + T_IS_NOT_EQUAL + != or <> + comparison operators + + + T_IS_NOT_IDENTICAL + !== + comparison operators + + + T_IS_SMALLER_OR_EQUAL + <= + comparison operators + + + T_LINE + __LINE__ + magic constants + + + T_LIST + list() + list + + + T_LNUMBER + 123, 012, 0x1ac, etc. + integers + + + T_LOGICAL_AND + and + logical operators + + + T_LOGICAL_OR + or + logical operators + + + T_LOGICAL_XOR + xor + logical operators + + + T_METHOD_C + __METHOD__ + + magic constants + + + + T_MINUS_EQUAL + -= + assignment + operators + + + T_MOD_EQUAL + %= + assignment + operators + + + T_MUL_EQUAL + *= + assignment + operators + + + T_NAMESPACE + namespace + + namespaces + + + + T_NEW + new + classes and objects + + + T_NS_C + __NAMESPACE__ + + namespaces + + + + T_NS_SEPARATOR + \ + + namespaces + + + + T_NUM_STRING + "$a[0]" + numeric array index + inside string + + + T_OBJECT_CAST + (object) + type-casting + + + T_OBJECT_OPERATOR + -> + classes and objects + + + T_NULLSAFE_OBJECT_OPERATOR + ?-> + classes and objects + + + T_OPEN_TAG + <?php, <? or <% + escaping + from HTML + + + T_OPEN_TAG_WITH_ECHO + <?= or <%= + escaping + from HTML + + + T_OR_EQUAL + |= + assignment + operators + + + T_PAAMAYIM_NEKUDOTAYIM + :: + ::. Also defined as + T_DOUBLE_COLON. + + + T_PLUS_EQUAL + += + assignment + operators + + + T_POW + ** + + arithmetic operators + + + + T_POW_EQUAL + **= + + assignment operators + + + + T_PRINT + print() + print + + + T_PRIVATE + private + + classes and objects + + + + T_PROTECTED + protected + + classes and objects + + + + T_PUBLIC + public + + classes and objects + + + + T_REQUIRE + require() + require + + + T_REQUIRE_ONCE + require_once() + require_once + + + T_RETURN + return + returning values + + + T_SL + << + bitwise + operators + + + T_SL_EQUAL + <<= + assignment + operators + + + T_SPACESHIP + <=> + + comparison operators + + + + T_SR + >> + bitwise + operators + + + T_SR_EQUAL + >>= + assignment + operators + + + T_START_HEREDOC + <<< + heredoc + syntax + + + T_STATIC + static + variable scope + + + T_STRING + parent, self, etc. + + identifiers, e.g. keywords like parent and self, + function names, class names and more are matched. + See also T_CONSTANT_ENCAPSED_STRING. + + + + T_STRING_CAST + (string) + type-casting + + + T_STRING_VARNAME + "${a + complex + variable parsed syntax + + + T_SWITCH + switch + switch + + + T_THROW + throw + + + + T_TRAIT + trait + + + + T_TRAIT_C + __TRAIT__ + __TRAIT__ + + + T_TRY + try + + + + T_UNSET + unset() + unset + + + T_UNSET_CAST + (unset) + type-casting + + + T_USE + use + namespaces + + + T_VAR + var + classes and objects + + + T_VARIABLE + $foo + variables + + + T_WHILE + while + while, do..while + + + T_WHITESPACE + \t \r\n + + + + T_XOR_EQUAL + ^= + assignment + operators + + + T_YIELD + yield + generators + + + T_YIELD_FROM + yield from + generators + + + +
+ + See also token_name. + +
+ + diff --git a/appendices/transports.xml b/appendices/transports.xml new file mode 100644 index 000000000..8e5732a4c --- /dev/null +++ b/appendices/transports.xml @@ -0,0 +1,142 @@ + + + + List of Supported Socket Transports + + The following is a list of the various URL style socket transports + that PHP has built-in for use with the streams based socket + functions such as fsockopen, and + stream_socket_client. These transports do + not apply to the + Sockets Extension. + + + + For a list of transports installed in your version of + PHP use stream_get_transports. + + +
+ Internet Domain: TCP, UDP, SSL, and TLS + + ssl://, tls://, + sslv2:// & sslv3://. + + + + + If no transport is specified, tcp:// will be assumed. + + + + + 127.0.0.1 + fe80::1 + www.example.com + tcp://127.0.0.1 + tcp://fe80::1 + tcp://www.example.com + udp://www.example.com + ssl://www.example.com + sslv2://www.example.com + sslv3://www.example.com + tls://www.example.com + + + + Internet Domain sockets expect a port number in addition + to a target address. In the case of fsockopen + this is specified in a second parameter and therefore does + not impact the formatting of transport URL. With + stream_socket_client and related functions + as with traditional URLs however, the port number is specified + as a suffix of the transport URL delimited by a colon. + + + + tcp://127.0.0.1:80 + tcp://[fe80::1]:80 + tcp://www.example.com:80 + + + + IPv6 numeric addresses with port numbers + + In the second example above, while the IPv4 and hostname + examples are left untouched apart from the addition of + their colon and portnumber, the IPv6 address is wrapped in + square brackets: [fe80::1]. This is to + distinguish between the colons used in an IPv6 address and + the colon used to delimit the portnumber. + + + + + The ssl:// and tls:// transports + (available only when openssl support is compiled into PHP) are extensions + of the tcp:// transport which include SSL encryption. + + + + ssl:// will attempt to negotiate an SSL V2, + or SSL V3 connection depending on the capabilities and preferences + of the remote host. sslv2:// and + sslv3:// will select the SSL V2 or SSL V3 + protocol explicitly. + +
+ +
+ Unix Domain: Unix and UDG + + unix:// and + udg:// (udg:// since PHP 5). + + + + unix:///tmp/mysock + udg:///tmp/mysock + + + + unix:// provides access to a socket stream + connection in the Unix domain. udg:// provides + an alternate transport to a Unix domain socket using the user datagram + protocol. + + + + Unix domain sockets, unlike Internet domain sockets, do not expect + a port number. In the case of fsockopen the + portno parameter should be set to 0. + + + + + Unix domain sockets are not supported on Windows. + + +
+ +
+ + diff --git a/reference/pcre/pattern.modifiers.xml b/reference/pcre/pattern.modifiers.xml index 40a5fe0d5..bf0a21882 100644 --- a/reference/pcre/pattern.modifiers.xml +++ b/reference/pcre/pattern.modifiers.xml @@ -113,172 +113,4 @@ (.*?))e', - '"" . strtoupper("$2") . ""', - $html -); -]]> - - - - L'esempio qui sopra può essere facilmente sfruttato passando una stringa come - <h1>{${eval($_GET[php_code])}}</h1>. Questo dà - all'attaccante la possibiltà di eseguire codice PHP arbitrario e ciò gli permette - un access quasi totale al server. - - - Per evitare questo tipo di vulnerabilità, la funzione - preg_replace_callback deve essere utilizzata al suo posto: - - - -(.*?))', - function ($m) { - return "" . strtoupper($m[2]) . ""; - }, - $html -); -]]> - - - - - - Soltanto preg_replace utilizza questo modificatore; - le altre funzioni di PCRE lo ignorano. - - - - - - A (PCRE_ANCHORED) - - - Se si specifica questo modificatore, si forza un 'ancoraggio' - del criterio di ricerca. In pratica questo viene costretto - a riconoscere il testo su cui si fa la ricerca solo dall'inizio. - Questo effetto può essere ottenuto anche con particolari - costruzioni dell'espressione regolare, che rappresentano gli - unici modi utilizzabili in Perl per ottenere il medesimo scopo. - - - - - D (PCRE_DOLLAR_ENDONLY) - - - L'uso di questo modificatore forza il carattere $ dell'espressione - regolare a indicare la fine della stringa oggetto della ricerca. - Senza questo modificatore il carattere $ indica la posizione subito - prima dell'ultimo carattere se questo è un "a capo" (ma comunque - non prima di ogni altro "a capo"). Questo modificatore viene ignorato - se è attivato il modificatore m. Non vi sono - flag equivalenti in Perl. - - - - - S - - - Quando una espressione regolare è destinata ad essere utilizzata - diverse volte, vale la pena dedicare del tempo ad ottimizzare - la velocità di riconoscimento. L'uso di questo modificatore permette - questa analisi. Al momento lo studio della velocità è significativo - per i criteri di ricerca "non ancorati", cioè espressioni che non - hanno un carattere di partenza fisso. - - - - - U (PCRE_UNGREEDY) - - - Questo modificatore inverte la "golosità" delle occorrenze, in modo - da non essere golose per default, ma lo tornano ad essere se - seguiti da ?. Questo flag non è compatibile con Perl. - Questo comportamento può anche essere settato dalla sequenza (?U) - settaggio dei modificatori - all'interno del criterio di ricerca o da un punto di domanda vicino ad un quantificatore (es. - .*?). - - - - Normalmente non è possibile eseguire una corrispondenza con più di pcre.backtrack_limit - caratteri in modalità non golosa. - - - - - - X (PCRE_EXTRA) - - - Questo modificatore attiva funzionalità addizionali di PCRE - che sono incompatibili con Perl. Ogni backslash (\) posto - nell'espressione regolare che non sia seguito da una lettera - con significato speciale causa un errore, ciò per riservare - queste sequenze a future espansioni. Per default, Perl - considera il backslash (\) seguito da una lettera priva di - significato speciale come un qualsiasi testo. Al momento non - vi sono altre caratteristiche gestite tramite questo modificatore. - - - - - J (PCRE_INFO_JCHANGED) - - - L'opzione di configurazione interna (?J) cambia l'opzione locale PCRE_DUPNAMES - Permette la duplicazione dei nomi per le sottoregole. - - - - - u (PCRE_UTF8) - - - Questo modificatore attiva funzionalità di PCRE che sono - incompatibili con Perl. Le stringhe di ricerca sono considerate - come UTF-8. Questo modificatore è disponibile dalla versione - 4.1.0 di PHP di Unix e dalla versione 4.2.3 sulla piattaforma win32. - La validità UTF-8 della regola è controllata da PHP 4.3.5. - - - - - - - - - + \ No newline at end of file