jasononeil / ufblog

A demo ufront app - a simple blog system
3 stars 3 forks source link

Error in php #3

Open astro75 opened 10 years ago

astro75 commented 10 years ago

Is this supposed to work on php? I get the folowing error

uncaught exception: Undefined property: ufront_module_ErrorModule::$__injected__ (errno: 8) in C:\projektai\ufblog2\out\php\minject\_Injector\InjecteeSet.class.php at line #19

Called from sys.db.Transaction::runMainLoop
Called from sys.db.Transaction::main
Called from server.Server::main

Error without db transactions:

uncaught exception: Undefined property: ufront_module_ErrorModule::$__injected__ (errno: 8) in C:\projektai\goodgames\out\php\minject\_Injector\InjecteeSet.class.php at line #19

Called from ufront.application.HttpApplication::dispose@399
Called from hxevents.AsyncDispatcher::dispatch@87
Called from hxevents.Async::completed
Called from hxevents.AsyncDispatcher::add@65
Called from hxevents.AsyncDispatcher::dispatch
Called from ufront.application.HttpApplication::_dispatchError@398
Called from hxevents.AsyncDispatcher::dispatch
Called from ufront.application.HttpApplication::_dispatchError
Called from ufront.application.HttpApplication::initModules
Called from ufront.application.HttpApplication::execute
Called from ufront.application.UfrontApplication::execute
Called from server.Server::main
astro75 commented 10 years ago

Got it working. The first fix is in the minject library. Replaced all occurrences of

#if (flash9 || cpp || java)

With

#if (flash9 || cpp || java || php)

Second fix is in ufront-mvc https://github.com/ufront/ufront-mvc/blob/master/src/php/ufront/web/context/HttpRequest.hx#L222

scriptDirectory =  untyped __php__('dirname($_SERVER["SCRIPT_FILENAME"])') + "/";

should be

scriptDirectory =  untyped __php__("dirname($_SERVER['SCRIPT_FILENAME'])") + "/";
jasononeil commented 10 years ago

Hi

I honestly haven't tested it on PHP, as I haven't even had time to finish the sample app on Neko... Sorry!

Thanks for looking into this. I'll fix up ufront-mvc and create an issue for minject.

If you discover any other fixes let me know On 14/10/2013 6:47 AM, "astro75" notifications@github.com wrote:

Got it working. The first fix is in the minject library. Replaced all occurrences of

if (flash9 || cpp || java)

With

if (flash9 || cpp || java || php)

Second fix is in ufront-mvc

https://github.com/ufront/ufront-mvc/blob/master/src/php/ufront/web/context/HttpRequest.hx#L222

scriptDirectory = untyped php('dirname($_SERVER["SCRIPT_FILENAME"])') + "/";

should be

scriptDirectory = untyped php("dirname($_SERVER['SCRIPT_FILENAME'])") + "/";

— Reply to this email directly or view it on GitHubhttps://github.com/jasononeil/ufblog/issues/3#issuecomment-26229034 .