public function put($path, $contents)
    {
        $directory = dirname($path);
        $this->createDir($directory);
        $path = $this->getPath($path);
        if (!file_exists($path) && !is_writable(dirname($path))) {
            throw new RuntimeException(dirname($path) . ' is not writable');
        }

        if (file_exists($path) && !is_writable($path)) {
            throw new RuntimeException($path . ' is not writable');
        }

        return file_put_contents($path, $contents);
    }
public function put($path, $contents)
    {
        $directory = dirname($path);
        $this->createDir($directory);
        $path = $this->getPath($path);
        if (!file_exists($path) && !is_writable(dirname($path))) {
            throw new RuntimeException(dirname($path) . ' is not writable');
        }

        if (file_exists($path) && !is_writable($path)) {
            throw new RuntimeException($path . ' is not writable');
        }

        return file_put_contents($path, $contents);
    }
public function put ( $ path , $ contents ) { $ directory = dirname ( $ path ) ; $ this -> createDir ( $ directory ) ; $ path = $ this -> getPath ( $ path ) ; if ( ! file_exists ( $ path ) && ! is_writable ( dirname ( $ path ) ) ) { throw new RuntimeException ( dirname ( $ path ) . ' is not writable' ) ; } if ( file_exists ( $ path ) && ! is_writable ( $ path ) ) { throw new RuntimeException ( $ path . ' is not writable' ) ; } return file_put_contents ( $ path , $ contents ) ; }
Write contents to a path.

@param string $path
@param string $contents

@return bool

@throws RuntimeException When the path is not writable.
Write contents to a path .