1

Zend framework is just a collection of PHP classes.

Phalanger is a complete PHP compiler.

So why I can not port Zend Framework-based application to Phalanger??

I got the following error whene I run the app in Phalanger:

line 13:

includePaths.library = APPLICATION_PATH "/../library"

error:

<b>Error</b>: Uncaught exception 'Zend_Config_Exception' with message 'Parse error on line 13' in D:\www\mehr-phalanger\library\Zend\Config\Ini.php:215:13
Stack trace:
#11 : Process
#10 : ProcessRequest
#9 : ProcessRequestNoDemand
#8 : ProcessRequestInternal
#7 : System.Web.IHttpAsyncHandler.BeginProcessRequest
#6 : ResumeSteps
#5 : ExecuteStep
#4 : System.Web.HttpApplication.IExecutionStep.Execute
#3 : <Main>
#2 D:\www\mehr-phalanger\public\index.php(40,1): Zend_Config_Ini->__construct
#1 D:\www\mehr-phalanger\library\Zend\Config\Ini.php(215,13): Zend_Config_Ini->_loadIniFile
#0 D:\www\mehr-phalanger\library\Zend\Config\Ini.php(215,13): Zend_Config_Ini->_parseIniFile
#12 {main}.<br/><br/> 
Handsome Nerd
  • 17,114
  • 22
  • 95
  • 173

3 Answers3

0

you have to use the extended path remove APPLICATION_PATH and put the full directory

0

First; you have a syntax error in your code, you miss "." (dot) between APPLICATION_PATH and "/../library"

Second; Phalanger will be able to compile ZendFramework (ZF), however it does not support some functions that ZF uses. You can either report issue https://github.com/devsense/phalanger/issues or take a look on Peachpie (github.com/iolevel/peachpie) which is reincarnation and successor of Phalanger, and report the issue there

Jakub Míšek
  • 1,036
  • 9
  • 12
-3

Humm, isn't phallanger a translator for PHP => .NET that compiles your source into dotnet code? I might be wrong but i remember trying that out quite some time ago out of curiosity.

EDIT: No i looked it up it's a language library for dotnet. It allows you to code .NET using PHP style syntax. Therefore you won't be able to use ZendFramework in there, you are coding ASP.NET but using PHP syntax. Don't expect anything from php to work in there...

Mathieu Dumoulin
  • 12,126
  • 7
  • 43
  • 71
  • 3
    No answer, its a revelation that there is no answer possible since the guy is not doing the right thing at all... – Mathieu Dumoulin Oct 14 '11 at 14:40
  • 2
    *Phalanger compiles the PHP source code into native .NET assemblies.* - http://wiki.php-compiler.net/Compilation – Jared Farrish Oct 14 '11 at 14:43
  • 1
    *Phalanger compiles standard PHP code into .NET 4.0 assemblies (EXE or DLL).* - http://www.php-compiler.net/features – Jared Farrish Oct 14 '11 at 14:44
  • I seriously don't know why i'm getting down voted on this.. My answer is perfectly fine, why would you want to use Zend Framework with Phalanger... You are coding in dot net? Use the dot net functions. IMO, trying to create a product in php that will be usable with windows server by shortcircuiting the php to a real dot net but also pushing a whole framework such as Zend in the process is suicidal and counter productive... Create two project one in real DotNet and one in PHP with Zend and give the best possible code and performance to your users... – Mathieu Dumoulin Mar 20 '12 at 13:04
  • 1
    incorrect - Phalanger is a compiler with supporting runtime and libraries. It builds .NET library/executable fully compatible with PHP behavior (Drupal, Wordpress, phpBB, ... runs on .NET when compiled by PHalanger). There are few differences tho, but most of php apps work fine. NOTE: Phalanger is a little bit outdated (supports up to PHP 5.4). Recommending to take a look on Peachpie (https://github.com/iolevel/peachpie) – Jakub Míšek Feb 19 '17 at 17:50