mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-07 13:08:40 +00:00
Fix path bugs
This commit is contained in:
parent
1ef5b8d01f
commit
1de4cd302b
|
|
@ -55,9 +55,9 @@ class InfoManager
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function __construct($path)
|
public function __construct(string $path)
|
||||||
{
|
{
|
||||||
$this->path = realpath($path);
|
$this->path = $path;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -83,8 +83,8 @@ class InfoManager
|
||||||
*/
|
*/
|
||||||
public function load() /* : void */
|
public function load() /* : void */
|
||||||
{
|
{
|
||||||
if ($this->path === false || !file_exists($this->path)) {
|
if (!file_exists($this->path)) {
|
||||||
throw new PathException((string) $this->path);
|
throw new PathException($this->path);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->info = json_decode(file_get_contents($this->path), true);
|
$this->info = json_decode(file_get_contents($this->path), true);
|
||||||
|
|
@ -99,7 +99,7 @@ class InfoManager
|
||||||
*/
|
*/
|
||||||
public function update() /* : void */
|
public function update() /* : void */
|
||||||
{
|
{
|
||||||
if ($this->path === false || !file_exists($this->path)) {
|
if (!file_exists($this->path)) {
|
||||||
throw new PathException((string) $this->path);
|
throw new PathException((string) $this->path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user