WinJsApps: Php Server Library

Call php file using WinJsApps

Directory Structure :

WinJsAops:
		dll:
		.	php_lib:		
		.	.	php-7.0.5-nts-Win32-VC14-x86: 
		.	.	.				php.exe
		.	.	.				php-cgi.exe
		.	.	.				php.ini
		.	.	.				...
		.	.	.
		.	WinJsAppsPHP.dll
		index.php 

php.ini

cgi.force_redirect = 0

Javascript Example Code :

	var curdir  = window.external.getCurrentDirectory().replace(/\\/g,"/"); 
	var phpdll  = window.external.loadDll("php_lib/WinJsAppsPHP.dll");  
	var libdir = phpdll.getLibDirectory();
		phpdll.startServer('http://localhost:7575', curdir , libdir + "/php-7.0.5-nts-Win32-VC14-x86");
		window.location = "http://localhost:7575";

C# Public method (WinJsAppsPHP.dll)

/* Return curent php lib directory path */
 public String getLibDirectory() 
 
 /* 
	void to start server
 
	@param:
	address : string  url and port eg( http://localhost:7878)
	phprootdocument : String derectory path to php root document
	phpbinarypath : String path php binary executable directory
 */
 public void startServer(String address, String phprootdocument, String phpbinarypath)  
 
 /*void StopServer*/
 public void stopServer() 

Hello World WinJsApps PHP (Video)

Dikirim oleh Anto Haryanto pada 3 April 2016

Download : dropbox