Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
WriteFactory.php
Go to the documentation of this file.
1 <?php
7 
9 
11 {
17  private $driverPool;
18 
24  public function __construct(DriverPool $driverPool)
25  {
26  $this->driverPool = $driverPool;
27  }
28 
37  public function create($path, $driverCode = DriverPool::FILE, $createPermissions = null)
38  {
39  $driver = $this->driverPool->getDriver($driverCode);
40  $factory = new \Magento\Framework\Filesystem\File\WriteFactory(
41  $this->driverPool
42  );
43 
44  return new Write(
45  $factory,
46  $driver,
47  $path,
48  $createPermissions,
49  new PathValidator($driver)
50  );
51  }
52 }
create($path, $driverCode=DriverPool::FILE, $createPermissions=null)