How to call php function in <script> tag from coldfusion 9

I have this nice big Dev Kit, written in PHP, but the application I'm currently developing is in CFML.

In an attempt to avoid overwriting PHP, I will try to simply wrap PHP in CF <script> tags and call the PHP functions when I need them.

Does anyone know how to call one of these PHP built-in functions in CF?

+4
source share
4 answers

There is no built-in way to do this, but using CFGroovy (which allows you to implement any implementation of the Java language compatible with the Java Scripting API) and Quercus (the implementation of PHP in Java), you may be able to remove what you want /

CFGroovy: http://www.barneyb.com/barneyblog/projects/cfgroovy2/

Quercus: http://www.caucho.com/resin-3.0/quercus/

A simple example that includes the source code: http://www.barneyb.com/cfgroovy2/

+5
source

You can not. This is a whole different application engine. You can use CFHTTP to invoke a PHP page, but that went a little too far. You can see the Sean solution here:

http://corfield.org/entry/ColdFusion_8_running_PHP

+3
source

Edward M. Smith is right. You may be able to mix PHP and CFML with Resin as your JVM. Although I did not do this, I believe it is possible that Resin interprets your PHP code in the same context as the CFML (ColdFusion) website.

A.cfm / .cfc cannot contain PHP, and the .php file cannot contain CFML / CFScript; however, these files may live side by side on your www.something.com domain.

Resin http://www.caucho.com/ is a web server / PHP interpreter that is very quickly written and written in Java. This is a joint JVM for Railo's open source CFML project.

Hope this helps.

+2
source

You can pass data back and forth using php / coldfusion store / retrieve client array or variables.

Another choice is to force coldfusion to parse through .php files, for any cold futurism inside. How it will handle a mixture of coldfusion and php, I'm not sure ...

0
source

Source: https://habr.com/ru/post/1313404/


All Articles