Jump to content
Larry Ullman's Book Forums

Recommended Posts

Hi Larry, would like to say great book, has really helped me out with my understanding of PHP and OOP.

 

On p358, when using the mkdir() command, would it not be preferable to set the recursive parameter to TRUE? So line 23 of db_backup.php is:

 

if (!@mkdir($dir, 0777, true)) {

 

My script wasn't creating the directories as expected until I set this to TRUE, by default it is set to FALSE.

 

Cheers

Noel

Link to comment
Share on other sites

Hello, noelmcg. Welcome to the forums.

 

The PHP.net page for the mkdir function (http://us3.php.net/mkdir) seems to imply that if you specify a nested directory for the first argument, then specifying true for the third argument allows you to create the nested directories as well.

 

I recommend experimenting with that a little bit and seeing what you find.

Link to comment
Share on other sites

Just realised I missed the line on step 16, p361, to create the folder 'backups' first. This would negate the need to set recursive to true as you are only creating the last directory.

 

My bad! I should have read the steps more thoroughly.

Link to comment
Share on other sites

 Share

×
×
  • Create New...