本文介绍了从PHP脚本调用fcsh的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是Flex的fcsh是否可以从PHP脚本中调用。这里是背景:

我已经创建了一个简单的过程,创建一个简单的测验/教程,将文本文件转换为.mxml文件并编译为.swf文件使用mxmlc编译器。这从命令行运行良好,但是我想通过创建一个web界面来简化这个过程。我最初尝试使用PHP的exec()函数没有奏效。我用来创建.mxml文件的Python脚本工作正常(使用exec()),但是我一直无法让mxmlc编译器正常工作。



After在Web上和本网站搜索,我相信使用fcsh(而不是mxmlc)可能是要走的路。使用fcsh肯定会编译.mxml文件(在第一次运行之后),我认为fcsh可以作为一个可以从PHP调用的服务启动。



另一方面,也许我正在接近这个错误的方式。编写一个调用fcsh并避免使用PHP的Flex应用程序会更好吗?



编辑:使用fcshctl as hasseg工作得很好。感谢Ali。

解决方案

从脚本中调用fcsh的问题在于它可以作为交互式shell来使用。 >而不是采取命令行参数,编译和返回退出状态。有不同的方法来解决这个问题,我已经在这个博客文章,其中我主要讨论 fcshctl (这是我自己的解决方案),但是在帖子的底部,我还列出了其他类似的解决方案来获得fcsh集成转换为非标准的构建工作流程。

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.

解决方案

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 fcshctl (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.

这篇关于从PHP脚本调用fcsh的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 09:04