如何在编译Haxe时确保找到PHP类? [英] How can I ensure a PHP class is found when compiling Haxe?
问题描述
我正在编译在Haxe 3.4之前可用的UFront应用程序.升级后,使用远程处理时它开始生成此错误:
I am compiling a UFront application which worked prior to Haxe 3.4. After upgrading it started generating this error when using remoting:
PHP Fatal error: Class 'haxe__Unserializer_DefaultResolver' not found…site/ufront/www/lib/haxe/Unserializer.class.php on line 554
作为临时解决方案,我在文件顶部插入了以下语句:
As a temporary fix I inserted this statement at the top of that file:
require '_Unserializer/DefaultResolver.class.php';
很明显,下次我编译时,该信息将消失.如何确保PHP找到DefaultResolver类?
Obviously that will disappear the next time I compile. How can I ensure that PHP finds the DefaultResolver class?
推荐答案
我通过在Server类中放置以下行来解决了这个问题:
I solved this by putting these lines in my Server class:
#if php
untyped __php__("require 'haxe/_Unserializer/DefaultResolver.class.php'; ");
#end
这篇关于如何在编译Haxe时确保找到PHP类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!