hotfix: Removed old code

This commit is contained in:
Chris 2016-12-11 23:23:09 +01:00
parent 302e5a50ce
commit 07101181c3
5 changed files with 0 additions and 102 deletions

View File

@ -1,23 +0,0 @@
<?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";
}
}

View File

@ -1,23 +0,0 @@
<?php
namespace NoccyLabs\Hotfix\Hotfix\Loader;
class GistLoader implements LoaderInterface
{
public function load($fix)
{
if (!preg_match('/^gist\:/i', $fix)) {
return false;
}
$url = "https://gist.githubusercontent.com/" . substr($fix, 5) . "/raw";
return file_get_contents($url);
}
public function getInfo()
{
return "gist:<info>user</info>/<info>gist-id</info> - Read hotfix from a Gist";
}
}

View File

@ -1,20 +0,0 @@
<?php
namespace NoccyLabs\Hotfix\Hotfix\Loader;
class HttpLoader implements LoaderInterface
{
public function load($fix)
{
if (preg_match("/^http[s]?:/", $fix)) {
$body = file_get_contents($fix);
return $body;
}
return false;
}
public function getInfo()
{
return "http(s)://<info>url</info> - Read hotfix from a URL";
}
}

View File

@ -1,8 +0,0 @@
<?php
namespace NoccyLabs\Hotfix\Hotfix\Loader;
interface LoaderInterface
{
public function load($fix);
}

View File

@ -1,28 +0,0 @@
<?php
namespace NoccyLabs\Hotfix\Hotfix\Loader;
class PastebinLoader implements LoaderInterface
{
public function load($fix)
{
if (!preg_match('/^pastebin\:/i', $fix)) {
return false;
}
$pasteId = substr($fix, 9);
$url = "https://pastebin.com/raw/{$pasteId}";
$body = file_get_contents($url);
$body = str_replace("\r\n", "\n", $body);
return $body;
}
public function getInfo()
{
return "pastebin:<info>paste-id</info> - Read hotfix from Pastebin";
}
}