Platforms to show: All Mac Windows Linux Cross-Platform

/Tools/PHP/PHPTest
Function:
Required plugins for this example: MBS Tools Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Tools/PHP/PHPTest
This example is the version from Thu, 6th Apr 2016.
Project "PHPTest.xojo_binary_project"
MenuBar MenuBar1
MenuItem UntitledMenu1 = ""
MenuItem FileMenu = "&File"
MenuItem FileQuit = "Quit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem UntitledMenu0 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "Clear"
End MenuBar
Class App Inherits Application
EventHandler Sub Open() dim f as FolderItem if TargetWin32 then f=FindFile("php5ts.dll") elseif TargetMachO then f=FindFile("libphp5.mac.dylib") elseif TargetLinux then f=FindFile("libphp5.so") else MsgBox "Unsupported Platform." quit end if if not PHPMBS.LoadLibrary(f) then MsgBox "Failed to load php library." end if dim p as new PHPMBS if p.Inited then p.setVariable "test","XojoTest" MsgBox p.getVariable("test") p.setVariable "test","XojoTest 2" MsgBox p.getVariable("test") MsgBox p.Execute("echo ""Hello World $test"";") MsgBox p.Execute("echo ""PHP Version: "".phpversion();") else MsgBox "Failed to execute." end if quit End EventHandler
Function FindFile(name as string) As FolderItem // Look for file in parent folders from executable on dim parent as FolderItem = app.ExecutableFile.Parent while parent<>Nil dim file as FolderItem = parent.Child(name) if file<>Nil and file.Exists then Return file end if parent = parent.Parent wend End Function
End Class
End Project

See also:

The items on this page are in the following plugins: MBS Tools Plugin.


💬 Ask a question or report a problem
The biggest plugin in space...