|
5 | 5 | { Author: }
|
6 | 6 | { Serhiy Perevoznyk }
|
7 | 7 | { serge_perevoznyk@hotmail.com }
|
8 | | -{ http://users.chello.be/ws36637 } |
9 | | -{ http://delphi32.blogspot.com } |
| 8 | +{ https://users.chello.be/ws36637 } |
| 9 | +{ https://delphi32.blogspot.com } |
10 | 10 | {*******************************************************}
|
11 | 11 |
|
12 | | -{ $Id: PHP.INC,v 7.4 10/2009 delphi32 Exp $ } |
| 12 | +{ $Id: PHP.INC,v 7.4 07/2020 delphi32 Exp $ } |
13 | 13 |
|
14 | 14 | {IMPORTANT:
|
15 | | -If you are using PHP version 5.0 please add $DEFINE PHP5 |
16 | | -If you are using PHP version 5.0.4 please add $DEFINE PHP504 |
17 | | -If you are using PHP version 5.1.0 or higher please add $DEFINE PHP510 |
18 | | -If you are using PHP version 5.1.1 or higher please add $DEFINE PHP511 |
19 | | -If you are using PHP version 5.1.2 or higher please add $DEFINE PHP512 |
20 | | -If you are using PHP version 5.2.0 or higher please add $DEFINE PHP520 |
21 | | -IF you are using PHP version 5.3.0 or higher please add $DEFINE PHP530 |
22 | | -IF you are using PHP version 5.4.0 or higher please add $DEFINE PHP540 |
23 | | -IF you are using PHP version 5.5.0 or higher please add $DEFINE PHP550 |
24 | | -IF you are using PHP version 5.6.0 or higher please add $DEFINE PHP560 |
25 | | -IF you are using PHP cersion 7.0.0 or higher please add $DEFINE PHP700 |
26 | | -If you are using PHP compiled via: |
27 | | -id, define compiler_id |
28 | | -VC9 COMPILER_VC9 |
29 | | -VC10 COMPILER_VC10 |
30 | | -VC11 COMPILER_VC11 |
31 | | -VC12 COMPILER_VC12 |
32 | | -VC13 COMPILER_VC13 |
33 | | -VC14 COMPILER_VC14 |
34 | | -Sorry for such complicated configuration, but PHP team does not keep |
35 | | -backward compatibility between PHP versions. |
| 15 | +Define suitable PHP version, the table is represented below: |
| 16 | +| Version | Directive | |
| 17 | + 5.0 $DEFINE PHP5 |
| 18 | + 5.0.4 $DEFINE PHP504 |
| 19 | + 5.1.0 $DEFINE PHP510 |
| 20 | + 5.1.1 $DEFINE PHP511 |
| 21 | + 5.1.2 $DEFINE PHP512 |
| 22 | + 5.2 $DEFINE PHP520 |
| 23 | + 5.3 $DEFINE PHP530 |
| 24 | + 5.4 $DEFINE PHP540 |
| 25 | + 5.5 $DEFINE PHP550 |
| 26 | + 5.6 $DEFINE PHP560 |
| 27 | + 7.0 $DEFINE PHP7 |
| 28 | + 7.1 $DEFINE PHP710 |
| 29 | + |
| 30 | +Define suitable visual library |
| 31 | +| Library | Directive | |
| 32 | + VCL $DEFINE VCL |
| 33 | + FMX $DEFINE FMX |
36 | 34 | }
|
37 | 35 |
|
38 | | -{PHP5 must be defined if you are using PHP5} |
39 | | -{$DEFINE PHP5} |
40 | | - |
41 | | -{For PHP5 you have to define the subversion of PHP} |
42 | | -{$DEFINE PHP504} |
43 | | -{$DEFINE PHP510} |
44 | | -{$DEFINE PHP511} |
45 | | -{$DEFINE PHP512} |
46 | | -{$DEFINE PHP520} |
47 | | -{$DEFINE PHP530} |
48 | | -{$DEFINE PHP540} |
49 | | -{$DEFINE PHP550} |
| 36 | +//Version |
50 | 37 | {$DEFINE PHP560}
|
| 38 | +{$DEFINE VCL} |
| 39 | + |
| 40 | +//Features |
| 41 | +{$DEFINE PHP_UNICODE} |
| 42 | + //PHP unicode support *Enables WideString and UnicodeString |
| 43 | +{$DEFINE REGISTER_COLOURS} |
| 44 | + //constants for Delphi colours |
| 45 | +{.$DEFINE QUIET_LOAD} |
| 46 | + //Do not show errors while loading php library |
| 47 | +{.$DEFINE PHP4DELPHI_AUTOLOAD} |
| 48 | + //Load php library at initialization |
| 49 | +{.$DEFINE PHP4DELPHI_AUTOUNLOAD} |
| 50 | + // Unload php library at finalization |
| 51 | + |
| 52 | +//Compiler switches |
| 53 | +{.$DEFINE php_side_handler} |
| 54 | + //enable ability to define own error handler from php side ~NON_TC |
| 55 | +{.$DEFINE COMPILER_php7pv} |
| 56 | + // use macroses from PHP sources patch |
| 57 | + // https://github.com/resistancelion/no-name-engine/tree/master/php-src |
| 58 | +{.$DEFINE PHP_DEBUG} |
| 59 | + //use debug libraries (php7debug, f.e) |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | +//E N D |
| 75 | +{$WARN UNIT_DEPRECATED OFF} |
| 76 | +{$IFDEF PHP_UNICODE} {$DEFINE UNICODE} {$ENDIF} |
| 77 | + |
| 78 | +{$IFDEF PHP710} {$DEFINE PHP700} {$ENDIF} |
| 79 | +{$IFDEF PHP700} {$DEFINE PHP7} {$ENDIF} |
| 80 | + |
| 81 | +{$IFDEF PHP7} {$DEFINE PHP560} {$ENDIF} |
| 82 | +{$IFDEF PHP560} {$DEFINE PHP550} {$ENDIF} |
| 83 | +{$IFDEF PHP550} {$DEFINE PHP540} {$ENDIF} |
| 84 | +{$IFDEF PHP540} {$DEFINE PHP530} {$ENDIF} |
51 | 85 | {$IFDEF PHP530}
|
| 86 | + {$DEFINE PHP520} |
52 | 87 | {$DEFINE ZEND_WIN32}
|
53 | 88 | {$DEFINE PHP_COMPILER_ID}
|
54 | 89 | {$ENDIF}
|
55 | | -{$DEFINE soulengine_build} |
56 | | -{.$DEFINE PHP7} |
57 | | -{.$DEFINE CUTTED_PHP7dll} |
58 | | - {$IFDEF PHP7} |
59 | | - {$DEFINE COMPILER_VC14} |
60 | | - {$DEFINE PHP560} |
61 | | - {$DEFINE PHP700} |
62 | | - {$ENDIF} |
63 | | -{$IFDEF PHP560} |
64 | | - {$DEFINE PHP530} |
65 | | - {$DEFINE PHP540} |
66 | | - {$DEFINE PHP550} |
67 | | - {$DEFINE ZEND_WIN32} |
68 | | - {$DEFINE PHP_COMPILER_ID} |
69 | | -{$ENDIF} |
70 | | -//Warning! You must select one of the compilers |
71 | | -//Look at the version of PHP you have installed |
72 | | -//I DO recommend to use php-5.6.40-Win32-VC11-x86, specially if you are using |
73 | | -//php4delphi component with php5ts.dll. If you are building PHP extensions, |
74 | | -//you have to define the right compiler, otherwise you would have incompatibility |
75 | | -//problems |
76 | | - |
| 90 | +{$IFDEF PHP520} {$DEFINE PHP512} {$ENDIF} |
| 91 | +{$IFDEF PHP512} {$DEFINE PHP511} {$ENDIF} |
| 92 | +{$IFDEF PHP511} {$DEFINE PHP510} {$ENDIF} |
| 93 | +{$IFDEF PHP510} {$DEFINE PHP504} {$ENDIF} |
| 94 | +{$IFDEF PHP504} {$DEFINE PHP5} {$ENDIF} |
77 | 95 | {$IFDEF PHP_COMPILER_ID}
|
78 | 96 | {$DEFINE COMPILER_VC9}
|
79 | 97 | {$IFNDEF PHP7}
|
80 | 98 | {$IFDEF PHP550} {$DEFINE COMPILER_VC11} {$ENDIF}
|
81 | | - {$ENDIF} |
| 99 | + {$ELSE} |
| 100 | + {$DEFINE COMPILER_VC14} |
| 101 | + {$ENDIF} |
82 | 102 | {$ENDIF}
|
83 | 103 |
|
84 | | -{$WARN UNIT_DEPRECATED OFF} |
85 | | - |
86 | | -{.$DEFINE QUIET_LOAD} //Do not show error while loading php4ts.dll or php5ts.dll (depends from php version) |
87 | | - |
88 | | -{.$DEFINE PHP4DELPHI_AUTOLOAD} //Load php4ts.dll or php5ts.dll at initialization |
89 | | -{.$DEFINE PHP4DELPHI_AUTOUNLOAD} // Unload php4ts.dll or php5ts.dll at finalization |
90 | | - |
91 | | -{.$DEFINE PHP_DEBUG} |
92 | | - |
93 | | -{$DEFINE REGISTER_COLORS} //register php constants for colors |
94 | | - |
95 | 104 | {$IFNDEF LINUX}
|
96 | | - {$DEFINE ZTS} {zts support} |
97 | | -{$ENDIF} |
98 | | - |
99 | | -{$IF Defined(COMPILER_VC11) and Defined(PHP560) or Defined(PHP7)} |
100 | | - {$DEFINE PHP_UNICODE} |
101 | | -{$ELSEIF Defined(COMPILER_VC12) or Defined(COMPILER_VC13) or Defined(COMPILER_VC14) or Defined(COMPILER_VC15)} |
102 | | - {$DEFINE PHP_UNICODE} |
| 105 | + {$DEFINE ZTS} {zend thread safety support} |
103 | 106 | {$ENDIF}
|
104 | 107 |
|
105 | 108 | {$IFNDEF VER80} {Delphi 1.0}
|
@@ -205,6 +208,14 @@ backward compatibility between PHP versions.
|
205 | 208 | {$WARNINGS OFF}
|
206 | 209 | {$ENDIF}
|
207 | 210 |
|
208 | | -{$IFDEF MSWINDOWS} |
209 | | -{$DEFINE WINDOWS} |
| 211 | +{$IFDEF MSWINDOWS} {$DEFINE WINDOWS} {$ENDIF} |
| 212 | +{$IFDEF FPC} |
| 213 | + {$IFDEF FMX} {$UNDEF FMX} {$ENDIF} |
| 214 | + {$IFDEF VCL} {$UNDEF VCL} {$ENDIF} |
| 215 | + {$DEFINE LCL} |
| 216 | +{$ELSE} |
| 217 | + {$IFDEF LCL} |
| 218 | + {$UNDEF LCL} |
| 219 | + {$DEFINE VCL} |
| 220 | + {$ENDIF} |
210 | 221 | {$ENDIF}
|
0 commit comments