mirror of
https://github.com/danog/file.git
synced 2024-12-02 09:17:57 +01:00
renaming
This commit is contained in:
parent
dcfb210792
commit
07e110ac03
16
README.md
16
README.md
@ -1,12 +1,12 @@
|
|||||||
# fs
|
# filesystem
|
||||||
|
|
||||||
[![Build Status](https://img.shields.io/travis/amphp/fs/master.svg?style=flat-square)](https://travis-ci.org/amphp/fs)
|
[![Build Status](https://img.shields.io/travis/amphp/filesystem/master.svg?style=flat-square)](https://travis-ci.org/amphp/filesystem)
|
||||||
[![CoverageStatus](https://img.shields.io/coveralls/amphp/fs/master.svg?style=flat-square)](https://coveralls.io/github/amphp/fs?branch=master)
|
[![CoverageStatus](https://img.shields.io/coveralls/amphp/filesystem/master.svg?style=flat-square)](https://coveralls.io/github/amphp/filesystem?branch=master)
|
||||||
![Unstable](https://img.shields.io/badge/api-unstable-orange.svg?style=flat-square)
|
![Unstable](https://img.shields.io/badge/api-unstable-orange.svg?style=flat-square)
|
||||||
![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)
|
![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)
|
||||||
|
|
||||||
|
|
||||||
`amphp/fs` is a non-blocking filesystem library for use with the [`amp`](https://github.com/amphp/amp)
|
`amphp/filesystem` is a non-blocking filesystem library for use with the [`amp`](https://github.com/amphp/amp)
|
||||||
concurrency framework.
|
concurrency framework.
|
||||||
|
|
||||||
**Dependencies**
|
**Dependencies**
|
||||||
@ -15,19 +15,19 @@ concurrency framework.
|
|||||||
- [eio](https://pecl.php.net/package/eio)
|
- [eio](https://pecl.php.net/package/eio)
|
||||||
- [php-uv](https://github.com/bwoebi/php-uv) (experimental, requires PHP7)
|
- [php-uv](https://github.com/bwoebi/php-uv) (experimental, requires PHP7)
|
||||||
|
|
||||||
`amphp/fs` works out of the box without any PHP extensions but it does so using
|
`amphp/filesystem` works out of the box without any PHP extensions but it does so using
|
||||||
blocking functions. This capability only exists to simplify development across
|
blocking functions. This capability only exists to simplify development across
|
||||||
environments where extensions may not be present. Using `amp/fs` in production
|
environments where extensions may not be present. Using `amphp/filesystem` in production
|
||||||
without pecl/eio or php-uv is **NOT** recommended.
|
without pecl/eio or php-uv is **NOT** recommended.
|
||||||
|
|
||||||
**Current Version**
|
**Current Version**
|
||||||
|
|
||||||
`amphp/fs` is currently pre-alpha software and has no tagged releases. Your mileage may vary.
|
`amphp/filesystem` is currently pre-alpha software and has no tagged releases. Your mileage may vary.
|
||||||
|
|
||||||
**Installation**
|
**Installation**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ composer require amphp/fs:dev-master
|
$ composer require amphp/filesystem:dev-master
|
||||||
```
|
```
|
||||||
|
|
||||||
**TODO**
|
**TODO**
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "amphp/fs",
|
"name": "amphp/filesystem",
|
||||||
"homepage": "https://github.com/amphp/fs",
|
"homepage": "https://github.com/amphp/filesystem",
|
||||||
"description": "Non-blocking filesystem tools for amp applications",
|
"description": "Non-blocking filesystem tools for amp applications",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"filesystem",
|
"filesystem",
|
||||||
@ -14,8 +14,7 @@
|
|||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "Daniel Lowrey",
|
"name": "Daniel Lowrey",
|
||||||
"email": "rdlowrey@php.net",
|
"email": "rdlowrey@php.net"
|
||||||
"role": "Creator / Lead Developer"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
@ -29,13 +28,13 @@
|
|||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"Amp\\Fs\\": "lib"
|
"Amp\\Filesystem\\": "lib"
|
||||||
},
|
},
|
||||||
"files": ["lib/functions.php"]
|
"files": ["lib/functions.php"]
|
||||||
},
|
},
|
||||||
"autoload-dev": {
|
"autoload-dev": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"Amp\\Fs\\Test\\": "test/"
|
"Amp\\Filesystem\\Test\\": "test/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"extra": {
|
"extra": {
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Amp\Fs;
|
namespace Amp\Filesystem;
|
||||||
|
|
||||||
use Amp\Promise;
|
use Amp\Promise;
|
||||||
use Amp\Success;
|
use Amp\Success;
|
||||||
use Amp\Failure;
|
use Amp\Failure;
|
||||||
|
|
||||||
class BlockingFilesystem implements Filesystem {
|
class BlockingDriver implements Driver {
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Amp\Fs;
|
namespace Amp\Filesystem;
|
||||||
|
|
||||||
interface Filesystem {
|
interface Driver {
|
||||||
/**
|
/**
|
||||||
* Execute a file stat operation
|
* Execute a file stat operation
|
||||||
*
|
*
|
@ -1,13 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Amp\Fs;
|
namespace Amp\Filesystem;
|
||||||
|
|
||||||
use Amp\Promise;
|
use Amp\Promise;
|
||||||
use Amp\Success;
|
use Amp\Success;
|
||||||
use Amp\Failure;
|
use Amp\Failure;
|
||||||
use Amp\Deferred;
|
use Amp\Deferred;
|
||||||
|
|
||||||
class EioFilesystem implements Filesystem {
|
class EioDriver implements Driver {
|
||||||
private static $isEioInitialized = false;
|
private static $isEioInitialized = false;
|
||||||
private $stream;
|
private $stream;
|
||||||
private $watcher;
|
private $watcher;
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Amp\Fs;
|
namespace Amp\Filesystem;
|
||||||
|
|
||||||
use Amp\UvReactor;
|
use Amp\UvReactor;
|
||||||
use Amp\Promise;
|
use Amp\Promise;
|
||||||
@ -10,7 +10,7 @@ use Amp\Deferred;
|
|||||||
/**
|
/**
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
*/
|
*/
|
||||||
class UvFilesystem implements Filesystem {
|
class UvDriver implements Driver {
|
||||||
private $reactor;
|
private $reactor;
|
||||||
private $loop;
|
private $loop;
|
||||||
|
|
@ -1,36 +1,37 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Amp\Fs;
|
namespace Amp\Filesystem;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the application-wide filesystem instance
|
* Retrieve the application-wide filesystem instance
|
||||||
*
|
*
|
||||||
* @param \Amp\Fs\Filesystem $assign Use the specified object as the application-wide filesystem instance
|
* @param \Amp\Fs\Driver $assign Use the specified object as the application-wide filesystem instance
|
||||||
* @return \Amp\Fs\Filesystem
|
* @return \Amp\Fs\Driver
|
||||||
*/
|
*/
|
||||||
function filesystem(Filesystem $assign = null) {
|
function filesystem(Driver $assign = null) {
|
||||||
static $filesystem;
|
static $driver;
|
||||||
if ($assign) {
|
if ($assign) {
|
||||||
return ($filesystem = $assign);
|
return ($driver = $assign);
|
||||||
} elseif ($filesystem) {
|
} elseif ($driver) {
|
||||||
return $filesystem;
|
return $driver;
|
||||||
} else {
|
} else {
|
||||||
return ($filesystem = init());
|
return ($driver = driver());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new filesystem instance best-suited for the current environment
|
* Create a new filesystem driver best-suited for the current environment
|
||||||
*
|
*
|
||||||
* @return \Amp\Fs\Filesystem
|
* @return \Amp\Fs\Filesystem
|
||||||
*/
|
*/
|
||||||
function init() {
|
function driver() {
|
||||||
if (\extension_loaded("uv")) {
|
$reactor = \Amp\reactor();
|
||||||
return new UvFilesystem(\Amp\reactor());
|
if ($reactor instanceof \Amp\UvReactor) {
|
||||||
|
return new UvDriver($reactor);
|
||||||
} elseif (\extension_loaded("eio")) {
|
} elseif (\extension_loaded("eio")) {
|
||||||
return new EioFilesystem;
|
return new EioDriver;
|
||||||
} else {
|
} else {
|
||||||
return BlockingFilesystem;
|
return BlockingDriver;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
10
test/BlockingDriverTest.php
Normal file
10
test/BlockingDriverTest.php
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Amp\Filesystem\Test;
|
||||||
|
|
||||||
|
class BlockingDriverTest extends DriverTest {
|
||||||
|
protected function setUp() {
|
||||||
|
\Amp\reactor(\Amp\init());
|
||||||
|
\Amp\Filesystem\filesystem(new \Amp\Filesystem\BlockingDriver);
|
||||||
|
}
|
||||||
|
}
|
@ -1,10 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Amp\Fs\Test;
|
|
||||||
|
|
||||||
class BlockingFilesystemTest extends FilesystemTest {
|
|
||||||
protected function setUp() {
|
|
||||||
\Amp\reactor(\Amp\init());
|
|
||||||
\Amp\Fs\filesystem(new \Amp\Fs\BlockingFilesystem);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,10 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Amp\Fs\Test;
|
namespace Amp\Filesystem\Test;
|
||||||
|
|
||||||
use Amp\Fs\Filesystem;
|
use Amp\Filesystem\Driver;
|
||||||
|
|
||||||
abstract class FilesystemTest extends \PHPUnit_Framework_TestCase {
|
abstract class DriverTest extends \PHPUnit_Framework_TestCase {
|
||||||
private static $fixtureId;
|
private static $fixtureId;
|
||||||
|
|
||||||
private static function getFixturePath() {
|
private static function getFixturePath() {
|
||||||
@ -21,10 +21,10 @@ abstract class FilesystemTest extends \PHPUnit_Framework_TestCase {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stripos(\PHP_OS, "win") === 0) {
|
if (\stripos(\PHP_OS, "win") === 0) {
|
||||||
system('rd /Q /S "' . $fixtureDir . '"');
|
\system('rd /Q /S "' . $fixtureDir . '"');
|
||||||
} else {
|
} else {
|
||||||
system('/bin/rm -rf ' . escapeshellarg($fixtureDir));
|
\system('/bin/rm -rf ' . escapeshellarg($fixtureDir));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -33,17 +33,17 @@ abstract class FilesystemTest extends \PHPUnit_Framework_TestCase {
|
|||||||
|
|
||||||
self::clearFixtureDir();
|
self::clearFixtureDir();
|
||||||
|
|
||||||
if (!mkdir($fixtureDir, $mode = 0777, $recursive = true)) {
|
if (!\mkdir($fixtureDir, $mode = 0777, $recursive = true)) {
|
||||||
throw new \RuntimeException(
|
throw new \RuntimeException(
|
||||||
"Failed creating temporary test fixture directory: {$fixtureDir}"
|
"Failed creating temporary test fixture directory: {$fixtureDir}"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (!mkdir($fixtureDir . "/dir", $mode = 0777, $recursive = true)) {
|
if (!\mkdir($fixtureDir . "/dir", $mode = 0777, $recursive = true)) {
|
||||||
throw new \RuntimeException(
|
throw new \RuntimeException(
|
||||||
"Failed creating temporary test fixture directory"
|
"Failed creating temporary test fixture directory"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (!file_put_contents($fixtureDir . "/small.txt", "small")) {
|
if (!\file_put_contents($fixtureDir . "/small.txt", "small")) {
|
||||||
throw new \RuntimeException(
|
throw new \RuntimeException(
|
||||||
"Failed creating temporary test fixture file"
|
"Failed creating temporary test fixture file"
|
||||||
);
|
);
|
||||||
@ -57,7 +57,7 @@ abstract class FilesystemTest extends \PHPUnit_Framework_TestCase {
|
|||||||
public function testScandir() {
|
public function testScandir() {
|
||||||
\Amp\run(function () {
|
\Amp\run(function () {
|
||||||
$fixtureDir = self::getFixturePath();
|
$fixtureDir = self::getFixturePath();
|
||||||
$actual = (yield \Amp\Fs\scandir($fixtureDir));
|
$actual = (yield \Amp\Filesystem\scandir($fixtureDir));
|
||||||
$expected = ["dir", "small.txt"];
|
$expected = ["dir", "small.txt"];
|
||||||
$this->assertSame($expected, $actual);
|
$this->assertSame($expected, $actual);
|
||||||
});
|
});
|
||||||
@ -69,9 +69,9 @@ abstract class FilesystemTest extends \PHPUnit_Framework_TestCase {
|
|||||||
|
|
||||||
$target = "{$fixtureDir}/small.txt";
|
$target = "{$fixtureDir}/small.txt";
|
||||||
$link = "{$fixtureDir}/symlink.txt";
|
$link = "{$fixtureDir}/symlink.txt";
|
||||||
$this->assertTrue(yield \Amp\Fs\symlink($target, $link));
|
$this->assertTrue(yield \Amp\Filesystem\symlink($target, $link));
|
||||||
$this->assertTrue(\is_link($link));
|
$this->assertTrue(\is_link($link));
|
||||||
yield \Amp\Fs\unlink($link);
|
yield \Amp\Filesystem\unlink($link);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,9 +81,9 @@ abstract class FilesystemTest extends \PHPUnit_Framework_TestCase {
|
|||||||
|
|
||||||
$target = "{$fixtureDir}/small.txt";
|
$target = "{$fixtureDir}/small.txt";
|
||||||
$link = "{$fixtureDir}/symlink.txt";
|
$link = "{$fixtureDir}/symlink.txt";
|
||||||
$this->assertTrue(yield \Amp\Fs\symlink($target, $link));
|
$this->assertTrue(yield \Amp\Filesystem\symlink($target, $link));
|
||||||
$this->assertTrue(is_array(yield \Amp\Fs\lstat($link)));
|
$this->assertTrue(is_array(yield \Amp\Filesystem\lstat($link)));
|
||||||
yield \Amp\Fs\unlink($link);
|
yield \Amp\Filesystem\unlink($link);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,7 +91,7 @@ abstract class FilesystemTest extends \PHPUnit_Framework_TestCase {
|
|||||||
\Amp\run(function () {
|
\Amp\run(function () {
|
||||||
$fixtureDir = self::getFixturePath();
|
$fixtureDir = self::getFixturePath();
|
||||||
|
|
||||||
$stat = (yield \Amp\Fs\stat("{$fixtureDir}/small.txt"));
|
$stat = (yield \Amp\Filesystem\stat("{$fixtureDir}/small.txt"));
|
||||||
$this->assertInternalType("array", $stat);
|
$this->assertInternalType("array", $stat);
|
||||||
$this->assertTrue($stat["isfile"]);
|
$this->assertTrue($stat["isfile"]);
|
||||||
$this->assertFalse($stat["isdir"]);
|
$this->assertFalse($stat["isdir"]);
|
||||||
@ -102,7 +102,7 @@ abstract class FilesystemTest extends \PHPUnit_Framework_TestCase {
|
|||||||
\Amp\run(function () {
|
\Amp\run(function () {
|
||||||
$fixtureDir = self::getFixturePath();
|
$fixtureDir = self::getFixturePath();
|
||||||
|
|
||||||
$stat = (yield \Amp\Fs\stat("{$fixtureDir}/dir"));
|
$stat = (yield \Amp\Filesystem\stat("{$fixtureDir}/dir"));
|
||||||
$this->assertInternalType("array", $stat);
|
$this->assertInternalType("array", $stat);
|
||||||
$this->assertTrue($stat["isdir"]);
|
$this->assertTrue($stat["isdir"]);
|
||||||
$this->assertFalse($stat["isfile"]);
|
$this->assertFalse($stat["isfile"]);
|
||||||
@ -113,7 +113,7 @@ abstract class FilesystemTest extends \PHPUnit_Framework_TestCase {
|
|||||||
\Amp\run(function () {
|
\Amp\run(function () {
|
||||||
$fixtureDir = self::getFixturePath();
|
$fixtureDir = self::getFixturePath();
|
||||||
|
|
||||||
$stat = (yield \Amp\Fs\stat("{$fixtureDir}/nonexistent"));
|
$stat = (yield \Amp\Filesystem\stat("{$fixtureDir}/nonexistent"));
|
||||||
$this->assertNull($stat);
|
$this->assertNull($stat);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -126,10 +126,10 @@ abstract class FilesystemTest extends \PHPUnit_Framework_TestCase {
|
|||||||
$old = "{$fixtureDir}/rename1.txt";
|
$old = "{$fixtureDir}/rename1.txt";
|
||||||
$new = "{$fixtureDir}/rename2.txt";
|
$new = "{$fixtureDir}/rename2.txt";
|
||||||
|
|
||||||
yield \Amp\Fs\put($old, $contents1);
|
yield \Amp\Filesystem\put($old, $contents1);
|
||||||
yield \Amp\Fs\rename($old, $new);
|
yield \Amp\Filesystem\rename($old, $new);
|
||||||
$contents2 = (yield \Amp\Fs\get($new));
|
$contents2 = (yield \Amp\Filesystem\get($new));
|
||||||
yield \Amp\Fs\unlink($new);
|
yield \Amp\Filesystem\unlink($new);
|
||||||
|
|
||||||
$this->assertSame($contents1, $contents2);
|
$this->assertSame($contents1, $contents2);
|
||||||
});
|
});
|
||||||
@ -141,10 +141,10 @@ abstract class FilesystemTest extends \PHPUnit_Framework_TestCase {
|
|||||||
|
|
||||||
$toUnlink = "{$fixtureDir}/unlink";
|
$toUnlink = "{$fixtureDir}/unlink";
|
||||||
|
|
||||||
yield \Amp\Fs\put($toUnlink, "unlink me");
|
yield \Amp\Filesystem\put($toUnlink, "unlink me");
|
||||||
$this->assertTrue((bool) (yield \Amp\Fs\stat($toUnlink)));
|
$this->assertTrue((bool) (yield \Amp\Filesystem\stat($toUnlink)));
|
||||||
yield \Amp\Fs\unlink($toUnlink);
|
yield \Amp\Filesystem\unlink($toUnlink);
|
||||||
$this->assertNull(yield \Amp\Fs\stat($toUnlink));
|
$this->assertNull(yield \Amp\Filesystem\stat($toUnlink));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -154,12 +154,12 @@ abstract class FilesystemTest extends \PHPUnit_Framework_TestCase {
|
|||||||
|
|
||||||
$dir = "{$fixtureDir}/newdir";
|
$dir = "{$fixtureDir}/newdir";
|
||||||
|
|
||||||
yield \Amp\Fs\mkdir($dir);
|
yield \Amp\Filesystem\mkdir($dir);
|
||||||
$stat = (yield \Amp\Fs\stat($dir));
|
$stat = (yield \Amp\Filesystem\stat($dir));
|
||||||
$this->assertTrue($stat["isdir"]);
|
$this->assertTrue($stat["isdir"]);
|
||||||
$this->assertFalse($stat["isfile"]);
|
$this->assertFalse($stat["isfile"]);
|
||||||
yield \Amp\Fs\rmdir($dir);
|
yield \Amp\Filesystem\rmdir($dir);
|
||||||
$this->assertNull(yield \Amp\Fs\stat($dir));
|
$this->assertNull(yield \Amp\Filesystem\stat($dir));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -171,13 +171,13 @@ abstract class FilesystemTest extends \PHPUnit_Framework_TestCase {
|
|||||||
$fixtureDir = self::getFixturePath();
|
$fixtureDir = self::getFixturePath();
|
||||||
|
|
||||||
$touch = "{$fixtureDir}/touch";
|
$touch = "{$fixtureDir}/touch";
|
||||||
yield \Amp\Fs\put($touch, "touch me");
|
yield \Amp\Filesystem\put($touch, "touch me");
|
||||||
|
|
||||||
$oldStat = (yield \Amp\Fs\stat($touch));
|
$oldStat = (yield \Amp\Filesystem\stat($touch));
|
||||||
sleep(1);
|
sleep(1);
|
||||||
yield \Amp\Fs\touch($touch);
|
yield \Amp\Filesystem\touch($touch);
|
||||||
$newStat = (yield \Amp\Fs\stat($touch));
|
$newStat = (yield \Amp\Filesystem\stat($touch));
|
||||||
yield \Amp\Fs\unlink($touch);
|
yield \Amp\Filesystem\unlink($touch);
|
||||||
|
|
||||||
$this->assertTrue($newStat["atime"] > $oldStat["atime"]);
|
$this->assertTrue($newStat["atime"] > $oldStat["atime"]);
|
||||||
$this->assertTrue($newStat["mtime"] > $oldStat["mtime"]);
|
$this->assertTrue($newStat["mtime"] > $oldStat["mtime"]);
|
@ -1,12 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Amp\Fs\Test;
|
namespace Amp\Filesystem\Test;
|
||||||
|
|
||||||
class EioFilesystemTest extends FilesystemTest {
|
class EioDriverTest extends DriverTest {
|
||||||
protected function setUp() {
|
protected function setUp() {
|
||||||
if (extension_loaded("eio")) {
|
if (extension_loaded("eio")) {
|
||||||
\Amp\reactor(\Amp\init());
|
\Amp\reactor(\Amp\init());
|
||||||
\Amp\Fs\filesystem(new \Amp\Fs\EioFilesystem);
|
\Amp\Filesystem\filesystem(new \Amp\Filesystem\EioDriver);
|
||||||
} else {
|
} else {
|
||||||
$this->markTestSkipped(
|
$this->markTestSkipped(
|
||||||
"eio extension not loaded"
|
"eio extension not loaded"
|
@ -1,13 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Amp\Fs\Test;
|
namespace Amp\Filesystem\Test;
|
||||||
|
|
||||||
class UvFilesystemTest extends FilesystemTest {
|
class UvDriverTest extends DriverTest {
|
||||||
protected function setUp() {
|
protected function setUp() {
|
||||||
if (\extension_loaded("uv")) {
|
if (\extension_loaded("uv")) {
|
||||||
$reactor = new \Amp\UvReactor;
|
$reactor = new \Amp\UvReactor;
|
||||||
\Amp\reactor($reactor);
|
\Amp\reactor($reactor);
|
||||||
\Amp\Fs\filesystem(new \Amp\Fs\UvFilesystem($reactor));
|
$driver = new \Amp\Filesystem\UvDriver($reactor);
|
||||||
|
\Amp\Filesystem\filesystem($driver);
|
||||||
} else {
|
} else {
|
||||||
$this->markTestSkipped(
|
$this->markTestSkipped(
|
||||||
"php-uv extension not loaded"
|
"php-uv extension not loaded"
|
Loading…
Reference in New Issue
Block a user