haxetink / tink_web

Tinkerbell Web Framework
https://haxetink.github.io/tink_web
43 stars 14 forks source link

php support ? #95

Closed sonygod closed 4 years ago

sonygod commented 4 years ago
 Build it with: haxe -php bin -main Server -lib tink_web

follow documents,it's support php?

https://haxetink.github.io/tink_web/#/getting-started/quick-start#Test with PHP

but compile error

C:\HaxeToolkit\haxe\lib\tink_http/git/src/tink/http/containers/NodeContainer.hx:9: characters 18-30 : You cannot access the js package while targeting php (for js.lib.Error)

Sanva commented 4 years ago

I think that for PHP you should use PHPContainer [1], not NodeContainer.

You can support multiple targets using conditional compilation [2].

[1] https://github.com/haxetink/tink_http/blob/master/src/tink/http/containers/PhpContainer.hx [2] https://haxe.org/manual/lf-condition-compilation.html

sonygod commented 4 years ago

@Sanva is that support neko or hashlink?

sonygod commented 4 years ago

how to set port of php target?

var container =PhpContainer.inst;

kevinresol commented 4 years ago

PhpContainer is not a "standalone" container. You need a frontend server (e.g. apache/nginx) to invoke the php script

grepsuzette commented 4 years ago

For dev you can just lauch a php devserver, e.g.:

php -S localhost:8080 -t /where/is/the/path/to/serve