Skip to content

Commit b992e36

Browse files
author
Andrew Zenin
committedMar 7, 2019
Final strokes
1 parent 64f8eda commit b992e36

File tree

3 files changed

+40
-19
lines changed

3 files changed

+40
-19
lines changed
 

‎Source/DelphiFunctions.pas

+17-3
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,13 @@ procedure delphi_get_author(ht : integer; return_value : pzval; return_value_ptr
139139
procedure delphi_get_author(ht : integer; return_value : pzval; this_ptr : pzval;
140140
return_value_used : integer; TSRMLS_DC : pointer); cdecl;
141141
{$ENDIF}
142-
142+
{$IFDEF PHP5}
143+
procedure delphi_is_uc(ht : integer; return_value : pzval; return_value_ptr : ppzval; this_ptr : pzval;
144+
return_value_used : integer; TSRMLS_DC : pointer); cdecl;
145+
{$ELSE}
146+
procedure delphi_is_uc(ht : integer; return_value : pzval; this_ptr : pzval;
147+
return_value_used : integer; TSRMLS_DC : pointer); cdecl;
148+
{$ENDIF}
143149
{$IFDEF PHP510}
144150
procedure register_delphi_component(ht : integer; return_value : pzval; return_value_ptr : ppzval; this_ptr : pzval;
145151
return_value_used : integer; TSRMLS_DC : pointer); cdecl;
@@ -641,8 +647,16 @@ procedure delphi_get_author(ht : integer; return_value : pzval; this_ptr : pzval
641647
{$ENDIF}
642648
end;
643649

644-
645-
650+
{$IFDEF PHP5}
651+
procedure delphi_is_uc(ht : integer; return_value : pzval; return_value_ptr : ppzval; this_ptr : pzval;
652+
return_value_used : integer; TSRMLS_DC : pointer); cdecl;
653+
{$ELSE}
654+
procedure delphi_is_uc(ht : integer; return_value : pzval; this_ptr : pzval;
655+
return_value_used : integer; TSRMLS_DC : pointer);
656+
{$ENDIF}
657+
begin
658+
{$IFDEF PHP_UNICE}ZVAL_TRUE{$ELSE}ZVAL_FALSE{$ENDIF}(return_value);
659+
end;
646660

647661
{$IFDEF PHP510}
648662
procedure register_delphi_object(ht : integer; return_value : pzval; return_value_ptr : ppzval; this_ptr : pzval;

‎Source/ZENDAPI.pas

+2-2
Original file line numberDiff line numberDiff line change
@@ -3433,13 +3433,13 @@ function Z_VARREC(z: pzval): TVarRec;
34333433
Result.VExtended^ := z.value.dval;
34343434
end;
34353435
IS_STRING: begin
3436-
Result.VType := {$IFDEF PHP_UNICE}vtUnicodeString{$ELSE}vtAnsiString{$ENDIF};
3436+
Result.VType := {$IFDEF PHP_UNICE}vtString{$ELSE}vtAnsiString{$ENDIF};
34373437

34383438
SetLength(P, z.value.str.len);
34393439
Move(z.value.str.val^, P[1], z.value.str.len);
34403440

34413441
{$IFDEF PHP_UNICE}
3442-
Result.VUnicodeString := Pointer(UnicodeString(p));
3442+
Result.VString := Pointer(String(p));
34433443
{$ELSE}
34443444
Result.VAnsiString := Pointer(P);
34453445
{$ENDIF}

‎Source/php4delphi.pas

+21-14
Original file line numberDiff line numberDiff line change
@@ -1791,7 +1791,7 @@ procedure TPHPEngine.RefreshLibrary;
17911791
cnt, offset : integer;
17921792
HashName : zend_ustr;
17931793
begin
1794-
SetLength(FLibraryEntryTable, FHash.Count + MyFuncs.Count + 13);
1794+
SetLength(FLibraryEntryTable, FHash.Count + MyFuncs.Count + 14);
17951795

17961796
PHP_FUNCTION(FLibraryEntryTable[0], 'delphi_date', @delphi_date);
17971797
PHP_FUNCTION(FLibraryEntryTable[1], 'delphi_extract_file_dir', @delphi_extract_file_dir);
@@ -1830,37 +1830,44 @@ procedure TPHPEngine.RefreshLibrary;
18301830
FLibraryEntryTable[7].arg_info := nil;
18311831
{$ENDIF}
18321832

1833-
FLibraryEntryTable[8].fname := 'delphi_str_date';
1834-
FLibraryEntryTable[8].handler := @delphi_str_date;
1833+
FLibraryEntryTable[8].fname := 'delphi_is_uc';
1834+
FLibraryEntryTable[8].handler := @delphi_is_uc;
18351835
{$IFDEF PHP4}
18361836
FLibraryEntryTable[8].func_arg_types := nil;
18371837
{$ELSE}
18381838
FLibraryEntryTable[8].arg_info := nil;
18391839
{$ENDIF}
18401840

1841+
FLibraryEntryTable[9].fname := 'delphi_str_date';
1842+
FLibraryEntryTable[9].handler := @delphi_str_date;
1843+
{$IFDEF PHP4}
1844+
FLibraryEntryTable[9].func_arg_types := nil;
1845+
{$ELSE}
1846+
FLibraryEntryTable[9].arg_info := nil;
1847+
{$ENDIF}
18411848

1842-
PHP_FUNCTION(FLibraryEntryTable[9], 'delphi_get_system_directory', @delphi_get_system_directory);
1843-
PHP_FUNCTION(FLibraryEntryTable[10], 'InputBox', @delphi_input_box);
1844-
PHP_FUNCTION(FLibraryEntryTable[11], 'register_delphi_component', @register_delphi_component);
1849+
PHP_FUNCTION(FLibraryEntryTable[10], 'delphi_get_system_directory', @delphi_get_system_directory);
1850+
PHP_FUNCTION(FLibraryEntryTable[11], 'InputBox', @delphi_input_box);
1851+
PHP_FUNCTION(FLibraryEntryTable[12], 'register_delphi_component', @register_delphi_component);
18451852

18461853

18471854
for cnt := 0 to FHash.Count - 1 do
18481855
begin
18491856
HashName := FHash[cnt];
18501857

18511858
{$IFNDEF COMPILER_VC9}
1852-
FLibraryEntryTable[cnt+12].fname := strdup(zend_pchar(HashName));
1859+
FLibraryEntryTable[cnt+13].fname := strdup(zend_pchar(HashName));
18531860
{$ELSE}
1854-
FLibraryEntryTable[cnt+12].fname := DupStr(zend_pchar(HashName));
1861+
FLibraryEntryTable[cnt+13].fname := DupStr(zend_pchar(HashName));
18551862
{$ENDIF}
18561863

1857-
FLibraryEntryTable[cnt+12].handler := @DispatchRequest;
1864+
FLibraryEntryTable[cnt+13].handler := @DispatchRequest;
18581865
{$IFDEF PHP4}
1859-
FLibraryEntryTable[cnt+12].func_arg_types := nil;
1866+
FLibraryEntryTable[cnt+13].func_arg_types := nil;
18601867
{$ENDIF}
18611868
end;
18621869

1863-
offset := FHash.Count + 12;
1870+
offset := FHash.Count + 13;
18641871
for cnt := 0 to MyFuncs.Count - 1 do
18651872
begin
18661873
HashName := MyFuncs[cnt];
@@ -1877,10 +1884,10 @@ procedure TPHPEngine.RefreshLibrary;
18771884
end;
18781885

18791886

1880-
FLibraryEntryTable[FHash.Count+MyFuncs.Count+12].fname := nil;
1881-
FLibraryEntryTable[FHash.Count+MyFuncs.Count+12].handler := nil;
1887+
FLibraryEntryTable[FHash.Count+MyFuncs.Count+13].fname := nil;
1888+
FLibraryEntryTable[FHash.Count+MyFuncs.Count+13].handler := nil;
18821889
{$IFDEF PHP4}
1883-
FLibraryEntryTable[FHash.Count+MyFuncs.Count+12].func_arg_types := nil;
1890+
FLibraryEntryTable[FHash.Count+MyFuncs.Count+13].func_arg_types := nil;
18841891
{$ENDIF}
18851892

18861893
FLibraryModule.functions := @FLibraryEntryTable[0];

0 commit comments

Comments
 (0)
Please sign in to comment.