Skip to content

Commit 07cf9dd

Browse files
committed
Merge pull request #147 from chaos0815/master
adds missing namespace
2 parents 340995c + 7aaf14d commit 07cf9dd

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
clover.xml
22
php-cs-fixer.phar
3-
composer.json
43
composer.lock
54
vendor
65
.idea

src/AssetManager/Controller/ConsoleController.php

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,14 @@ protected function purgeCache($verbose = false)
106106
continue;
107107
}
108108
$this->output(sprintf('Purging %s on "%s"...', $config['options']['dir'], $configName), $verbose);
109-
$this->recursiveRemove($config['options']['dir']);
109+
110+
$node = $config['options']['dir'];
111+
112+
if ($configName !== 'default') {
113+
$node .= '/'.$configName;
114+
}
115+
116+
$this->recursiveRemove($node, $verbose);
110117
}
111118

112119
return true;
@@ -115,8 +122,9 @@ protected function purgeCache($verbose = false)
115122
/**
116123
* Removes given node from filesystem (recursively).
117124
* @param string $node - uri of node that should be removed from filesystem
125+
* @param bool $verbose verbose flag, default false
118126
*/
119-
protected function recursiveRemove($node)
127+
protected function recursiveRemove($node, $verbose = false)
120128
{
121129
if (is_dir($node)) {
122130
$objects = scandir($node);
@@ -127,9 +135,8 @@ protected function recursiveRemove($node)
127135
}
128136
$this->recursiveRemove($node . '/' . $object);
129137
}
130-
131-
rmdir($node);
132-
} else {
138+
} elseif (is_file($node)) {
139+
$this->output(sprintf("unlinking %s...", $node), $verbose);
133140
unlink($node);
134141
}
135142
}

src/AssetManager/Resolver/PrioritizedPathsResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ public function collect()
218218
/** @var SplFileInfo $pathInfo */
219219
$pathInfo = $locations->pop();
220220
if (!$pathInfo->isReadable()) {
221-
throw new RuntimeException(sprintf('%s is not readable.', $pathInfo->getPath()));
221+
throw new Exception\RuntimeException(sprintf('%s is not readable.', $pathInfo->getPath()));
222222
}
223223
if ($pathInfo->isDir()) {
224224
foreach (new DirectoryResource($pathInfo->getRealPath()) as $resource) {

0 commit comments

Comments
 (0)