src/PHPDish/Bundle/CoreBundle/Installer/Checker/DirectoryChecker.php
public function ensureIsWritable($directory)
    {
        if (is_writable($directory)) {
            return;
        }
        try {
            $this->filesystem->chmod($directory, 0755);
            $this->output->writeln(sprintf('<comment>Changed "%s" permissions to 0755.</comment>', realpath($directory)));
        } catch (IOException $exception) {
            $this->output->writeln('');
            $this->output->writeln('<error>Cannot run command due to bad directory permissions (tried to change permissions to 0755).</error>');
            $this->output->writeln('');
            throw new \RuntimeException(sprintf(
                'Set "%s" writable and run command "<comment>%s</comment>"',
                realpath(dirname($directory)),
                $this->name
            ));
        }
    }
public function ensureIsWritable($directory)
    {
        if (is_writable($directory)) {
            return;
        }
        try {
            $this->filesystem->chmod($directory, 0755);
            $this->output->writeln(sprintf('<comment>Changed "%s" permissions to 0755.</comment>', realpath($directory)));
        } catch (IOException $exception) {
            $this->output->writeln('');
            $this->output->writeln('<error>Cannot run command due to bad directory permissions (tried to change permissions to 0755).</error>');
            $this->output->writeln('');
            throw new \RuntimeException(sprintf(
                'Set "%s" writable and run command "<comment>%s</comment>"',
                realpath(dirname($directory)),
                $this->name
            ));
        }
    }
检查目录是否可写.

@param string $directory