对于您的口味,这可能有点骇人听闻,但这将是一种有效且简单的解决方法。
您可以创建一个由您选择的数据库管理的“队列”,首先,将请求存储在数据库的队列表中,然后输出一个 iframe,该 iframe 会导致一个脚本,该脚本将触发与您的 queue_id 匹配的指令数据库。
前任:
<?php
mysql_query('INSERT INTO queue ('instructions') VALUES ('something would go here');
echo('<iframe src="/yourapp/execute_queue/id?' . mysql_insert_id() . '" />');
?>
框架会做类似的事情
前任:
<?php
$result = mysql_query('SELECT instructions FROM queue WHERE id = ' . $_GET['id']);
// From here, simply execute some instruction based on the "instructions" field, then delete the instruction from the database.
?>
就像我说的,我可以看到你怎么会认为这个 hackish,但是框架将独立于它的父页面加载,所以它可以实现你想要的,而不需要在后台运行一些其他应用程序。
希望这至少可以为您指明正确的方向。
干杯!