php-hotfix/src/Hotfix/Loader/FileLoader.php

24 lines
471 B
PHP

<?php
namespace NoccyLabs\Hotfix\Hotfix\Loader;
class FileLoader implements LoaderInterface
{
public function load($fix)
{
if ($fix[0] !== '/') {
$fix = getcwd()."/".$fix;
}
if (file_exists($fix)) {
$hotfix = file_get_contents($fix);
return $hotfix;
}
return false;
}
public function getInfo()
{
return "<info>filename</info> - Read a hotfix from a file";
}
}