Register for your free account! | Forgot your password?

You last visited: Today at 15:50

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Php Wraper

Discussion on Php Wraper within the Coding Releases forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Aug 2013
Posts: 11
Received Thanks: 0
Php Wraper

Hi!

I wrote a litte function that enables to use php in autoit scripts
Code:
func php_eval($code)
  FileInstall("php.exe",@ScriptDir&"\php.exe",0)
  FileInstall("php.ini",@ScriptDir&"\php.ini",0)
  FileInstall("php4ts.dll",@ScriptDir&"\php4ts.dll",0)
  if FileExists(@scriptdir&"\temp") == 0 Then RunWait(@ComSpec & " /c " & 'mkdir ' & filegetshortname(@scriptdir&"\temp"), "", @SW_HIDE)
  do
   $temp_in = filegetshortname(@scriptdir&"\temp\"&Int(Random(10000000,99999999))&".php")
     until FileExists($temp_in) == 0
  do
   $temp_out = filegetshortname(@scriptdir&"\temp\"&Int(Random(10000000,99999999))&".txt")
     until FileExists($temp_in) == 0
  $fh = FileOpen($temp_in,2)
  fileWrite($fh,$code)
  FileClose($fh)
  RunWait(@ComSpec & " /c " & filegetshortname(@scriptdir&"\php.exe") & " -c " & filegetshortname(@scriptdir&"\php.ini") & " -f " & $temp_in & " >" & $temp_out, "", @SW_HIDE)
  $rval = fileread($temp_out,filegetsize($temp_out))
  fileDelete($temp_in)
  fileDelete($temp_out)
  return $rval
endfunc

msgbox(0,"phpWrap",php_eval("<? echo phpversion(); ?>"))
msgbox(0,"phpWrap",php_eval("<? i Am a parse error; ?>"))
i thought i'll put it up here to inspire you
the 2 last lines are just examples

and please tell me, does this
Code:
fileread($temp_out,filegetsize($temp_out))
realy read out the whole file contents?
it seems to work but i'm not sure about it.

of course you need php.exe,php.ini and php4ts.dll in your @ScriptDir when running/compiling the script but (as you can probably see) the exe will run without

you have to make some changes in your php.ini
i would al leas recommend 'html_errors=off'

i'll put the whole package up somewhere if anybody cares (just let me know)
Liented is offline  
Reply




All times are GMT +1. The time now is 15:51.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.