Sign in to follow this  
Followers 0
usabrad86

Trying to Parse PHP

2 posts in this topic

#1 ·  Posted (edited)

well im going somewhere with this i think...

trying to parse php scripts

i got it to post in scite debug console

put i cant grab the data out of the debugscript form within the script

index.php

<?php 

echo "Hello !World!";

?>

parse.au3

$pid = _PHPRun("index.php")


While 1
    Sleep(250)
WEnd

Func _PHPRun($File)
    $ret = DllCall("Kernel32.dll", "hwnd", "AllocConsole")
    Return Run(@ScriptDir & "\php\php.exe " & $File, @ScriptDir)
EndFunc
Edited by usabrad86

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hey,

This should get you started.

#cs
    Use the php.exe to parse php files.

    More about the usage of the php commandline:
        http://www.php.net/manual/en/features.commandline.php
        http://www.php.net/manual/en/features.commandline.usage.php
        http://www.php.net/manual/en/features.commandline.options.php

    Make sure the following files are in the $PHP_DIR:
        php.exe
        php.ini
        php5ts.dll
#ce
Global Const $PHP_DIR = @ScriptDir & "\php" ; path to the folder with the php files
Global $phpScriptFile = @ScriptDir & "\scripts\foo_script.php" ; the script file to be parsed
Global $phpOutputFile = @TempDir & "\output.html" ; the file to write the output of the php script to

; parse the PHP file
RunWait(@ComSpec & " /c " & FileGetShortName($PHP_DIR & "\php.exe") & _ ; php.exe
            " -c " & FileGetShortName($PHP_DIR & "\php.ini") & _ ; php.ini to use
            " -f " & FileGetShortName($phpScriptFile) & " >" & _ ; script to parse
            FileGetShortName($phpOutputFile), "", @SW_HIDE) ; output file

; output
MsgBox(262144, "phpParseFile", FileRead($phpOutputFile))

edit: added some more comments

Edited by Robjong

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0