├── Demos
├── Extensions
│ ├── css
│ │ ├── CREDITS
│ │ └── EXPERIMENTAL
│ ├── killer
│ │ ├── CREDITS
│ │ ├── killer.res
│ │ ├── killer.dpr
│ │ ├── Unit1.dfm
│ │ ├── tests
│ │ │ └── test_killer.php
│ │ ├── Unit1.dti
│ │ └── Unit1.pas
│ ├── skeleton
│ │ ├── EXPERIMENTAL
│ │ ├── CREDITS
│ │ └── tests
│ │ │ ├── skeleton.php
│ │ │ └── test_skeleton.php
│ ├── Delphi Class 1
│ │ ├── readme.txt
│ │ ├── delphi_class.res
│ │ ├── delphi_class_module.ddp
│ │ ├── delphi_class.php
│ │ ├── delphi_class.dpr
│ │ ├── delphi_class_module.dti
│ │ └── delphi_class_module.dfm
│ ├── Delphi Class 2
│ │ ├── readme.txt
│ │ ├── delphi_class2.php
│ │ ├── delphi_class.php
│ │ └── delphi_class2.dpr
│ ├── Math
│ │ ├── extmain.ddp
│ │ ├── delphi_math.res
│ │ ├── delphi_math.dpr
│ │ ├── test_math.php
│ │ ├── extmain.dti
│ │ ├── extmain.dfm
│ │ └── extmain.pas
│ ├── phpDLL
│ │ ├── phpDLL.res
│ │ ├── phpDLL.dpr
│ │ ├── Unit1.dfm
│ │ ├── testdll.php
│ │ ├── Unit1.dti
│ │ └── Unit1.pas
│ ├── Resources
│ │ ├── Unit1.ddp
│ │ ├── res_ext.res
│ │ ├── res_ext.dpr
│ │ ├── test_resource.php
│ │ ├── Unit1.dti
│ │ ├── Unit1.dfm
│ │ └── Unit1.pas
│ ├── reference
│ │ ├── php_ref.res
│ │ ├── php_ref.dpr
│ │ ├── Unit1.dfm
│ │ ├── testref.php
│ │ └── Unit1.pas
│ ├── array result
│ │ ├── rarray.res
│ │ ├── rarray.dpr
│ │ ├── Unit1.dfm
│ │ ├── rarray.php
│ │ └── Unit1.pas
│ ├── Class demo
│ │ ├── class_demo.res
│ │ ├── test_class.php
│ │ ├── class_demo.dpr
│ │ ├── dm_Class.dti
│ │ ├── dm_Class.dfm
│ │ └── dm_Class.pas
│ ├── Borland Demo
│ │ ├── borland_demo.res
│ │ ├── borland_demo.php
│ │ ├── borland_demo.dpr
│ │ └── Unit1.dti
│ └── php class
│ │ └── test_class.php
├── psvPHP
│ ├── console
│ │ ├── test.php
│ │ └── phpcon.dpr
│ ├── sample1
│ │ ├── test.php
│ │ ├── php.gif
│ │ ├── Unit1.ddp
│ │ ├── zend1.gif
│ │ ├── zend2.gif
│ │ ├── Project1.res
│ │ ├── internal.RES
│ │ ├── internal.rc
│ │ └── Project1.dpr
│ ├── Logo
│ │ ├── LogoDemo.res
│ │ ├── LogoDemo.dpr
│ │ ├── uMain.dfm
│ │ └── uMain.pas
│ ├── sample2
│ │ ├── Unit1.ddp
│ │ ├── Project1.res
│ │ ├── Project1.dpr
│ │ ├── Unit1.pas
│ │ └── Unit1.dfm
│ ├── Encryption
│ │ ├── uMain.ddp
│ │ ├── EncDemo.res
│ │ ├── EncDemo.dpr
│ │ └── uMain.pas
│ ├── Graph
│ │ ├── Project1.res
│ │ ├── Project1.dpr
│ │ ├── Unit1.dfm
│ │ └── Unit1.pas
│ ├── sample3
│ │ ├── Project1.res
│ │ ├── Project1.dpr
│ │ ├── Unit1.pas
│ │ └── Unit1.dfm
│ ├── Library demo
│ │ ├── Project1.res
│ │ ├── Project1.dpr
│ │ ├── Unit1.dfm
│ │ └── Unit1.pas
│ ├── array demo
│ │ ├── Project1.res
│ │ ├── Project1.dpr
│ │ ├── Unit1.dfm
│ │ └── Unit1.pas
│ ├── sample4
│ │ ├── frm_PHPTest.ddp
│ │ ├── psvPHP_test.res
│ │ ├── psvPHP_test.dpr
│ │ ├── frm_PHPTest.pas
│ │ └── frm_PHPTest.dfm
│ ├── Components
│ │ ├── ComponentsDemo.res
│ │ ├── ComponentsDemo.dpr
│ │ ├── Unit1.dfm
│ │ └── Unit1.pas
│ ├── Dynamic Array
│ │ └── dynamic_array.dpr
│ └── Custom Library
│ │ └── phpShellLibrary.pas
├── php4Applications
│ ├── MS Word
│ │ ├── test.php
│ │ └── Doc1.doc
│ ├── Visual Basic
│ │ ├── test.php
│ │ ├── php_VB.vbw
│ │ ├── MSSCCPRJ.SCC
│ │ ├── php_VB.vbp
│ │ ├── php_module.bas
│ │ └── Form1.frm
│ ├── C#
│ │ └── PHP4DelphiDemo
│ │ │ ├── test.php
│ │ │ ├── App.ico
│ │ │ ├── app.config
│ │ │ ├── PHP4DelphiDemo.sln
│ │ │ ├── PHP4DelphiDemo.csproj.user
│ │ │ └── AssemblyInfo.cs
│ ├── Delphi
│ │ ├── test.php
│ │ ├── Project1.res
│ │ ├── Project1.dpr
│ │ ├── Unit1.dfm
│ │ └── Unit1.pas
│ ├── C++ VS 2005
│ │ ├── test.php
│ │ ├── StdAfx.cpp
│ │ ├── cdemo.dsw
│ │ ├── StdAfx.h
│ │ └── cdemo.sln
│ ├── C++ VS 6.0
│ │ ├── test.php
│ │ ├── StdAfx.cpp
│ │ ├── cdemo.dsw
│ │ └── StdAfx.h
│ ├── Delphi .NET
│ │ ├── php4DelphiDemo.res
│ │ ├── php4Delphi.TWinForm.resources
│ │ └── php4Delphi.Standard.pas
│ └── VB .NET
│ │ └── php4delphi
│ │ ├── php4delphi
│ │ ├── My Project
│ │ │ ├── Application.myapp
│ │ │ └── Application.Designer.vb
│ │ ├── php4delphi.vbproj.user
│ │ ├── ApplicationEvents.vb
│ │ ├── Form1.vb
│ │ ├── Form1.Designer.vb
│ │ └── php4delphi.vbproj
│ │ └── php4delphi.sln
├── Bonus
│ ├── PHPEncoder
│ │ ├── test.php
│ │ └── phpencoder.dpr
│ ├── wincon
│ │ ├── Bin
│ │ │ ├── php_wincon.dll
│ │ │ └── test_wincon.php
│ │ ├── resource.h
│ │ ├── wincon.dsw
│ │ ├── wincon.sln
│ │ ├── php_wincon.h
│ │ └── wincon.rc
│ ├── phpRegistry
│ │ └── Bin
│ │ │ └── php_registry.dll
│ └── JpegConverter
│ │ └── php_jpeg.php
└── Tutorial
│ ├── Step.01
│ ├── Project1.res
│ ├── Unit1.dfm
│ ├── Project1.dpr
│ ├── Unit1.dti
│ └── Unit1.pas
│ ├── Step.02
│ ├── Project1.res
│ ├── Unit1.dfm
│ ├── Project1.dpr
│ ├── Unit1.dti
│ └── Unit1.pas
│ ├── Step.03
│ ├── Project1.res
│ ├── Unit1.dfm
│ ├── Project1.dpr
│ ├── Unit1.dti
│ └── Unit1.pas
│ ├── Step.04
│ ├── Project1.res
│ ├── Project1.dpr
│ ├── Unit1.dfm
│ ├── Unit1.dti
│ └── Unit1.pas
│ ├── Step.05
│ ├── Project1.res
│ ├── Project1.dpr
│ ├── Unit1.dfm
│ ├── Unit1.dti
│ └── Unit1.pas
│ └── Step.06
│ └── test_script.php
├── php4App.res
├── PHP4DELPHI.HLP
├── php4Delphi.pdf
├── php4delphi.dcr
├── php4DelphiD5.res
├── php4DelphiD6.res
├── php4DelphiD7.res
├── php4DelphiR5.res
├── php4DelphiR6.res
├── php4DelphiR7.res
├── PHP4DelphiD2006.res
├── PHPProjectWizard.res
├── php4DelphiD2005.res
├── php4DelphiR2005.res
├── php4DelphiR2006.res
├── ExtensionBuilder
├── PHPEXT.RES
├── phpExtBuilderD5.res
├── phpExtBuilderD6.res
├── phpExtBuilderD7.res
├── frm_Functions.pas
├── phpExtBuilderD5.dpk
├── phpExtBuilderD6.dpk
├── phpExtBuilderD7.dpk
├── frm_Functions.dfm
└── Builder.Inc
├── php4Applications
├── PHP4
│ └── php4App.dll
├── PHP511
│ └── php4App.dll
└── PHP512
│ └── php4App.dll
├── php4Delphi2005.bdsgroup
├── php4Delphi2006.bdsgroup
├── php4delphi.cnt
├── Php4DelphiGroup5.bpg
├── Php4DelphiGroup7.bpg
├── php4DelphiD6.dpk
├── php4DelphiD5.dpk
├── php4DelphiD7.dpk
├── PHP4DelphiD2006.dpk
├── php4DelphiD2005.dpk
├── php4App.dpr
├── php4DelphiR5.dpk
├── php4DelphiR6.dpk
├── php4DelphiR7.dpk
├── php4DelphiR2005.dpk
├── php4DelphiR2006.dpk
├── phpApp.pas
├── php4AppIntf.pas
├── php4DelphiWeb.pas
├── zend_dynamic_array.pas
├── phpAbout.pas
├── phpWeb.pas
└── license.txt
/Demos/Extensions/css/CREDITS:
--------------------------------------------------------------------------------
1 | css
--------------------------------------------------------------------------------
/Demos/Extensions/css/EXPERIMENTAL:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Demos/Extensions/killer/CREDITS:
--------------------------------------------------------------------------------
1 | killer
--------------------------------------------------------------------------------
/Demos/Extensions/skeleton/EXPERIMENTAL:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Demos/Extensions/skeleton/CREDITS:
--------------------------------------------------------------------------------
1 | extname
--------------------------------------------------------------------------------
/Demos/psvPHP/console/test.php:
--------------------------------------------------------------------------------
1 |
4 |
5 |
--------------------------------------------------------------------------------
/Demos/psvPHP/sample1/test.php:
--------------------------------------------------------------------------------
1 |
4 |
5 |
--------------------------------------------------------------------------------
/php4App.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/php4App.res
--------------------------------------------------------------------------------
/PHP4DELPHI.HLP:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/PHP4DELPHI.HLP
--------------------------------------------------------------------------------
/php4Delphi.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/php4Delphi.pdf
--------------------------------------------------------------------------------
/php4delphi.dcr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/php4delphi.dcr
--------------------------------------------------------------------------------
/Demos/Extensions/Delphi Class 1/readme.txt:
--------------------------------------------------------------------------------
1 | This demo can be compiled using Delphi 7 or higher
--------------------------------------------------------------------------------
/Demos/Extensions/Delphi Class 2/readme.txt:
--------------------------------------------------------------------------------
1 | This demo can be compiled using Delphi 7 or higher
--------------------------------------------------------------------------------
/Demos/php4Applications/MS Word/test.php:
--------------------------------------------------------------------------------
1 |
2 | $z = $x + $y;
3 | phpinfo();
4 | ?>
5 |
--------------------------------------------------------------------------------
/php4DelphiD5.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/php4DelphiD5.res
--------------------------------------------------------------------------------
/php4DelphiD6.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/php4DelphiD6.res
--------------------------------------------------------------------------------
/php4DelphiD7.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/php4DelphiD7.res
--------------------------------------------------------------------------------
/php4DelphiR5.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/php4DelphiR5.res
--------------------------------------------------------------------------------
/php4DelphiR6.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/php4DelphiR6.res
--------------------------------------------------------------------------------
/php4DelphiR7.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/php4DelphiR7.res
--------------------------------------------------------------------------------
/Demos/php4Applications/Visual Basic/test.php:
--------------------------------------------------------------------------------
1 |
2 | $z = $x + $y;
3 | phpinfo();
4 | ?>
5 |
--------------------------------------------------------------------------------
/PHP4DelphiD2006.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/PHP4DelphiD2006.res
--------------------------------------------------------------------------------
/PHPProjectWizard.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/PHPProjectWizard.res
--------------------------------------------------------------------------------
/php4DelphiD2005.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/php4DelphiD2005.res
--------------------------------------------------------------------------------
/php4DelphiR2005.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/php4DelphiR2005.res
--------------------------------------------------------------------------------
/php4DelphiR2006.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/php4DelphiR2006.res
--------------------------------------------------------------------------------
/Demos/Bonus/PHPEncoder/test.php:
--------------------------------------------------------------------------------
1 |
2 | dl('phpencoder.dll');
3 | ex_dec();
4 | ?>
5 | x`xafng !3
--------------------------------------------------------------------------------
/Demos/php4Applications/C#/PHP4DelphiDemo/test.php:
--------------------------------------------------------------------------------
1 |
2 | $z = $x + $y;
3 | phpinfo();
4 | ?>
5 |
--------------------------------------------------------------------------------
/Demos/php4Applications/Delphi/test.php:
--------------------------------------------------------------------------------
1 |
2 | $z = $x + $y;
3 | echo "Result " ;
4 | echo $z;
5 | ?>
6 |
--------------------------------------------------------------------------------
/Demos/psvPHP/sample1/php.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/Demos/psvPHP/sample1/php.gif
--------------------------------------------------------------------------------
/ExtensionBuilder/PHPEXT.RES:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/ExtensionBuilder/PHPEXT.RES
--------------------------------------------------------------------------------
/Demos/php4Applications/C++ VS 2005/test.php:
--------------------------------------------------------------------------------
1 |
2 | $z = $x + $y;
3 | echo "Result " ;
4 | echo $z;
5 | ?>
6 |
--------------------------------------------------------------------------------
/Demos/php4Applications/C++ VS 6.0/test.php:
--------------------------------------------------------------------------------
1 |
2 | $z = $x + $y;
3 | echo "Result " ;
4 | echo $z;
5 | ?>
6 |
--------------------------------------------------------------------------------
/Demos/psvPHP/Logo/LogoDemo.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/Demos/psvPHP/Logo/LogoDemo.res
--------------------------------------------------------------------------------
/Demos/psvPHP/sample1/Unit1.ddp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/Demos/psvPHP/sample1/Unit1.ddp
--------------------------------------------------------------------------------
/Demos/psvPHP/sample1/zend1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/Demos/psvPHP/sample1/zend1.gif
--------------------------------------------------------------------------------
/Demos/psvPHP/sample1/zend2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/Demos/psvPHP/sample1/zend2.gif
--------------------------------------------------------------------------------
/Demos/psvPHP/sample2/Unit1.ddp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/Demos/psvPHP/sample2/Unit1.ddp
--------------------------------------------------------------------------------
/Demos/Extensions/Math/extmain.ddp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/Demos/Extensions/Math/extmain.ddp
--------------------------------------------------------------------------------
/Demos/psvPHP/Encryption/uMain.ddp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/Demos/psvPHP/Encryption/uMain.ddp
--------------------------------------------------------------------------------
/Demos/psvPHP/Graph/Project1.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/Demos/psvPHP/Graph/Project1.res
--------------------------------------------------------------------------------
/Demos/psvPHP/sample1/Project1.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/Demos/psvPHP/sample1/Project1.res
--------------------------------------------------------------------------------
/Demos/psvPHP/sample1/internal.RES:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/Demos/psvPHP/sample1/internal.RES
--------------------------------------------------------------------------------
/Demos/psvPHP/sample2/Project1.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/Demos/psvPHP/sample2/Project1.res
--------------------------------------------------------------------------------
/Demos/psvPHP/sample3/Project1.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/Demos/psvPHP/sample3/Project1.res
--------------------------------------------------------------------------------
/php4Applications/PHP4/php4App.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/php4Applications/PHP4/php4App.dll
--------------------------------------------------------------------------------
/Demos/Extensions/killer/killer.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/Demos/Extensions/killer/killer.res
--------------------------------------------------------------------------------
/Demos/Extensions/phpDLL/phpDLL.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/Demos/Extensions/phpDLL/phpDLL.res
--------------------------------------------------------------------------------
/Demos/Tutorial/Step.01/Project1.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/Demos/Tutorial/Step.01/Project1.res
--------------------------------------------------------------------------------
/Demos/Tutorial/Step.02/Project1.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/Demos/Tutorial/Step.02/Project1.res
--------------------------------------------------------------------------------
/Demos/Tutorial/Step.03/Project1.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/Demos/Tutorial/Step.03/Project1.res
--------------------------------------------------------------------------------
/Demos/Tutorial/Step.04/Project1.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/Demos/Tutorial/Step.04/Project1.res
--------------------------------------------------------------------------------
/Demos/Tutorial/Step.05/Project1.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/Demos/Tutorial/Step.05/Project1.res
--------------------------------------------------------------------------------
/Demos/psvPHP/Encryption/EncDemo.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/Demos/psvPHP/Encryption/EncDemo.res
--------------------------------------------------------------------------------
/php4Applications/PHP511/php4App.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/php4Applications/PHP511/php4App.dll
--------------------------------------------------------------------------------
/php4Applications/PHP512/php4App.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/php4Applications/PHP512/php4App.dll
--------------------------------------------------------------------------------
/Demos/Bonus/wincon/Bin/php_wincon.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/Demos/Bonus/wincon/Bin/php_wincon.dll
--------------------------------------------------------------------------------
/Demos/Extensions/Math/delphi_math.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/Demos/Extensions/Math/delphi_math.res
--------------------------------------------------------------------------------
/Demos/Extensions/Resources/Unit1.ddp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/Demos/Extensions/Resources/Unit1.ddp
--------------------------------------------------------------------------------
/Demos/Extensions/Resources/res_ext.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/Demos/Extensions/Resources/res_ext.res
--------------------------------------------------------------------------------
/Demos/Extensions/reference/php_ref.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/Demos/Extensions/reference/php_ref.res
--------------------------------------------------------------------------------
/Demos/psvPHP/Library demo/Project1.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/Demos/psvPHP/Library demo/Project1.res
--------------------------------------------------------------------------------
/Demos/psvPHP/array demo/Project1.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/Demos/psvPHP/array demo/Project1.res
--------------------------------------------------------------------------------
/Demos/psvPHP/sample4/frm_PHPTest.ddp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/Demos/psvPHP/sample4/frm_PHPTest.ddp
--------------------------------------------------------------------------------
/Demos/psvPHP/sample4/psvPHP_test.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/Demos/psvPHP/sample4/psvPHP_test.res
--------------------------------------------------------------------------------
/ExtensionBuilder/phpExtBuilderD5.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/ExtensionBuilder/phpExtBuilderD5.res
--------------------------------------------------------------------------------
/ExtensionBuilder/phpExtBuilderD6.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/ExtensionBuilder/phpExtBuilderD6.res
--------------------------------------------------------------------------------
/ExtensionBuilder/phpExtBuilderD7.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/ExtensionBuilder/phpExtBuilderD7.res
--------------------------------------------------------------------------------
/Demos/Extensions/array result/rarray.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/Demos/Extensions/array result/rarray.res
--------------------------------------------------------------------------------
/Demos/php4Applications/MS Word/Doc1.doc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/Demos/php4Applications/MS Word/Doc1.doc
--------------------------------------------------------------------------------
/Demos/php4Applications/Visual Basic/php_VB.vbw:
--------------------------------------------------------------------------------
1 | Form1 = 66, 66, 702, 613, , 22, 22, 658, 569, C
2 | php_module = 44, 44, 680, 591,
3 |
--------------------------------------------------------------------------------
/Demos/Extensions/Class demo/class_demo.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/Demos/Extensions/Class demo/class_demo.res
--------------------------------------------------------------------------------
/Demos/php4Applications/Delphi/Project1.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/Demos/php4Applications/Delphi/Project1.res
--------------------------------------------------------------------------------
/Demos/psvPHP/Components/ComponentsDemo.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/Demos/psvPHP/Components/ComponentsDemo.res
--------------------------------------------------------------------------------
/Demos/psvPHP/sample1/internal.rc:
--------------------------------------------------------------------------------
1 | php 23 DISCARDABLE php.gif
2 | zend2 23 DISCARDABLE zend2.gif
3 | zend1 23 DISCARDABLE zend1.gif
4 |
--------------------------------------------------------------------------------
/Demos/Bonus/phpRegistry/Bin/php_registry.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/Demos/Bonus/phpRegistry/Bin/php_registry.dll
--------------------------------------------------------------------------------
/Demos/Extensions/Borland Demo/borland_demo.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/Demos/Extensions/Borland Demo/borland_demo.res
--------------------------------------------------------------------------------
/Demos/Extensions/Delphi Class 1/delphi_class.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/Demos/Extensions/Delphi Class 1/delphi_class.res
--------------------------------------------------------------------------------
/Demos/php4Applications/C#/PHP4DelphiDemo/App.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/Demos/php4Applications/C#/PHP4DelphiDemo/App.ico
--------------------------------------------------------------------------------
/Demos/php4Applications/Delphi .NET/php4DelphiDemo.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/Demos/php4Applications/Delphi .NET/php4DelphiDemo.res
--------------------------------------------------------------------------------
/Demos/Extensions/Delphi Class 1/delphi_class_module.ddp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/Demos/Extensions/Delphi Class 1/delphi_class_module.ddp
--------------------------------------------------------------------------------
/Demos/php4Applications/Delphi .NET/php4Delphi.TWinForm.resources:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perevoznyk/php4delphi/HEAD/Demos/php4Applications/Delphi .NET/php4Delphi.TWinForm.resources
--------------------------------------------------------------------------------
/Demos/Tutorial/Step.01/Unit1.dfm:
--------------------------------------------------------------------------------
1 | object PHPExtension1: TPHPExtension1
2 | OldCreateOrder = False
3 | Version = '0.0'
4 | Functions = <>
5 | Height = 0
6 | Width = 0
7 | end
8 |
--------------------------------------------------------------------------------
/Demos/Tutorial/Step.02/Unit1.dfm:
--------------------------------------------------------------------------------
1 | object PHPExtension1: TPHPExtension1
2 | OldCreateOrder = False
3 | Version = '1.0'
4 | Functions = <>
5 | ModuleName = 'mymodule'
6 | Height = 0
7 | Width = 0
8 | end
9 |
--------------------------------------------------------------------------------
/Demos/php4Applications/C#/PHP4DelphiDemo/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Demos/php4Applications/Visual Basic/MSSCCPRJ.SCC:
--------------------------------------------------------------------------------
1 | [SCC]
2 | SCC=This is a source code control file
3 | [php_VB.vbp]
4 | SCC_Project_Name=this project is not under source code control
5 | SCC_Aux_Path=
6 |
--------------------------------------------------------------------------------
/Demos/psvPHP/Graph/Project1.dpr:
--------------------------------------------------------------------------------
1 | program Project1;
2 |
3 | uses
4 | Forms,
5 | Unit1 in 'Unit1.pas' {Form1};
6 |
7 | {$R *.RES}
8 |
9 | begin
10 | Application.Initialize;
11 | Application.CreateForm(TForm1, Form1);
12 | Application.Run;
13 | end.
14 |
--------------------------------------------------------------------------------
/Demos/psvPHP/Logo/LogoDemo.dpr:
--------------------------------------------------------------------------------
1 | program LogoDemo;
2 |
3 | uses
4 | Forms,
5 | uMain in 'uMain.pas' {Form1};
6 |
7 | {$R *.RES}
8 |
9 | begin
10 | Application.Initialize;
11 | Application.CreateForm(TForm1, Form1);
12 | Application.Run;
13 | end.
14 |
--------------------------------------------------------------------------------
/Demos/psvPHP/sample3/Project1.dpr:
--------------------------------------------------------------------------------
1 | program Project1;
2 |
3 | uses
4 | Forms,
5 | Unit1 in 'Unit1.pas' {Form1};
6 |
7 | {$R *.res}
8 |
9 | begin
10 | Application.Initialize;
11 | Application.CreateForm(TForm1, Form1);
12 | Application.Run;
13 | end.
14 |
--------------------------------------------------------------------------------
/Demos/psvPHP/Library demo/Project1.dpr:
--------------------------------------------------------------------------------
1 | program Project1;
2 |
3 | uses
4 | Forms,
5 | Unit1 in 'Unit1.pas' {Form1};
6 |
7 | {$R *.RES}
8 |
9 | begin
10 | Application.Initialize;
11 | Application.CreateForm(TForm1, Form1);
12 | Application.Run;
13 | end.
14 |
--------------------------------------------------------------------------------
/Demos/psvPHP/array demo/Project1.dpr:
--------------------------------------------------------------------------------
1 | program Project1;
2 |
3 | uses
4 | Forms,
5 | Unit1 in 'Unit1.pas' {Form1};
6 |
7 | {$R *.RES}
8 |
9 | begin
10 | Application.Initialize;
11 | Application.CreateForm(TForm1, Form1);
12 | Application.Run;
13 | end.
14 |
--------------------------------------------------------------------------------
/Demos/Extensions/Class demo/test_class.php:
--------------------------------------------------------------------------------
1 |
2 | if(!extension_loaded('class_demo')) {
3 | dl('class_demo.dll');
4 | }
5 |
6 | $a = new demo_class();
7 | echo $a->get_email();
8 |
9 | echo "\n";
10 |
11 | $b = new_class();
12 | echo $b->prop;
13 |
14 | ?>
15 |
16 |
--------------------------------------------------------------------------------
/Demos/php4Applications/Delphi/Project1.dpr:
--------------------------------------------------------------------------------
1 | program Project1;
2 |
3 | uses
4 | Forms,
5 | Unit1 in 'Unit1.pas' {Form1};
6 |
7 | {$R *.RES}
8 |
9 | begin
10 | Application.Initialize;
11 | Application.CreateForm(TForm1, Form1);
12 | Application.Run;
13 | end.
14 |
--------------------------------------------------------------------------------
/Demos/psvPHP/Encryption/EncDemo.dpr:
--------------------------------------------------------------------------------
1 | program EncDemo;
2 |
3 | uses
4 | Forms,
5 | uMain in 'uMain.pas' {frmMain};
6 |
7 | {$R *.res}
8 |
9 | begin
10 | Application.Initialize;
11 | Application.CreateForm(TfrmMain, frmMain);
12 | Application.Run;
13 | end.
14 |
--------------------------------------------------------------------------------
/Demos/Extensions/php class/test_class.php:
--------------------------------------------------------------------------------
1 |
2 | if(!extension_loaded('php_class')) {
3 | dl('php_class.dll');
4 | }
5 |
6 | $a = new php_demo_class();
7 | echo $a->demo_email();
8 |
9 | echo "\n";
10 |
11 | $b = get_demo_class();
12 | echo $b->tool;
13 |
14 | ?>
15 |
16 |
--------------------------------------------------------------------------------
/Demos/psvPHP/Components/ComponentsDemo.dpr:
--------------------------------------------------------------------------------
1 | program ComponentsDemo;
2 |
3 | uses
4 | Forms,
5 | Unit1 in 'Unit1.pas' {frmTest};
6 |
7 | {$R *.RES}
8 |
9 | begin
10 | Application.Initialize;
11 | Application.CreateForm(TfrmTest, frmTest);
12 | Application.Run;
13 | end.
14 |
--------------------------------------------------------------------------------
/Demos/psvPHP/sample2/Project1.dpr:
--------------------------------------------------------------------------------
1 | program Project1;
2 |
3 | uses
4 | Forms,
5 | Unit1 in 'Unit1.pas' {Form1},
6 | PHP4Delphi;
7 |
8 | {$R *.RES}
9 |
10 | begin
11 | Application.Initialize;
12 | Application.CreateForm(TForm1, Form1);
13 | Application.Run;
14 | end.
15 |
--------------------------------------------------------------------------------
/Demos/psvPHP/sample4/psvPHP_test.dpr:
--------------------------------------------------------------------------------
1 | program psvPHP_test;
2 |
3 | uses
4 | Forms,
5 | frm_PHPTest in 'frm_PHPTest.pas' {frmPHPTest};
6 |
7 | {$R *.RES}
8 |
9 | begin
10 | Application.Initialize;
11 | Application.CreateForm(TfrmPHPTest, frmPHPTest);
12 | Application.Run;
13 | end.
14 |
--------------------------------------------------------------------------------
/Demos/Tutorial/Step.03/Unit1.dfm:
--------------------------------------------------------------------------------
1 | object PHPExtension1: TPHPExtension1
2 | OldCreateOrder = False
3 | Version = '1.0'
4 | Functions = <
5 | item
6 | FunctionName = 'myfunction'
7 | Tag = 0
8 | Parameters = <>
9 | end>
10 | ModuleName = 'mymodule'
11 | Height = 0
12 | Width = 0
13 | end
14 |
--------------------------------------------------------------------------------
/Demos/php4Applications/C++ VS 6.0/StdAfx.cpp:
--------------------------------------------------------------------------------
1 | // stdafx.cpp : source file that includes just the standard includes
2 | // cdemo.pch will be the pre-compiled header
3 | // stdafx.obj will contain the pre-compiled type information
4 |
5 | #include "stdafx.h"
6 |
7 | // TODO: reference any additional headers you need in STDAFX.H
8 | // and not in this file
9 |
--------------------------------------------------------------------------------
/Demos/Extensions/Delphi Class 1/delphi_class.php:
--------------------------------------------------------------------------------
1 |
2 | if(!extension_loaded('delphi_class')) {
3 | dl('delphi_class.dll');
4 | }
5 |
6 | $a = delphi_class_create("TButton", 'btnOK');
7 | delphi_set_prop($a, "Caption", "OK");
8 | echo delphi_get_prop($a, "Caption");
9 |
10 | echo "\n";
11 |
12 | delphi_class_free($a);
13 |
14 | ?>
15 |
16 |
--------------------------------------------------------------------------------
/Demos/Extensions/Resources/res_ext.dpr:
--------------------------------------------------------------------------------
1 | library res_ext;
2 |
3 | uses
4 | Windows,
5 | SysUtils,
6 | phpApp,
7 | phpModules,
8 | Unit1 in 'Unit1.pas' {res_module: TPHPExtension};
9 |
10 | {$R *.RES}
11 |
12 | begin
13 | Application.Initialize;
14 | Application.CreateForm(Tres_module, res_module);
15 | Application.Run;
16 | end.
--------------------------------------------------------------------------------
/Demos/php4Applications/C++ VS 2005/StdAfx.cpp:
--------------------------------------------------------------------------------
1 | // stdafx.cpp : source file that includes just the standard includes
2 | // cdemo.pch will be the pre-compiled header
3 | // stdafx.obj will contain the pre-compiled type information
4 |
5 | #include "stdafx.h"
6 |
7 | // TODO: reference any additional headers you need in STDAFX.H
8 | // and not in this file
9 |
--------------------------------------------------------------------------------
/Demos/Extensions/phpDLL/phpDLL.dpr:
--------------------------------------------------------------------------------
1 | library phpDLL;
2 |
3 | uses
4 | Windows,
5 | SysUtils,
6 | phpApp,
7 | phpModules,
8 | Unit1 in 'Unit1.pas' {PHPExtension1: TPHPExtension};
9 |
10 | {$R *.RES}
11 |
12 | begin
13 | Application.Initialize;
14 | Application.CreateForm(TPHPExtension1, PHPExtension1);
15 | Application.Run;
16 | end.
--------------------------------------------------------------------------------
/Demos/Tutorial/Step.01/Project1.dpr:
--------------------------------------------------------------------------------
1 | library Project1;
2 |
3 | uses
4 | Windows,
5 | SysUtils,
6 | phpApp,
7 | phpModules,
8 | Unit1 in 'Unit1.pas' {PHPExtension1: TPHPExtension};
9 |
10 | {$R *.RES}
11 |
12 | begin
13 | Application.Initialize;
14 | Application.CreateForm(TPHPExtension1, PHPExtension1);
15 | Application.Run;
16 | end.
--------------------------------------------------------------------------------
/Demos/Tutorial/Step.02/Project1.dpr:
--------------------------------------------------------------------------------
1 | library Project1;
2 |
3 | uses
4 | Windows,
5 | SysUtils,
6 | phpApp,
7 | phpModules,
8 | Unit1 in 'Unit1.pas' {PHPExtension1: TPHPExtension};
9 |
10 | {$R *.RES}
11 |
12 | begin
13 | Application.Initialize;
14 | Application.CreateForm(TPHPExtension1, PHPExtension1);
15 | Application.Run;
16 | end.
--------------------------------------------------------------------------------
/Demos/Tutorial/Step.03/Project1.dpr:
--------------------------------------------------------------------------------
1 | library Project1;
2 |
3 | uses
4 | Windows,
5 | SysUtils,
6 | phpApp,
7 | phpModules,
8 | Unit1 in 'Unit1.pas' {PHPExtension1: TPHPExtension};
9 |
10 | {$R *.RES}
11 |
12 | begin
13 | Application.Initialize;
14 | Application.CreateForm(TPHPExtension1, PHPExtension1);
15 | Application.Run;
16 | end.
--------------------------------------------------------------------------------
/Demos/Tutorial/Step.04/Project1.dpr:
--------------------------------------------------------------------------------
1 | library Project1;
2 |
3 | uses
4 | Windows,
5 | SysUtils,
6 | phpApp,
7 | phpModules,
8 | Unit1 in 'Unit1.pas' {PHPExtension1: TPHPExtension};
9 |
10 | {$R *.RES}
11 |
12 | begin
13 | Application.Initialize;
14 | Application.CreateForm(TPHPExtension1, PHPExtension1);
15 | Application.Run;
16 | end.
--------------------------------------------------------------------------------
/Demos/Tutorial/Step.05/Project1.dpr:
--------------------------------------------------------------------------------
1 | library Project1;
2 |
3 | uses
4 | Windows,
5 | SysUtils,
6 | phpApp,
7 | phpModules,
8 | Unit1 in 'Unit1.pas' {PHPExtension1: TPHPExtension};
9 |
10 | {$R *.RES}
11 |
12 | begin
13 | Application.Initialize;
14 | Application.CreateForm(TPHPExtension1, PHPExtension1);
15 | Application.Run;
16 | end.
--------------------------------------------------------------------------------
/Demos/Extensions/Borland Demo/borland_demo.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | if (isset($_GET) && !empty($_GET['action']))
4 | $action = $_GET["action"];
5 | else
6 | $action = "";
7 |
8 | if ($action == "runquery")
9 | {
10 | $id = $_GET["CustNo"];
11 | echo runquery($id);
12 | }
13 | else
14 | echo produce_page($action);
15 |
16 |
17 | ?>
18 |
19 |
--------------------------------------------------------------------------------
/Demos/Extensions/Class demo/class_demo.dpr:
--------------------------------------------------------------------------------
1 | library class_demo;
2 |
3 | uses
4 | Windows,
5 | SysUtils,
6 | phpApp,
7 | phpModules,
8 | dm_Class in 'dm_Class.pas' {classdemo: TPHPExtension};
9 |
10 | {$R *.RES}
11 |
12 | begin
13 | Application.Initialize;
14 | Application.CreateForm(Tclassdemo, classdemo);
15 | Application.Run;
16 | end.
--------------------------------------------------------------------------------
/Demos/Extensions/array result/rarray.dpr:
--------------------------------------------------------------------------------
1 | library rarray;
2 |
3 | uses
4 | Windows,
5 | SysUtils,
6 | phpApp,
7 | phpModules,
8 | Unit1 in 'Unit1.pas' {PHPExtension1: TPHPExtension};
9 |
10 | {$R *.RES}
11 |
12 | begin
13 | Application.Initialize;
14 | Application.CreateForm(TPHPExtension1, PHPExtension1);
15 | Application.Run;
16 | end.
--------------------------------------------------------------------------------
/Demos/Extensions/reference/php_ref.dpr:
--------------------------------------------------------------------------------
1 | library php_ref;
2 |
3 | uses
4 | Windows,
5 | SysUtils,
6 | phpApp,
7 | phpModules,
8 | Unit1 in 'Unit1.pas' {PHPExtension1: TPHPExtension};
9 |
10 | {$R *.RES}
11 |
12 | begin
13 | Application.Initialize;
14 | Application.CreateForm(TPHPExtension1, PHPExtension1);
15 | Application.Run;
16 | end.
--------------------------------------------------------------------------------
/Demos/Extensions/Math/delphi_math.dpr:
--------------------------------------------------------------------------------
1 | library delphi_math;
2 |
3 | uses
4 | Windows,
5 | SysUtils,
6 | phpApp,
7 | phpModules,
8 | extmain in 'extmain.pas' {MathExtension: TPHPExtension};
9 |
10 | {$R *.RES}
11 |
12 | begin
13 | Application.Initialize;
14 | Application.CreateForm(TMathExtension, MathExtension);
15 | Application.Run;
16 | end.
--------------------------------------------------------------------------------
/Demos/Extensions/Borland Demo/borland_demo.dpr:
--------------------------------------------------------------------------------
1 | library borland_demo;
2 |
3 | uses
4 | Windows,
5 | SysUtils,
6 | phpApp,
7 | phpModules,
8 | Unit1 in 'Unit1.pas' {PHPExtension1: TPHPExtension};
9 |
10 | {$R *.RES}
11 |
12 | begin
13 | Application.Initialize;
14 | Application.CreateForm(TPHPExtension1, PHPExtension1);
15 | Application.Run;
16 | end.
--------------------------------------------------------------------------------
/Demos/psvPHP/sample1/Project1.dpr:
--------------------------------------------------------------------------------
1 | program Project1;
2 |
3 | {%ToDo 'Project1.todo'}
4 |
5 | uses
6 | Forms,
7 | Unit1 in 'Unit1.pas' {frmPHPDemo},
8 | zendAPI,
9 | php4delphi,
10 | phpAPI;
11 |
12 | {$R *.RES}
13 |
14 | begin
15 | Application.Initialize;
16 | Application.CreateForm(TfrmPHPDemo, frmPHPDemo);
17 | Application.Run;
18 | end.
19 |
--------------------------------------------------------------------------------
/Demos/Extensions/killer/killer.dpr:
--------------------------------------------------------------------------------
1 | library killer;
2 |
3 | uses
4 | Windows,
5 | SysUtils,
6 | phpApp,
7 | phpModules,
8 | Unit1 in 'Unit1.pas' {killerExt: TPHPExtension},
9 | ProcessViewer in 'ProcessViewer.pas';
10 |
11 | {$R *.RES}
12 |
13 | begin
14 | Application.Initialize;
15 | Application.CreateForm(TkillerExt, killerExt);
16 | Application.Run;
17 | end.
--------------------------------------------------------------------------------
/Demos/Extensions/Delphi Class 1/delphi_class.dpr:
--------------------------------------------------------------------------------
1 | library delphi_class;
2 |
3 | uses
4 | Windows,
5 | SysUtils,
6 | phpApp,
7 | phpModules,
8 | delphi_class_module in 'delphi_class_module.pas' {PHDelphiPExtension: TPHPExtension};
9 |
10 | {$R *.RES}
11 |
12 | begin
13 | Application.Initialize;
14 | Application.CreateForm(TPHDelphiPExtension, PHDelphiPExtension);
15 | Application.Run;
16 | end.
--------------------------------------------------------------------------------
/Demos/Extensions/Resources/test_resource.php:
--------------------------------------------------------------------------------
1 |
2 | if(!extension_loaded('res_ext')) {
3 | dl('res_ext.dll');
4 | }
5 |
6 | $module = 'res_ext';
7 |
8 | if (extension_loaded($module)) {
9 | $str = "module loaded";
10 | } else {
11 | $str = "Module $module is not compiled into PHP";
12 | }
13 | echo "$str\n";
14 |
15 |
16 | $i = res_create();
17 | echo res_get($i);
18 |
19 |
20 |
21 | ?>
22 |
--------------------------------------------------------------------------------
/Demos/Bonus/JpegConverter/php_jpeg.php:
--------------------------------------------------------------------------------
1 |
2 | $j = $_SERVER['DOCUMENT_ROOT'] . "/test.jpg";
3 | $b = $_SERVER['DOCUMENT_ROOT'] . "/test.bmp";
4 |
5 | //show_bmp_jpeg($b);
6 |
7 | //convert_bmp_jpeg($b, $j);
8 |
9 | $color = 0xFFFFFF;
10 | $fontname = "Arial Bold";
11 | $fontsize = 10;
12 | $x = 10;
13 | $y = 10;
14 | sign_jpeg($j, $fontname, $color, $fontsize, $x, $y, "Signed by Me");
15 |
16 | ?>
17 |
--------------------------------------------------------------------------------
/Demos/Tutorial/Step.04/Unit1.dfm:
--------------------------------------------------------------------------------
1 | object PHPExtension1: TPHPExtension1
2 | OldCreateOrder = False
3 | Version = '1.0'
4 | Functions = <
5 | item
6 | FunctionName = 'myfunction'
7 | Tag = 0
8 | Parameters = <
9 | item
10 | Name = 'myparameter'
11 | ParamType = tpString
12 | end>
13 | end>
14 | ModuleName = 'mymodule'
15 | Height = 0
16 | Width = 0
17 | end
18 |
--------------------------------------------------------------------------------
/Demos/Bonus/wincon/resource.h:
--------------------------------------------------------------------------------
1 | //{{NO_DEPENDENCIES}}
2 | // Microsoft Visual C++ generated include file.
3 | // Used by wincon.rc
4 |
5 | // Next default values for new objects
6 | //
7 | #ifdef APSTUDIO_INVOKED
8 | #ifndef APSTUDIO_READONLY_SYMBOLS
9 | #define _APS_NEXT_RESOURCE_VALUE 101
10 | #define _APS_NEXT_COMMAND_VALUE 40001
11 | #define _APS_NEXT_CONTROL_VALUE 1001
12 | #define _APS_NEXT_SYMED_VALUE 101
13 | #endif
14 | #endif
15 |
--------------------------------------------------------------------------------
/Demos/Tutorial/Step.05/Unit1.dfm:
--------------------------------------------------------------------------------
1 | object PHPExtension1: TPHPExtension1
2 | OldCreateOrder = False
3 | Version = '1.0'
4 | Functions = <
5 | item
6 | FunctionName = 'myfunction'
7 | Tag = 0
8 | Parameters = <
9 | item
10 | Name = 'myparameter'
11 | ParamType = tpString
12 | end>
13 | OnExecute = PHPExtension1Functions0Execute
14 | end>
15 | ModuleName = 'mymodule'
16 | Height = 0
17 | Width = 0
18 | end
19 |
--------------------------------------------------------------------------------
/Demos/Bonus/wincon/Bin/test_wincon.php:
--------------------------------------------------------------------------------
1 |
2 | if(!extension_loaded('php_wincon')) {
3 | dl('php_wincon.dll');
4 | }
5 |
6 |
7 | $hStdout = GetStdHandle(STD_OUTPUT_HANDLE);
8 | SetConsoleTextAttribute($hStdout, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE );
9 | writeconsole($hStdout, "PHP Console Extension\n");
10 | SetConsoleTextAttribute($hStdout, FOREGROUND_GREEN | FOREGROUND_INTENSITY);
11 | writeconsole($hStdout, "Enables standard console functions for PHP\n");
12 |
13 | ?>
14 |
--------------------------------------------------------------------------------
/Demos/Extensions/killer/Unit1.dfm:
--------------------------------------------------------------------------------
1 | object killerExt: TkillerExt
2 | OldCreateOrder = False
3 | Version = '0.0'
4 | Functions = <
5 | item
6 | FunctionName = 'killprocessbypid'
7 | Tag = 0
8 | Parameters = <
9 | item
10 | Name = 'PID'
11 | ParamType = tpInteger
12 | end>
13 | OnExecute = PHPExtension1Functions0Execute
14 | end>
15 | ModuleName = 'killer'
16 | Left = 192
17 | Top = 198
18 | Height = 480
19 | Width = 696
20 | end
21 |
--------------------------------------------------------------------------------
/Demos/Extensions/phpDLL/Unit1.dfm:
--------------------------------------------------------------------------------
1 | object PHPExtension1: TPHPExtension1
2 | OldCreateOrder = False
3 | Version = '0.0'
4 | Functions = <
5 | item
6 | FunctionName = 'mygettext'
7 | Tag = 0
8 | Parameters = <
9 | item
10 | Name = 'AText'
11 | ParamType = tpString
12 | end>
13 | OnExecute = PHPExtension1Functions0Execute
14 | end>
15 | ModuleName = 'some_functions'
16 | Left = 411
17 | Top = 314
18 | Height = 150
19 | Width = 215
20 | end
21 |
--------------------------------------------------------------------------------
/Demos/Tutorial/Step.06/test_script.php:
--------------------------------------------------------------------------------
1 |
2 | if(!extension_loaded('mymodule')) {
3 | dl('project1.dll');
4 | }
5 |
6 |
7 | $module = 'mymodule';
8 |
9 | if (extension_loaded($module)) {
10 | $str = "module loaded";
11 | } else {
12 | $str = "Module $module is not compiled into PHP";
13 | }
14 | echo "$str\n";
15 |
16 | $functions = get_extension_funcs($module);
17 | echo "Functions available in the $module extension:
\n";
18 | foreach($functions as $func) {
19 | echo $func."
\n";
20 | }
21 |
22 | ?>
23 |
--------------------------------------------------------------------------------
/Demos/Extensions/killer/tests/test_killer.php:
--------------------------------------------------------------------------------
1 |
2 | if(!extension_loaded('killer')) {
3 | dl('killer.dll');
4 | }
5 |
6 | //killprocessbypid(100);
7 |
8 | $module = 'killer';
9 |
10 | if (extension_loaded($module)) {
11 | $str = "module loaded";
12 | } else {
13 | $str = "Module $module is not compiled into PHP";
14 | }
15 | echo "$str\n";
16 |
17 | $functions = get_extension_funcs($module);
18 | echo "Functions available in the $module extension:
\n";
19 | foreach($functions as $func) {
20 | echo $func."
\n";
21 | }
22 |
23 | ?>
24 |
--------------------------------------------------------------------------------
/Demos/php4Applications/VB .NET/php4delphi/php4delphi/My Project/Application.myapp:
--------------------------------------------------------------------------------
1 |
2 |
3 | true
4 | Form1
5 | false
6 | 0
7 | true
8 | 0
9 | true
10 |
--------------------------------------------------------------------------------
/Demos/Extensions/Delphi Class 2/delphi_class2.php:
--------------------------------------------------------------------------------
1 |
2 | if(!extension_loaded('delphi_class')) {
3 | dl('delphi_class.dll');
4 | }
5 |
6 | if(!extension_loaded('delphi_class2')) {
7 | dl('delphi_class2.dll');
8 | }
9 |
10 | $a = delphi_class_create("TButton", 'btnOK');
11 | delphi_set_prop($a, "Caption", "OK");
12 | echo delphi_get_prop($a, "Caption");
13 |
14 | echo "\n";
15 |
16 |
17 | $b = register_delphi_object($a);
18 | $b->caption = "Cancel";
19 | echo $b->caption;
20 |
21 | echo "\n";
22 |
23 | delphi_class_free($a);
24 |
25 | ?>
26 |
27 |
--------------------------------------------------------------------------------
/Demos/Extensions/skeleton/tests/skeleton.php:
--------------------------------------------------------------------------------
1 |
2 | if(!extension_loaded('extname')) {
3 | dl('skeleton.dll');
4 | }
5 | $module = 'extname';
6 | $functions = get_extension_funcs($module);
7 | echo "Functions available in the test extension:
\n";
8 | foreach($functions as $func) {
9 | echo $func."
\n";
10 | }
11 | echo "
\n";
12 | $function = 'confirm_' . $module . '_compiled';
13 | if (extension_loaded($module)) {
14 | $str = $function($module);
15 | } else {
16 | $str = "Module $module is not compiled into PHP";
17 | }
18 | echo "$str\n";
19 | ?>
20 |
--------------------------------------------------------------------------------
/ExtensionBuilder/frm_Functions.pas:
--------------------------------------------------------------------------------
1 | unit frm_Functions;
2 |
3 | interface
4 |
5 | uses
6 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
7 | StdCtrls;
8 |
9 | type
10 | TfrmFunctions = class(TForm)
11 | Functions: TMemo;
12 | btnOK: TButton;
13 | btnCancel: TButton;
14 | Label1: TLabel;
15 | private
16 | { Private declarations }
17 | public
18 | { Public declarations }
19 | end;
20 |
21 | var
22 | frmFunctions: TfrmFunctions;
23 |
24 | implementation
25 |
26 | {$R *.DFM}
27 |
28 | end.
29 |
--------------------------------------------------------------------------------
/Demos/Extensions/array result/Unit1.dfm:
--------------------------------------------------------------------------------
1 | object PHPExtension1: TPHPExtension1
2 | OldCreateOrder = False
3 | Version = '0.0'
4 | Functions = <
5 | item
6 | FunctionName = 'get_month_names'
7 | Tag = 0
8 | Parameters = <>
9 | OnExecute = PHPExtension1Functions0Execute
10 | end
11 | item
12 | FunctionName = 'get_year_info'
13 | Tag = 0
14 | Parameters = <>
15 | OnExecute = PHPExtension1Functions1Execute
16 | end>
17 | ModuleName = 'rarray'
18 | Left = 311
19 | Top = 296
20 | Height = 500
21 | Width = 624
22 | end
23 |
--------------------------------------------------------------------------------
/Demos/Extensions/skeleton/tests/test_skeleton.php:
--------------------------------------------------------------------------------
1 |
2 | if(!extension_loaded('extname')) {
3 | dl('skeleton.dll');
4 | }
5 |
6 |
7 | $str = confirm_extname_compiled("skeleton");
8 | echo "$str\n";
9 |
10 | $module = 'extname';
11 |
12 | if (extension_loaded($module)) {
13 | $str = "module loaded";
14 | } else {
15 | $str = "Module $module is not compiled into PHP";
16 | }
17 | echo "$str\n";
18 |
19 | $functions = get_extension_funcs($module);
20 | echo "Functions available in the $module extension:
\n";
21 | foreach($functions as $func) {
22 | echo $func."
\n";
23 | }
24 |
25 | ?>
26 |
--------------------------------------------------------------------------------
/Demos/Extensions/reference/Unit1.dfm:
--------------------------------------------------------------------------------
1 | object PHPExtension1: TPHPExtension1
2 | OldCreateOrder = False
3 | Version = '0.0'
4 | Functions = <
5 | item
6 | FunctionName = 'helloworld'
7 | Tag = 0
8 | Parameters = <
9 | item
10 | Name = 'Param1'
11 | ParamType = tpString
12 | end
13 | item
14 | Name = 'Param2'
15 | ParamType = tpString
16 | end>
17 | OnExecute = PHPExtension1Functions0Execute
18 | end>
19 | ModuleName = 'php_ref'
20 | Left = 192
21 | Top = 114
22 | Height = 150
23 | Width = 215
24 | end
25 |
--------------------------------------------------------------------------------
/Demos/Extensions/reference/testref.php:
--------------------------------------------------------------------------------
1 |
2 | if(!extension_loaded('php_ref')) {
3 | dl('php_ref.dll');
4 | }
5 |
6 | $module = 'php_ref';
7 |
8 | if (extension_loaded($module)) {
9 | $str = "module loaded";
10 | } else {
11 | $str = "Module $module is not compiled into PHP";
12 | }
13 | echo "$str
";
14 |
15 | $functions = get_extension_funcs($module);
16 | echo "Functions available in the $module extension:
\n";
17 | foreach($functions as $func) {
18 | echo $func."
";
19 | }
20 |
21 | $a = "";
22 | $b = "";
23 |
24 | helloworld($a, $b);
25 |
26 | echo $a." ".$b;
27 |
28 | ?>
29 |
--------------------------------------------------------------------------------
/Demos/Extensions/array result/rarray.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | if(!extension_loaded('rarray')) {
4 | dl('rarray.dll');
5 | }
6 |
7 |
8 | $ar = get_month_names();
9 |
10 | for ($i=0; $i<12; $i++):
11 | $x = $i + 1;
12 | echo sprintf("%02d : ", $x);
13 | print "$ar[$i]\n";
14 | endfor;
15 |
16 | $ar2 = get_year_info();
17 | $months = $ar2["months"];
18 | $smonths = $ar2["abbrevmonths"];
19 |
20 | echo "\n";
21 |
22 |
23 | for ($i=0; $i<12; $i++):
24 | $x = $i + 1;
25 | echo sprintf("%02d : ", $x);
26 | echo sprintf("%12s : ", $months[$i]);
27 | print "$smonths[$i]\n";
28 | endfor;
29 |
30 | ?>
31 |
32 |
--------------------------------------------------------------------------------
/Demos/php4Applications/VB .NET/php4delphi/php4delphi/php4delphi.vbproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 | publish\
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | 0
13 | en-US
14 | false
15 |
16 |
--------------------------------------------------------------------------------
/Demos/Extensions/phpDLL/testdll.php:
--------------------------------------------------------------------------------
1 |
2 | if(!extension_loaded('phpDll')) {
3 | dl('phpDll.dll');
4 | }
5 | $module = 'some_functions';
6 |
7 | if (extension_loaded($module)) {
8 | $str = "module loaded";
9 | } else {
10 | $str = "Module $module is not compiled into PHP";
11 | }
12 | echo "$str
";
13 |
14 | $functions = get_extension_funcs($module);
15 | echo "Functions available in the $module extension:
\n";
16 | foreach($functions as $func) {
17 | echo $func."
";
18 | }
19 |
20 | $str = MyGetText("Hello!"); //This Delphi function is : ... ReturnValue:='Hello From DLL';
21 |
22 | echo "Delphi ret -->$str
";
23 |
24 | ?>
25 |
--------------------------------------------------------------------------------
/Demos/Bonus/wincon/wincon.dsw:
--------------------------------------------------------------------------------
1 | Microsoft Developer Studio Workspace File, Format Version 6.00
2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
3 |
4 | ###############################################################################
5 |
6 | Project: "wincon"=".\wincon.dsp" - Package Owner=<4>
7 |
8 | Package=<5>
9 | {{{
10 | }}}
11 |
12 | Package=<4>
13 | {{{
14 | }}}
15 |
16 | ###############################################################################
17 |
18 | Global:
19 |
20 | Package=<5>
21 | {{{
22 | }}}
23 |
24 | Package=<3>
25 | {{{
26 | }}}
27 |
28 | ###############################################################################
29 |
30 |
--------------------------------------------------------------------------------
/Demos/php4Applications/C++ VS 2005/cdemo.dsw:
--------------------------------------------------------------------------------
1 | Microsoft Developer Studio Workspace File, Format Version 6.00
2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
3 |
4 | ###############################################################################
5 |
6 | Project: "cdemo"=.\cdemo.dsp - Package Owner=<4>
7 |
8 | Package=<5>
9 | {{{
10 | }}}
11 |
12 | Package=<4>
13 | {{{
14 | }}}
15 |
16 | ###############################################################################
17 |
18 | Global:
19 |
20 | Package=<5>
21 | {{{
22 | }}}
23 |
24 | Package=<3>
25 | {{{
26 | }}}
27 |
28 | ###############################################################################
29 |
30 |
--------------------------------------------------------------------------------
/Demos/php4Applications/C++ VS 6.0/cdemo.dsw:
--------------------------------------------------------------------------------
1 | Microsoft Developer Studio Workspace File, Format Version 6.00
2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
3 |
4 | ###############################################################################
5 |
6 | Project: "cdemo"=.\cdemo.dsp - Package Owner=<4>
7 |
8 | Package=<5>
9 | {{{
10 | }}}
11 |
12 | Package=<4>
13 | {{{
14 | }}}
15 |
16 | ###############################################################################
17 |
18 | Global:
19 |
20 | Package=<5>
21 | {{{
22 | }}}
23 |
24 | Package=<3>
25 | {{{
26 | }}}
27 |
28 | ###############################################################################
29 |
30 |
--------------------------------------------------------------------------------
/Demos/Extensions/killer/Unit1.dti:
--------------------------------------------------------------------------------
1 | [Designer]
2 | Version=1
3 | Left=285
4 | Top=161
5 | Width=741
6 | Height=479
7 | Splitter=185
8 | SelectedTab=Components
9 |
10 | [Components]
11 | Version=1
12 | Left=0
13 | Top=0
14 |
15 | [TreeView]
16 | Version=1
17 | PrintHeader=1
18 | PrintToSingle=1
19 | PrintToFile=0
20 | PrintBorders=1
21 | PrintSelected=0
22 | PrintVisible=0
23 | ExpandedItems=
24 |
25 | [DataDiagrams]
26 | Version=1
27 | PrintHeader=1
28 | PrintToSingle=1
29 | PrintToFile=0
30 | PrintBorders=1
31 | Left=0
32 | Top=0
33 | ModeSelected=SelectionMode
34 | Count=1
35 |
36 | [DataDiagrams.Diagram.0]
37 | Islands=
38 | Comments=
39 | Bridges=
40 | Alludes=
41 |
42 |
--------------------------------------------------------------------------------
/Demos/Extensions/phpDLL/Unit1.dti:
--------------------------------------------------------------------------------
1 | [Designer]
2 | Version=1
3 | Left=285
4 | Top=161
5 | Width=741
6 | Height=479
7 | Splitter=185
8 | SelectedTab=Components
9 |
10 | [Components]
11 | Version=1
12 | Left=0
13 | Top=0
14 |
15 | [TreeView]
16 | Version=1
17 | PrintHeader=1
18 | PrintToSingle=1
19 | PrintToFile=0
20 | PrintBorders=1
21 | PrintSelected=0
22 | PrintVisible=0
23 | ExpandedItems=
24 |
25 | [DataDiagrams]
26 | Version=1
27 | PrintHeader=1
28 | PrintToSingle=1
29 | PrintToFile=0
30 | PrintBorders=1
31 | Left=0
32 | Top=0
33 | ModeSelected=SelectionMode
34 | Count=1
35 |
36 | [DataDiagrams.Diagram.0]
37 | Islands=
38 | Comments=
39 | Bridges=
40 | Alludes=
41 |
42 |
--------------------------------------------------------------------------------
/Demos/Extensions/Resources/Unit1.dti:
--------------------------------------------------------------------------------
1 | [Designer]
2 | Version=1
3 | Left=285
4 | Top=161
5 | Width=741
6 | Height=479
7 | Splitter=185
8 | SelectedTab=Components
9 |
10 | [Components]
11 | Version=1
12 | Left=0
13 | Top=0
14 |
15 | [TreeView]
16 | Version=1
17 | PrintHeader=1
18 | PrintToSingle=1
19 | PrintToFile=0
20 | PrintBorders=1
21 | PrintSelected=0
22 | PrintVisible=0
23 | ExpandedItems=
24 |
25 | [DataDiagrams]
26 | Version=1
27 | PrintHeader=1
28 | PrintToSingle=1
29 | PrintToFile=0
30 | PrintBorders=1
31 | Left=0
32 | Top=0
33 | ModeSelected=SelectionMode
34 | Count=1
35 |
36 | [DataDiagrams.Diagram.0]
37 | Islands=
38 | Comments=
39 | Bridges=
40 | Alludes=
41 |
42 |
--------------------------------------------------------------------------------
/Demos/php4Applications/C++ VS 2005/StdAfx.h:
--------------------------------------------------------------------------------
1 | // stdafx.h : include file for standard system include files,
2 | // or project specific include files that are used frequently, but
3 | // are changed infrequently
4 | //
5 |
6 | #if !defined(AFX_STDAFX_H__B8E472A2_BB1C_46B3_B1A1_8D3133C82D8D__INCLUDED_)
7 | #define AFX_STDAFX_H__B8E472A2_BB1C_46B3_B1A1_8D3133C82D8D__INCLUDED_
8 |
9 | #if _MSC_VER > 1000
10 | #pragma once
11 | #endif // _MSC_VER > 1000
12 |
13 |
14 |
15 |
16 | //{{AFX_INSERT_LOCATION}}
17 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
18 |
19 | #endif // !defined(AFX_STDAFX_H__B8E472A2_BB1C_46B3_B1A1_8D3133C82D8D__INCLUDED_)
20 |
--------------------------------------------------------------------------------
/Demos/php4Applications/C++ VS 6.0/StdAfx.h:
--------------------------------------------------------------------------------
1 | // stdafx.h : include file for standard system include files,
2 | // or project specific include files that are used frequently, but
3 | // are changed infrequently
4 | //
5 |
6 | #if !defined(AFX_STDAFX_H__B8E472A2_BB1C_46B3_B1A1_8D3133C82D8D__INCLUDED_)
7 | #define AFX_STDAFX_H__B8E472A2_BB1C_46B3_B1A1_8D3133C82D8D__INCLUDED_
8 |
9 | #if _MSC_VER > 1000
10 | #pragma once
11 | #endif // _MSC_VER > 1000
12 |
13 |
14 |
15 |
16 | //{{AFX_INSERT_LOCATION}}
17 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
18 |
19 | #endif // !defined(AFX_STDAFX_H__B8E472A2_BB1C_46B3_B1A1_8D3133C82D8D__INCLUDED_)
20 |
--------------------------------------------------------------------------------
/Demos/Extensions/Math/test_math.php:
--------------------------------------------------------------------------------
1 |
2 | if(!extension_loaded('delphi_math')) {
3 | dl('delphi_math.dll');
4 | }
5 |
6 |
7 | $module = 'delphi_math';
8 |
9 | if (extension_loaded($module)) {
10 | $str = "module loaded";
11 | } else {
12 | $str = "Module $module is not compiled into PHP";
13 | }
14 | echo "$str\n";
15 |
16 | echo "Sin(90.0) = ";
17 | $str = delphi_sin(90.0);
18 | echo "$str\n";
19 |
20 | echo "Cosh(45.0) = ";
21 | $str = delphi_cosh(45.0);
22 | echo "$str\n\n";
23 |
24 | $functions = get_extension_funcs($module);
25 | echo "Functions available in the $module extension:
\n";
26 | foreach($functions as $func) {
27 | echo $func."
\n";
28 | }
29 |
30 | ?>
31 |
--------------------------------------------------------------------------------
/Demos/Tutorial/Step.01/Unit1.dti:
--------------------------------------------------------------------------------
1 | [Designer]
2 | Version=1
3 | Left=267
4 | Top=308
5 | Width=696
6 | Height=480
7 | Splitter=185
8 | SelectedTab=Components
9 |
10 | [Components]
11 | Version=1
12 | Left=0
13 | Top=0
14 |
15 | [TreeView]
16 | Version=1
17 | PrintHeader=1
18 | PrintToSingle=1
19 | PrintToFile=0
20 | PrintBorders=1
21 | PrintSelected=0
22 | PrintVisible=0
23 | ExpandedItems=PHPExtension1
24 |
25 | [DataDiagrams]
26 | Version=1
27 | PrintHeader=1
28 | PrintToSingle=1
29 | PrintToFile=0
30 | PrintBorders=1
31 | Left=0
32 | Top=0
33 | ModeSelected=SelectionMode
34 | Count=1
35 |
36 | [DataDiagrams.Diagram.0]
37 | Islands=
38 | Comments=
39 | Bridges=
40 | Alludes=
41 |
42 |
--------------------------------------------------------------------------------
/Demos/Tutorial/Step.02/Unit1.dti:
--------------------------------------------------------------------------------
1 | [Designer]
2 | Version=1
3 | Left=192
4 | Top=130
5 | Width=696
6 | Height=480
7 | Splitter=185
8 | SelectedTab=Components
9 |
10 | [Components]
11 | Version=1
12 | Left=0
13 | Top=0
14 |
15 | [TreeView]
16 | Version=1
17 | PrintHeader=1
18 | PrintToSingle=1
19 | PrintToFile=0
20 | PrintBorders=1
21 | PrintSelected=0
22 | PrintVisible=0
23 | ExpandedItems=PHPExtension1
24 |
25 | [DataDiagrams]
26 | Version=1
27 | PrintHeader=1
28 | PrintToSingle=1
29 | PrintToFile=0
30 | PrintBorders=1
31 | Left=0
32 | Top=0
33 | ModeSelected=SelectionMode
34 | Count=1
35 |
36 | [DataDiagrams.Diagram.0]
37 | Islands=
38 | Comments=
39 | Bridges=
40 | Alludes=
41 |
42 |
--------------------------------------------------------------------------------
/Demos/psvPHP/Dynamic Array/dynamic_array.dpr:
--------------------------------------------------------------------------------
1 | {$APPTYPE CONSOLE}
2 | program dynamic_array;
3 |
4 | uses
5 | Windows, SysUtils, Classes, ZENDAPI, zend_dynamic_array;
6 |
7 | var
8 | ar : TDynamicArray;
9 | P : pointer;
10 | El : PChar;
11 | begin
12 | zend_dynamic_array_init(@ar,sizeof(PChar), 3);
13 | El := 'Test1';
14 | P := zend_dynamic_array_push(@ar);
15 | Move(El, P^, sizeof(PChar));
16 | El := 'Test2';
17 | P := zend_dynamic_array_push(@ar);
18 | Move(El, P^, sizeof(PChar));
19 | El := 'Test3';
20 | P := zend_dynamic_array_push(@ar);
21 | Move(El, P^, sizeof(PChar));
22 | P := zend_dynamic_array_get_element(@ar, 1);
23 | El := PChar(P^);
24 | writeln(el);
25 | end.
--------------------------------------------------------------------------------
/Demos/Extensions/Resources/Unit1.dfm:
--------------------------------------------------------------------------------
1 | object res_module: Tres_module
2 | OldCreateOrder = False
3 | Version = '0.0'
4 | Functions = <
5 | item
6 | FunctionName = 'res_create'
7 | Tag = 0
8 | Parameters = <>
9 | OnExecute = PHPExtension1Functions0Execute
10 | end
11 | item
12 | FunctionName = 'res_get'
13 | Tag = 0
14 | Parameters = <
15 | item
16 | Name = 'Param1'
17 | ParamType = tpInteger
18 | end>
19 | OnExecute = PHPExtension1Functions1Execute
20 | end>
21 | ModuleName = 'res_ext'
22 | OnModuleInit = PHPExtensionModuleInit
23 | Left = 192
24 | Top = 160
25 | Height = 150
26 | Width = 215
27 | end
28 |
--------------------------------------------------------------------------------
/Demos/Extensions/Math/extmain.dti:
--------------------------------------------------------------------------------
1 | [Designer]
2 | Version=1
3 | Left=285
4 | Top=161
5 | Width=741
6 | Height=479
7 | Splitter=185
8 | SelectedTab=Components
9 |
10 | [Components]
11 | Version=1
12 | Left=0
13 | Top=0
14 |
15 | [TreeView]
16 | Version=1
17 | PrintHeader=1
18 | PrintToSingle=1
19 | PrintToFile=0
20 | PrintBorders=1
21 | PrintSelected=0
22 | PrintVisible=0
23 | ExpandedItems=MathExtension\MathExtension.Functions
24 |
25 | [DataDiagrams]
26 | Version=1
27 | PrintHeader=1
28 | PrintToSingle=1
29 | PrintToFile=0
30 | PrintBorders=1
31 | Left=0
32 | Top=0
33 | ModeSelected=SelectionMode
34 | Count=1
35 |
36 | [DataDiagrams.Diagram.0]
37 | Islands=
38 | Comments=
39 | Bridges=
40 | Alludes=
41 |
42 |
--------------------------------------------------------------------------------
/Demos/Tutorial/Step.03/Unit1.dti:
--------------------------------------------------------------------------------
1 | [Designer]
2 | Version=1
3 | Left=192
4 | Top=130
5 | Width=696
6 | Height=480
7 | Splitter=185
8 | SelectedTab=Components
9 |
10 | [Components]
11 | Version=1
12 | Left=0
13 | Top=0
14 |
15 | [TreeView]
16 | Version=1
17 | PrintHeader=1
18 | PrintToSingle=1
19 | PrintToFile=0
20 | PrintBorders=1
21 | PrintSelected=0
22 | PrintVisible=0
23 | ExpandedItems=PHPExtension1\PHPExtension1.Functions
24 |
25 | [DataDiagrams]
26 | Version=1
27 | PrintHeader=1
28 | PrintToSingle=1
29 | PrintToFile=0
30 | PrintBorders=1
31 | Left=0
32 | Top=0
33 | ModeSelected=SelectionMode
34 | Count=1
35 |
36 | [DataDiagrams.Diagram.0]
37 | Islands=
38 | Comments=
39 | Bridges=
40 | Alludes=
41 |
42 |
--------------------------------------------------------------------------------
/Demos/Extensions/Borland Demo/Unit1.dti:
--------------------------------------------------------------------------------
1 | [Designer]
2 | Version=1
3 | Left=285
4 | Top=161
5 | Width=741
6 | Height=479
7 | Splitter=185
8 | SelectedTab=Components
9 |
10 | [Components]
11 | Version=1
12 | Left=0
13 | Top=0
14 |
15 | [TreeView]
16 | Version=1
17 | PrintHeader=1
18 | PrintToSingle=1
19 | PrintToFile=0
20 | PrintBorders=1
21 | PrintSelected=0
22 | PrintVisible=0
23 | ExpandedItems=PHPExtension1\PHPExtension1.Functions
24 |
25 | [DataDiagrams]
26 | Version=1
27 | PrintHeader=1
28 | PrintToSingle=1
29 | PrintToFile=0
30 | PrintBorders=1
31 | Left=0
32 | Top=0
33 | ModeSelected=SelectionMode
34 | Count=1
35 |
36 | [DataDiagrams.Diagram.0]
37 | Islands=
38 | Comments=
39 | Bridges=
40 | Alludes=
41 |
42 |
--------------------------------------------------------------------------------
/Demos/Extensions/Class demo/dm_Class.dti:
--------------------------------------------------------------------------------
1 | [Designer]
2 | Version=1
3 | Left=285
4 | Top=161
5 | Width=741
6 | Height=479
7 | Splitter=185
8 | SelectedTab=Components
9 |
10 | [Components]
11 | Version=1
12 | Left=0
13 | Top=0
14 |
15 | [TreeView]
16 | Version=1
17 | PrintHeader=1
18 | PrintToSingle=1
19 | PrintToFile=0
20 | PrintBorders=1
21 | PrintSelected=0
22 | PrintVisible=0
23 | ExpandedItems=classdemo\PHPDemoClass\PHPDemoClass.Methods
24 |
25 | [DataDiagrams]
26 | Version=1
27 | PrintHeader=1
28 | PrintToSingle=1
29 | PrintToFile=0
30 | PrintBorders=1
31 | Left=0
32 | Top=0
33 | ModeSelected=SelectionMode
34 | Count=1
35 |
36 | [DataDiagrams.Diagram.0]
37 | Islands=
38 | Comments=
39 | Bridges=
40 | Alludes=
41 |
42 |
--------------------------------------------------------------------------------
/Demos/Extensions/Delphi Class 1/delphi_class_module.dti:
--------------------------------------------------------------------------------
1 | [Designer]
2 | Version=1
3 | Left=285
4 | Top=161
5 | Width=741
6 | Height=479
7 | Splitter=185
8 | SelectedTab=Components
9 |
10 | [Components]
11 | Version=1
12 | Left=0
13 | Top=0
14 |
15 | [TreeView]
16 | Version=1
17 | PrintHeader=1
18 | PrintToSingle=1
19 | PrintToFile=0
20 | PrintBorders=1
21 | PrintSelected=0
22 | PrintVisible=0
23 | ExpandedItems=PHDelphiPExtension\PHDelphiPExtension.Functions
24 |
25 | [DataDiagrams]
26 | Version=1
27 | PrintHeader=1
28 | PrintToSingle=1
29 | PrintToFile=0
30 | PrintBorders=1
31 | Left=0
32 | Top=0
33 | ModeSelected=SelectionMode
34 | Count=1
35 |
36 | [DataDiagrams.Diagram.0]
37 | Islands=
38 | Comments=
39 | Bridges=
40 | Alludes=
41 |
42 |
--------------------------------------------------------------------------------
/Demos/Tutorial/Step.04/Unit1.dti:
--------------------------------------------------------------------------------
1 | [Designer]
2 | Version=1
3 | Left=192
4 | Top=130
5 | Width=696
6 | Height=480
7 | Splitter=185
8 | SelectedTab=Components
9 |
10 | [Components]
11 | Version=1
12 | Left=0
13 | Top=0
14 |
15 | [TreeView]
16 | Version=1
17 | PrintHeader=1
18 | PrintToSingle=1
19 | PrintToFile=0
20 | PrintBorders=1
21 | PrintSelected=0
22 | PrintVisible=0
23 | ExpandedItems=PHPExtension1\PHPExtension1.Functions\PHPExtension1.Functions[0]\TFunctionParams
24 |
25 | [DataDiagrams]
26 | Version=1
27 | PrintHeader=1
28 | PrintToSingle=1
29 | PrintToFile=0
30 | PrintBorders=1
31 | Left=0
32 | Top=0
33 | ModeSelected=SelectionMode
34 | Count=1
35 |
36 | [DataDiagrams.Diagram.0]
37 | Islands=
38 | Comments=
39 | Bridges=
40 | Alludes=
41 |
42 |
--------------------------------------------------------------------------------
/Demos/Tutorial/Step.05/Unit1.dti:
--------------------------------------------------------------------------------
1 | [Designer]
2 | Version=1
3 | Left=192
4 | Top=130
5 | Width=696
6 | Height=480
7 | Splitter=185
8 | SelectedTab=Components
9 |
10 | [Components]
11 | Version=1
12 | Left=0
13 | Top=0
14 |
15 | [TreeView]
16 | Version=1
17 | PrintHeader=1
18 | PrintToSingle=1
19 | PrintToFile=0
20 | PrintBorders=1
21 | PrintSelected=0
22 | PrintVisible=0
23 | ExpandedItems=PHPExtension1\PHPExtension1.Functions\PHPExtension1.Functions[0]\TFunctionParams
24 |
25 | [DataDiagrams]
26 | Version=1
27 | PrintHeader=1
28 | PrintToSingle=1
29 | PrintToFile=0
30 | PrintBorders=1
31 | Left=0
32 | Top=0
33 | ModeSelected=SelectionMode
34 | Count=1
35 |
36 | [DataDiagrams.Diagram.0]
37 | Islands=
38 | Comments=
39 | Bridges=
40 | Alludes=
41 |
42 |
--------------------------------------------------------------------------------
/Demos/php4Applications/VB .NET/php4delphi/php4delphi/ApplicationEvents.vb:
--------------------------------------------------------------------------------
1 | Namespace My
2 |
3 | ' The following events are availble for MyApplication:
4 | '
5 | ' Startup: Raised when the application starts, before the startup form is created.
6 | ' Shutdown: Raised after all application forms are closed. This event is not raised if the application terminates abnormally.
7 | ' UnhandledException: Raised if the application encounters an unhandled exception.
8 | ' StartupNextInstance: Raised when launching a single-instance application and the application is already active.
9 | ' NetworkAvailabilityChanged: Raised when the network connection is connected or disconnected.
10 | Partial Friend Class MyApplication
11 |
12 | End Class
13 |
14 | End Namespace
15 |
16 |
--------------------------------------------------------------------------------
/php4Delphi2005.bdsgroup:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | php4DelphiR2005.bdsproj
15 | php4DelphiD2005.bdsproj
16 | php4DelphiR2005.bpl php4DelphiD2005.bpl
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/php4Delphi2006.bdsgroup:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | php4DelphiR2006.bdsproj
15 | PHP4DelphiD2006.bdsproj
16 | php4DelphiR2006.bpl PHP4DelphiD2006.bpl
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/php4delphi.cnt:
--------------------------------------------------------------------------------
1 | :Base php4delphi.hlp>MAIN
2 | :Title php4Delphi help system
3 | 1 php4Delphi Units
4 | 2 php4delphi unit=php4delphi_unit
5 | 2 phpFunctions unit=phpfunctions_unit
6 | 2 phpLibrary unit=phplibrary_unit
7 | 1 php4Delphi Components
8 | 2 TpsvPHP component=TpsvPHP_Component
9 | 2 TPHPLibrary component=TPHPLibrary_component
10 | 1 php4Delphi Classes
11 | 2 TPHPVariable class=TPHPVariable_component
12 | 2 TPHPVariables class=TPHPVariables_component
13 | 2 TPHPConstant class=TPHPConstant_component
14 | 2 TPHPConstants class=TPHPConstants_component
15 | 2 TPHPFunction class=TPHPFunction_component
16 | 2 TPHPFunctions class=TPHPFunctions_component
17 | 2 TFunctionParam class=TFunctionParam_component
18 | 2 TFunctionParams class=TFunctionParams_component
19 | 2 TZendVariable class=TZendVariable_component
20 |
--------------------------------------------------------------------------------
/Demos/php4Applications/Visual Basic/php_VB.vbp:
--------------------------------------------------------------------------------
1 | Type=Exe
2 | Form=Form1.frm
3 | Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\WINNT\System32\StdOle2.Tlb#OLE Automation
4 | Module=php_module; php_module.bas
5 | IconForm="Form1"
6 | Startup="Form1"
7 | ExeName32="php_VB.exe"
8 | Command32=""
9 | Name="php_VB"
10 | HelpContextID="0"
11 | CompatibleMode="0"
12 | MajorVer=1
13 | MinorVer=0
14 | RevisionVer=0
15 | AutoIncrementVer=0
16 | ServerSupportFiles=0
17 | VersionCompanyName="Fedpol"
18 | CompilationType=0
19 | OptimizationType=0
20 | FavorPentiumPro(tm)=0
21 | CodeViewDebugInfo=0
22 | NoAliasing=0
23 | BoundsCheck=0
24 | OverflowCheck=0
25 | FlPointCheck=0
26 | FDIVCheck=0
27 | UnroundedFP=0
28 | StartMode=0
29 | Unattended=0
30 | Retained=0
31 | ThreadPerObject=0
32 | MaxNumberOfThreads=1
33 |
--------------------------------------------------------------------------------
/ExtensionBuilder/phpExtBuilderD5.dpk:
--------------------------------------------------------------------------------
1 | package phpExtBuilderD5;
2 |
3 | {$R *.RES}
4 | {$ALIGN ON}
5 | {$ASSERTIONS ON}
6 | {$BOOLEVAL OFF}
7 | {$DEBUGINFO ON}
8 | {$EXTENDEDSYNTAX ON}
9 | {$IMPORTEDDATA ON}
10 | {$IOCHECKS ON}
11 | {$LOCALSYMBOLS ON}
12 | {$LONGSTRINGS ON}
13 | {$OPENSTRINGS ON}
14 | {$OPTIMIZATION ON}
15 | {$OVERFLOWCHECKS OFF}
16 | {$RANGECHECKS OFF}
17 | {$REFERENCEINFO ON}
18 | {$SAFEDIVIDE OFF}
19 | {$STACKFRAMES OFF}
20 | {$TYPEDADDRESS OFF}
21 | {$VARSTRINGCHECKS ON}
22 | {$WRITEABLECONST ON}
23 | {$MINENUMSIZE 1}
24 | {$IMAGEBASE $400000}
25 | {$DESCRIPTION 'PHP Extension Builder'}
26 | {$DESIGNONLY}
27 | {$IMPLICITBUILD OFF}
28 |
29 | requires
30 | vcl50,
31 | dsnide50;
32 |
33 | contains
34 | phpExtensionBuilder in 'phpExtensionBuilder.pas',
35 | frm_Functions in 'frm_Functions.pas' {frmFunctions};
36 |
37 | end.
38 |
--------------------------------------------------------------------------------
/ExtensionBuilder/phpExtBuilderD6.dpk:
--------------------------------------------------------------------------------
1 | package phpExtBuilderD6;
2 |
3 | {$R *.res}
4 | {$ALIGN 8}
5 | {$ASSERTIONS ON}
6 | {$BOOLEVAL OFF}
7 | {$DEBUGINFO ON}
8 | {$EXTENDEDSYNTAX ON}
9 | {$IMPORTEDDATA ON}
10 | {$IOCHECKS ON}
11 | {$LOCALSYMBOLS ON}
12 | {$LONGSTRINGS ON}
13 | {$OPENSTRINGS ON}
14 | {$OPTIMIZATION ON}
15 | {$OVERFLOWCHECKS OFF}
16 | {$RANGECHECKS OFF}
17 | {$REFERENCEINFO ON}
18 | {$SAFEDIVIDE OFF}
19 | {$STACKFRAMES OFF}
20 | {$TYPEDADDRESS OFF}
21 | {$VARSTRINGCHECKS ON}
22 | {$WRITEABLECONST ON}
23 | {$MINENUMSIZE 1}
24 | {$IMAGEBASE $400000}
25 | {$DESCRIPTION 'PHP Extension Builder'}
26 | {$DESIGNONLY}
27 | {$IMPLICITBUILD OFF}
28 |
29 | requires
30 | vcl,
31 | designide;
32 |
33 | contains
34 | phpExtensionBuilder in 'phpExtensionBuilder.pas',
35 | frm_Functions in 'frm_Functions.pas' {frmFunctions};
36 |
37 | end.
38 |
--------------------------------------------------------------------------------
/ExtensionBuilder/phpExtBuilderD7.dpk:
--------------------------------------------------------------------------------
1 | package phpExtBuilderD7;
2 |
3 | {$R *.res}
4 | {$ALIGN 8}
5 | {$ASSERTIONS ON}
6 | {$BOOLEVAL OFF}
7 | {$DEBUGINFO ON}
8 | {$EXTENDEDSYNTAX ON}
9 | {$IMPORTEDDATA ON}
10 | {$IOCHECKS ON}
11 | {$LOCALSYMBOLS ON}
12 | {$LONGSTRINGS ON}
13 | {$OPENSTRINGS ON}
14 | {$OPTIMIZATION ON}
15 | {$OVERFLOWCHECKS OFF}
16 | {$RANGECHECKS OFF}
17 | {$REFERENCEINFO ON}
18 | {$SAFEDIVIDE OFF}
19 | {$STACKFRAMES OFF}
20 | {$TYPEDADDRESS OFF}
21 | {$VARSTRINGCHECKS ON}
22 | {$WRITEABLECONST ON}
23 | {$MINENUMSIZE 1}
24 | {$IMAGEBASE $400000}
25 | {$DESCRIPTION 'PHP Extension Builder'}
26 | {$DESIGNONLY}
27 | {$IMPLICITBUILD OFF}
28 |
29 | requires
30 | vcl,
31 | designide;
32 |
33 | contains
34 | phpExtensionBuilder in 'phpExtensionBuilder.pas',
35 | frm_Functions in 'frm_Functions.pas' {frmFunctions};
36 |
37 | end.
38 |
--------------------------------------------------------------------------------
/Demos/psvPHP/Logo/uMain.dfm:
--------------------------------------------------------------------------------
1 | object Form1: TForm1
2 | Left = 520
3 | Top = 365
4 | BorderStyle = bsDialog
5 | Caption = 'Logo demo'
6 | ClientHeight = 52
7 | ClientWidth = 178
8 | Color = clBtnFace
9 | Font.Charset = DEFAULT_CHARSET
10 | Font.Color = clWindowText
11 | Font.Height = -11
12 | Font.Name = 'MS Sans Serif'
13 | Font.Style = []
14 | OldCreateOrder = False
15 | Position = poScreenCenter
16 | PixelsPerInch = 96
17 | TextHeight = 13
18 | object Button1: TButton
19 | Left = 11
20 | Top = 14
21 | Width = 75
22 | Height = 25
23 | Caption = 'PHP egg'
24 | TabOrder = 0
25 | OnClick = Button1Click
26 | end
27 | object Button2: TButton
28 | Left = 91
29 | Top = 14
30 | Width = 75
31 | Height = 25
32 | Caption = 'Close'
33 | TabOrder = 1
34 | OnClick = Button2Click
35 | end
36 | end
37 |
--------------------------------------------------------------------------------
/Demos/psvPHP/sample4/frm_PHPTest.pas:
--------------------------------------------------------------------------------
1 | unit frm_PHPTest;
2 |
3 | interface
4 |
5 | uses
6 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
7 | php4delphi, StdCtrls, ExtCtrls;
8 |
9 | type
10 | TfrmPHPTest = class(TForm)
11 | Panel1: TPanel;
12 | Panel2: TPanel;
13 | Button1: TButton;
14 | Panel3: TPanel;
15 | Splitter1: TSplitter;
16 | Panel4: TPanel;
17 | memoScript: TMemo;
18 | MemoResult: TMemo;
19 | psvPHP: TpsvPHP;
20 | procedure Button1Click(Sender: TObject);
21 | private
22 | { Private declarations }
23 | public
24 | { Public declarations }
25 | end;
26 |
27 | var
28 | frmPHPTest: TfrmPHPTest;
29 |
30 | implementation
31 |
32 | {$R *.DFM}
33 |
34 | procedure TfrmPHPTest.Button1Click(Sender: TObject);
35 | begin
36 | MemoResult.Text := psvPHP.RunCode(memoScript.Text);
37 | end;
38 |
39 | end.
40 |
--------------------------------------------------------------------------------
/Php4DelphiGroup5.bpg:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | VERSION = BWS.01
3 | #------------------------------------------------------------------------------
4 | !ifndef ROOT
5 | ROOT = $(MAKEDIR)\..
6 | !endif
7 | #------------------------------------------------------------------------------
8 | MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$**
9 | DCC = $(ROOT)\bin\dcc32.exe $**
10 | BRCC = $(ROOT)\bin\brcc32.exe $**
11 | #------------------------------------------------------------------------------
12 | PROJECTS = php4DelphiR5.bpl php4DelphiD5.bpl
13 | #------------------------------------------------------------------------------
14 | default: $(PROJECTS)
15 | #------------------------------------------------------------------------------
16 |
17 | php4DelphiR5.bpl: php4DelphiR5.dpk
18 | $(DCC)
19 |
20 | php4DelphiD5.bpl: php4DelphiD5.dpk
21 | $(DCC)
22 |
23 |
24 |
--------------------------------------------------------------------------------
/Php4DelphiGroup7.bpg:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | VERSION = BWS.01
3 | #------------------------------------------------------------------------------
4 | !ifndef ROOT
5 | ROOT = $(MAKEDIR)\..
6 | !endif
7 | #------------------------------------------------------------------------------
8 | MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$**
9 | DCC = $(ROOT)\bin\dcc32.exe $**
10 | BRCC = $(ROOT)\bin\brcc32.exe $**
11 | #------------------------------------------------------------------------------
12 | PROJECTS = php4DelphiR7.bpl php4DelphiD7.bpl
13 | #------------------------------------------------------------------------------
14 | default: $(PROJECTS)
15 | #------------------------------------------------------------------------------
16 |
17 | php4DelphiR7.bpl: php4DelphiR7.dpk
18 | $(DCC)
19 |
20 | php4DelphiD7.bpl: php4DelphiD7.dpk
21 | $(DCC)
22 |
23 |
24 |
--------------------------------------------------------------------------------
/Demos/php4Applications/C++ VS 2005/cdemo.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 9.00
3 | # Visual Studio 2005
4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cdemo", "cdemo.vcproj", "{30D7BBD6-5766-4A88-818A-47AC1520B484}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Win32 = Debug|Win32
9 | Release|Win32 = Release|Win32
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {30D7BBD6-5766-4A88-818A-47AC1520B484}.Debug|Win32.ActiveCfg = Debug|Win32
13 | {30D7BBD6-5766-4A88-818A-47AC1520B484}.Debug|Win32.Build.0 = Debug|Win32
14 | {30D7BBD6-5766-4A88-818A-47AC1520B484}.Release|Win32.ActiveCfg = Release|Win32
15 | {30D7BBD6-5766-4A88-818A-47AC1520B484}.Release|Win32.Build.0 = Release|Win32
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/php4DelphiD6.dpk:
--------------------------------------------------------------------------------
1 | package php4DelphiD6;
2 |
3 | {$R *.res}
4 | {$R 'php4delphi.dcr'}
5 | {$ALIGN 8}
6 | {$ASSERTIONS ON}
7 | {$BOOLEVAL OFF}
8 | {$DEBUGINFO ON}
9 | {$EXTENDEDSYNTAX ON}
10 | {$IMPORTEDDATA ON}
11 | {$IOCHECKS ON}
12 | {$LOCALSYMBOLS ON}
13 | {$LONGSTRINGS ON}
14 | {$OPENSTRINGS ON}
15 | {$OPTIMIZATION ON}
16 | {$OVERFLOWCHECKS OFF}
17 | {$RANGECHECKS OFF}
18 | {$REFERENCEINFO ON}
19 | {$SAFEDIVIDE OFF}
20 | {$STACKFRAMES OFF}
21 | {$TYPEDADDRESS OFF}
22 | {$VARSTRINGCHECKS ON}
23 | {$WRITEABLECONST OFF}
24 | {$MINENUMSIZE 1}
25 | {$IMAGEBASE $400000}
26 | {$DESCRIPTION 'php4Delphi'}
27 | {$DESIGNONLY}
28 | {$IMPLICITBUILD OFF}
29 |
30 | requires
31 | rtl,
32 | designide,
33 | php4DelphiR6;
34 |
35 | contains
36 | PHPProjectWizard in 'PHPProjectWizard.pas',
37 | php4DelphiReg in 'php4DelphiReg.pas',
38 | phpWeb in 'phpWeb.pas',
39 | php4DelphiWeb in 'php4DelphiWeb.pas',
40 | phpAbout in 'phpAbout.pas' {dlgAbout};
41 |
42 | end.
43 |
--------------------------------------------------------------------------------
/Demos/psvPHP/console/phpcon.dpr:
--------------------------------------------------------------------------------
1 | {$APPTYPE CONSOLE}
2 |
3 | {*******************************************************}
4 | { PHP4Delphi }
5 | { PHP - Delphi interface }
6 | { Author: }
7 | { Serhiy Perevoznyk }
8 | { serge_perevoznyk@hotmail.com }
9 | { http://users.chello.be/ws36637 }
10 | {*******************************************************}
11 |
12 | { $Id: phpcon.dpr,v 6.2 02/2006 delphi32 Exp $ }
13 |
14 | program phpcon;
15 |
16 | uses SysUtils, php4delphi;
17 |
18 | var
19 | php : TpsvPHP;
20 | begin
21 | if ParamCount <> 1 then
22 | begin
23 | writeln(Format('Usage: %s ', [ParamStr(0)]));
24 | Halt(1);
25 | end;
26 | php := TpsvPHP.Create(nil);
27 | php.FileName := ParamStr(1);
28 | write(php.Execute);
29 | php.Free;
30 | end.
31 |
--------------------------------------------------------------------------------
/Demos/Bonus/wincon/wincon.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 9.00
3 | # Visual Studio 2005
4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wincon", "wincon.vcproj", "{FA700C0B-DE1A-473D-8FCE-BE984E866697}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug_TS|Win32 = Debug_TS|Win32
9 | Release_TS|Win32 = Release_TS|Win32
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {FA700C0B-DE1A-473D-8FCE-BE984E866697}.Debug_TS|Win32.ActiveCfg = Debug_TS|Win32
13 | {FA700C0B-DE1A-473D-8FCE-BE984E866697}.Debug_TS|Win32.Build.0 = Debug_TS|Win32
14 | {FA700C0B-DE1A-473D-8FCE-BE984E866697}.Release_TS|Win32.ActiveCfg = Release_TS|Win32
15 | {FA700C0B-DE1A-473D-8FCE-BE984E866697}.Release_TS|Win32.Build.0 = Release_TS|Win32
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/php4DelphiD5.dpk:
--------------------------------------------------------------------------------
1 | package php4DelphiD5;
2 |
3 | {$R *.RES}
4 | {$R 'php4delphi.dcr'}
5 | {$ALIGN ON}
6 | {$ASSERTIONS ON}
7 | {$BOOLEVAL OFF}
8 | {$DEBUGINFO ON}
9 | {$EXTENDEDSYNTAX ON}
10 | {$IMPORTEDDATA ON}
11 | {$IOCHECKS ON}
12 | {$LOCALSYMBOLS ON}
13 | {$LONGSTRINGS ON}
14 | {$OPENSTRINGS ON}
15 | {$OPTIMIZATION ON}
16 | {$OVERFLOWCHECKS OFF}
17 | {$RANGECHECKS OFF}
18 | {$REFERENCEINFO ON}
19 | {$SAFEDIVIDE OFF}
20 | {$STACKFRAMES OFF}
21 | {$TYPEDADDRESS OFF}
22 | {$VARSTRINGCHECKS ON}
23 | {$WRITEABLECONST ON}
24 | {$MINENUMSIZE 1}
25 | {$IMAGEBASE $400000}
26 | {$DESCRIPTION 'php4Delphi (Design)'}
27 | {$DESIGNONLY}
28 | {$IMPLICITBUILD OFF}
29 |
30 | requires
31 | vcl50,
32 | php4DelphiR5,
33 | dsnide50;
34 |
35 | contains
36 | PHPProjectWizard in 'PHPProjectWizard.pas',
37 | php4DelphiReg in 'php4DelphiReg.pas',
38 | phpAbout in 'phpAbout.pas' {dlgAbout},
39 | phpWeb in 'phpWeb.pas',
40 | php4DelphiWeb in 'php4DelphiWeb.pas';
41 |
42 | end.
43 |
--------------------------------------------------------------------------------
/Demos/psvPHP/Logo/uMain.pas:
--------------------------------------------------------------------------------
1 | unit uMain;
2 |
3 | interface
4 |
5 | uses
6 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
7 | StdCtrls, ShellAPI;
8 |
9 | type
10 | TForm1 = class(TForm)
11 | Button1: TButton;
12 | Button2: TButton;
13 | procedure Button1Click(Sender: TObject);
14 | procedure Button2Click(Sender: TObject);
15 | private
16 | { Private declarations }
17 | public
18 | { Public declarations }
19 | end;
20 |
21 | var
22 | Form1: TForm1;
23 |
24 | implementation
25 | uses
26 | logos;
27 |
28 | {$R *.DFM}
29 |
30 | procedure TForm1.Button1Click(Sender: TObject);
31 | var
32 | FS : TFileStream;
33 | begin
34 | FS := TFileStream.Create('egg.gif', fmCreate);
35 | FS.Write(php_egg_logo, 7538);
36 | FS.Free;
37 | ShellExecute(0, 'open', 'egg.gif', nil, nil, SW_SHOWNORMAL);
38 | end;
39 |
40 | procedure TForm1.Button2Click(Sender: TObject);
41 | begin
42 | Close;
43 | end;
44 |
45 | end.
46 |
--------------------------------------------------------------------------------
/Demos/Extensions/Delphi Class 2/delphi_class.php:
--------------------------------------------------------------------------------
1 |
2 | if(!extension_loaded('delphi_class')) {
3 | dl('delphi_class.dll');
4 | }
5 |
6 | if(!extension_loaded('delphi_class2')) {
7 | dl('delphi_class2.dll');
8 | }
9 |
10 | $a = delphi_class_create("TPHPButton", 'btnOK');
11 | delphi_set_prop($a, "Caption", "OK");
12 | echo delphi_get_prop($a, "Caption");
13 |
14 | echo "\n";
15 |
16 |
17 | $b = register_delphi_object($a);
18 | $b->Caption = "Cancel";
19 | echo $b->caption;
20 |
21 | echo "\n";
22 |
23 | echo $b->GetClassName();
24 |
25 |
26 | $f = delphi_form_create("TPHPForm", "MyForm");
27 | $form = register_delphi_object($f);
28 | $form->Caption = "This is a Delphi form!";
29 | $form->BorderStyle = 3;
30 | $form->Color = 333;
31 | $form->Position = 4;
32 | $b->Parent = $f;
33 | $b->Left = 20;
34 | $b->Top = 50;
35 | $b->ScriptText = "delphi_message('Hello');";
36 | $form->ShowModal();
37 |
38 | delphi_class_free($a);
39 | delphi_class_free($f);
40 |
41 | ?>
42 |
43 |
--------------------------------------------------------------------------------
/Demos/php4Applications/VB .NET/php4delphi/php4delphi.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 9.00
3 | # Visual Studio 2005
4 | Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "php4delphi", "php4delphi\php4delphi.vbproj", "{98A25626-5C96-46EB-8A80-2D2C7236D025}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {98A25626-5C96-46EB-8A80-2D2C7236D025}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {98A25626-5C96-46EB-8A80-2D2C7236D025}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {98A25626-5C96-46EB-8A80-2D2C7236D025}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {98A25626-5C96-46EB-8A80-2D2C7236D025}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/Demos/php4Applications/C#/PHP4DelphiDemo/PHP4DelphiDemo.sln:
--------------------------------------------------------------------------------
1 | Microsoft Visual Studio Solution File, Format Version 8.00
2 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PHP4DelphiDemo", "PHP4DelphiDemo.csproj", "{0DA732DE-42B5-436C-8BD0-9036B7D79EAA}"
3 | ProjectSection(ProjectDependencies) = postProject
4 | EndProjectSection
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfiguration) = preSolution
8 | Debug = Debug
9 | Release = Release
10 | EndGlobalSection
11 | GlobalSection(ProjectConfiguration) = postSolution
12 | {0DA732DE-42B5-436C-8BD0-9036B7D79EAA}.Debug.ActiveCfg = Debug|.NET
13 | {0DA732DE-42B5-436C-8BD0-9036B7D79EAA}.Debug.Build.0 = Debug|.NET
14 | {0DA732DE-42B5-436C-8BD0-9036B7D79EAA}.Release.ActiveCfg = Release|.NET
15 | {0DA732DE-42B5-436C-8BD0-9036B7D79EAA}.Release.Build.0 = Release|.NET
16 | EndGlobalSection
17 | GlobalSection(ExtensibilityGlobals) = postSolution
18 | EndGlobalSection
19 | GlobalSection(ExtensibilityAddIns) = postSolution
20 | EndGlobalSection
21 | EndGlobal
22 |
--------------------------------------------------------------------------------
/php4DelphiD7.dpk:
--------------------------------------------------------------------------------
1 | package php4DelphiD7;
2 |
3 | {$R *.res}
4 | {$R 'php4delphi.dcr'}
5 | {$ALIGN 8}
6 | {$ASSERTIONS ON}
7 | {$BOOLEVAL OFF}
8 | {$DEBUGINFO ON}
9 | {$EXTENDEDSYNTAX ON}
10 | {$IMPORTEDDATA ON}
11 | {$IOCHECKS ON}
12 | {$LOCALSYMBOLS ON}
13 | {$LONGSTRINGS ON}
14 | {$OPENSTRINGS ON}
15 | {$OPTIMIZATION ON}
16 | {$OVERFLOWCHECKS OFF}
17 | {$RANGECHECKS OFF}
18 | {$REFERENCEINFO ON}
19 | {$SAFEDIVIDE OFF}
20 | {$STACKFRAMES OFF}
21 | {$TYPEDADDRESS OFF}
22 | {$VARSTRINGCHECKS ON}
23 | {$WRITEABLECONST OFF}
24 | {$MINENUMSIZE 1}
25 | {$IMAGEBASE $400000}
26 | {$DESCRIPTION 'php4Delphi (design-time)'}
27 | {$DESIGNONLY}
28 | {$IMPLICITBUILD OFF}
29 |
30 | requires
31 | rtl,
32 | vcl,
33 | designide,
34 | vclactnband,
35 | vclx,
36 | php4DelphiR7;
37 |
38 | contains
39 | PHPProjectWizard in 'PHPProjectWizard.pas',
40 | php4DelphiReg in 'php4DelphiReg.pas',
41 | php4DelphiWeb in 'php4DelphiWeb.pas',
42 | phpWeb in 'phpWeb.pas',
43 | phpAbout in 'phpAbout.pas' {dlgAbout};
44 |
45 | end.
46 |
--------------------------------------------------------------------------------
/PHP4DelphiD2006.dpk:
--------------------------------------------------------------------------------
1 | package php4DelphiD2006;
2 |
3 | {$R *.res}
4 | {$R 'php4delphi.dcr'}
5 | {$ALIGN 8}
6 | {$ASSERTIONS ON}
7 | {$BOOLEVAL OFF}
8 | {$DEBUGINFO ON}
9 | {$EXTENDEDSYNTAX ON}
10 | {$IMPORTEDDATA ON}
11 | {$IOCHECKS ON}
12 | {$LOCALSYMBOLS ON}
13 | {$LONGSTRINGS ON}
14 | {$OPENSTRINGS ON}
15 | {$OPTIMIZATION ON}
16 | {$OVERFLOWCHECKS OFF}
17 | {$RANGECHECKS OFF}
18 | {$REFERENCEINFO ON}
19 | {$SAFEDIVIDE OFF}
20 | {$STACKFRAMES OFF}
21 | {$TYPEDADDRESS OFF}
22 | {$VARSTRINGCHECKS ON}
23 | {$WRITEABLECONST OFF}
24 | {$MINENUMSIZE 1}
25 | {$IMAGEBASE $400000}
26 | {$DESCRIPTION 'php4Delphi (design-time)'}
27 | {$DESIGNONLY}
28 | {$IMPLICITBUILD OFF}
29 |
30 | requires
31 | rtl,
32 | vcl,
33 | designide,
34 | vclactnband,
35 | vclx,
36 | php4DelphiR2006;
37 |
38 | contains
39 | PHPProjectWizard in 'PHPProjectWizard.pas',
40 | php4DelphiReg in 'php4DelphiReg.pas',
41 | php4DelphiWeb in 'php4DelphiWeb.pas',
42 | phpWeb in 'phpWeb.pas',
43 | phpAbout in 'phpAbout.pas' {dlgAbout};
44 |
45 | end.
46 |
--------------------------------------------------------------------------------
/php4DelphiD2005.dpk:
--------------------------------------------------------------------------------
1 | package php4DelphiD2005;
2 |
3 | {$R *.res}
4 | {$R 'php4delphi.dcr'}
5 | {$ALIGN 8}
6 | {$ASSERTIONS ON}
7 | {$BOOLEVAL OFF}
8 | {$DEBUGINFO ON}
9 | {$EXTENDEDSYNTAX ON}
10 | {$IMPORTEDDATA ON}
11 | {$IOCHECKS ON}
12 | {$LOCALSYMBOLS ON}
13 | {$LONGSTRINGS ON}
14 | {$OPENSTRINGS ON}
15 | {$OPTIMIZATION ON}
16 | {$OVERFLOWCHECKS OFF}
17 | {$RANGECHECKS OFF}
18 | {$REFERENCEINFO ON}
19 | {$SAFEDIVIDE OFF}
20 | {$STACKFRAMES OFF}
21 | {$TYPEDADDRESS OFF}
22 | {$VARSTRINGCHECKS ON}
23 | {$WRITEABLECONST OFF}
24 | {$MINENUMSIZE 1}
25 | {$IMAGEBASE $400000}
26 | {$DESCRIPTION 'php4Delphi (design-time)'}
27 | {$DESIGNONLY}
28 | {$IMPLICITBUILD OFF}
29 |
30 | requires
31 | rtl,
32 | vcl,
33 | designide,
34 | vclactnband,
35 | vclx,
36 | php4DelphiR2005;
37 |
38 | contains
39 | PHPProjectWizard in 'PHPProjectWizard.pas',
40 | php4DelphiReg in 'php4DelphiReg.pas',
41 | php4DelphiWeb in 'php4DelphiWeb.pas',
42 | phpWeb in 'phpWeb.pas',
43 | phpAbout in 'phpAbout.pas' {dlgAbout};
44 |
45 | end.
46 |
--------------------------------------------------------------------------------
/Demos/Extensions/reference/Unit1.pas:
--------------------------------------------------------------------------------
1 | unit Unit1;
2 |
3 | interface
4 |
5 | uses
6 | Windows,
7 | Messages,
8 | SysUtils,
9 | Classes,
10 | Forms,
11 | zendTypes,
12 | zendAPI,
13 | phpTypes,
14 | phpAPI,
15 | phpFunctions,
16 | PHPModules;
17 |
18 | type
19 |
20 | TPHPExtension1 = class(TPHPExtension)
21 | procedure PHPExtension1Functions0Execute(Sender: TObject;
22 | Parameters: TFunctionParams; var ReturnValue: Variant;
23 | ThisPtr: pzval; TSRMLS_DC: Pointer);
24 | private
25 | { Private declarations }
26 | public
27 | { Public declarations }
28 | end;
29 |
30 | var
31 | PHPExtension1: TPHPExtension1;
32 |
33 | implementation
34 |
35 | {$R *.DFM}
36 |
37 | procedure TPHPExtension1.PHPExtension1Functions0Execute(Sender: TObject;
38 | Parameters: TFunctionParams; var ReturnValue: Variant; ThisPtr: pzval;
39 | TSRMLS_DC: Pointer);
40 | begin
41 | ZVAL_STRING(Parameters[0].ZendValue, 'hello', true);
42 | ZVAL_STRING(Parameters[1].ZendValue, 'world', true);
43 | end;
44 |
45 | end.
--------------------------------------------------------------------------------
/php4App.dpr:
--------------------------------------------------------------------------------
1 | {*******************************************************}
2 | { PHP4Applications }
3 | { }
4 | { Author: }
5 | { Serhiy Perevoznyk }
6 | { serge_perevoznyk@hotmail.com }
7 | { http://users.chello.be/ws36637 }
8 | {*******************************************************}
9 |
10 | { $Id: php4App.dpr,v 6.2 02/2006 delphi32 Exp $ }
11 |
12 | {$I PHP.INC}
13 |
14 | library php4App;
15 | uses
16 | Windows,
17 | Classes,
18 | SysUtils,
19 | ZendTypes,
20 | PHPTypes,
21 | ZendAPI,
22 | PHPAPI,
23 | php4AppUnit;
24 |
25 | {$R *.RES}
26 |
27 |
28 |
29 | exports
30 | InitRequest,
31 | DoneRequest,
32 | ExecutePHP,
33 | ExecuteCode,
34 | RegisterVariable,
35 | GetResultText,
36 | GetVariable,
37 | SaveToFile,
38 | GetVariableSize,
39 | GetResultBufferSize;
40 |
41 | begin
42 | InitEngine;
43 | end.
44 |
--------------------------------------------------------------------------------
/Demos/Tutorial/Step.01/Unit1.pas:
--------------------------------------------------------------------------------
1 | {*******************************************************}
2 | { PHP4Delphi }
3 | { PHP - Delphi interface }
4 | { Author: }
5 | { Serhiy Perevoznyk }
6 | { serge_perevoznyk@hotmail.com }
7 | { http://users.chello.be/ws36637 }
8 | {*******************************************************}
9 |
10 | unit Unit1;
11 |
12 | { $Id: Unit1.pas,v 6.2 02/2006 delphi32 Exp $ }
13 |
14 | interface
15 |
16 | uses
17 | Windows,
18 | Messages,
19 | SysUtils,
20 | Classes,
21 | Forms,
22 | zendTypes,
23 | zendAPI,
24 | phpTypes,
25 | phpAPI,
26 | phpFunctions,
27 | PHPModules;
28 |
29 | type
30 |
31 | TPHPExtension1 = class(TPHPExtension)
32 | private
33 | { Private declarations }
34 | public
35 | { Public declarations }
36 | end;
37 |
38 | var
39 | PHPExtension1: TPHPExtension1;
40 |
41 | implementation
42 |
43 | {$R *.DFM}
44 |
45 | end.
--------------------------------------------------------------------------------
/Demos/Tutorial/Step.02/Unit1.pas:
--------------------------------------------------------------------------------
1 | {*******************************************************}
2 | { PHP4Delphi }
3 | { PHP - Delphi interface }
4 | { Author: }
5 | { Serhiy Perevoznyk }
6 | { serge_perevoznyk@hotmail.com }
7 | { http://users.chello.be/ws36637 }
8 | {*******************************************************}
9 |
10 | unit Unit1;
11 |
12 | { $Id: Unit1.pas,v 6.2 02/2006 delphi32 Exp $ }
13 |
14 | interface
15 |
16 | uses
17 | Windows,
18 | Messages,
19 | SysUtils,
20 | Classes,
21 | Forms,
22 | zendTypes,
23 | zendAPI,
24 | phpTypes,
25 | phpAPI,
26 | phpFunctions,
27 | PHPModules;
28 |
29 | type
30 |
31 | TPHPExtension1 = class(TPHPExtension)
32 | private
33 | { Private declarations }
34 | public
35 | { Public declarations }
36 | end;
37 |
38 | var
39 | PHPExtension1: TPHPExtension1;
40 |
41 | implementation
42 |
43 | {$R *.DFM}
44 |
45 | end.
--------------------------------------------------------------------------------
/Demos/Tutorial/Step.03/Unit1.pas:
--------------------------------------------------------------------------------
1 | {*******************************************************}
2 | { PHP4Delphi }
3 | { PHP - Delphi interface }
4 | { Author: }
5 | { Serhiy Perevoznyk }
6 | { serge_perevoznyk@hotmail.com }
7 | { http://users.chello.be/ws36637 }
8 | {*******************************************************}
9 |
10 | unit Unit1;
11 |
12 | { $Id: Unit1.pas,v 6.2 02/2006 delphi32 Exp $ }
13 |
14 | interface
15 |
16 | uses
17 | Windows,
18 | Messages,
19 | SysUtils,
20 | Classes,
21 | Forms,
22 | zendTypes,
23 | zendAPI,
24 | phpTypes,
25 | phpAPI,
26 | phpFunctions,
27 | PHPModules;
28 |
29 | type
30 |
31 | TPHPExtension1 = class(TPHPExtension)
32 | private
33 | { Private declarations }
34 | public
35 | { Public declarations }
36 | end;
37 |
38 | var
39 | PHPExtension1: TPHPExtension1;
40 |
41 | implementation
42 |
43 | {$R *.DFM}
44 |
45 | end.
--------------------------------------------------------------------------------
/Demos/Tutorial/Step.04/Unit1.pas:
--------------------------------------------------------------------------------
1 | {*******************************************************}
2 | { PHP4Delphi }
3 | { PHP - Delphi interface }
4 | { Author: }
5 | { Serhiy Perevoznyk }
6 | { serge_perevoznyk@hotmail.com }
7 | { http://users.chello.be/ws36637 }
8 | {*******************************************************}
9 |
10 | unit Unit1;
11 |
12 | { $Id: Unit1.pas,v 6.2 02/2006 delphi32 Exp $ }
13 |
14 | interface
15 |
16 | uses
17 | Windows,
18 | Messages,
19 | SysUtils,
20 | Classes,
21 | Forms,
22 | zendTypes,
23 | zendAPI,
24 | phpTypes,
25 | phpAPI,
26 | phpFunctions,
27 | PHPModules;
28 |
29 | type
30 |
31 | TPHPExtension1 = class(TPHPExtension)
32 | private
33 | { Private declarations }
34 | public
35 | { Public declarations }
36 | end;
37 |
38 | var
39 | PHPExtension1: TPHPExtension1;
40 |
41 | implementation
42 |
43 | {$R *.DFM}
44 |
45 | end.
--------------------------------------------------------------------------------
/php4DelphiR5.dpk:
--------------------------------------------------------------------------------
1 | package php4DelphiR5;
2 |
3 | {$R *.RES}
4 | {$R 'php4delphi.dcr'}
5 | {$ALIGN ON}
6 | {$ASSERTIONS ON}
7 | {$BOOLEVAL OFF}
8 | {$DEBUGINFO ON}
9 | {$EXTENDEDSYNTAX ON}
10 | {$IMPORTEDDATA ON}
11 | {$IOCHECKS ON}
12 | {$LOCALSYMBOLS ON}
13 | {$LONGSTRINGS ON}
14 | {$OPENSTRINGS ON}
15 | {$OPTIMIZATION ON}
16 | {$OVERFLOWCHECKS OFF}
17 | {$RANGECHECKS OFF}
18 | {$REFERENCEINFO ON}
19 | {$SAFEDIVIDE OFF}
20 | {$STACKFRAMES OFF}
21 | {$TYPEDADDRESS OFF}
22 | {$VARSTRINGCHECKS ON}
23 | {$WRITEABLECONST ON}
24 | {$MINENUMSIZE 1}
25 | {$IMAGEBASE $400000}
26 | {$DESCRIPTION 'PHP4Delphi (run-time)'}
27 | {$RUNONLY}
28 | {$IMPLICITBUILD OFF}
29 |
30 | requires
31 | vcl50;
32 |
33 | contains
34 | zendAPI in 'ZENDAPI.pas',
35 | DelphiFunctions in 'DelphiFunctions.pas',
36 | php4delphi in 'php4delphi.pas',
37 | phpAPI in 'PHPAPI.pas',
38 | phpLibrary in 'PHPLibrary.pas',
39 | PHPCustomLibrary in 'phpCustomLibrary.pas',
40 | phpFunctions in 'phpFunctions.pas',
41 | PHPTypes in 'PHPTypes.pas',
42 | ZENDTypes in 'ZENDTypes.pas',
43 | phpClass in 'phpClass.pas',
44 | phpModules in 'phpModules.pas',
45 | PHPCommon in 'PHPCommon.pas';
46 |
47 | end.
48 |
--------------------------------------------------------------------------------
/php4DelphiR6.dpk:
--------------------------------------------------------------------------------
1 | package php4DelphiR6;
2 |
3 | {$R *.res}
4 | {$R 'php4delphi.dcr'}
5 | {$ALIGN 8}
6 | {$ASSERTIONS ON}
7 | {$BOOLEVAL OFF}
8 | {$DEBUGINFO ON}
9 | {$EXTENDEDSYNTAX ON}
10 | {$IMPORTEDDATA ON}
11 | {$IOCHECKS ON}
12 | {$LOCALSYMBOLS ON}
13 | {$LONGSTRINGS ON}
14 | {$OPENSTRINGS ON}
15 | {$OPTIMIZATION ON}
16 | {$OVERFLOWCHECKS OFF}
17 | {$RANGECHECKS OFF}
18 | {$REFERENCEINFO ON}
19 | {$SAFEDIVIDE OFF}
20 | {$STACKFRAMES OFF}
21 | {$TYPEDADDRESS OFF}
22 | {$VARSTRINGCHECKS ON}
23 | {$WRITEABLECONST OFF}
24 | {$MINENUMSIZE 1}
25 | {$IMAGEBASE $400000}
26 | {$DESCRIPTION 'php4Delphi (run-time)'}
27 | {$RUNONLY}
28 | {$IMPLICITBUILD OFF}
29 |
30 | requires
31 | rtl,
32 | vcl;
33 |
34 | contains
35 | zendAPI in 'ZENDAPI.pas',
36 | DelphiFunctions in 'DelphiFunctions.pas',
37 | php4delphi in 'php4delphi.pas',
38 | phpAPI in 'PHPAPI.pas',
39 | phpModules in 'phpModules.pas',
40 | phpLibrary in 'PHPLibrary.pas',
41 | PHPCustomLibrary in 'phpCustomLibrary.pas',
42 | phpFunctions in 'PHPFunctions.pas',
43 | ZENDTypes in 'ZendTypes.pas',
44 | PHPTypes in 'phpTypes.pas',
45 | phpClass in 'phpClass.pas',
46 | PHPCommon in 'PHPCommon.pas';
47 |
48 | end.
49 |
--------------------------------------------------------------------------------
/php4DelphiR7.dpk:
--------------------------------------------------------------------------------
1 | package php4DelphiR7;
2 |
3 | {$R *.res}
4 | {$R 'php4delphi.dcr'}
5 | {$ALIGN 8}
6 | {$ASSERTIONS ON}
7 | {$BOOLEVAL OFF}
8 | {$DEBUGINFO ON}
9 | {$EXTENDEDSYNTAX ON}
10 | {$IMPORTEDDATA ON}
11 | {$IOCHECKS ON}
12 | {$LOCALSYMBOLS ON}
13 | {$LONGSTRINGS ON}
14 | {$OPENSTRINGS ON}
15 | {$OPTIMIZATION ON}
16 | {$OVERFLOWCHECKS OFF}
17 | {$RANGECHECKS OFF}
18 | {$REFERENCEINFO ON}
19 | {$SAFEDIVIDE OFF}
20 | {$STACKFRAMES OFF}
21 | {$TYPEDADDRESS OFF}
22 | {$VARSTRINGCHECKS ON}
23 | {$WRITEABLECONST OFF}
24 | {$MINENUMSIZE 1}
25 | {$IMAGEBASE $400000}
26 | {$DESCRIPTION 'php4Delphi (run-rime)'}
27 | {$RUNONLY}
28 | {$IMPLICITBUILD OFF}
29 |
30 | requires
31 | rtl,
32 | vcl;
33 |
34 | contains
35 | zendAPI in 'ZENDAPI.pas',
36 | DelphiFunctions in 'DelphiFunctions.pas',
37 | php4delphi in 'php4delphi.pas',
38 | phpAPI in 'PHPAPI.pas',
39 | phpModules in 'phpModules.pas',
40 | phpLibrary in 'PHPLibrary.pas',
41 | PHPCustomLibrary in 'phpCustomLibrary.pas',
42 | phpFunctions in 'PHPFunctions.pas',
43 | PHPTypes in 'PHPTypes.pas',
44 | ZENDTypes in 'ZENDTypes.pas',
45 | phpClass in 'phpClass.pas',
46 | PHPCommon in 'PHPCommon.pas';
47 |
48 | end.
49 |
--------------------------------------------------------------------------------
/php4DelphiR2005.dpk:
--------------------------------------------------------------------------------
1 | package php4DelphiR2005;
2 |
3 | {$R *.res}
4 | {$R 'php4delphi.dcr'}
5 | {$ALIGN 8}
6 | {$ASSERTIONS ON}
7 | {$BOOLEVAL OFF}
8 | {$DEBUGINFO ON}
9 | {$EXTENDEDSYNTAX ON}
10 | {$IMPORTEDDATA ON}
11 | {$IOCHECKS ON}
12 | {$LOCALSYMBOLS ON}
13 | {$LONGSTRINGS ON}
14 | {$OPENSTRINGS ON}
15 | {$OPTIMIZATION ON}
16 | {$OVERFLOWCHECKS OFF}
17 | {$RANGECHECKS OFF}
18 | {$REFERENCEINFO ON}
19 | {$SAFEDIVIDE OFF}
20 | {$STACKFRAMES OFF}
21 | {$TYPEDADDRESS OFF}
22 | {$VARSTRINGCHECKS ON}
23 | {$WRITEABLECONST OFF}
24 | {$MINENUMSIZE 1}
25 | {$IMAGEBASE $400000}
26 | {$DESCRIPTION 'php4Delphi (run-rime)'}
27 | {$RUNONLY}
28 | {$IMPLICITBUILD OFF}
29 |
30 | requires
31 | rtl,
32 | vcl;
33 |
34 | contains
35 | zendAPI in 'ZENDAPI.pas',
36 | DelphiFunctions in 'DelphiFunctions.pas',
37 | php4delphi in 'php4delphi.pas',
38 | phpAPI in 'PHPAPI.pas',
39 | phpModules in 'phpModules.pas',
40 | phpLibrary in 'PHPLibrary.pas',
41 | PHPCustomLibrary in 'phpCustomLibrary.pas',
42 | phpFunctions in 'PHPFunctions.pas',
43 | PHPTypes in 'PHPTypes.pas',
44 | ZENDTypes in 'ZENDTypes.pas',
45 | phpClass in 'phpClass.pas',
46 | PHPCommon in 'PHPCommon.pas';
47 |
48 | end.
49 |
--------------------------------------------------------------------------------
/php4DelphiR2006.dpk:
--------------------------------------------------------------------------------
1 | package php4DelphiR2006;
2 |
3 | {$R *.res}
4 | {$R 'php4delphi.dcr'}
5 | {$ALIGN 8}
6 | {$ASSERTIONS ON}
7 | {$BOOLEVAL OFF}
8 | {$DEBUGINFO ON}
9 | {$EXTENDEDSYNTAX ON}
10 | {$IMPORTEDDATA ON}
11 | {$IOCHECKS ON}
12 | {$LOCALSYMBOLS ON}
13 | {$LONGSTRINGS ON}
14 | {$OPENSTRINGS ON}
15 | {$OPTIMIZATION ON}
16 | {$OVERFLOWCHECKS OFF}
17 | {$RANGECHECKS OFF}
18 | {$REFERENCEINFO ON}
19 | {$SAFEDIVIDE OFF}
20 | {$STACKFRAMES OFF}
21 | {$TYPEDADDRESS OFF}
22 | {$VARSTRINGCHECKS ON}
23 | {$WRITEABLECONST OFF}
24 | {$MINENUMSIZE 1}
25 | {$IMAGEBASE $400000}
26 | {$DESCRIPTION 'php4Delphi (run-rime)'}
27 | {$RUNONLY}
28 | {$IMPLICITBUILD OFF}
29 |
30 | requires
31 | rtl,
32 | vcl;
33 |
34 | contains
35 | ZENDAPI in 'ZENDAPI.pas',
36 | DelphiFunctions in 'DelphiFunctions.pas',
37 | php4delphi in 'php4delphi.pas',
38 | PHPAPI in 'PHPAPI.pas',
39 | phpModules in 'phpModules.pas',
40 | PHPLibrary in 'PHPLibrary.pas',
41 | phpCustomLibrary in 'phpCustomLibrary.pas',
42 | PHPFunctions in 'PHPFunctions.pas',
43 | PHPTypes in 'PHPTypes.pas',
44 | ZENDTypes in 'ZENDTypes.pas',
45 | phpClass in 'phpClass.pas',
46 | PHPCommon in 'PHPCommon.pas';
47 |
48 | end.
49 |
--------------------------------------------------------------------------------
/Demos/php4Applications/Visual Basic/php_module.bas:
--------------------------------------------------------------------------------
1 | Attribute VB_Name = "php_module"
2 | Option Explicit
3 |
4 | Public Declare Function ExecutePHP Lib "php4app.dll" (ByVal RequestID As Long, ByVal FileName As String) As Long
5 | Public Declare Function InitRequest Lib "php4app.dll" () As Long
6 | Public Declare Sub DoneRequest Lib "php4app.dll" (ByVal RequestID As Long)
7 | Public Declare Function GetResultText Lib "php4app.dll" (ByVal RequestID As Long, ByVal Buf As String, ByVal Buflen As Long) As Long
8 | Public Declare Sub RegisterVariable Lib "php4app.dll" (ByVal RequestID As Long, ByVal AName As String, ByVal AValue As String)
9 | Public Declare Function ExecuteCode Lib "php4app.dll" (ByVal RequestID As Long, ByVal ACode As String) As Long
10 | Public Declare Function GetVariable Lib "php4app.dll" (ByVal RequestID As Long, ByVal AName As String, ByVal Buffer As String, ByVal BufLen As Long) As Long
11 | Public Declare Sub SaveToFile Lib "php4app.dll" (ByVal RequestID As Long, ByVal AFileName As String)
12 | Public Declare Function GetVariableSize Lib "php4app.dll" (ByVal RequestID As Long, ByVal AName As String) As Long
13 | Public Declare Function GetResultBufferSize Lib "php4app.dll" (ByVal RequestID As Long) As Long
14 |
15 |
--------------------------------------------------------------------------------
/Demos/Extensions/Math/extmain.dfm:
--------------------------------------------------------------------------------
1 | object MathExtension: TMathExtension
2 | OldCreateOrder = False
3 | Version = '1.0'
4 | Functions = <
5 | item
6 | FunctionName = 'delphi_sin'
7 | Tag = 0
8 | Parameters = <
9 | item
10 | Name = 'X'
11 | ParamType = tpFloat
12 | end>
13 | OnExecute = SinExecute
14 | end
15 | item
16 | FunctionName = 'delphi_cosh'
17 | Tag = 0
18 | Parameters = <
19 | item
20 | Name = 'X'
21 | ParamType = tpFloat
22 | end>
23 | OnExecute = CoshExecute
24 | end
25 | item
26 | FunctionName = 'delphi_arcsin'
27 | Tag = 0
28 | Parameters = <
29 | item
30 | Name = 'X'
31 | ParamType = tpFloat
32 | end>
33 | OnExecute = ArcsinExecute
34 | end
35 | item
36 | FunctionName = 'delphi_arccosh'
37 | Tag = 0
38 | Parameters = <
39 | item
40 | Name = 'X'
41 | ParamType = tpFloat
42 | end>
43 | OnExecute = ArccoshExecute
44 | end>
45 | ModuleName = 'delphi_math'
46 | Left = 619
47 | Top = 344
48 | Height = 266
49 | Width = 269
50 | end
51 |
--------------------------------------------------------------------------------
/Demos/psvPHP/array demo/Unit1.dfm:
--------------------------------------------------------------------------------
1 | object Form1: TForm1
2 | Left = 283
3 | Top = 220
4 | Width = 264
5 | Height = 194
6 | Caption = 'Array demo'
7 | Color = clBtnFace
8 | Font.Charset = DEFAULT_CHARSET
9 | Font.Color = clWindowText
10 | Font.Height = -11
11 | Font.Name = 'MS Sans Serif'
12 | Font.Style = []
13 | OldCreateOrder = False
14 | PixelsPerInch = 96
15 | TextHeight = 13
16 | object Button1: TButton
17 | Left = 16
18 | Top = 64
19 | Width = 75
20 | Height = 25
21 | Caption = 'Button1'
22 | TabOrder = 0
23 | OnClick = Button1Click
24 | end
25 | object ListBox1: TListBox
26 | Left = 108
27 | Top = 4
28 | Width = 121
29 | Height = 97
30 | ItemHeight = 13
31 | TabOrder = 1
32 | end
33 | object psvPHP1: TpsvPHP
34 | Constants = <>
35 | Variables = <>
36 | Left = 20
37 | Top = 16
38 | end
39 | object PHPLibrary1: TPHPLibrary
40 | Executor = psvPHP1
41 | LibraryName = 'ArrayLib'
42 | Functions = <
43 | item
44 | FunctionName = 'get_php_array'
45 | Tag = 0
46 | Parameters = <>
47 | OnExecute = PHPLibrary1Functions0Execute
48 | end>
49 | Left = 52
50 | Top = 16
51 | end
52 | end
53 |
--------------------------------------------------------------------------------
/ExtensionBuilder/frm_Functions.dfm:
--------------------------------------------------------------------------------
1 | object frmFunctions: TfrmFunctions
2 | Left = 414
3 | Top = 217
4 | BorderStyle = bsDialog
5 | Caption = 'Functions'
6 | ClientHeight = 442
7 | ClientWidth = 370
8 | Color = clBtnFace
9 | Font.Charset = DEFAULT_CHARSET
10 | Font.Color = clWindowText
11 | Font.Height = -11
12 | Font.Name = 'MS Sans Serif'
13 | Font.Style = []
14 | OldCreateOrder = False
15 | Position = poScreenCenter
16 | PixelsPerInch = 96
17 | TextHeight = 13
18 | object Label1: TLabel
19 | Left = 20
20 | Top = 8
21 | Width = 259
22 | Height = 52
23 | Caption =
24 | 'This wizard will create PHP extension project for you'#13#10#13#10'Please ' +
25 | 'enter name of the functions you want to include'#13#10'in this project'
26 | end
27 | object Functions: TMemo
28 | Left = 16
29 | Top = 68
30 | Width = 337
31 | Height = 319
32 | TabOrder = 0
33 | end
34 | object btnOK: TButton
35 | Left = 208
36 | Top = 408
37 | Width = 75
38 | Height = 25
39 | Caption = 'OK'
40 | Default = True
41 | ModalResult = 1
42 | TabOrder = 1
43 | end
44 | object btnCancel: TButton
45 | Left = 284
46 | Top = 408
47 | Width = 75
48 | Height = 25
49 | Cancel = True
50 | Caption = 'Cancel'
51 | ModalResult = 2
52 | TabOrder = 2
53 | end
54 | end
55 |
--------------------------------------------------------------------------------
/phpApp.pas:
--------------------------------------------------------------------------------
1 | {*******************************************************}
2 | { PHP4Delphi }
3 | { Custom PHP extension application }
4 | { }
5 | { Author: }
6 | { Serhiy Perevoznyk }
7 | { serge_perevoznyk@hotmail.com }
8 | { http://users.chello.be/ws36637 }
9 | {*******************************************************}
10 | {$I PHP.INC}
11 |
12 | { $Id: phpApp.pas,v 6.2 02/2006 delphi32 Exp $ }
13 |
14 |
15 | {$DENYPACKAGEUNIT}
16 |
17 | unit phpAPP;
18 |
19 | interface
20 |
21 | uses
22 | Windows, SysUtils, PHPAPI, phpModules;
23 |
24 | implementation
25 |
26 | { InitApplication }
27 | procedure InitApplication;
28 | begin
29 | Application := TPHPApplication.Create(nil);
30 | end;
31 |
32 | { DoneApplication }
33 | procedure DoneApplication;
34 | begin
35 | try
36 | if Assigned(Application) then
37 | begin
38 | Application.CacheConnections := false;
39 | Application.Free;
40 | Application := nil;
41 | end;
42 | except
43 | end;
44 | end;
45 |
46 | initialization
47 | if not PHPLoaded then
48 | LoadPHP;
49 |
50 | InitApplication;
51 |
52 | finalization
53 | DoneApplication;
54 |
55 | end.
56 |
57 |
--------------------------------------------------------------------------------
/Demos/psvPHP/sample2/Unit1.pas:
--------------------------------------------------------------------------------
1 | {*******************************************************}
2 | { PHP4Delphi }
3 | { PHP - Delphi interface }
4 | { Author: }
5 | { Serhiy Perevoznyk }
6 | { serge_perevoznyk@hotmail.com }
7 | { http://users.chello.be/ws36637 }
8 | {*******************************************************}
9 | unit Unit1;
10 |
11 | { $Id: Unit1.pas,v 6.2 02/2006 delphi32 Exp $ }
12 |
13 | interface
14 |
15 | uses
16 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
17 | StdCtrls, php4delphi;
18 |
19 | type
20 | TForm1 = class(TForm)
21 | psvPHP1: TpsvPHP;
22 | Edit1: TEdit;
23 | Edit2: TEdit;
24 | Label1: TLabel;
25 | Label2: TLabel;
26 | Label3: TLabel;
27 | Button1: TButton;
28 | procedure Button1Click(Sender: TObject);
29 | private
30 | { Private declarations }
31 | public
32 | { Public declarations }
33 | end;
34 |
35 | var
36 | Form1: TForm1;
37 |
38 | implementation
39 |
40 | {$R *.DFM}
41 |
42 | procedure TForm1.Button1Click(Sender: TObject);
43 | begin
44 | psvPHP1.Variables.Items[0].Value := Edit1.text;
45 | psvPHP1.Variables.Items[1].Value := Edit2.text;
46 | psvPHP1.RunCode('$z = $x + $y;');
47 | Label3.Caption := psvPHP1.VariableByName('z').Value;
48 | end;
49 |
50 | end.
51 |
--------------------------------------------------------------------------------
/Demos/Extensions/killer/Unit1.pas:
--------------------------------------------------------------------------------
1 | {*******************************************************}
2 | { PHP4Delphi }
3 | { PHP - Delphi interface }
4 | { Author: }
5 | { Serhiy Perevoznyk }
6 | { serge_perevoznyk@hotmail.com }
7 | { http://users.chello.be/ws36637 }
8 | {*******************************************************}
9 | unit Unit1;
10 |
11 | interface
12 |
13 | uses
14 | Windows,
15 | Messages,
16 | SysUtils,
17 | Classes,
18 | Forms,
19 | zendTypes,
20 | zendAPI,
21 | phpTypes,
22 | phpAPI,
23 | PHPFunctions,
24 | PHPModules;
25 |
26 | type
27 |
28 | TkillerExt = class(TPHPExtension)
29 | procedure PHPExtension1Functions0Execute(Sender: TObject;
30 | Parameters: TFunctionParams; var ReturnValue: Variant;
31 | ThisPtr: Pzval; TSRMLS_DC: Pointer);
32 | private
33 | { Private declarations }
34 | public
35 | { Public declarations }
36 | end;
37 |
38 | var
39 | killerExt: TkillerExt;
40 |
41 | implementation
42 |
43 | uses ProcessViewer;
44 |
45 | {$R *.DFM}
46 |
47 | procedure TkillerExt.PHPExtension1Functions0Execute(Sender: TObject;
48 | Parameters: TFunctionParams; var ReturnValue: Variant; ThisPtr: Pzval;
49 | TSRMLS_DC: Pointer);
50 | begin
51 | ReturnValue := KillProcessByPID(Parameters.Items[0].Value);
52 | end;
53 |
54 | end.
--------------------------------------------------------------------------------
/Demos/php4Applications/Delphi/Unit1.dfm:
--------------------------------------------------------------------------------
1 | object Form1: TForm1
2 | Left = 259
3 | Top = 321
4 | BorderStyle = bsDialog
5 | Caption = 'Form1'
6 | ClientHeight = 296
7 | ClientWidth = 609
8 | Color = clBtnFace
9 | Font.Charset = DEFAULT_CHARSET
10 | Font.Color = clWindowText
11 | Font.Height = -11
12 | Font.Name = 'MS Sans Serif'
13 | Font.Style = []
14 | OldCreateOrder = False
15 | PixelsPerInch = 96
16 | TextHeight = 13
17 | object Memo1: TMemo
18 | Left = 16
19 | Top = 12
20 | Width = 581
21 | Height = 241
22 | Lines.Strings = (
23 | '')
24 | TabOrder = 0
25 | end
26 | object btnExecuteScript: TButton
27 | Left = 16
28 | Top = 264
29 | Width = 101
30 | Height = 25
31 | Caption = 'Execute script'
32 | TabOrder = 1
33 | OnClick = btnExecuteScriptClick
34 | end
35 | object btnExecuteCode: TButton
36 | Left = 124
37 | Top = 264
38 | Width = 109
39 | Height = 25
40 | Caption = 'Execute Code'
41 | TabOrder = 2
42 | OnClick = btnExecuteCodeClick
43 | end
44 | object btnClose: TButton
45 | Left = 524
46 | Top = 264
47 | Width = 75
48 | Height = 25
49 | Caption = 'Close'
50 | TabOrder = 3
51 | OnClick = btnCloseClick
52 | end
53 | object btnExecuteAndSave: TButton
54 | Left = 240
55 | Top = 264
56 | Width = 145
57 | Height = 25
58 | Caption = 'Execute and Save'
59 | TabOrder = 4
60 | OnClick = btnExecuteAndSaveClick
61 | end
62 | end
63 |
--------------------------------------------------------------------------------
/Demos/php4Applications/Visual Basic/Form1.frm:
--------------------------------------------------------------------------------
1 | VERSION 5.00
2 | Begin VB.Form Form1
3 | Caption = "Form1"
4 | ClientHeight = 6870
5 | ClientLeft = 60
6 | ClientTop = 345
7 | ClientWidth = 8790
8 | LinkTopic = "Form1"
9 | ScaleHeight = 6870
10 | ScaleWidth = 8790
11 | StartUpPosition = 3 'Windows Default
12 | Begin VB.CommandButton ButtonExecute
13 | Caption = "Execute"
14 | Height = 375
15 | Left = 7560
16 | TabIndex = 1
17 | Top = 360
18 | Width = 1095
19 | End
20 | Begin VB.TextBox Text1
21 | Height = 6495
22 | Left = 240
23 | MultiLine = -1 'True
24 | TabIndex = 0
25 | Top = 240
26 | Width = 7215
27 | End
28 | End
29 | Attribute VB_Name = "Form1"
30 | Attribute VB_GlobalNameSpace = False
31 | Attribute VB_Creatable = False
32 | Attribute VB_PredeclaredId = True
33 | Attribute VB_Exposed = False
34 | Private Sub ButtonExecute_Click()
35 | Dim code As Long
36 | Dim RequestID As Long
37 | Dim L As Long
38 | Dim Res As String
39 |
40 | Res = ""
41 | RequestID = InitRequest()
42 | code = ExecutePHP(RequestID, "c:\php5\test.php")
43 | L = GetResultText(RequestID, Res, 0)
44 | Res = Space(L + 1)
45 |
46 | L = GetResultText(RequestID, Res, L)
47 | DoneRequest (RequestID)
48 | Text1.Text = Res
49 |
50 | End Sub
51 |
--------------------------------------------------------------------------------
/Demos/Extensions/phpDLL/Unit1.pas:
--------------------------------------------------------------------------------
1 | {*******************************************************}
2 | { PHP4Delphi }
3 | { PHP - Delphi interface }
4 | { Author: }
5 | { Serhiy Perevoznyk }
6 | { serge_perevoznyk@hotmail.com }
7 | { http://users.chello.be/ws36637 }
8 | {*******************************************************}
9 |
10 | { $Id: Unit1.pas,v 6.2 02/2006 delphi32 Exp $ }
11 |
12 | unit Unit1;
13 |
14 | interface
15 |
16 | uses
17 | Windows,
18 | Messages,
19 | SysUtils,
20 | Classes,
21 | Forms,
22 | zendTypes,
23 | zendAPI,
24 | phpTypes,
25 | phpAPI,
26 | phpFunctions,
27 | PHPModules;
28 |
29 | type
30 |
31 | TPHPExtension1 = class(TPHPExtension)
32 | procedure PHPExtension1Functions0Execute(Sender: TObject;
33 | Parameters: TFunctionParams; var ReturnValue: Variant;
34 | ThisPtr: Pzval; TSRMLS_DC: Pointer);
35 | private
36 | { Private declarations }
37 | public
38 | { Public declarations }
39 | end;
40 |
41 | var
42 | PHPExtension1: TPHPExtension1;
43 |
44 | implementation
45 |
46 | {$R *.DFM}
47 |
48 | procedure TPHPExtension1.PHPExtension1Functions0Execute(Sender: TObject;
49 | Parameters: TFunctionParams; var ReturnValue: Variant; ThisPtr: Pzval;
50 | TSRMLS_DC: Pointer);
51 |
52 | begin
53 | ReturnValue := Parameters[0].Value + ' from DLL';
54 | end;
55 |
56 | end.
--------------------------------------------------------------------------------
/Demos/psvPHP/Components/Unit1.dfm:
--------------------------------------------------------------------------------
1 | object frmTest: TfrmTest
2 | Left = 399
3 | Top = 356
4 | BorderStyle = bsDialog
5 | Caption = 'Components demo'
6 | ClientHeight = 252
7 | ClientWidth = 472
8 | Color = clBtnFace
9 | Font.Charset = DEFAULT_CHARSET
10 | Font.Color = clWindowText
11 | Font.Height = -11
12 | Font.Name = 'MS Sans Serif'
13 | Font.Style = []
14 | OldCreateOrder = False
15 | Position = poScreenCenter
16 | OnCreate = FormCreate
17 | PixelsPerInch = 96
18 | TextHeight = 13
19 | object Label1: TLabel
20 | Left = 0
21 | Top = 226
22 | Width = 472
23 | Height = 26
24 | Align = alBottom
25 | Caption =
26 | 'This demo project shows how to access published property'#13#10'of Del' +
27 | 'phi components from PHP script'
28 | Color = clInfoBk
29 | ParentColor = False
30 | WordWrap = True
31 | end
32 | object memScript: TMemo
33 | Left = 8
34 | Top = 8
35 | Width = 369
36 | Height = 213
37 | TabOrder = 0
38 | end
39 | object btnExecute: TButton
40 | Left = 384
41 | Top = 12
42 | Width = 75
43 | Height = 25
44 | Caption = '&Execute'
45 | TabOrder = 1
46 | OnClick = btnExecuteClick
47 | end
48 | object btnClose: TButton
49 | Left = 384
50 | Top = 42
51 | Width = 75
52 | Height = 25
53 | Caption = '&Close'
54 | TabOrder = 2
55 | OnClick = btnCloseClick
56 | end
57 | object PHP: TpsvPHP
58 | Constants = <>
59 | Variables = <>
60 | Left = 400
61 | Top = 136
62 | end
63 | end
64 |
--------------------------------------------------------------------------------
/Demos/Tutorial/Step.05/Unit1.pas:
--------------------------------------------------------------------------------
1 | {*******************************************************}
2 | { PHP4Delphi }
3 | { PHP - Delphi interface }
4 | { Author: }
5 | { Serhiy Perevoznyk }
6 | { serge_perevoznyk@hotmail.com }
7 | { http://users.chello.be/ws36637 }
8 | {*******************************************************}
9 |
10 | unit Unit1;
11 |
12 | { $Id: Unit1.pas,v 6.2 02/2006 delphi32 Exp $ }
13 |
14 | interface
15 |
16 | uses
17 | Windows,
18 | Messages,
19 | SysUtils,
20 | Classes,
21 | Forms,
22 | zendTypes,
23 | zendAPI,
24 | phpTypes,
25 | phpAPI,
26 | phpFunctions,
27 | PHPModules;
28 |
29 | type
30 |
31 | TPHPExtension1 = class(TPHPExtension)
32 | procedure PHPExtension1Functions0Execute(Sender: TObject;
33 | Parameters: TFunctionParams; var ReturnValue: Variant;
34 | ThisPtr: Pzval; TSRMLS_DC: Pointer);
35 | private
36 | { Private declarations }
37 | public
38 | { Public declarations }
39 | end;
40 |
41 | var
42 | PHPExtension1: TPHPExtension1;
43 |
44 | implementation
45 |
46 | {$R *.DFM}
47 |
48 | procedure TPHPExtension1.PHPExtension1Functions0Execute(Sender: TObject;
49 | Parameters: TFunctionParams; var ReturnValue: Variant; ThisPtr: Pzval;
50 | TSRMLS_DC: Pointer);
51 |
52 | begin
53 | //just returns the received value back
54 | ReturnValue := Parameters[0].Value;
55 | end;
56 |
57 | end.
--------------------------------------------------------------------------------
/Demos/Extensions/Class demo/dm_Class.dfm:
--------------------------------------------------------------------------------
1 | object classdemo: Tclassdemo
2 | OldCreateOrder = False
3 | Version = '1.0'
4 | Functions = <
5 | item
6 | FunctionName = 'new_class'
7 | Tag = 0
8 | Parameters = <>
9 | OnExecute = classdemoFunctions0Execute
10 | end>
11 | ModuleName = 'class_demo'
12 | Left = 235
13 | Top = 225
14 | Height = 479
15 | Width = 741
16 | object PHPDemoClass: TPHPClass
17 | Properties = <
18 | item
19 | Name = 'prop'
20 | Value = 'hello'
21 | end>
22 | Methods = <
23 | item
24 | Name = 'get_email'
25 | Tag = 0
26 | Parameters = <>
27 | OnExecute = GetEmailExecute
28 | end
29 | item
30 | Name = 'get_address'
31 | Tag = 0
32 | Parameters = <>
33 | OnExecute = GetAddressExecute
34 | end
35 | item
36 | Name = 'print_text'
37 | Tag = 0
38 | Parameters = <
39 | item
40 | Name = 'AText'
41 | ParamType = tpString
42 | end>
43 | OnExecute = PrintTextExecute
44 | end
45 | item
46 | Name = 'add_int'
47 | Tag = 0
48 | Parameters = <
49 | item
50 | Name = 'X'
51 | ParamType = tpInteger
52 | end
53 | item
54 | Name = 'Y'
55 | ParamType = tpInteger
56 | end>
57 | OnExecute = AddIntExecute
58 | end>
59 | PHPClassName = 'demo_class'
60 | Left = 120
61 | Top = 48
62 | end
63 | end
64 |
--------------------------------------------------------------------------------
/Demos/psvPHP/sample2/Unit1.dfm:
--------------------------------------------------------------------------------
1 | object Form1: TForm1
2 | Left = 414
3 | Top = 391
4 | Width = 344
5 | Height = 154
6 | Caption = 'Form1'
7 | Color = clBtnFace
8 | Font.Charset = DEFAULT_CHARSET
9 | Font.Color = clWindowText
10 | Font.Height = -11
11 | Font.Name = 'MS Sans Serif'
12 | Font.Style = []
13 | OldCreateOrder = False
14 | PixelsPerInch = 96
15 | TextHeight = 13
16 | object Label1: TLabel
17 | Left = 40
18 | Top = 36
19 | Width = 6
20 | Height = 13
21 | Caption = '+'
22 | end
23 | object Label2: TLabel
24 | Left = 140
25 | Top = 36
26 | Width = 6
27 | Height = 13
28 | Caption = '='
29 | end
30 | object Label3: TLabel
31 | Left = 156
32 | Top = 36
33 | Width = 3
34 | Height = 13
35 | end
36 | object Edit1: TEdit
37 | Left = 8
38 | Top = 8
39 | Width = 121
40 | Height = 21
41 | TabOrder = 0
42 | Text = '2'
43 | end
44 | object Edit2: TEdit
45 | Left = 8
46 | Top = 52
47 | Width = 121
48 | Height = 21
49 | TabOrder = 1
50 | Text = '2'
51 | end
52 | object Button1: TButton
53 | Left = 244
54 | Top = 88
55 | Width = 75
56 | Height = 25
57 | Caption = 'Calculate'
58 | TabOrder = 2
59 | OnClick = Button1Click
60 | end
61 | object psvPHP1: TpsvPHP
62 | Constants = <>
63 | Variables = <
64 | item
65 | Name = 'x'
66 | end
67 | item
68 | Name = 'y'
69 | end
70 | item
71 | Name = 'z'
72 | Value = '0'
73 | end>
74 | Left = 20
75 | Top = 80
76 | end
77 | end
78 |
--------------------------------------------------------------------------------
/Demos/psvPHP/Graph/Unit1.dfm:
--------------------------------------------------------------------------------
1 | object Form1: TForm1
2 | Left = 404
3 | Top = 217
4 | BorderStyle = bsDialog
5 | Caption = 'PHP Graph demo'
6 | ClientHeight = 531
7 | ClientWidth = 630
8 | Color = clBtnFace
9 | Font.Charset = DEFAULT_CHARSET
10 | Font.Color = clWindowText
11 | Font.Height = -11
12 | Font.Name = 'MS Sans Serif'
13 | Font.Style = []
14 | OldCreateOrder = False
15 | Position = poScreenCenter
16 | PixelsPerInch = 96
17 | TextHeight = 13
18 | object PaintBox: TPaintBox
19 | Left = 0
20 | Top = 0
21 | Width = 512
22 | Height = 512
23 | end
24 | object btnExecute: TButton
25 | Left = 524
26 | Top = 4
27 | Width = 75
28 | Height = 25
29 | Caption = '&Execute'
30 | TabOrder = 0
31 | OnClick = btnExecuteClick
32 | end
33 | object cbKeepSession: TCheckBox
34 | Left = 524
35 | Top = 44
36 | Width = 97
37 | Height = 17
38 | Caption = 'Keep Session'
39 | TabOrder = 1
40 | end
41 | object psvPHP: TpsvPHP
42 | Constants = <
43 | item
44 | Name = 'MinT'
45 | Value = '0'
46 | end
47 | item
48 | Name = 'MaxT'
49 | Value = '82'
50 | end
51 | item
52 | Name = 'Steps'
53 | Value = '2000'
54 | end>
55 | Variables = <
56 | item
57 | Name = 'X'
58 | Value = '0'
59 | end
60 | item
61 | Name = 'Y'
62 | Value = '0'
63 | end
64 | item
65 | Name = 'T'
66 | Value = '0'
67 | end>
68 | UseDelimiters = False
69 | Left = 236
70 | Top = 36
71 | end
72 | end
73 |
--------------------------------------------------------------------------------
/Demos/php4Applications/VB .NET/php4delphi/php4delphi/My Project/Application.Designer.vb:
--------------------------------------------------------------------------------
1 | '------------------------------------------------------------------------------
2 | '
3 | ' This code was generated by a tool.
4 | ' Runtime Version:2.0.50727.42
5 | '
6 | ' Changes to this file may cause incorrect behavior and will be lost if
7 | ' the code is regenerated.
8 | '
9 | '------------------------------------------------------------------------------
10 |
11 | Option Strict On
12 | Option Explicit On
13 |
14 |
15 | Namespace My
16 |
17 | 'NOTE: This file is auto-generated; do not modify it directly. To make changes,
18 | ' or if you encounter build errors in this file, go to the Project Designer
19 | ' (go to Project Properties or double-click the My Project node in
20 | ' Solution Explorer), and make changes on the Application tab.
21 | '
22 | Partial Friend Class MyApplication
23 |
24 | _
25 | Public Sub New()
26 | MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows)
27 | Me.IsSingleInstance = false
28 | Me.EnableVisualStyles = true
29 | Me.SaveMySettingsOnExit = true
30 | Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses
31 | End Sub
32 |
33 | _
34 | Protected Overrides Sub OnCreateMainForm()
35 | Me.MainForm = Global.php4delphi.Form1
36 | End Sub
37 | End Class
38 | End Namespace
39 |
--------------------------------------------------------------------------------
/Demos/psvPHP/sample3/Unit1.pas:
--------------------------------------------------------------------------------
1 | {*******************************************************}
2 | { PHP4Delphi }
3 | { PHP - Delphi interface }
4 | { Author: }
5 | { Serhiy Perevoznyk }
6 | { serge_perevoznyk@hotmail.com }
7 | { http://users.chello.be/ws36637 }
8 | {*******************************************************}
9 |
10 | unit Unit1;
11 |
12 | {$I PHP.INC}
13 |
14 | { $Id: Unit1.pas,v 6.2 02/2006 delphi32 Exp $ }
15 |
16 | interface
17 |
18 | uses
19 | Windows, Messages, SysUtils,
20 | {$IFDEF VERSION6} Variants, {$ENDIF} Classes, Graphics, Controls, Forms,
21 | Dialogs, php4delphi, StdCtrls;
22 |
23 | type
24 | TForm1 = class(TForm)
25 | Memo1: TMemo;
26 | Memo2: TMemo;
27 | Memo3: TMemo;
28 | Button1: TButton;
29 | Button2: TButton;
30 | Button3: TButton;
31 | psvPHP1: TpsvPHP;
32 | procedure Button1Click(Sender: TObject);
33 | procedure Button2Click(Sender: TObject);
34 | procedure Button3Click(Sender: TObject);
35 | private
36 | { Private declarations }
37 | public
38 | { Public declarations }
39 | end;
40 |
41 | var
42 | Form1: TForm1;
43 |
44 | implementation
45 |
46 | {$R *.dfm}
47 |
48 | procedure TForm1.Button1Click(Sender: TObject);
49 | begin
50 | psvPHP1.RunCode(Memo1.Lines.text);
51 | end;
52 |
53 | procedure TForm1.Button2Click(Sender: TObject);
54 | begin
55 | psvPHP1.RunCode(Memo2.Lines.text);
56 | end;
57 |
58 | procedure TForm1.Button3Click(Sender: TObject);
59 | begin
60 | ShowMessage(psvPHP1.RunCode(Memo3.Lines.text));
61 | end;
62 |
63 | end.
64 |
--------------------------------------------------------------------------------
/Demos/Bonus/wincon/php_wincon.h:
--------------------------------------------------------------------------------
1 | #ifndef PHP_WINCON_H
2 | #define PHP_WINCON_H
3 |
4 | extern zend_module_entry extname_module_entry;
5 | #define phpext_extname_ptr &extname_module_entry
6 |
7 | #ifdef PHP_WIN32
8 | #define PHP_WINCON_API __declspec(dllexport)
9 | #else
10 | #define PHP_WINCON_API
11 | #endif
12 |
13 | #ifdef ZTS
14 | #include "TSRM.h"
15 | #endif
16 |
17 | PHP_MINIT_FUNCTION(wincon);
18 | PHP_MSHUTDOWN_FUNCTION(wincon);
19 | PHP_RINIT_FUNCTION(wincon);
20 | PHP_RSHUTDOWN_FUNCTION(wincon);
21 | PHP_MINFO_FUNCTION(wincon);
22 |
23 | PHP_FUNCTION(allocconsole);
24 | PHP_FUNCTION(createconsolescreenbuffer);
25 | PHP_FUNCTION(fillconsoleoutputattribute);
26 | PHP_FUNCTION(getstdhandle);
27 | PHP_FUNCTION(setconsoletitle);
28 | PHP_FUNCTION(readconsole);
29 | PHP_FUNCTION(flushconsoleinputbuffer);
30 | PHP_FUNCTION(freeconsole);
31 | PHP_FUNCTION(generateconsolectrlevent);
32 | PHP_FUNCTION(getconsolecp);
33 | PHP_FUNCTION(getconsolecursorsize);
34 | PHP_FUNCTION(getconsolecursorvisible);
35 | PHP_FUNCTION(getconsolemode);
36 | PHP_FUNCTION(getconsoleoutputcp);
37 | PHP_FUNCTION(getconsolescreenbufferinfo);
38 | PHP_FUNCTION(getconsoletitle);
39 | PHP_FUNCTION(getnumberofconsoleinputevents);
40 | PHP_FUNCTION(setconsolecp);
41 | PHP_FUNCTION(writeconsole);
42 | PHP_FUNCTION(setconsoletextattribute);
43 | PHP_FUNCTION(setconsoleoutputcp);
44 | PHP_FUNCTION(setstdhandle);
45 | PHP_FUNCTION(setconsolemode);
46 | PHP_FUNCTION(setconsolecursorposition);
47 | PHP_FUNCTION(setconsolecursorinfo);
48 | PHP_FUNCTION(writeconsoleoutputcharacter);
49 |
50 |
51 |
52 | #ifdef ZTS
53 | #define EXTNAME_G(v) TSRMG(wincon_globals_id, zend_wincon_globals *, v)
54 | #else
55 | #define EXTNAME_G(v) (wincon_globals.v)
56 | #endif
57 |
58 | #endif /* PHP_WINCON_H */
59 |
60 |
--------------------------------------------------------------------------------
/Demos/psvPHP/Library demo/Unit1.dfm:
--------------------------------------------------------------------------------
1 | object Form1: TForm1
2 | Left = 395
3 | Top = 303
4 | Caption = 'Form1'
5 | ClientHeight = 209
6 | ClientWidth = 377
7 | Color = clBtnFace
8 | Font.Charset = DEFAULT_CHARSET
9 | Font.Color = clWindowText
10 | Font.Height = -11
11 | Font.Name = 'MS Sans Serif'
12 | Font.Style = []
13 | OldCreateOrder = False
14 | PixelsPerInch = 96
15 | TextHeight = 13
16 | object Memo1: TMemo
17 | Left = 8
18 | Top = 8
19 | Width = 185
20 | Height = 189
21 | Lines.Strings = (
22 | 'formcaption("Hello from PHP");'
23 | 'buttonclick();')
24 | TabOrder = 0
25 | end
26 | object Button1: TButton
27 | Left = 292
28 | Top = 172
29 | Width = 75
30 | Height = 25
31 | Caption = 'Click'
32 | TabOrder = 1
33 | OnClick = Button1Click
34 | end
35 | object Button2: TButton
36 | Left = 292
37 | Top = 12
38 | Width = 75
39 | Height = 25
40 | Caption = 'Execute'
41 | TabOrder = 2
42 | OnClick = Button2Click
43 | end
44 | object psvPHP1: TpsvPHP
45 | Constants = <>
46 | Variables = <>
47 | Left = 32
48 | Top = 28
49 | end
50 | object PHPLibrary1: TPHPLibrary
51 | Executor = psvPHP1
52 | LibraryName = 'SimpleLib'
53 | Functions = <
54 | item
55 | FunctionName = 'formcaption'
56 | Tag = 0
57 | Parameters = <
58 | item
59 | Name = 'Param1'
60 | ParamType = tpString
61 | end>
62 | OnExecute = PHPLibrary1Functions0Execute
63 | end
64 | item
65 | FunctionName = 'buttonclick'
66 | Tag = 0
67 | Parameters = <>
68 | OnExecute = PHPLibrary1Functions1Execute
69 | end>
70 | Left = 68
71 | Top = 28
72 | end
73 | end
74 |
--------------------------------------------------------------------------------
/Demos/php4Applications/C#/PHP4DelphiDemo/PHP4DelphiDemo.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
21 |
37 |
38 |
39 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/php4AppIntf.pas:
--------------------------------------------------------------------------------
1 | {*******************************************************}
2 | { PHP4Applications }
3 | { }
4 | { Delphi interface for PHP4Applications }
5 | { }
6 | { Author: }
7 | { Serhiy Perevoznyk }
8 | { serge_perevoznyk@hotmail.com }
9 | { http://users.chello.be/ws36637 }
10 | {*******************************************************}
11 |
12 | unit php4AppIntf;
13 |
14 | interface
15 |
16 | function InitRequest : integer; stdcall;
17 | procedure DoneRequest(RequestID : integer); stdcall;
18 | procedure RegisterVariable(RequestID : integer; AName : PChar; AValue : PChar); stdcall;
19 | function ExecutePHP(RequestID : integer; FileName : PChar) : integer; stdcall;
20 | function ExecuteCode(RequestID : integer; ACode : PChar) : integer; stdcall;
21 | function GetResultText(RequestID : integer; Buffer : PChar; BufLen : integer) : integer; stdcall;
22 | function GetVariable(RequestID : integer; AName : PChar; Buffer : PChar; BufLen : integer) : integer; stdcall;
23 | procedure SaveToFile(RequestID : integer; AFileName : PChar); stdcall;
24 | function GetVariableSize(RequestID : integer; AName : PChar) : integer; stdcall;
25 | function GetResultBufferSize(RequestID : integer) : integer; stdcall;
26 |
27 | implementation
28 |
29 | function InitRequest; external 'php4app.dll';
30 | procedure DoneRequest; external 'php4app.dll';
31 | procedure RegisterVariable; external 'php4app.dll';
32 | function ExecutePHP; external 'php4app.dll';
33 | function ExecuteCode; external 'php4app.dll';
34 | function GetResultText; external 'php4app.dll';
35 | function GetVariable; external 'php4app.dll';
36 | procedure SaveToFile; external 'php4app.dll';
37 | function GetVariableSize; external 'php4app.dll';
38 | function GetResultBufferSize; external 'php4app.dll';
39 |
40 | end.
--------------------------------------------------------------------------------
/Demos/psvPHP/sample3/Unit1.dfm:
--------------------------------------------------------------------------------
1 | object Form1: TForm1
2 | Left = 309
3 | Top = 184
4 | BorderStyle = bsDialog
5 | Caption = 'Built-in functions and class sample'
6 | ClientHeight = 331
7 | ClientWidth = 460
8 | Color = clBtnFace
9 | Font.Charset = DEFAULT_CHARSET
10 | Font.Color = clWindowText
11 | Font.Height = -11
12 | Font.Name = 'MS Sans Serif'
13 | Font.Style = []
14 | OldCreateOrder = False
15 | Position = poScreenCenter
16 | PixelsPerInch = 96
17 | TextHeight = 13
18 | object Memo1: TMemo
19 | Left = 8
20 | Top = 8
21 | Width = 329
22 | Height = 89
23 | Lines.Strings = (
24 | 'delphi_Show_Message("Hello, Delphi!");')
25 | TabOrder = 0
26 | end
27 | object Memo2: TMemo
28 | Left = 8
29 | Top = 108
30 | Width = 329
31 | Height = 89
32 | Lines.Strings = (
33 | '$a = new php4delphi_author();'
34 | '$a->send_email();')
35 | TabOrder = 1
36 | end
37 | object Memo3: TMemo
38 | Left = 8
39 | Top = 212
40 | Width = 329
41 | Height = 89
42 | Lines.Strings = (
43 | 'echo delphi_get_system_directory();')
44 | TabOrder = 2
45 | end
46 | object Button1: TButton
47 | Left = 364
48 | Top = 60
49 | Width = 75
50 | Height = 25
51 | Caption = 'Execute'
52 | TabOrder = 3
53 | OnClick = Button1Click
54 | end
55 | object Button2: TButton
56 | Left = 364
57 | Top = 160
58 | Width = 75
59 | Height = 25
60 | Caption = 'Execute'
61 | TabOrder = 4
62 | OnClick = Button2Click
63 | end
64 | object Button3: TButton
65 | Left = 372
66 | Top = 268
67 | Width = 75
68 | Height = 25
69 | Caption = 'Execute'
70 | TabOrder = 5
71 | OnClick = Button3Click
72 | end
73 | object psvPHP1: TpsvPHP
74 | Constants = <>
75 | Variables = <
76 | item
77 | Name = 'test'
78 | Value = 'test'
79 | end>
80 | HandleErrors = False
81 | Left = 112
82 | Top = 140
83 | end
84 | end
85 |
--------------------------------------------------------------------------------
/Demos/php4Applications/VB .NET/php4delphi/php4delphi/Form1.vb:
--------------------------------------------------------------------------------
1 | Imports System.Runtime.InteropServices
2 |
3 | Public Class Form1
4 |
5 | Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
6 | Dim L As Integer
7 | Dim builder As StringBuilder = New StringBuilder
8 | Dim RequestID As Integer
9 | Dim fn As String
10 | If OpenFileDialog1.ShowDialog Then
11 | RequestID = InitRequest()
12 | fn = OpenFileDialog1.FileName
13 | ExecutePHP(RequestID, fn)
14 | L = GetResultText(RequestID, builder, 0)
15 | builder.Capacity = L
16 | L = GetResultText(RequestID, builder, builder.Capacity + 1)
17 | TextBox1.Text = builder.ToString()
18 | DoneRequest(RequestID)
19 | End If
20 | End Sub
21 | Public Declare Ansi Function ExecutePHP Lib "php4app.dll" (ByVal RequestID As Integer, ByVal FileName As String) As Integer
22 | Public Declare Ansi Function InitRequest Lib "php4app.dll" () As Integer
23 | Public Declare Ansi Sub DoneRequest Lib "php4app.dll" (ByVal RequestID As Integer)
24 | Public Declare Ansi Function GetResultText Lib "php4app.dll" (ByVal RequestID As Integer, ByVal Buf As StringBuilder, ByVal Buflen As Integer) As Integer
25 | Public Declare Ansi Sub RegisterVariable Lib "php4app.dll" (ByVal RequestID As Integer, ByVal AName As String, ByVal AValue As String)
26 | Public Declare Ansi Function ExecuteCode Lib "php4app.dll" (ByVal RequestID As Integer, ByVal ACode As String) As Integer
27 | Public Declare Ansi Function GetVariable Lib "php4app.dll" (ByVal RequestID As Integer, ByVal AName As String, ByVal Buffer As StringBuilder, ByVal BufLen As Integer) As Integer
28 | Public Declare Ansi Sub SaveToFile Lib "php4app.dll" (ByVal RequestID As Integer, ByVal AFileName As String)
29 | Public Declare Ansi Function GetVariableSize Lib "php4app.dll" (ByVal RequestID As Integer, ByVal AName As String) As Integer
30 | Public Declare Ansi Function GetResultBufferSize Lib "php4app.dll" (ByVal RequestID As Integer) As Integer
31 |
32 | End Class
33 |
--------------------------------------------------------------------------------
/php4DelphiWeb.pas:
--------------------------------------------------------------------------------
1 | {*******************************************************}
2 | { PHP4Delphi }
3 | { PHP - Delphi interface }
4 | { }
5 | { Author: }
6 | { Serhiy Perevoznyk }
7 | { serge_perevoznyk@hotmail.com }
8 | { http://users.chello.be/ws36637 }
9 | {*******************************************************}
10 | {$I PHP.INC}
11 |
12 | { $Id: php4DelphiWeb.pas,v 6.2 02/2006 delphi32 Exp $ }
13 |
14 | unit php4DelphiWeb;
15 |
16 | interface
17 |
18 | uses
19 | Windows, ToolsAPI, Forms, Dialogs, SysUtils, Graphics, Classes, ShellAPI;
20 |
21 | type
22 | Tphp4DelphiWeb = class(TNotifierObject, IOTAWIzard, IOTAMenuWizard)
23 | public
24 | function GetMenuText: string;
25 | function GetIDString: string;
26 | function GetName: string;
27 | function GetState: TWizardState;
28 | procedure Execute;
29 | end;
30 |
31 | procedure Register;
32 |
33 | implementation
34 |
35 | procedure Register;
36 | begin
37 | RegisterPackageWizard(Tphp4DelphiWeb.Create as IOTAWizard);
38 | end;
39 |
40 | procedure InitExpert;
41 | begin
42 | { stubbed out }
43 | end;
44 |
45 | procedure DoneExpert;
46 | begin
47 | { stubbed out }
48 | end;
49 |
50 | { Tphp4DelphiWeb }
51 |
52 | procedure Tphp4DelphiWeb.Execute;
53 | begin
54 | ShellExecute(0, 'open', 'http://users.chello.be/ws36637', nil, nil, SW_SHOW);
55 | end;
56 |
57 | function Tphp4DelphiWeb.GetIDString: string;
58 | begin
59 | Result := 'Perevoznyk.Tphp4DelphiWeb';
60 | end;
61 |
62 | function Tphp4DelphiWeb.GetMenuText: string;
63 | begin
64 | Result := 'PHP4Delphi Home Page';
65 | end;
66 |
67 | function Tphp4DelphiWeb.GetName: string;
68 | begin
69 | Result := 'Tphp4DelphiWeb';
70 | end;
71 |
72 | function Tphp4DelphiWeb.GetState: TWizardState;
73 | begin
74 | Result := [wsEnabled];
75 | end;
76 |
77 | initialization
78 | InitExpert;
79 |
80 | finalization
81 | DoneExpert;
82 |
83 | end.
84 |
--------------------------------------------------------------------------------
/ExtensionBuilder/Builder.Inc:
--------------------------------------------------------------------------------
1 | {$IFNDEF VER80} {Delphi 1.0}
2 | {$DEFINE VERSION2} {Delphi 2.0 and BCB 1 or higher}
3 | {$ENDIF}
4 |
5 | {$IFDEF VERSION2}
6 | {$IFNDEF VER90} {Delphi 2.0}
7 | {$IFNDEF VER93} {BCB 1.0}
8 | {$DEFINE VERSION3} {Delphi 3.0 or BCB 3.0}
9 | {$ENDIF}
10 | {$ENDIF}
11 | {$ENDIF}
12 |
13 | {$IFDEF VERSION3}
14 | {$IFNDEF VER100} {Delphi 3}
15 | {$IFNDEF VER110} {BCB 3}
16 | {$DEFINE VERSION4} {Delphi 4.0 or higher}
17 | {$ENDIF}
18 | {$ENDIF}
19 | {$ENDIF}
20 |
21 | {$IFDEF VERSION4}
22 | {$IFNDEF VER120} {Delphi 4}
23 | {$IFNDEF VER125} {BCB 4}
24 | {$DEFINE VERSION5} {Delphi 5.0 or higher}
25 | {$ENDIF}
26 | {$ENDIF}
27 | {$ENDIF}
28 |
29 | {$IFDEF VERSION5}
30 | {$IFNDEF VER130} {Delphi 5}
31 | {$IFNDEF VER135} {BCB 5}
32 | {$DEFINE VERSION6} {Delphi 6.0 or higher}
33 | {$ENDIF}
34 | {$ENDIF}
35 | {$ENDIF}
36 |
37 | {$IFDEF VERSION6}
38 | {$IFNDEF VER140} {Delphi 6}
39 | {$IFNDEF VER145} {BCB 6}
40 | {$DEFINE VERSION7} {Delphi 7.0 or higher}
41 | {$ENDIF}
42 | {$ENDIF}
43 | {$ENDIF}
44 |
45 | {$IFDEF VERSION6}
46 | {$WARN SYMBOL_PLATFORM OFF}
47 | {$IFDEF VERSION7}
48 | {$WARN UNIT_PLATFORM OFF}
49 | {$WARN UNSAFE_CODE OFF}
50 | {$WARN UNSAFE_TYPE OFF}
51 | {$WARN UNSAFE_CAST OFF}
52 | {$WARN UNIT_DEPRECATED OFF}
53 | {$ENDIF}
54 | {$ENDIF}
55 |
56 | {$IFDEF VERSION5}
57 | {$IFNDEF VERSION6}
58 | {$DEFINE VERSION5ONLY}
59 | {$ENDIF}
60 | {$ENDIF}
61 |
62 | {$IFDEF VERSION6}
63 | {$A8}
64 | {ELSE}
65 | {$A+}
66 | {$ENDIF}
67 |
68 |
--------------------------------------------------------------------------------
/Demos/psvPHP/sample4/frm_PHPTest.dfm:
--------------------------------------------------------------------------------
1 | object frmPHPTest: TfrmPHPTest
2 | Left = 218
3 | Top = 174
4 | Width = 590
5 | Height = 435
6 | Caption = 'psvPHP test'
7 | Color = clBtnFace
8 | Font.Charset = DEFAULT_CHARSET
9 | Font.Color = clWindowText
10 | Font.Height = -11
11 | Font.Name = 'MS Sans Serif'
12 | Font.Style = []
13 | OldCreateOrder = False
14 | PixelsPerInch = 96
15 | TextHeight = 13
16 | object Splitter1: TSplitter
17 | Left = 241
18 | Top = 0
19 | Width = 3
20 | Height = 360
21 | Cursor = crHSplit
22 | end
23 | object Panel1: TPanel
24 | Left = 0
25 | Top = 360
26 | Width = 582
27 | Height = 41
28 | Align = alBottom
29 | BevelOuter = bvNone
30 | TabOrder = 0
31 | object Panel2: TPanel
32 | Left = 397
33 | Top = 0
34 | Width = 185
35 | Height = 41
36 | Align = alRight
37 | BevelOuter = bvNone
38 | TabOrder = 0
39 | object Button1: TButton
40 | Left = 100
41 | Top = 8
42 | Width = 75
43 | Height = 25
44 | Caption = 'Execute'
45 | TabOrder = 0
46 | OnClick = Button1Click
47 | end
48 | end
49 | end
50 | object Panel3: TPanel
51 | Left = 0
52 | Top = 0
53 | Width = 241
54 | Height = 360
55 | Align = alLeft
56 | BevelOuter = bvNone
57 | Caption = 'Panel3'
58 | TabOrder = 1
59 | object memoScript: TMemo
60 | Left = 0
61 | Top = 0
62 | Width = 241
63 | Height = 360
64 | Align = alClient
65 | Lines.Strings = (
66 | 'phpinfo();')
67 | ScrollBars = ssBoth
68 | TabOrder = 0
69 | end
70 | end
71 | object Panel4: TPanel
72 | Left = 244
73 | Top = 0
74 | Width = 338
75 | Height = 360
76 | Align = alClient
77 | BevelOuter = bvNone
78 | Caption = 'Panel4'
79 | TabOrder = 2
80 | object MemoResult: TMemo
81 | Left = 0
82 | Top = 0
83 | Width = 338
84 | Height = 360
85 | Align = alClient
86 | ScrollBars = ssBoth
87 | TabOrder = 0
88 | end
89 | end
90 | object psvPHP: TpsvPHP
91 | Constants = <>
92 | Variables = <>
93 | Left = 84
94 | Top = 148
95 | end
96 | end
97 |
--------------------------------------------------------------------------------
/Demos/psvPHP/Library demo/Unit1.pas:
--------------------------------------------------------------------------------
1 | {*******************************************************}
2 | { PHP4Delphi }
3 | { PHP - Delphi interface }
4 | { Author: }
5 | { Serhiy Perevoznyk }
6 | { serge_perevoznyk@hotmail.com }
7 | { http://users.chello.be/ws36637 }
8 | {*******************************************************}
9 |
10 | { $Id: Unit1.pas,v 6.2 02/2006 delphi32 Exp $ }
11 |
12 | unit Unit1;
13 |
14 | interface
15 |
16 | uses
17 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
18 | StdCtrls, PHPCustomLibrary, phpLibrary, php4delphi, PHPAPI, ZENDAPI,
19 | PHPFunctions, ZendTypes, phpTypes, PHPCommon;
20 |
21 | type
22 | TForm1 = class(TForm)
23 | psvPHP1: TpsvPHP;
24 | PHPLibrary1: TPHPLibrary;
25 | Memo1: TMemo;
26 | Button1: TButton;
27 | Button2: TButton;
28 | procedure Button1Click(Sender: TObject);
29 | procedure Button2Click(Sender: TObject);
30 | procedure PHPLibrary1Functions0Execute(Sender: TObject;
31 | Parameters: TFunctionParams; var ReturnValue: Variant;
32 | ThisPtr: Pzval; TSRMLS_DC: Pointer);
33 | procedure PHPLibrary1Functions1Execute(Sender: TObject;
34 | Parameters: TFunctionParams; var ReturnValue: Variant;
35 | ThisPtr: Pzval; TSRMLS_DC: Pointer);
36 | private
37 | { Private declarations }
38 | public
39 | { Public declarations }
40 | end;
41 |
42 | var
43 | Form1: TForm1;
44 |
45 | implementation
46 |
47 | {$R *.DFM}
48 |
49 | procedure TForm1.Button1Click(Sender: TObject);
50 | begin
51 | ShowMessage('Click');
52 | end;
53 |
54 | procedure TForm1.Button2Click(Sender: TObject);
55 | begin
56 | psvPhp1.RunCode(memo1.Lines.text);
57 | end;
58 |
59 | procedure TForm1.PHPLibrary1Functions0Execute(Sender: TObject;
60 | Parameters: TFunctionParams; var ReturnValue: Variant; ThisPtr: Pzval;
61 | TSRMLS_DC: Pointer);
62 | begin
63 | Form1.Caption := Parameters[0].Value;
64 | end;
65 |
66 | procedure TForm1.PHPLibrary1Functions1Execute(Sender: TObject;
67 | Parameters: TFunctionParams; var ReturnValue: Variant; ThisPtr: Pzval;
68 | TSRMLS_DC: Pointer);
69 | begin
70 | Button1.Click;
71 | end;
72 |
73 | end.
74 |
--------------------------------------------------------------------------------
/Demos/Extensions/Delphi Class 1/delphi_class_module.dfm:
--------------------------------------------------------------------------------
1 | object PHDelphiPExtension: TPHDelphiPExtension
2 | OldCreateOrder = False
3 | OnCreate = PHPExtensionCreate
4 | Version = '1.0'
5 | Functions = <
6 | item
7 | FunctionName = 'delphi_class_create'
8 | Tag = 0
9 | Parameters = <
10 | item
11 | Name = 'ClassName'
12 | ParamType = tpString
13 | end
14 | item
15 | Name = 'ComponentName'
16 | ParamType = tpString
17 | end>
18 | OnExecute = ClassCreateExecute
19 | end
20 | item
21 | FunctionName = 'delphi_get_prop'
22 | Tag = 0
23 | Parameters = <
24 | item
25 | Name = 'Instance'
26 | ParamType = tpInteger
27 | end
28 | item
29 | Name = 'PropName'
30 | ParamType = tpString
31 | end>
32 | OnExecute = GetPropertyExecute
33 | end
34 | item
35 | FunctionName = 'delphi_class_free'
36 | Tag = 0
37 | Parameters = <
38 | item
39 | Name = 'Instance'
40 | ParamType = tpInteger
41 | end>
42 | OnExecute = ClassFreeExecute
43 | end
44 | item
45 | FunctionName = 'delphi_set_prop'
46 | Tag = 0
47 | Parameters = <
48 | item
49 | Name = 'Instance'
50 | ParamType = tpInteger
51 | end
52 | item
53 | Name = 'PropName'
54 | ParamType = tpString
55 | end
56 | item
57 | Name = 'PropValue'
58 | ParamType = tpString
59 | end>
60 | OnExecute = SetPropertyExecute
61 | end
62 | item
63 | FunctionName = 'delphi_form_create'
64 | Tag = 0
65 | Parameters = <
66 | item
67 | Name = 'ClassName'
68 | ParamType = tpString
69 | end
70 | item
71 | Name = 'ComponentName'
72 | ParamType = tpString
73 | end>
74 | OnExecute = FormCreateExecute
75 | end
76 | item
77 | FunctionName = 'delphi_message'
78 | Tag = 0
79 | Parameters = <
80 | item
81 | Name = 'Message'
82 | ParamType = tpString
83 | end>
84 | OnExecute = DelphiMessageExecute
85 | end>
86 | ModuleName = 'delphi_class'
87 | Left = 285
88 | Top = 161
89 | Height = 479
90 | Width = 741
91 | end
92 |
--------------------------------------------------------------------------------
/Demos/php4Applications/Delphi .NET/php4Delphi.Standard.pas:
--------------------------------------------------------------------------------
1 | unit php4Delphi.Standard;
2 |
3 | interface
4 | uses
5 | Types, System.Text, System.Runtime.InteropServices;
6 |
7 | function InitRequest : integer;
8 | procedure DoneRequest(RequestID : integer);
9 | procedure RegisterVariable(RequestID : integer; AName : string; AValue : string);
10 | function ExecutePHP(RequestID : integer; FileName : string) : integer;
11 | function ExecuteCode(RequestID : integer; ACode : string) : integer;
12 | function GetResultText(RequestID : integer; Buffer : StringBuilder; BufLen : integer) : integer;
13 | function GetVariable(RequestID : integer; AName : string; Buffer : StringBuilder; BufLen : integer) : integer;
14 | procedure SaveToFile(RequestID : integer; AFileName : string);
15 | function GetVariableSize(RequestID : integer; AName : string) : integer;
16 | function GetResultBufferSize(RequestID : integer) : integer;
17 |
18 | implementation
19 | uses
20 | System.Security;
21 |
22 | [SuppressUnmanagedCodeSecurity, DllImport('php4app.dll', CharSet = CharSet.Ansi, SetLastError = True)]
23 | function InitRequest; external;
24 |
25 | [SuppressUnmanagedCodeSecurity, DllImport('php4app.dll', CharSet = CharSet.Ansi, SetLastError = True)]
26 | procedure DoneRequest; external;
27 |
28 | [SuppressUnmanagedCodeSecurity, DllImport('php4app.dll', CharSet = CharSet.Ansi, SetLastError = True)]
29 | procedure RegisterVariable;external;
30 |
31 | [SuppressUnmanagedCodeSecurity, DllImport('php4app.dll', CharSet = CharSet.Ansi, SetLastError = True)]
32 | function ExecutePHP;external;
33 |
34 | [SuppressUnmanagedCodeSecurity, DllImport('php4app.dll', CharSet = CharSet.Ansi, SetLastError = True)]
35 | function ExecuteCode;external;
36 |
37 | [SuppressUnmanagedCodeSecurity, DllImport('php4app.dll', CharSet = CharSet.Ansi, SetLastError = True)]
38 | function GetResultText;external;
39 |
40 | [SuppressUnmanagedCodeSecurity, DllImport('php4app.dll', CharSet = CharSet.Ansi, SetLastError = True)]
41 | function GetVariable;external;
42 |
43 | [SuppressUnmanagedCodeSecurity, DllImport('php4app.dll', CharSet = CharSet.Ansi, SetLastError = True)]
44 | procedure SaveToFile;external;
45 |
46 | [SuppressUnmanagedCodeSecurity, DllImport('php4app.dll', CharSet = CharSet.Ansi, SetLastError = True)]
47 | function GetVariableSize;external;
48 |
49 | [SuppressUnmanagedCodeSecurity, DllImport('php4app.dll', CharSet = CharSet.Ansi, SetLastError = True)]
50 | function GetResultBufferSize;external;
51 |
52 | end.
53 |
--------------------------------------------------------------------------------
/Demos/Extensions/Delphi Class 2/delphi_class2.dpr:
--------------------------------------------------------------------------------
1 | {*******************************************************}
2 | { PHP4Delphi }
3 | { PHP - Delphi interface }
4 | { Author: }
5 | { Serhiy Perevoznyk }
6 | { serge_perevoznyk@hotmail.com }
7 | { http://users.chello.be/ws36637 }
8 | {*******************************************************}
9 |
10 | {$I php.inc}
11 |
12 | library delphi_class2;
13 |
14 | uses
15 | Windows, SysUtils, zendTypes, ZENDAPI, phpTypes, PHPAPI, DelphiFunctions;
16 |
17 |
18 | function rinit (_type : integer; module_number : integer; TSRMLS_DC : pointer) : integer; cdecl;
19 | begin
20 | Result := SUCCESS;
21 | end;
22 |
23 | function rshutdown (_type : integer; module_number : integer; TSRMLS_DC : pointer) : integer; cdecl;
24 | begin
25 | Result := SUCCESS;
26 | end;
27 |
28 | procedure php_info_module(zend_module : Pzend_module_entry; TSRMLS_DC : pointer); cdecl;
29 | begin
30 | php_info_print_table_start();
31 | php_info_print_table_row(2, PChar('Delphi classes support'), PChar('enabled'));
32 | php_info_print_table_end();
33 | end;
34 |
35 | function minit (_type : integer; module_number : integer; TSRMLS_DC : pointer) : integer; cdecl;
36 | begin
37 | RegisterInternalClasses(TSRMLS_DC);
38 | RESULT := SUCCESS;
39 | end;
40 |
41 | function mshutdown (_type : integer; module_number : integer; TSRMLS_DC : pointer) : integer; cdecl;
42 | begin
43 | RESULT := SUCCESS;
44 | end;
45 |
46 |
47 |
48 | var
49 | moduleEntry : Tzend_module_entry;
50 |
51 |
52 | function get_module : Pzend_module_entry; cdecl;
53 | begin
54 | if not PHPLoaded then
55 | LoadPHP;
56 | InitDelphiFunctions;
57 | ModuleEntry.size := sizeof(Tzend_module_entry);
58 | ModuleEntry.zend_api := ZEND_MODULE_API_NO;
59 | ModuleEntry.zts := USING_ZTS;
60 | ModuleEntry.Name := 'delphi_class2';
61 | ModuleEntry.version := '1.0';
62 | ModuleEntry.module_startup_func := @minit;
63 | ModuleEntry.module_shutdown_func := @mshutdown;
64 | ModuleEntry.request_startup_func := @rinit;
65 | ModuleEntry.request_shutdown_func := @rshutdown;
66 | ModuleEntry.info_func := @php_info_module;
67 | {$IFDEF PHP4}
68 | Module_entry_table[0].func_arg_types := nil;
69 | {$ENDIF}
70 | ModuleEntry.functions := @DelphiTable[0];
71 | ModuleEntry._type := MODULE_PERSISTENT;
72 | Result := @ModuleEntry;
73 | end;
74 |
75 |
76 |
77 | exports
78 | get_module;
79 |
80 | end.
81 |
82 |
--------------------------------------------------------------------------------
/zend_dynamic_array.pas:
--------------------------------------------------------------------------------
1 | {*******************************************************}
2 | { PHP4Delphi }
3 | { PHP - Delphi interface }
4 | { }
5 | { Author: }
6 | { Serhiy Perevoznyk }
7 | { serge_perevoznyk@hotmail.com }
8 | { http://users.chello.be/ws36637 }
9 | {*******************************************************}
10 | {$I PHP.INC}
11 |
12 | { $Id: zend_dynamic_array.pas,v 6.2 02/2006 delphi32 Exp $ }
13 |
14 | unit zend_dynamic_array;
15 |
16 | interface
17 | uses
18 | Windows, SysUtils;
19 |
20 | type
21 |
22 |
23 | dynamic_array = record
24 | _array : PChar;
25 | element_size : UINT;
26 | current : UINT;
27 | allocated : UINT;
28 | end;
29 |
30 | TDynamicArray = dynamic_array;
31 | PDynamicArray = ^TDynamicArray;
32 |
33 | function zend_dynamic_array_init(da : PDynamicArray; element_size : UINT; size: UINT) : integer; cdecl;
34 | function zend_dynamic_array_push(da : PDynamicArray) : pointer; cdecl;
35 | function zend_dynamic_array_pop(da : PDynamicArray) : pointer; cdecl;
36 | function zend_dynamic_array_get_element(da : PDynamicArray; index: UINT) : pointer; cdecl;
37 |
38 | implementation
39 |
40 | function zend_dynamic_array_init(da : PDynamicArray; element_size : UINT; size: UINT) : integer; cdecl;
41 | begin
42 | da^.element_size := element_size;
43 | da^.allocated := size;
44 | da^.current := 0;
45 | da^._array := AllocMem(size*element_size);
46 | if (da^._array = nil) then
47 | Result := 1
48 | else
49 | Result := 0;
50 | end;
51 |
52 |
53 | function zend_dynamic_array_push(da : PDynamicArray) : pointer; cdecl;
54 | begin
55 | if (da^.current = da^.allocated) then
56 | begin
57 | da^.allocated := da^.Allocated * 2;
58 | da^._array := ReallocMemory (da^._array, da^.allocated*da^.element_size);
59 | end;
60 | Result := da^._array + (da^.current)*da^.element_size;
61 | inc(da^.current);
62 | end;
63 |
64 | function zend_dynamic_array_pop(da : PDynamicArray) : pointer; cdecl;
65 | begin
66 | dec(da^.current);
67 | Result := da^._array + (da^.current)*da^.element_size;
68 | end;
69 |
70 | function zend_dynamic_array_get_element(da : PDynamicArray; index: UINT) : pointer; cdecl;
71 | begin
72 | if (index >= da^.current) then
73 | result := nil
74 | else
75 | Result := da^._array+index*da^.element_size;
76 | end;
77 |
78 | end.
79 |
--------------------------------------------------------------------------------
/Demos/php4Applications/C#/PHP4DelphiDemo/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 |
4 | //
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | //
9 | [assembly: AssemblyTitle("")]
10 | [assembly: AssemblyDescription("")]
11 | [assembly: AssemblyConfiguration("")]
12 | [assembly: AssemblyCompany("")]
13 | [assembly: AssemblyProduct("")]
14 | [assembly: AssemblyCopyright("")]
15 | [assembly: AssemblyTrademark("")]
16 | [assembly: AssemblyCulture("")]
17 |
18 | //
19 | // Version information for an assembly consists of the following four values:
20 | //
21 | // Major Version
22 | // Minor Version
23 | // Build Number
24 | // Revision
25 | //
26 | // You can specify all the values or you can default the Revision and Build Numbers
27 | // by using the '*' as shown below:
28 |
29 | [assembly: AssemblyVersion("1.0.*")]
30 |
31 | //
32 | // In order to sign your assembly you must specify a key to use. Refer to the
33 | // Microsoft .NET Framework documentation for more information on assembly signing.
34 | //
35 | // Use the attributes below to control which key is used for signing.
36 | //
37 | // Notes:
38 | // (*) If no key is specified, the assembly is not signed.
39 | // (*) KeyName refers to a key that has been installed in the Crypto Service
40 | // Provider (CSP) on your machine. KeyFile refers to a file which contains
41 | // a key.
42 | // (*) If the KeyFile and the KeyName values are both specified, the
43 | // following processing occurs:
44 | // (1) If the KeyName can be found in the CSP, that key is used.
45 | // (2) If the KeyName does not exist and the KeyFile does exist, the key
46 | // in the KeyFile is installed into the CSP and used.
47 | // (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
48 | // When specifying the KeyFile, the location of the KeyFile should be
49 | // relative to the project output directory which is
50 | // %Project Directory%\obj\. For example, if your KeyFile is
51 | // located in the project directory, you would specify the AssemblyKeyFile
52 | // attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
53 | // (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
54 | // documentation for more information on this.
55 | //
56 | [assembly: AssemblyDelaySign(false)]
57 | [assembly: AssemblyKeyFile("")]
58 | [assembly: AssemblyKeyName("")]
59 |
--------------------------------------------------------------------------------
/Demos/Extensions/Resources/Unit1.pas:
--------------------------------------------------------------------------------
1 | unit Unit1;
2 |
3 | interface
4 |
5 | uses
6 | Windows,
7 | Messages,
8 | SysUtils,
9 | Classes,
10 | Forms,
11 | zendTypes,
12 | zendAPI,
13 | phpTypes,
14 | phpAPI,
15 | phpFunctions,
16 | PHPModules;
17 |
18 | type
19 |
20 | Tres_module = class(TPHPExtension)
21 | procedure PHPExtensionModuleInit(Sender: TObject; TSRMLS_DC: Pointer);
22 | procedure PHPExtension1Functions0Execute(Sender: TObject;
23 | Parameters: TFunctionParams; var ReturnValue: Variant;
24 | ThisPtr: Pzval; TSRMLS_DC: Pointer);
25 | procedure PHPExtension1Functions1Execute(Sender: TObject;
26 | Parameters: TFunctionParams; var ReturnValue: Variant;
27 | ThisPtr: Pzval; TSRMLS_DC: Pointer);
28 | private
29 | { Private declarations }
30 | public
31 | { Public declarations }
32 | end;
33 |
34 | var
35 | res_module: Tres_module;
36 |
37 | type
38 | PMyResource = ^TMyResource;
39 | TMyResource = record
40 | resource_link : integer;
41 | resource_string : PChar;
42 | end;
43 |
44 | implementation
45 |
46 | {$R *.DFM}
47 |
48 | var
49 | le_myresource : integer;
50 |
51 | const
52 | le_myresource_name = 'My type of resource';
53 |
54 | procedure my_destructor_handler(rsrc : PZend_rsrc_list_entry; TSRMLS_D : pointer); cdecl;
55 | var
56 | my_resource : PMyResource;
57 | begin
58 | my_resource := rsrc^.ptr;
59 | my_resource.resource_string := nil;
60 | end;
61 |
62 | procedure Tres_module.PHPExtensionModuleInit(Sender: TObject;
63 | TSRMLS_DC: Pointer);
64 | begin
65 | le_myresource := zend_register_list_destructors_ex(@my_destructor_handler, nil, PChar(le_myresource_name), Application.ModuleNumber);
66 | end;
67 |
68 | procedure Tres_module.PHPExtension1Functions0Execute(Sender: TObject;
69 | Parameters: TFunctionParams; var ReturnValue: Variant; ThisPtr: Pzval;
70 | TSRMLS_DC: Pointer);
71 | var
72 | rc : PMyResource;
73 | rn : integer;
74 | begin
75 | rc := emalloc(sizeof(TMyResource));
76 | rc^.resource_link := 1;
77 | rc^.resource_string := 'Hello';
78 | rn := zend_register_resource(Functions[0].ZendVar.AsZendVariable, rc, le_myresource);
79 | ZVAL_RESOURCE(Functions[0].ZendVar.AsZendVariable, rn);
80 | end;
81 |
82 | procedure Tres_module.PHPExtension1Functions1Execute(Sender: TObject;
83 | Parameters: TFunctionParams; var ReturnValue: Variant; ThisPtr: Pzval;
84 | TSRMLS_DC: Pointer);
85 | var
86 | rc : PMyResource;
87 |
88 | begin
89 | rc := zend_fetch_resource(@Parameters[0].ZendValue, TSRMLS_DC, -1, 'my resource', nil, 1, le_myresource);
90 | ReturnValue := String(rc^.resource_string);
91 | end;
92 |
93 | end.
94 |
--------------------------------------------------------------------------------
/Demos/Extensions/Math/extmain.pas:
--------------------------------------------------------------------------------
1 | {*******************************************************}
2 | { PHP4Delphi }
3 | { PHP - Delphi interface }
4 | { Author: }
5 | { Serhiy Perevoznyk }
6 | { serge_perevoznyk@hotmail.com }
7 | { http://users.chello.be/ws36637 }
8 | {*******************************************************}
9 |
10 | { $Id: extmain.pas,v 6.2 02/2006 delphi32 Exp $ }
11 |
12 | unit extmain;
13 |
14 | interface
15 |
16 | uses
17 | Windows,
18 | Messages,
19 | SysUtils,
20 | Classes,
21 | Forms,
22 | zendTypes,
23 | zendAPI,
24 | phpTypes,
25 | phpAPI,
26 | phpFunctions,
27 | PHPModules,
28 | math;
29 |
30 | type
31 |
32 | TMathExtension = class(TPHPExtension)
33 | procedure SinExecute(Sender: TObject;
34 | Parameters: TFunctionParams; var ReturnValue: Variant;
35 | ThisPtr: Pzval; TSRMLS_DC: Pointer);
36 | procedure CoshExecute(Sender: TObject;
37 | Parameters: TFunctionParams; var ReturnValue: Variant;
38 | ThisPtr: Pzval; TSRMLS_DC: Pointer);
39 | procedure ArcsinExecute(Sender: TObject;
40 | Parameters: TFunctionParams; var ReturnValue: Variant;
41 | ThisPtr: Pzval; TSRMLS_DC: Pointer);
42 | procedure ArccoshExecute(Sender: TObject;
43 | Parameters: TFunctionParams; var ReturnValue: Variant;
44 | ThisPtr: Pzval; TSRMLS_DC: Pointer);
45 | private
46 | { Private declarations }
47 | public
48 | { Public declarations }
49 | end;
50 |
51 | var
52 | MathExtension: TMathExtension;
53 |
54 | implementation
55 |
56 | {$R *.DFM}
57 |
58 | procedure TMathExtension.SinExecute(Sender: TObject;
59 | Parameters: TFunctionParams; var ReturnValue: Variant; ThisPtr: Pzval;
60 | TSRMLS_DC: Pointer);
61 | begin
62 | ReturnValue := Sin(Parameters[0].ZendVariable.AsFloat);
63 | end;
64 |
65 | procedure TMathExtension.CoshExecute(Sender: TObject;
66 | Parameters: TFunctionParams; var ReturnValue: Variant; ThisPtr: Pzval;
67 | TSRMLS_DC: Pointer);
68 | begin
69 | ReturnValue := Cosh(Parameters[0].Value);
70 | end;
71 |
72 | procedure TMathExtension.ArcsinExecute(Sender: TObject;
73 | Parameters: TFunctionParams; var ReturnValue: Variant; ThisPtr: Pzval;
74 | TSRMLS_DC: Pointer);
75 | begin
76 | ReturnValue := ArcSin(Parameters[0].value);
77 | end;
78 |
79 | procedure TMathExtension.ArccoshExecute(Sender: TObject;
80 | Parameters: TFunctionParams; var ReturnValue: Variant; ThisPtr: Pzval;
81 | TSRMLS_DC: Pointer);
82 | begin
83 | ReturnValue := ArcCosh(Parameters[0].ZendVariable.AsFloat);
84 | end;
85 |
86 | end.
--------------------------------------------------------------------------------
/Demos/psvPHP/Graph/Unit1.pas:
--------------------------------------------------------------------------------
1 | {*******************************************************}
2 | { PHP4Delphi }
3 | { PHP - Delphi interface }
4 | { Author: }
5 | { Serhiy Perevoznyk }
6 | { serge_perevoznyk@hotmail.com }
7 | { http://users.chello.be/ws36637 }
8 | {*******************************************************}
9 |
10 | { $Id: Unit1.pas,v 6.2 02/2006 delphi32 Exp $ }
11 |
12 | unit Unit1;
13 |
14 | interface
15 |
16 | uses
17 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
18 | ExtCtrls, php4delphi, StdCtrls;
19 |
20 | type
21 | TForm1 = class(TForm)
22 | PaintBox: TPaintBox;
23 | psvPHP: TpsvPHP;
24 | btnExecute: TButton;
25 | cbKeepSession: TCheckBox;
26 | procedure btnExecuteClick(Sender: TObject);
27 | private
28 | { Private declarations }
29 | public
30 | { Public declarations }
31 | end;
32 |
33 | var
34 | Form1: TForm1;
35 |
36 | implementation
37 |
38 | {$R *.DFM}
39 |
40 | procedure TForm1.btnExecuteClick(Sender: TObject);
41 | var
42 | Script : TStringList;
43 | Canvas: TCanvas;
44 | Steps, X, Y: integer;
45 | MinT, MaxT, DeltaT, T: double;
46 | begin
47 | psvPHP.KeepSession := cbKeepSession.Checked;
48 | Canvas := PaintBox.Canvas;
49 | Canvas.Brush.Color := clWhite;
50 | Canvas.FillRect(PaintBox.ClientRect);
51 | Canvas.Pen.Color := clSilver;
52 | Canvas.MoveTo(0, 256); Canvas.LineTo(512, 256);
53 | Canvas.MoveTo(256, 0); Canvas.LineTo(256, 512);
54 | Canvas.Pen.Color := clBlack;
55 | Script := TStringList.Create;
56 | Script.Add('$R1 = 90.0;');
57 | Script.Add('$R2 = 26.0;');
58 | Script.Add('$O = 70.0;');
59 | Script.Add('$X = ($R1+$R2)*cos($T) - ($R2+$O)*cos((($R1+$R2)/$R2)*$T) + 256;');
60 | Script.Add('$Y = ($R1+$R2)*sin($T) - ($R2+$O)*sin((($R1+$R2)/$R2)*$T) + 256;');
61 | MinT := StrToFloat(psvPHP.Constants.Items[0].Value);
62 | MaxT := StrToFloat(psvPHP.Constants.Items[1].Value);
63 | Steps := StrToInt(psvPHP.Constants.Items[2].Value);
64 | DeltaT := (MaxT - MinT) / Steps;
65 | T := MinT;
66 | psvPHP.VariableByName('T').AsFloat := T;
67 | psvPHP.RunCode(Script);
68 | X := psvPHP.VariableByName('X').AsInteger;
69 | Y := psvPHP.VariableByName('Y').AsInteger;
70 | Canvas.MoveTo(X, Y);
71 | repeat
72 | T := T + DeltaT;
73 | psvPHP.VariableByName('T').AsFloat := T;
74 | psvPHP.RunCode(Script);
75 | X := psvPHP.VariableByName('X').AsInteger;
76 | Y := psvPHP.VariableByName('Y').AsInteger;
77 | Canvas.LineTo(X, Y);
78 | Application.ProcessMessages;
79 | until T >= MaxT;
80 | Script.Free;
81 | end;
82 |
83 | end.
84 |
--------------------------------------------------------------------------------
/Demos/psvPHP/Components/Unit1.pas:
--------------------------------------------------------------------------------
1 | {*******************************************************}
2 | { PHP4Delphi }
3 | { PHP - Delphi interface }
4 | { Author: }
5 | { Serhiy Perevoznyk }
6 | { serge_perevoznyk@hotmail.com }
7 | { http://users.chello.be/ws36637 }
8 | {*******************************************************}
9 |
10 | { $Id: Unit1.pas,v 6.2 02/2006 delphi32 Exp $ }
11 |
12 | //This demo project shows how to access published property
13 | //of Delphi components from PHP script
14 |
15 | {$I PHP.INC}
16 |
17 | unit Unit1;
18 |
19 | interface
20 |
21 | uses
22 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
23 | StdCtrls, php4delphi;
24 |
25 | type
26 | TfrmTest = class(TForm)
27 | memScript: TMemo;
28 | btnExecute: TButton;
29 | btnClose: TButton;
30 | PHP: TpsvPHP;
31 | Label1: TLabel;
32 | procedure btnExecuteClick(Sender: TObject);
33 | procedure btnCloseClick(Sender: TObject);
34 | procedure FormCreate(Sender: TObject);
35 | private
36 | { Private declarations }
37 | public
38 | { Public declarations }
39 | end;
40 |
41 | var
42 | frmTest: TfrmTest;
43 |
44 | implementation
45 |
46 | {$R *.DFM}
47 |
48 | procedure TfrmTest.btnExecuteClick(Sender: TObject);
49 | begin
50 | PHP.RunCode(memScript.Lines.Text);
51 | end;
52 |
53 | procedure TfrmTest.btnCloseClick(Sender: TObject);
54 | begin
55 | Close;
56 | end;
57 |
58 | procedure TfrmTest.FormCreate(Sender: TObject);
59 | begin
60 | memScript.Lines.Clear;
61 | with memScript.Lines do
62 | begin
63 | {$IFDEF PHP4}
64 | Add('$btnClose = register_delphi_component("btnClose");');
65 | Add('$frmTest = register_delphi_component("frmTest");');
66 | Add('$btnClose->Caption = "&Exit";');
67 | Add('$frmTest->Caption = "PHP4Delphi demo";');
68 | Add('$btnClose->Top = 150;');
69 | Add('$btnClose->Font->Size = 10;');
70 | Add('$btnClose->Cursor = -21;');
71 | Add('$frmTest->Color = clGreen;');
72 | Add('$st = delphi_input_box("InputBox", "Type your message", "Done");');
73 | Add('delphi_show_message($st);');
74 | {$ELSE}
75 | Add('$btnClose = register_delphi_component("btnClose");');
76 | Add('$frmTest = register_delphi_component("frmTest");');
77 | Add('$btnClose->Caption = "&Exit";');
78 | Add('$frmTest->Caption = "PHP4Delphi demo";');
79 | Add('$btnClose->Top = 150;');
80 | Add('$Font = $btnClose->Font;');
81 | Add('$Font->Size = 10;');
82 | Add('$btnClose->Cursor = -21;');
83 | Add('$frmTest->Color = clGreen;');
84 | Add('$st = delphi_input_box("InputBox", "Type your message", "Done");');
85 | Add('delphi_show_message($st);');
86 | {$ENDIF}
87 | end;
88 | end;
89 |
90 | end.
91 |
--------------------------------------------------------------------------------
/Demos/php4Applications/VB .NET/php4delphi/php4delphi/Form1.Designer.vb:
--------------------------------------------------------------------------------
1 | _
2 | Partial Class Form1
3 | Inherits System.Windows.Forms.Form
4 |
5 | 'Form overrides dispose to clean up the component list.
6 | _
7 | Protected Overrides Sub Dispose(ByVal disposing As Boolean)
8 | If disposing AndAlso components IsNot Nothing Then
9 | components.Dispose()
10 | End If
11 | MyBase.Dispose(disposing)
12 | End Sub
13 |
14 | 'Required by the Windows Form Designer
15 | Private components As System.ComponentModel.IContainer
16 |
17 | 'NOTE: The following procedure is required by the Windows Form Designer
18 | 'It can be modified using the Windows Form Designer.
19 | 'Do not modify it using the code editor.
20 | _
21 | Private Sub InitializeComponent()
22 | Me.TextBox1 = New System.Windows.Forms.TextBox
23 | Me.Button1 = New System.Windows.Forms.Button
24 | Me.OpenFileDialog1 = New System.Windows.Forms.OpenFileDialog
25 | Me.SuspendLayout()
26 | '
27 | 'TextBox1
28 | '
29 | Me.TextBox1.Location = New System.Drawing.Point(10, 16)
30 | Me.TextBox1.Multiline = True
31 | Me.TextBox1.Name = "TextBox1"
32 | Me.TextBox1.ScrollBars = System.Windows.Forms.ScrollBars.Both
33 | Me.TextBox1.Size = New System.Drawing.Size(588, 177)
34 | Me.TextBox1.TabIndex = 0
35 | '
36 | 'Button1
37 | '
38 | Me.Button1.Location = New System.Drawing.Point(13, 223)
39 | Me.Button1.Name = "Button1"
40 | Me.Button1.Size = New System.Drawing.Size(75, 23)
41 | Me.Button1.TabIndex = 1
42 | Me.Button1.Text = "Execute"
43 | Me.Button1.UseVisualStyleBackColor = True
44 | '
45 | 'OpenFileDialog1
46 | '
47 | Me.OpenFileDialog1.Filter = "PHP files|*.php"
48 | Me.OpenFileDialog1.Title = "Select script to execute"
49 | '
50 | 'Form1
51 | '
52 | Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
53 | Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
54 | Me.ClientSize = New System.Drawing.Size(610, 266)
55 | Me.Controls.Add(Me.Button1)
56 | Me.Controls.Add(Me.TextBox1)
57 | Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
58 | Me.MaximizeBox = False
59 | Me.MinimizeBox = False
60 | Me.Name = "Form1"
61 | Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
62 | Me.Text = "php4delphi"
63 | Me.ResumeLayout(False)
64 | Me.PerformLayout()
65 |
66 | End Sub
67 | Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
68 | Friend WithEvents Button1 As System.Windows.Forms.Button
69 | Friend WithEvents OpenFileDialog1 As System.Windows.Forms.OpenFileDialog
70 |
71 | End Class
72 |
--------------------------------------------------------------------------------
/Demos/psvPHP/array demo/Unit1.pas:
--------------------------------------------------------------------------------
1 | {*******************************************************}
2 | { PHP4Delphi }
3 | { PHP - Delphi interface }
4 | { Author: }
5 | { Serhiy Perevoznyk }
6 | { serge_perevoznyk@hotmail.com }
7 | { http://users.chello.be/ws36637 }
8 | {*******************************************************}
9 |
10 | { $Id: Unit1.pas,v 6.2 02/2006 delphi32 Exp $ }
11 |
12 | //This sample shows how to return an array as a result of PHP function
13 | unit Unit1;
14 |
15 | interface
16 |
17 | uses
18 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
19 | PHPCustomLibrary, phpLibrary, php4delphi, phpFunctions, ZendAPI, PHPAPI,
20 | StdCtrls, ZendTypes, phpTypes;
21 |
22 | type
23 | TForm1 = class(TForm)
24 | psvPHP1: TpsvPHP;
25 | PHPLibrary1: TPHPLibrary;
26 | Button1: TButton;
27 | ListBox1: TListBox;
28 | procedure PHPLibrary1Functions0Execute(Sender: TObject;
29 | Parameters: TFunctionParams; var ReturnValue: Variant;
30 | ThisPtr: Pzval; TSRMLS_DC: Pointer);
31 | procedure Button1Click(Sender: TObject);
32 | private
33 | { Private declarations }
34 | public
35 | { Public declarations }
36 | ar : array of string;
37 | end;
38 |
39 | var
40 | Form1: TForm1;
41 |
42 | implementation
43 |
44 | {$R *.DFM}
45 |
46 | procedure TForm1.PHPLibrary1Functions0Execute(Sender: TObject;
47 | Parameters: TFunctionParams; var ReturnValue: Variant; ThisPtr: Pzval;
48 | TSRMLS_DC: Pointer);
49 | var
50 | ht : PHashTable;
51 | data: ^ppzval;
52 | cnt : integer;
53 | variable : pzval;
54 | tmp : ^ppzval;
55 | begin
56 | ht := GetSymbolsTable(TSRMLS_DC);
57 | if Assigned(ht) then
58 | begin
59 | new(data);
60 | if zend_hash_find(ht, 'ar', 3, data) = SUCCESS then
61 | begin
62 | variable := data^^;
63 | if variable^._type = IS_ARRAY then
64 | begin
65 | SetLength(ar, zend_hash_num_elements(variable^.value.ht));
66 | for cnt := 0 to zend_hash_num_elements(variable^.value.ht) -1 do
67 | begin
68 | new(tmp);
69 | zend_hash_index_find(variable^.value.ht, cnt, tmp);
70 | ar[cnt] := tmp^^^.value.str.val;
71 | freemem(tmp);
72 | end;
73 | end;
74 | end;
75 | freemem(data);
76 | end;
77 | end;
78 |
79 | procedure TForm1.Button1Click(Sender: TObject);
80 | var
81 | cnt : integer;
82 | begin
83 | //Clear array
84 | SetLength(ar,0);
85 | //Execute code
86 | psvPHP1.RunCode('$z=0; $y=0; $ar=array("la","hu"); $x=45; $z = $x + $y; $count=count($ar); get_php_array();');
87 | //Display new value of the array
88 | ListBox1.Items.Clear;
89 | for cnt := 0 to Length(ar) - 1 do
90 | ListBox1.Items.Add(ar[cnt]);
91 | end;
92 |
93 | end.
94 |
--------------------------------------------------------------------------------
/Demos/Bonus/PHPEncoder/phpencoder.dpr:
--------------------------------------------------------------------------------
1 | library phpencoder;
2 |
3 | {$I PHP.INC}
4 |
5 | uses
6 | Windows, SysUtils, zendTypes, ZENDAPI, phpTypes, PHPAPI, Classes;
7 |
8 |
9 | function rinit (_type : integer; module_number : integer; TSRMLS_DC : pointer) : integer; cdecl;
10 | begin
11 | Result := SUCCESS;
12 | end;
13 |
14 | function rshutdown (_type : integer; module_number : integer; TSRMLS_DC : pointer) : integer; cdecl;
15 | begin
16 | Result := SUCCESS;
17 | end;
18 |
19 | procedure php_info_module(zend_module : Pzend_module_entry; TSRMLS_DC : pointer); cdecl;
20 | begin
21 | php_info_print_table_start();
22 | php_info_print_table_row(2, PChar('php encryption'), PChar('enabled'));
23 | php_info_print_table_end();
24 | end;
25 |
26 | function minit (_type : integer; module_number : integer; TSRMLS_DC : pointer) : integer; cdecl;
27 | begin
28 | RESULT := SUCCESS;
29 | end;
30 |
31 | function mshutdown (_type : integer; module_number : integer; TSRMLS_DC : pointer) : integer; cdecl;
32 | begin
33 | RESULT := SUCCESS;
34 | end;
35 |
36 | {$IFDEF PHP510}
37 | procedure ex_dec(ht : integer; return_value : pzval; return_value_ptr : ppzval; this_ptr : pzval;
38 | return_value_used : integer; TSRMLS_DC : pointer); cdecl;
39 | {$ELSE}
40 | procedure ex_dec(ht : integer; return_value : pzval; this_ptr : pzval;
41 | return_value_used : integer; TSRMLS_DC : pointer); cdecl;
42 | {$ENDIF}
43 | var
44 | FileName : PChar;
45 | S : TFileStream;
46 | st : string;
47 | i : integer;
48 | begin
49 | FileName := zend_get_executed_filename(TSRMLS_DC);
50 |
51 | S := TFileStream.Create(FileName, fmOpenRead or fmShareDenyNone);
52 | SetLength(St, S.Size);
53 | S.Read(St[1], S.Size);
54 | S.Free;
55 | i := pos('?>', St);
56 | Delete(St, 1, I + 1);
57 | //Now st contains encrypted string
58 | //encryption is very simple: xor
59 | for i := 1 to length(st) do
60 | if (st[i] <> #10) and (st[i] <> #13) then
61 | st[i] := chr ( ord(st[i]) xor 8);
62 | zend_eval_string(PChar(st), nil, 'decoded', TSRMLS_DC);
63 | end;
64 |
65 |
66 | var
67 | moduleEntry : Tzend_module_entry;
68 | module_entry_table : array[0..1] of zend_function_entry;
69 |
70 |
71 | function get_module : Pzend_module_entry; cdecl;
72 | begin
73 | if not PHPLoaded then
74 | LoadPHP;
75 | ModuleEntry.size := sizeof(Tzend_module_entry);
76 | ModuleEntry.zend_api := ZEND_MODULE_API_NO;
77 | ModuleEntry.zts := USING_ZTS;
78 | ModuleEntry.Name := 'phpencoder';
79 | ModuleEntry.version := '0.0';
80 | ModuleEntry.module_startup_func := @minit;
81 | ModuleEntry.module_shutdown_func := @mshutdown;
82 | ModuleEntry.request_startup_func := @rinit;
83 | ModuleEntry.request_shutdown_func := @rshutdown;
84 | ModuleEntry.info_func := @php_info_module;
85 | Module_entry_table[0].fname := 'ex_dec';
86 | Module_entry_table[0].handler := @ex_dec;
87 | ModuleEntry.functions := @module_entry_table[0];
88 | ModuleEntry._type := MODULE_PERSISTENT;
89 | Result := @ModuleEntry;
90 | end;
91 |
92 |
93 |
94 | exports
95 | get_module;
96 |
97 | end.
98 |
99 |
--------------------------------------------------------------------------------
/phpAbout.pas:
--------------------------------------------------------------------------------
1 | {*******************************************************}
2 | { PHP4Delphi }
3 | { PHP - Delphi interface }
4 | { }
5 | { Author: }
6 | { Serhiy Perevoznyk }
7 | { serge_perevoznyk@hotmail.com }
8 | { http://users.chello.be/ws36637 }
9 | {*******************************************************}
10 | {$I PHP.INC}
11 |
12 | { $Id: phpAbout.pas,v 6.2 02/2006 delphi32 Exp $ }
13 |
14 | unit phpAbout;
15 |
16 | interface
17 |
18 | uses
19 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
20 | StdCtrls, ExtCtrls,
21 | {$IFDEF VERSION6}
22 | DesignIntf,
23 | DesignEditors,
24 | {$ELSE}
25 | dsgnintf,
26 | {$ENDIF}
27 | math;
28 |
29 | type
30 | TdlgAbout = class(TForm)
31 | pnlLeft: TPanel;
32 | pnlImage: TPanel;
33 | imgAbout: TImage;
34 | pnlBody: TPanel;
35 | bvlSpit: TBevel;
36 | labTitleShadow: TLabel;
37 | labTitle: TLabel;
38 | labDelphiShadow: TLabel;
39 | lblAuthor: TLabel;
40 | labDelphi: TLabel;
41 | labVersion: TLabel;
42 | btnOK: TButton;
43 | procedure FormCreate(Sender: TObject);
44 | protected
45 | end;
46 |
47 | TPHPVersionEditor = class(TPropertyEditor)
48 | function AllEqual: boolean; override;
49 | procedure Edit; override;
50 | function GetAttributes: TPropertyAttributes; override;
51 | function GetValue: string; override;
52 | procedure SetValue(const Value: string); override;
53 | end;
54 |
55 |
56 | const php4DelphiVersion = '6.2';
57 |
58 | implementation
59 |
60 | {$R *.DFM}
61 |
62 | function TPHPVersionEditor.AllEqual: boolean;
63 | var
64 | componentIndex: integer;
65 | currentValue: string;
66 | begin
67 | Result := False;
68 | if (PropCount > 1) then
69 | begin
70 | currentValue := GetStrValue;
71 | for componentIndex := 1 to PropCount - 1 do
72 | begin
73 | if (GetStrValueAt(componentIndex) <> currentValue) then
74 | exit;
75 | end;
76 | end;
77 | Result := True;
78 | end;
79 |
80 | procedure TPHPVersionEditor.Edit;
81 | begin
82 | with TdlgAbout.Create(NIL) do
83 | begin
84 | try
85 | ShowModal;
86 | finally
87 | Free; { Free dialog. }
88 | end;
89 | end;
90 | end;
91 |
92 | function TPHPVersionEditor.GetAttributes: TPropertyAttributes;
93 | begin
94 | Result := [paDialog, paReadOnly];
95 | end;
96 |
97 | function TPHPVersionEditor.GetValue: string;
98 | begin
99 | Result := 'PHP4Delphi ' + php4DelphiVersion;
100 | end;
101 |
102 | procedure TPHPVersionEditor.SetValue(const Value: string);
103 | begin
104 | end;
105 |
106 | procedure TdlgAbout.FormCreate(Sender: TObject);
107 | begin
108 | labVersion.Caption := 'Version ' + php4DelphiVersion;
109 | end;
110 |
111 | end.
112 |
--------------------------------------------------------------------------------
/Demos/php4Applications/Delphi/Unit1.pas:
--------------------------------------------------------------------------------
1 | { $Id: Unit1.pas,v 6.2 02/2006 delphi32 Exp $ }
2 |
3 | unit Unit1;
4 |
5 | interface
6 |
7 | uses
8 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
9 | StdCtrls, PHP4AppIntf;
10 |
11 | type
12 | TForm1 = class(TForm)
13 | Memo1: TMemo;
14 | btnExecuteScript: TButton;
15 | btnExecuteCode: TButton;
16 | btnClose: TButton;
17 | btnExecuteAndSave: TButton;
18 | procedure btnExecuteScriptClick(Sender: TObject);
19 | procedure btnCloseClick(Sender: TObject);
20 | procedure btnExecuteCodeClick(Sender: TObject);
21 | procedure btnExecuteAndSaveClick(Sender: TObject);
22 | private
23 | { Private declarations }
24 | public
25 | { Public declarations }
26 | RequestID : integer;
27 | end;
28 |
29 | var
30 | Form1: TForm1;
31 |
32 |
33 | implementation
34 |
35 | {$R *.DFM}
36 |
37 | procedure TForm1.btnExecuteScriptClick(Sender: TObject);
38 | var
39 | S : String;
40 | L : integer;
41 | begin
42 | Memo1.Lines.Clear;
43 | RequestID := InitRequest;
44 | RegisterVariable(RequestID, 'x','2');
45 | RegisterVariable(RequestID, 'y','3');
46 | RegisterVariable(RequestID, 'z','0');
47 | ExecutePHP(RequestID, 'test.php');
48 | L := GetResultText(RequestID, nil, 0);
49 | if L > 0 then
50 | begin
51 | SetLength(S, L);
52 | GetResultText(RequestID, PChar(S), L);
53 | end;
54 | memo1.Lines.Text := S;
55 | L := GetVariableSize(RequestID, 'z');
56 | if L > 0 then
57 | begin
58 | SetLength(S, L);
59 | GetVariable(RequestID, 'z', PChar(S), L);
60 | ShowMessage('After execution z = ' + S);
61 | end;
62 | DoneRequest(RequestID);
63 | end;
64 |
65 | procedure TForm1.btnCloseClick(Sender: TObject);
66 | begin
67 | Close;
68 | end;
69 |
70 | procedure TForm1.btnExecuteCodeClick(Sender: TObject);
71 | var
72 | S : String;
73 | L : integer;
74 | begin
75 | Memo1.Lines.Clear;
76 | RequestID := InitRequest;
77 | RegisterVariable(RequestID, 'x','2');
78 | RegisterVariable(RequestID, 'y','3');
79 | RegisterVariable(RequestID, 'z','0');
80 | ExecuteCode(RequestID, '$z = $x + $y; echo "Result "; echo $z;');
81 | L := GetResultBufferSize(RequestID);
82 | if L > 0 then
83 | begin
84 | SetLength(S, L);
85 | GetResultText(RequestID, PChar(S), L);
86 | end;
87 | memo1.Lines.Text := S;
88 | L := GetVariableSize(RequestID, 'z');
89 | if L > 0 then
90 | begin
91 | SetLength(S, L);
92 | GetVariable(RequestID, 'z', PChar(S), L);
93 | ShowMessage('After execution z = ' + S);
94 | end;
95 | DoneRequest(RequestID);
96 | end;
97 |
98 | procedure TForm1.btnExecuteAndSaveClick(Sender: TObject);
99 | begin
100 | Memo1.Lines.Clear;
101 | RequestID := InitRequest;
102 | RegisterVariable(RequestID, 'x','2');
103 | RegisterVariable(RequestID, 'y','3');
104 | RegisterVariable(RequestID, 'z','0');
105 | ExecuteCode(RequestID, '$z = $x + $y; echo "Result "; echo $z;');
106 | SaveToFile(RequestID, 'result.txt');
107 | memo1.Lines.LoadFromFile('result.txt');
108 | DoneRequest(RequestID);
109 | end;
110 |
111 | end.
112 |
--------------------------------------------------------------------------------
/phpWeb.pas:
--------------------------------------------------------------------------------
1 | {*******************************************************}
2 | { PHP4Delphi }
3 | { PHP - Delphi interface }
4 | { }
5 | { Author: }
6 | { Serhiy Perevoznyk }
7 | { serge_perevoznyk@hotmail.com }
8 | { http://users.chello.be/ws36637 }
9 | {*******************************************************}
10 | {$I PHP.INC}
11 |
12 | { $Id: phpWeb.pas,v 6.2 02/2006 delphi32 Exp $ }
13 |
14 | unit phpWeb;
15 |
16 | interface
17 |
18 | uses
19 | Windows, ToolsAPI, Forms, Dialogs, SysUtils, Graphics, Classes, ShellAPI;
20 |
21 | type
22 | TphpWebWizard = class(TNotifierObject, IOTAWIzard, IOTAMenuWizard)
23 | public
24 | function GetMenuText: string;
25 | function GetIDString: string;
26 | function GetName: string;
27 | function GetState: TWizardState;
28 | procedure Execute;
29 | end;
30 |
31 |
32 | TphpForumWizard = class(TNotifierObject, IOTAWIzard, IOTAMenuWizard)
33 | public
34 | function GetMenuText: string;
35 | function GetIDString: string;
36 | function GetName: string;
37 | function GetState: TWizardState;
38 | procedure Execute;
39 | end;
40 |
41 | procedure Register;
42 |
43 | implementation
44 |
45 | procedure Register;
46 | begin
47 | RegisterPackageWizard(TphpWebWizard.Create as IOTAWizard);
48 | RegisterPackageWizard(TphpForumWizard.Create as IOTAWizard);
49 | end;
50 |
51 | procedure InitExpert;
52 | begin
53 | { stubbed out }
54 | end;
55 |
56 | procedure DoneExpert;
57 | begin
58 | { stubbed out }
59 | end;
60 |
61 | { TphpWebWizard }
62 |
63 | procedure TphpWebWizard.Execute;
64 | begin
65 | ShellExecute(0, 'open', 'http://www.php.net', nil, nil, SW_SHOW);
66 | end;
67 |
68 | function TphpWebWizard.GetIDString: string;
69 | begin
70 | Result := 'Perevoznyk.TphpWebWizard';
71 | end;
72 |
73 | function TphpWebWizard.GetMenuText: string;
74 | begin
75 | Result := 'PHP Home Page';
76 | end;
77 |
78 | function TphpWebWizard.GetName: string;
79 | begin
80 | Result := 'TphpWebWizard';
81 | end;
82 |
83 | function TphpWebWizard.GetState: TWizardState;
84 | begin
85 | Result := [wsEnabled];
86 | end;
87 |
88 |
89 |
90 | { TphpForumWizard }
91 |
92 | procedure TphpForumWizard.Execute;
93 | begin
94 | ShellExecute(0, 'open', 'http://sourceforge.net/forum/forum.php?forum_id=324242', nil, nil, SW_SHOW);
95 | end;
96 |
97 | function TphpForumWizard.GetIDString: string;
98 | begin
99 | Result := 'Perevoznyk.TphpForumWizard';
100 | end;
101 |
102 | function TphpForumWizard.GetMenuText: string;
103 | begin
104 | Result := 'PHP4Delphi Forum';
105 | end;
106 |
107 | function TphpForumWizard.GetName: string;
108 | begin
109 | Result := 'TphpForumWizard';
110 | end;
111 |
112 | function TphpForumWizard.GetState: TWizardState;
113 | begin
114 | Result := [wsEnabled];
115 | end;
116 |
117 | initialization
118 | InitExpert;
119 |
120 | finalization
121 | DoneExpert;
122 |
123 | end.
124 |
--------------------------------------------------------------------------------
/Demos/psvPHP/Custom Library/phpShellLibrary.pas:
--------------------------------------------------------------------------------
1 | {*******************************************************}
2 | { PHP4Delphi }
3 | { PHP - Delphi interface }
4 | { Author: }
5 | { Serhiy Perevoznyk }
6 | { serge_perevoznyk@hotmail.com }
7 | { http://users.chello.be/ws36637 }
8 | {*******************************************************}
9 |
10 | { $Id: phpShellLibrary.pas,v 6.2 02/2006 delphi32 Exp $ }
11 |
12 | //This sample shows how to create custom library for psvPHP component
13 | unit phpShellLibrary;
14 |
15 | interface
16 |
17 | uses
18 | Windows, Messages, SysUtils, Classes, Controls, Graphics, Dialogs,
19 | PHPAPI, ZENDAPI, phpCustomLibrary, ShellAPI, phpFunctions,
20 | ZendTypes, phpTypes;
21 |
22 |
23 |
24 | type
25 | TphpShellLibrary = class(TCustomPHPLibrary)
26 | protected
27 | procedure _ShellExecute(Sender: TObject; Parameters: TFunctionParams; var ReturnValue: Variant;
28 | ThisPtr: Pzval; TSRMLS_DC: Pointer);
29 | public
30 | procedure Refresh; override;
31 | published
32 | property Executor;
33 | end;
34 |
35 | procedure Register;
36 |
37 | implementation
38 |
39 |
40 | procedure Register;
41 | begin
42 | RegisterComponents('PHP', [TphpShellLibrary]);
43 | end;
44 |
45 |
46 | { TphpShellLibrary }
47 |
48 | procedure TphpShellLibrary._ShellExecute(Sender: TObject;
49 | Parameters: TFunctionParams; var ReturnValue: Variant; ThisPtr: Pzval;
50 | TSRMLS_DC: Pointer);
51 | var
52 | hWnd : THandle;
53 | Operation, FileName, AParameters,
54 | Directory: string; ShowCmd: Integer;
55 |
56 | begin
57 | hWnd := Parameters[0].Value;
58 | Operation := Parameters[1].Value;
59 | FileName := Parameters[2].Value;
60 | AParameters := Parameters[3].Value;
61 | Directory := Parameters[4].Value;
62 | ShowCmd := Parameters[5].Value;
63 | ShellExecute(hWnd, PChar(Operation), PChar(FileName), PChar(AParameters), PChar(Directory), ShowCmd);
64 | end;
65 |
66 | procedure TphpShellLibrary.Refresh;
67 | var
68 | Func : TphpFunction;
69 | Parm : TFunctionParam;
70 | begin
71 | Functions.Clear;
72 |
73 | Func := TphpFunction(Functions.Add);
74 | Func.FunctionName := 'shellexecute';
75 |
76 | Parm := TFunctionParam(Func.Parameters.Add);
77 | Parm.Name := 'hwnd';
78 | Parm.ParamType := tpInteger;
79 |
80 | Parm := TFunctionParam(Func.Parameters.Add);
81 | Parm.Name := 'operation';
82 | Parm.ParamType := tpString;
83 |
84 | Parm := TFunctionParam(Func.Parameters.Add);
85 | Parm.Name := 'filename';
86 | Parm.ParamType := tpString;
87 |
88 | Parm := TFunctionParam(Func.Parameters.Add);
89 | Parm.Name := 'parameters';
90 | Parm.ParamType := tpString;
91 |
92 | Parm := TFunctionParam(Func.Parameters.Add);
93 | Parm.Name := 'directory';
94 | Parm.ParamType := tpString;
95 |
96 | Parm := TFunctionParam(Func.Parameters.Add);
97 | Parm.Name := 'showcmd';
98 | Parm.ParamType := tpInteger;
99 |
100 | Func.OnExecute := _ShellExecute;
101 |
102 |
103 | inherited;
104 | end;
105 |
106 | end.
--------------------------------------------------------------------------------
/Demos/Bonus/wincon/wincon.rc:
--------------------------------------------------------------------------------
1 | // Microsoft Visual C++ generated resource script.
2 | //
3 | #include "resource.h"
4 |
5 | #define APSTUDIO_READONLY_SYMBOLS
6 | /////////////////////////////////////////////////////////////////////////////
7 | //
8 | // Generated from the TEXTINCLUDE 2 resource.
9 | //
10 | #include "afxres.h"
11 |
12 | /////////////////////////////////////////////////////////////////////////////
13 | #undef APSTUDIO_READONLY_SYMBOLS
14 |
15 | /////////////////////////////////////////////////////////////////////////////
16 | // Russian resources
17 |
18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
19 | #ifdef _WIN32
20 | LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
21 | #pragma code_page(1251)
22 | #endif //_WIN32
23 |
24 | #ifdef APSTUDIO_INVOKED
25 | /////////////////////////////////////////////////////////////////////////////
26 | //
27 | // TEXTINCLUDE
28 | //
29 |
30 | 1 TEXTINCLUDE
31 | BEGIN
32 | "resource.h\0"
33 | END
34 |
35 | 2 TEXTINCLUDE
36 | BEGIN
37 | "#include ""afxres.h""\r\n"
38 | "\0"
39 | END
40 |
41 | 3 TEXTINCLUDE
42 | BEGIN
43 | "\r\n"
44 | "\0"
45 | END
46 |
47 | #endif // APSTUDIO_INVOKED
48 |
49 | #endif // Russian resources
50 | /////////////////////////////////////////////////////////////////////////////
51 |
52 |
53 | /////////////////////////////////////////////////////////////////////////////
54 | // Dutch (Belgium) resources
55 |
56 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NLB)
57 | #ifdef _WIN32
58 | LANGUAGE LANG_DUTCH, SUBLANG_DUTCH_BELGIAN
59 | #pragma code_page(1252)
60 | #endif //_WIN32
61 |
62 | /////////////////////////////////////////////////////////////////////////////
63 | //
64 | // Version
65 | //
66 |
67 | VS_VERSION_INFO VERSIONINFO
68 | FILEVERSION 6,2,0,1
69 | PRODUCTVERSION 6,2,0,1
70 | FILEFLAGSMASK 0x17L
71 | #ifdef _DEBUG
72 | FILEFLAGS 0x1L
73 | #else
74 | FILEFLAGS 0x0L
75 | #endif
76 | FILEOS 0x4L
77 | FILETYPE 0x2L
78 | FILESUBTYPE 0x0L
79 | BEGIN
80 | BLOCK "StringFileInfo"
81 | BEGIN
82 | BLOCK "000904b0"
83 | BEGIN
84 | VALUE "CompanyName", "Serhiy Perevoznyk"
85 | VALUE "FileDescription", "Windows Console PHP Extension"
86 | VALUE "FileVersion", "6, 2, 0, 1"
87 | VALUE "InternalName", "wincon"
88 | VALUE "LegalCopyright", "Copyright (C) 2006, Serhiy Perevoznyk"
89 | VALUE "LegalTrademarks", "PHP4Delphi"
90 | VALUE "OriginalFilename", "wincon.dll"
91 | VALUE "ProductName", "PHP4Delphi"
92 | VALUE "ProductVersion", "6, 2, 0, 1"
93 | END
94 | END
95 | BLOCK "VarFileInfo"
96 | BEGIN
97 | VALUE "Translation", 0x9, 1200
98 | END
99 | END
100 |
101 | #endif // Dutch (Belgium) resources
102 | /////////////////////////////////////////////////////////////////////////////
103 |
104 |
105 |
106 | #ifndef APSTUDIO_INVOKED
107 | /////////////////////////////////////////////////////////////////////////////
108 | //
109 | // Generated from the TEXTINCLUDE 3 resource.
110 | //
111 |
112 |
113 | /////////////////////////////////////////////////////////////////////////////
114 | #endif // not APSTUDIO_INVOKED
115 |
116 |
--------------------------------------------------------------------------------
/license.txt:
--------------------------------------------------------------------------------
1 | --------------------------------------------------------------------
2 | The PHP License, version 3.0
3 | Copyright (c) 1999 - 2002 The PHP Group. All rights reserved.
4 | --------------------------------------------------------------------
5 |
6 | Redistribution and use in source and binary forms, with or without
7 | modification, is permitted provided that the following conditions
8 | are met:
9 |
10 | 1. Redistributions of source code must retain the above copyright
11 | notice, this list of conditions and the following disclaimer.
12 |
13 | 2. Redistributions in binary form must reproduce the above copyright
14 | notice, this list of conditions and the following disclaimer in
15 | the documentation and/or other materials provided with the
16 | distribution.
17 |
18 | 3. The name "PHP" must not be used to endorse or promote products
19 | derived from this software without prior written permission. For
20 | written permission, please contact group@php.net.
21 |
22 | 4. Products derived from this software may not be called "PHP", nor
23 | may "PHP" appear in their name, without prior written permission
24 | from group@php.net. You may indicate that your software works in
25 | conjunction with PHP by saying "Foo for PHP" instead of calling
26 | it "PHP Foo" or "phpfoo"
27 |
28 | 5. The PHP Group may publish revised and/or new versions of the
29 | license from time to time. Each version will be given a
30 | distinguishing version number.
31 | Once covered code has been published under a particular version
32 | of the license, you may always continue to use it under the terms
33 | of that version. You may also choose to use such covered code
34 | under the terms of any subsequent version of the license
35 | published by the PHP Group. No one other than the PHP Group has
36 | the right to modify the terms applicable to covered code created
37 | under this License.
38 |
39 | 6. Redistributions of any form whatsoever must retain the following
40 | acknowledgment:
41 | "This product includes PHP, freely available from
42 | ".
43 |
44 | THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND
45 | ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
46 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
47 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PHP
48 | DEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
49 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
50 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
51 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
52 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
53 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
54 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
55 | OF THE POSSIBILITY OF SUCH DAMAGE.
56 |
57 | --------------------------------------------------------------------
58 |
59 | This software consists of voluntary contributions made by many
60 | individuals on behalf of the PHP Group.
61 |
62 | The PHP Group can be contacted via Email at group@php.net.
63 |
64 | For more information on the PHP Group and the PHP project,
65 | please see .
66 |
67 | This product includes the Zend Engine, freely available at
68 | .
69 |
--------------------------------------------------------------------------------
/Demos/Extensions/array result/Unit1.pas:
--------------------------------------------------------------------------------
1 | {*******************************************************}
2 | { PHP4Delphi }
3 | { PHP - Delphi interface }
4 | { Author: }
5 | { Serhiy Perevoznyk }
6 | { serge_perevoznyk@hotmail.com }
7 | { http://users.chello.be/ws36637 }
8 | {*******************************************************}
9 |
10 | { $Id: Unit1.pas,v 6.2 02/2006 delphi32 Exp $ }
11 |
12 | unit Unit1;
13 |
14 | interface
15 |
16 | uses
17 | Windows,
18 | Messages,
19 | SysUtils,
20 | Classes,
21 | Forms,
22 | zendTypes,
23 | zendAPI,
24 | phpTypes,
25 | phpAPI,
26 | phpFunctions,
27 | PHPModules;
28 |
29 | type
30 |
31 | TPHPExtension1 = class(TPHPExtension)
32 | procedure PHPExtension1Functions0Execute(Sender: TObject;
33 | Parameters: TFunctionParams; var ReturnValue: Variant;
34 | ThisPtr: Pzval; TSRMLS_DC: Pointer);
35 | procedure PHPExtension1Functions1Execute(Sender: TObject;
36 | Parameters: TFunctionParams; var ReturnValue: Variant;
37 | ThisPtr: Pzval; TSRMLS_DC: Pointer);
38 | private
39 | { Private declarations }
40 | public
41 | { Public declarations }
42 | end;
43 |
44 | var
45 | PHPExtension1: TPHPExtension1;
46 |
47 | implementation
48 |
49 | {$R *.DFM}
50 |
51 | procedure TPHPExtension1.PHPExtension1Functions0Execute(Sender: TObject;
52 | Parameters: TFunctionParams; var ReturnValue: Variant; ThisPtr: Pzval;
53 | TSRMLS_DC: Pointer);
54 |
55 | var
56 | pval : pzval;
57 | cnt : integer;
58 | begin
59 | // Function get_my_array returns an array as result
60 | // This demo shows how to use zend variable and work with complex
61 | // PHP types
62 |
63 | pval := Functions[0].ZendVar.AsZendVariable;
64 | if _array_init(pval, nil, 0) = FAILURE then
65 | begin
66 | php_error_docref(nil , TSRMLS_DC, E_ERROR, 'Unable to initialize array');
67 | ZVAL_FALSE(pval);
68 | Exit;
69 | end;
70 |
71 | for cnt := 1 to 12 do
72 | begin
73 | add_next_index_string(pval, PChar(LongMonthNames[cnt]), 1);
74 | end;
75 |
76 | end;
77 |
78 | procedure TPHPExtension1.PHPExtension1Functions1Execute(Sender: TObject;
79 | Parameters: TFunctionParams; var ReturnValue: Variant; ThisPtr: Pzval;
80 | TSRMLS_DC: Pointer);
81 | var
82 | pval : pzval;
83 | cnt : integer;
84 | months : pzval;
85 | smonths : pzval;
86 | begin
87 | pval := Functions[1].ZendVar.AsZendVariable;
88 | if _array_init(pval, nil, 0) = FAILURE then
89 | begin
90 | php_error_docref(nil , TSRMLS_DC, E_ERROR, 'Unable to initialize array');
91 | ZVAL_FALSE(pval);
92 | Exit;
93 | end;
94 |
95 | months := MAKE_STD_ZVAL;
96 | smonths := MAKE_STD_ZVAL;
97 |
98 | _array_init(months, nil, 0);
99 | _array_init(smonths, nil, 0);
100 |
101 | for cnt := 1 to 12 do
102 | begin
103 | add_next_index_string(months, PChar(LongMonthNames[cnt]), 1);
104 | add_next_index_string(smonths, PChar(ShortMonthNames[cnt]), 1);
105 | end;
106 |
107 | add_assoc_zval_ex(pval, 'months', strlen('months') + 1, months);
108 | add_assoc_zval_ex(pval, 'abbrevmonths', strlen('abbrevmonths') + 1, smonths);
109 |
110 | end;
111 |
112 | end.
--------------------------------------------------------------------------------
/Demos/Extensions/Class demo/dm_Class.pas:
--------------------------------------------------------------------------------
1 | {*******************************************************}
2 | { PHP4Delphi }
3 | { PHP - Delphi interface }
4 | { Author: }
5 | { Serhiy Perevoznyk }
6 | { serge_perevoznyk@hotmail.com }
7 | { http://users.chello.be/ws36637 }
8 | {*******************************************************}
9 |
10 | { $Id: dm_Class.pas,v 6.2 02/2006 delphi32 Exp $ }
11 |
12 | unit dm_Class;
13 |
14 | interface
15 |
16 | uses
17 | Windows,
18 | Messages,
19 | SysUtils,
20 | Classes,
21 | Forms,
22 | zendTypes,
23 | zendAPI,
24 | phpTypes,
25 | phpAPI,
26 | phpFunctions,
27 | phpClass,
28 | PHPModules, PHPCommon;
29 |
30 | type
31 |
32 | Tclassdemo = class(TPHPExtension)
33 | PHPDemoClass: TPHPClass;
34 | procedure PrintTextExecute(Sender: TPHPClassInstance;
35 | Parameters: TFunctionParams; var ReturnValue: Variant; ZendValue,
36 | this_ptr: Pzval; TSRMLS_DC: Pointer);
37 | procedure AddIntExecute(Sender: TPHPClassInstance;
38 | Parameters: TFunctionParams; var ReturnValue: Variant; ZendValue,
39 | this_ptr: Pzval; TSRMLS_DC: Pointer);
40 | procedure GetAddressExecute(Sender: TPHPClassInstance;
41 | Parameters: TFunctionParams; var ReturnValue: Variant; ZendValue,
42 | this_ptr: Pzval; TSRMLS_DC: Pointer);
43 | procedure GetEmailExecute(Sender: TPHPClassInstance;
44 | Parameters: TFunctionParams; var ReturnValue: Variant; ZendValue,
45 | this_ptr: Pzval; TSRMLS_DC: Pointer);
46 | procedure classdemoFunctions0Execute(Sender: TObject;
47 | Parameters: TFunctionParams; var ReturnValue: Variant;
48 | ThisPtr: Pzval; TSRMLS_DC: Pointer);
49 | private
50 | { Private declarations }
51 | public
52 | { Public declarations }
53 | end;
54 |
55 | var
56 | classdemo: Tclassdemo;
57 |
58 | implementation
59 |
60 | uses
61 | Dialogs;
62 |
63 | {$R *.DFM}
64 |
65 |
66 | procedure Tclassdemo.PrintTextExecute(Sender: TPHPClassInstance;
67 | Parameters: TFunctionParams; var ReturnValue: Variant; ZendValue,
68 | this_ptr: Pzval; TSRMLS_DC: Pointer);
69 | begin
70 | ReturnValue := Parameters[0].Value;
71 | end;
72 |
73 | procedure Tclassdemo.AddIntExecute(Sender: TPHPClassInstance;
74 | Parameters: TFunctionParams; var ReturnValue: Variant; ZendValue,
75 | this_ptr: Pzval; TSRMLS_DC: Pointer);
76 | begin
77 | ReturnValue := Parameters[0].Value + Parameters[1].Value;
78 | end;
79 |
80 | procedure Tclassdemo.GetAddressExecute(Sender: TPHPClassInstance;
81 | Parameters: TFunctionParams; var ReturnValue: Variant; ZendValue,
82 | this_ptr: Pzval; TSRMLS_DC: Pointer);
83 | begin
84 | ReturnValue := 'www.php.net';
85 | end;
86 |
87 | procedure Tclassdemo.GetEmailExecute(Sender: TPHPClassInstance;
88 | Parameters: TFunctionParams; var ReturnValue: Variant; ZendValue,
89 | this_ptr: Pzval; TSRMLS_DC: Pointer);
90 | begin
91 | ReturnValue := 'myaddress@hotmail.com';
92 | end;
93 |
94 | procedure Tclassdemo.classdemoFunctions0Execute(Sender: TObject;
95 | Parameters: TFunctionParams; var ReturnValue: Variant; ThisPtr: Pzval;
96 | TSRMLS_DC: Pointer);
97 | begin
98 | PHPDemoClass.ProduceInstance(Functions[0].ZendVar.AsZendVariable);
99 | end;
100 |
101 | end.
102 |
--------------------------------------------------------------------------------
/Demos/php4Applications/VB .NET/php4delphi/php4delphi/php4delphi.vbproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 8.0.50727
7 | 2.0
8 | {98A25626-5C96-46EB-8A80-2D2C7236D025}
9 | WinExe
10 | php4delphi.My.MyApplication
11 | php4delphi
12 | php4delphi
13 | WindowsForms
14 |
15 |
16 | true
17 | full
18 | true
19 | true
20 | bin\Debug\
21 | php4delphi.xml
22 | 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022
23 |
24 |
25 | pdbonly
26 | false
27 | true
28 | true
29 | bin\Release\
30 | php4delphi.xml
31 | 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 | Form
56 |
57 |
58 | Form1.vb
59 | Form
60 |
61 |
62 | True
63 | Application.myapp
64 |
65 |
66 |
67 |
68 | Designer
69 | Form1.vb
70 |
71 |
72 |
73 |
74 |
75 |
76 | MyApplicationCodeGenerator
77 | Application.Designer.vb
78 |
79 |
80 |
81 |
88 |
--------------------------------------------------------------------------------
/Demos/psvPHP/Encryption/uMain.pas:
--------------------------------------------------------------------------------
1 | unit uMain;
2 |
3 | interface
4 |
5 | uses
6 | Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
7 | Dialogs, StdCtrls, php4delphi, PHPCustomLibrary, phpLibrary, phpFunctions,
8 | ZendTypes;
9 |
10 | type
11 | TfrmMain = class(TForm)
12 | lblCaption: TLabel;
13 | Label2: TLabel;
14 | Label3: TLabel;
15 | Label4: TLabel;
16 | Label5: TLabel;
17 | Label6: TLabel;
18 | btnEncrypt: TButton;
19 | btnDecrypt: TButton;
20 | edtKey: TEdit;
21 | edtPassword: TEdit;
22 | edtPassLen: TEdit;
23 | edtAjustment: TEdit;
24 | edtModulus: TEdit;
25 | btnClose: TButton;
26 | lblEncrypt: TLabel;
27 | lblDecrypt: TLabel;
28 | Label9: TLabel;
29 | Label10: TLabel;
30 | Label11: TLabel;
31 | psvPHP: TpsvPHP;
32 | Errors: TMemo;
33 | Label1: TLabel;
34 | PHPLibrary1: TPHPLibrary;
35 | procedure btnEncryptClick(Sender: TObject);
36 | procedure btnDecryptClick(Sender: TObject);
37 | procedure btnCloseClick(Sender: TObject);
38 | procedure PHPLibrary1Functions0Execute(Sender: TObject;
39 | Parameters: TFunctionParams; var ReturnValue: Variant;
40 | ThisPtr: Pzval; TSRMLS_DC: Pointer);
41 | private
42 | { Private declarations }
43 | public
44 | { Public declarations }
45 | procedure Execute(Encrypt : boolean);
46 | end;
47 |
48 | var
49 | frmMain: TfrmMain;
50 |
51 | implementation
52 |
53 | {$R *.dfm}
54 |
55 | { TfrmMain }
56 |
57 | procedure TfrmMain.Execute(Encrypt: boolean);
58 | var
59 | Script : TStringList;
60 | begin
61 | psvPHP.VariableByName('key').Value := edtKey.Text;
62 | psvPHP.VariableByName('password').Value := edtPassword.Text;
63 | psvPHP.VariableByName('pswdlen').Value := edtPassLen.Text;
64 | psvPHP.VariableByName('adj').Value := edtAjustment.Text;
65 | psvPHP.VariableByName('mod').Value := edtModulus.Text;
66 | psvPHP.Variables[5].Value := lblEncrypt.Caption;
67 | psvPHP.Variables[6].Value := lblDecrypt.Caption;
68 |
69 | Script := TStringList.Create;
70 | With Script do
71 | begin
72 | Add('require ''std.encryption.class.inc'';');
73 | Add('$crypt = new Encryption;');
74 | Add('ini_set(''session.bug_compat_warn'', 0);');
75 | Add('$crypt->setAdjustment($adj);');
76 | Add('$crypt->setModulus($mod);');
77 | Add('$adj = $crypt->getAdjustment();');
78 | Add('$mod = $crypt->getModulus();');
79 | Add('$errors = array();');
80 |
81 | if Encrypt then
82 | begin
83 | Add('$encrypt_result = $crypt->encrypt($key, $password, $pswdlen);');
84 | Add('$errors = $crypt->errors;');
85 | end
86 | else
87 | begin
88 | Add('$decrypt_result = $crypt->decrypt($key, $encrypt_result);');
89 | Add('$errors = $crypt->errors;');
90 | end;
91 | Add('foreach ($errors as $error) {');
92 | Add('printerror($error);');
93 | Add('echo $error;');
94 | Add('} // foreach');
95 |
96 | end;
97 | psvPHP.RunCode(Script.Text);
98 | lblEncrypt.Caption := psvPHP.Variables[5].Value;
99 | lblDecrypt.Caption := psvPHP.Variables[6].Value;
100 | Script.Free;
101 | end;
102 |
103 | procedure TfrmMain.btnEncryptClick(Sender: TObject);
104 | begin
105 | Execute(true);
106 | end;
107 |
108 | procedure TfrmMain.btnDecryptClick(Sender: TObject);
109 | begin
110 | Execute(false);
111 | end;
112 |
113 | procedure TfrmMain.btnCloseClick(Sender: TObject);
114 | begin
115 | Close;
116 | end;
117 |
118 | procedure TfrmMain.PHPLibrary1Functions0Execute(Sender: TObject;
119 | Parameters: TFunctionParams; var ReturnValue: Variant; ThisPtr: Pzval;
120 | TSRMLS_DC: Pointer);
121 | begin
122 | Errors.Lines.Add(Parameters[0].Value);
123 | end;
124 |
125 | end.
126 |
--------------------------------------------------------------------------------