upgrade to wellrested v5.1.1, fix
This commit is contained in:
parent
c5f49214b5
commit
ca3bb2cb0a
|
|
@ -117,21 +117,21 @@ class UploadedFile implements UploadedFileInterface
|
||||||
*
|
*
|
||||||
* @see http://php.net/is_uploaded_file
|
* @see http://php.net/is_uploaded_file
|
||||||
* @see http://php.net/move_uploaded_file
|
* @see http://php.net/move_uploaded_file
|
||||||
* @param string $path Path to which to move the uploaded file.
|
* @param string $targetPath Path to which to move the uploaded file.
|
||||||
* @return void
|
* @return void
|
||||||
* @throws InvalidArgumentException if the $path specified is invalid.
|
* @throws InvalidArgumentException if the $path specified is invalid.
|
||||||
* @throws RuntimeException on any error during the move operation, or on
|
* @throws RuntimeException on any error during the move operation, or on
|
||||||
* the second or subsequent call to the method.
|
* the second or subsequent call to the method.
|
||||||
*/
|
*/
|
||||||
public function moveTo($path)
|
public function moveTo($targetPath)
|
||||||
{
|
{
|
||||||
if ($this->tmpName === null || !file_exists($this->tmpName)) {
|
if ($this->tmpName === null || !file_exists($this->tmpName)) {
|
||||||
throw new RuntimeException("File {$this->tmpName} does not exist.");
|
throw new RuntimeException("File {$this->tmpName} does not exist.");
|
||||||
}
|
}
|
||||||
if (php_sapi_name() === 'cli') {
|
if (php_sapi_name() === 'cli') {
|
||||||
rename($this->tmpName, $path);
|
rename($this->tmpName, $targetPath);
|
||||||
} else {
|
} else {
|
||||||
move_uploaded_file($this->tmpName, $path);
|
move_uploaded_file($this->tmpName, $targetPath);
|
||||||
}
|
}
|
||||||
$this->moved = true;
|
$this->moved = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -278,7 +278,7 @@ class Router implements MiddlewareInterface
|
||||||
usort($matches, $compareByLength);
|
usort($matches, $compareByLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
$bestMatch = $matches[0];
|
$bestMatch = array_values($matches)[0];
|
||||||
return $this->prefixRoutes[$bestMatch];
|
return $this->prefixRoutes[$bestMatch];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue