|Calling fcsh from PHP script||#1|
My question is whether or not Flex's fcsh can be called from within a PHP script. Here is the background:
I have been created a simple process that creates a simple quiz/tutorial by converting a text file into a .mxml file and compiling to a .swf file using the mxmlc compiler. This works well from the command line, but I wanted to make the process easier by creating a web-interface to do this. My initial attempts with PHP's exec() function have not worked. The Python scripts I use to create the .mxml file work fine (using exec()), but I have not been able to get the mxmlc compiler to work.
After searching on the Web and on this site, I believe that using fcsh (instead of mxmlc) may be the way to go. Using fcsh would certainly compile the .mxml file faster (after the first run), and I think that fcsh can be launched as a service that might be able to be called from PHP.
On the other hand, maybe I am approaching this the wrong way. Would it be better to write a Flex application that calls fcsh and avoid using PHP?
Edit: Using fcshctl as hasseg suggested in his answer below worked very well. Thanks Ali.
posted date: 2008-12-07 11:41:00
|Re: Calling fcsh from PHP script||#3|
There are a few other ways in php to execute an external script. They are exec(), passthru(), system(), and backticks i.e. the key to the left of the 1 key. Each one has a different purpose and return mechanism.You may have to put the command that executes your executable into a script and call that script via one of these functions.
posted date: 2008-12-07 13:26:00
|Re: Calling fcsh from PHP script||#4|
The problem with calling fcsh from within scripts is that it works as an interactive shell instead of taking command-line arguments, compiling, and returning an exit status. There are different ways to get around this, which I've listed in this blog post of mine, where I mainly talk about
(which is my own solution for this,) but at the bottom of the post I've also listed other similar solutions to get fcsh integrated into nonstandard build workflows.
posted date: 2008-12-07 13:42:00
|Re: Calling fcsh from PHP script||#5|
I have seen your post, and I like the idea. I will be trying fchsctl out to see if it works. Thanks, Vern
posted date: 2008-12-07 17:56:00
|Re: Calling fcsh from PHP script||#6|
Is there a particular reason why you can't use
directly? It seems like it would be easier to call than
. Just specify all your compiler options in a XML file run it like
mxmlc -load-config path/to/config.xml
. You can find an example of the XML configuration format in
posted date: 2008-12-15 07:14:00
|select page: « 1 »|