Skip to content
This repository has been archived by the owner on Mar 1, 2023. It is now read-only.

Commit

Permalink
fixes #384 (#387)
Browse files Browse the repository at this point in the history
* fixes #384

* added code-coverage

* change ext
  • Loading branch information
prisis committed Sep 19, 2016
1 parent 8f4709d commit 5316d7a
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 42 deletions.
2 changes: 2 additions & 0 deletions build/travis/after_success.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
if [[ "$CHECK_CS" = true && "$SEND_COVERAGE" = true ]]; then
# Run codecov
bash <(curl -s https://codecov.io/bash)
wget https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --access-token="a8a3ec5b2ec383bfeb6c161acd5950fffb54e507a27cf61646e28318285c31c3" --format=php-clover coverage.xml
fi
22 changes: 1 addition & 21 deletions src/Viserio/Filesystem/FilesystemAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,26 +255,6 @@ public function getTimestamp(string $path)
return ! $getTimestamp ?: $getTimestamp['timestamp'];
}

/**
* Set the path for LocalAdapter.
*
* @param string $path
*/
public function setLocalPath(string $path)
{
$this->localPath = $path;
}

/**
* Get the LocalAdapter path.
*
* @return string
*/
public function getLocalPath(): string
{
return $this->localPath !== '' ? $this->localPath : '/storage/';
}

/**
* {@inheritdoc}
*
Expand All @@ -289,7 +269,7 @@ public function url(string $path): string

return $adapter->getClient()->getObjectUrl($adapter->getBucket(), $path);
} elseif ($adapter instanceof LocalAdapter) {
return $this->normalizeDirectorySeparator($this->getLocalPath()) . $path;
return $adapter->getPathPrefix() . $path;
} elseif (method_exists($adapter, 'getUrl')) {
return $adapter->getUrl($path);
}
Expand Down
8 changes: 0 additions & 8 deletions src/Viserio/Filesystem/FilesystemManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ protected function getCacheConfig(string $name): array
*/
protected function adapt(AdapterInterface $adapter, array $config): FilesystemContract
{
$localAdapter = $adapter instanceof FlyLocal;

if (isset($config['cache']) && is_array($config['cache'])) {
$cacheFactory = new CachedFactory($this, $this->cache);

Expand All @@ -122,12 +120,6 @@ protected function adapt(AdapterInterface $adapter, array $config): FilesystemCo

$filesystemAdapter = new FilesystemAdapter($adapter);

if ($localAdapter) {
$filesystemAdapter->setLocalPath(
$this->config->get($this->getConfigName() . '.disks.local.root', '')
);
}

return $filesystemAdapter;
}

Expand Down
12 changes: 0 additions & 12 deletions src/Viserio/Filesystem/Tests/FilesystemManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,6 @@ public function testLocalConnectorDriver()
'path' => __DIR__,
],
]);
$config->shouldReceive('get')
->once()
->with('filesystem.disks.local.root', '')
->andReturn('');

$manager = new FilesystemManager($config);

Expand Down Expand Up @@ -220,10 +216,6 @@ public function testVfsConnectorDriver()
->andReturn([
'vfs' => [],
]);
$config->shouldReceive('get')
->once()
->with('filesystem.disks.local.root', '')
->andReturn('');

$manager = new FilesystemManager($config);

Expand Down Expand Up @@ -307,10 +299,6 @@ public function testCachedAdapter()
'cache' => 'local',
],
]);
$config->shouldReceive('get')
->once()
->with('filesystem.disks.local.root', '')
->andReturn('');
$config->shouldReceive('get')
->once()
->with('filesystem.cached')
Expand Down
2 changes: 1 addition & 1 deletion src/Viserio/Filesystem/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
</php>

<testsuites>
<testsuite name="Narrowspark Filesystem Test Suite">
<testsuite name="Narrowspark Filesystem Component Test Suite">
<directory suffix="Test.php">./Tests/</directory>
</testsuite>
</testsuites>
Expand Down

0 comments on commit 5316d7a

Please sign in to comment.