src/Controller/Plugin/Prerequisites.php
public function checkDirectory($dir, $validationSpec)
    {
        $exists    = file_exists($dir);
        $writable  = $exists && is_writable($dir);
        $missing   = !$exists;
        $creatable = $missing && is_writable(dirname($dir));

        $return = array(
            'exists'    => $exists,
            'writable'  => $writable,
            'missing'   => $missing,
            'creatable' => $creatable
        );

        $return['valid'] = $this->validateDirectory($return, $validationSpec);

        return $return;
    }
public function checkDirectory($dir, $validationSpec)
    {
        $exists    = file_exists($dir);
        $writable  = $exists && is_writable($dir);
        $missing   = !$exists;
        $creatable = $missing && is_writable(dirname($dir));

        $return = array(
            'exists'    => $exists,
            'writable'  => $writable,
            'missing'   => $missing,
            'creatable' => $creatable
        );

        $return['valid'] = $this->validateDirectory($return, $validationSpec);

        return $return;
    }
public function checkDirectory ( $ dir , $ validationSpec ) { $ exists = file_exists ( $ dir ) ; $ writable = $ exists && is_writable ( $ dir ) ; $ missing = ! $ exists ; $ creatable = $ missing && is_writable ( dirname ( $ dir ) ) ; $ return = array ( 'exists' => $ exists , 'writable' => $ writable , 'missing' => $ missing , 'creatable' => $ creatable ) ; $ return [ 'valid' ] = $ this -> validateDirectory ( $ return , $ validationSpec ) ; return $ return ; }
Checks a directory.

@param string $dir
@param string $validationSpec

@return array
Checks a directory .