-1

I have created a web application. I used wxPHP to convert that to a stand-alone desktop application. Everything works fine except I need to access the CLI for writing the command like:

D:\wamp\www\Vishnu\wxPHP\examples>wxphp myApp.php

I do not want to do this because my client is not familiar with it . So I need to have .exe application . It should like , when I click on the specific link (button) myApp.php file need to execute. This is my PHP program:

  //Load the wxPHP module
 if(!extension_loaded('wxwidgets'))
 {
     dl('wxwidgets.' . PHP_SHLIB_SUFFIX);
 }



class MyFrame1 extends wxFrame {

function __construct( $parent=null ){
    parent::__construct ( $parent, wxID_ANY, wxEmptyString, wxDefaultPosition, new wxSize( 500,300 ), wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL );

    $this->SetSizeHints( wxDefaultSize, wxDefaultSize );

    $bSizer1 = new wxBoxSizer( wxVERTICAL );

    $this->m_webView = wxWebView::NewMethod( $this, wxID_ANY, "http://localhost/Vishnu/myFolder/" );

    $bSizer1->Add( $this->m_webView, 1, wxALL|wxEXPAND, 5 );


    $this->SetSizer( $bSizer1 );
    $this->Layout();

    $this->Centre( wxBOTH );
}


function __destruct( ){
}

}


//Application initialization start point
class myApp extends wxApp 
{

function OnInit()
{
    $zs = new MyFrame1();
    $zs->Show();
    $zs->Maximize();

    $this->frm = $zs;

    return true;


}

 function OnExit()
 {
    return 0;
 }
 }

 wxInitAllImageHandlers();

 $gridApp = new myApp();

 wxApp::SetInstance($gridApp);
 wxEntry();

Is there any way to do that?

halfer
  • 19,824
  • 17
  • 99
  • 186
Vishnu R Nair
  • 335
  • 2
  • 17
  • You'd need to distribute a copy of PHP with the compiled wxWidgets module, or get your installer to fetch the PHP installer and then copy the module into the appropriate modules directory. – halfer Dec 17 '15 at 08:32
  • [windows what are desktop shortcuts](https://www.google.com/search?q=windows+what+are+desktop+shortcuts) – jww Nov 28 '18 at 06:41

1 Answers1

1

You might create a bat file that runs the command... I guess that's a quick way.

Prakash Pazhanisamy
  • 997
  • 1
  • 15
  • 25
PekosoG
  • 246
  • 3
  • 9
  • I do'nt know how to do it, can you please show me an example – Vishnu R Nair Oct 01 '15 at 06:08
  • Open notepad and write your line "D:\wamp\www\Vishnu\wxPHP\examples>wxphp myApp.php" , then save it with the ".bat" extension, like this "MyProgram.bat". – PekosoG Oct 01 '15 at 06:10
  • Nothing happened , it show a CLI Editor and fade away – Vishnu R Nair Oct 01 '15 at 06:18
  • That's weird, are you sure that's the correct line you need to write on the command line? – PekosoG Oct 01 '15 at 06:27
  • I have followed what you said . Like notepad open and command writing saving it as batch file everything when I double clicked the batch file It's fade away – Vishnu R Nair Oct 01 '15 at 06:31
  • The console disappears, but the program should be run in background. Are you sure? I guess the line that you need to write in the bat file is `cd D:\wamp\www\Vishnu\wxPHP\examples` and then `wxphp myApp.php` in the second line – Marcos Pérez Gude Dec 17 '15 at 09:00