src/PhpSigep/Cache/Storage/Adapter/FileSystemOptions.php
public function setFilePermission($filePermission)
    {
        if ($filePermission !== false) {
            if (is_string($filePermission)) {
                $filePermission = octdec($filePermission);
            } else {
                $filePermission = (int)$filePermission;
            }

            // validate
            if (($filePermission & 0600) != 0600) {
                throw new Exception\InvalidArgumentException(
                    'Invalid file permission: need permission to read and write by owner'
                );
            } elseif ($filePermission & 0111) {
                throw new Exception\InvalidArgumentException(
                    "Invalid file permission: Cache files shoudn't be executable"
                );
            }
        }

        if ($this->filePermission !== $filePermission) {
            $this->filePermission = $filePermission;
        }

        return $this;
    }
public function setFilePermission($filePermission)
    {
        if ($filePermission !== false) {
            if (is_string($filePermission)) {
                $filePermission = octdec($filePermission);
            } else {
                $filePermission = (int)$filePermission;
            }

            // validate
            if (($filePermission & 0600) != 0600) {
                throw new Exception\InvalidArgumentException(
                    'Invalid file permission: need permission to read and write by owner'
                );
            } elseif ($filePermission & 0111) {
                throw new Exception\InvalidArgumentException(
                    "Invalid file permission: Cache files shoudn't be executable"
                );
            }
        }

        if ($this->filePermission !== $filePermission) {
            $this->filePermission = $filePermission;
        }

        return $this;
    }
public function setFilePermission ( $ filePermission ) { if ( $ filePermission !== false ) { if ( is_string ( $ filePermission ) ) { $ filePermission = octdec ( $ filePermission ) ; } else { $ filePermission = ( int ) $ filePermission ; } // validate if ( ( $ filePermission & 0600 ) != 0600 ) { throw new Exception \ InvalidArgumentException ( 'Invalid file permission: need permission to read and write by owner' ) ; } elseif ( $ filePermission & 0111 ) { throw new Exception \ InvalidArgumentException ( "Invalid file permission: Cache files shoudn't be executable" ) ; } } if ( $ this -> filePermission !== $ filePermission ) { $ this -> filePermission = $ filePermission ; } return $ this ; }
Set permission to create files on unix systems

@param false|string|int $filePermission FALSE to disable explicit permission or an octal number
@throws Exception\InvalidArgumentException
@return FilesystemOptions
@see setUmask
@see setDirPermission
@link http://php.net/manual/function.chmod.php
Set permission to create files on unix systems