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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Hi HartleySan, thanks for the welcome

 

I believe we are in agreement then? As it is a nested directory that we wish to create the third argument should be set to true to allow for the creation of the nested directories.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...