Think/Storage/Driver/File.php
public static function put($filename, $content)
    {
        $dir = dirname($filename);
        if (!is_dir($dir)) {
            mkdir($dir, 0777, true);
        }
        if (false === file_put_contents($filename, $content)) {
            throw new BaseException(L('_STORAGE_WRITE_ERROR_').':'.$filename);
        } else {
            static::$contents[$filename] = $content;

            return true;
        }
    }
public static function put($filename, $content)
    {
        $dir = dirname($filename);
        if (!is_dir($dir)) {
            mkdir($dir, 0777, true);
        }
        if (false === file_put_contents($filename, $content)) {
            throw new BaseException(L('_STORAGE_WRITE_ERROR_').':'.$filename);
        } else {
            static::$contents[$filename] = $content;

            return true;
        }
    }
文件写入


@param string $filename 文件名
@param string $content 文件内容
@return bool
@throws BaseException