FileStore::__construct PHP Method

__construct() public method

构造函数
public __construct ( 配置名 $config_name )
$config_name 配置名
    public function __construct($config_name)
    {
        if (!is_dir(\Config\Store::$storePath) && !@mkdir(\Config\Store::$storePath, 0777, true)) {
            // 可能目录已经被其它进程创建
            clearstatcache();
            if (!is_dir(\Config\Store::$storePath)) {
                // 避免狂刷日志
                sleep(1);
                throw new \Exception('cant not mkdir(' . \Config\Store::$storePath . ')');
            }
        }
        $this->dataFileHandle = fopen(__FILE__, 'r');
        if (!$this->dataFileHandle) {
            throw new \Exception('can not fopen dataFileHandle');
        }
    }