Page 1 of 1

Missing sql dir causes infinite loop on upgrade

Posted: Mon Apr 11, 2011 5:08 am
by SaneLemmingCorp
This error occurs on upgrade if the sql directory doesn't exist:

Code: Select all

PHP Warning:  opendir(/path-to-s9y/sql/) [<a href='function.opendir'>function.opendir</a>]: failed to open dir: No such file or directory in /path-to-s9y/include/admin/upgrader.inc.php on line 155
Then this error occurs in an infinite loop, resulting in a gigabytes-large Apache log:

Code: Select all

PHP Warning:  readdir() expects parameter 1 to be resource, boolean given in /path-to-s9y/include/admin/upgrader.inc.php on line 157
Wasn't fun trying to cut that from the rest of my log.

Re: Missing sql dir causes infinite loop on upgrade

Posted: Mon Apr 11, 2011 9:16 am
by garvinhicking
Hi!

Well, you can't expect s9y to properly work if files/directories are missing...?!

Regards,
Garvin

Re: Missing sql dir causes infinite loop on upgrade

Posted: Tue Apr 12, 2011 4:47 am
by SaneLemmingCorp
Well, I got rid of it because I didn't want the SQL files lying around. There were no new ones in the archive so it didn't get recreated: There were no DB upgrades to be done. They're not PHP files, so it's not like they're critical to S9Y working - in fact, only the upgrader could possibly expect them to be there.
So yes, I actually kind of expect one of two situations: Graceful handling of it considered as an error, or assumption that there are no upgrades to do. Is it that unlikely that someone would want to clean up old upgrade files that have no further use?

Re: Missing sql dir causes infinite loop on upgrade

Posted: Tue Apr 12, 2011 11:11 am
by garvinhicking
Hi!

The files there might always be related to s9y, you cannot simply delete files and expect a tool to work when you delete them.

We need to rely on certain factors; s9y having access to all files shipping with s9y is one of them. If we were to check each of those factors time and again, it would both slow down execution and cause a considerable maintenance overhead...

Regards,
Garvin