Re: Ming - php sync problem?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



John Coppens wrote:
> I have simple page that generates a simple flash with some random images,
> then publishes it - on the same page. If I do this, i regularly have
> several kinds of problems, one of them, an error message like:
>
> getimagesize(img/topmovie/toplogo.swf): failed to open stream: No such
> file or directory
>
> or the size getimagesize reports isn't the correct one.
>
> If I only _call_ the swf (no generation), the message isn't there and
> things look more normal.

You have PHP configured to dump error messages out to the browser, which
in the first case is where you are sending out the SWF, so they get all
muddled together.

Change your php.ini to send error messages somewhere else, and get in the
habit of checking that "somewhere else" when you code.

My errors all go to Apache error_log, so I just to tail -f error_log

> Is the swf generation an asynchronous process and do I have to wait until
> the  movie->save(xxx) finishes?

It's possible that you could manage to write several scripts that would be
trying to read/write the same SWF file, and movie->save(xxx) would only be
half-finished writing the file when your other script was reading, and the
reading script would time-out waiting for the writing script...

But you'd probably have to really work at it to make that all happen...

It has NOTHING to do with your current problem of having error output
mixed in with the Flash content though, so for your current purposes, you
can safely assume that the process is synchronous -- The movie will get
totally saved before you send it to the browser, assuming you have PHP
code that does those things in order:

<?php
.
.
.
$movie->save(xxx);
header("Content-type: application/swf");
readfile(xxx);
?>

or something similar is synchronous.

If you're doing $movie->save(xxx) in one script, and reading xxx from some
different script, all bets are off, though it will USUALLY work because
the ->save(xxx) will end up being "atomic" mostly sorta...  Not TRULY
atomic, depending on the size of the SWF and other factors, but ...

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux