Author:
touchstone
Version:
1.4
Released:
18 July 2011
Category:
Workflow

Closed#1: mkdir() function error

I get the below error when I try to update a folder's permission:

mkdir() [function.mkdir]: File exists
    /Users/allen/Sites/test-suite/symphony-2.2.2/extensions/health_check/content/content.directories.php line 198

    193                     break;
    194             }
    195         }
    196
    197         if(isset($_POST['action']) == 'create-tmp-cache') {
    198             mkdir(getcwd() . '/manifest/tmp', 0777);
    199             mkdir(getcwd() . '/manifest/cache', 0777);
    200         }elseif(isset($_POST['action']) == 'create-tmp') {
    201             mkdir(getcwd() . '/manifest/tmp', 0777);
    202         }elseif(isset($_POST['action']) == 'create-cache') {

I should add that the directory's permissions are still updated successfully after a page refresh.

Great extension by the way!

Hey Allen,

Thanks a lot for the feedback. It means I continue to learn :)

There were 2 problems with this:

  • The first being that I was testing for isset($_POST..) which was always going to return true, so all the actions were triggering at once. Hence the error you got, it was trying to write the dir even though it existed already.
  • The second being that my if statements were off. The action is an array as well so $POST['action']) == 'name' was failing. I needed to make it arraykeyexists('name', $POST['action']) in order to return true.

But I am sure you knew all that already! :p

I have fixed it up and pushed v1.1.1 to Master branch, so it should all work swimmingly now... touch wood.

p.s It 's good to have you trolling the forums again :)

This issue is closed.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details