Skip to content

Commit

Permalink
rename CacheAccess -> ShortLinkAccess because we get cache somewhere …
Browse files Browse the repository at this point in the history
…else as well now
  • Loading branch information
joschahenningsen committed Jan 12, 2021
1 parent cb0e4df commit 36bd806
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion api/CacheAccess.php → api/ShortLinkAccess.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

class CacheAccess {
class ShortLinkAccess {
const SHORTLINKPREFIXURL = "shortlink_to_url_";

/**
Expand Down
4 changes: 2 additions & 2 deletions api/get_rbg_hls_link.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
include 'simple_html_dom.php';
include_once 'CacheAccess.php';
include_once 'ShortLinkAccess.php';

function get_rbg_hls_link(string $url): ?string {
$html = CacheAccess::getHtml($url, 60 * 60 * 24); // this site should be static, therefore we cache it longer.
$html = ShortLinkAccess::getHtml($url, 60 * 60 * 24); // this site should be static, therefore we cache it longer.

if ($html) {
$matches = [];
Expand Down
2 changes: 0 additions & 2 deletions api/get_rbg_stream_site.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php
include 'simple_html_dom.php';
include_once 'CacheAccess.php';


function ParseInformation($link) {
$CACHEKEY = "get_rbg_stream_site";
Expand Down
4 changes: 2 additions & 2 deletions api/get_rbg_streams.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
include 'simple_html_dom.php';
include_once 'CacheAccess.php';
include_once 'ShortLinkAccess.php';

$CACHEKEY = "get_rbg_streams";
$CACETTL = 60;
Expand Down Expand Up @@ -127,7 +127,7 @@ function FormatLink($string) {
}

function FormatAndShortenLink($string) {
return CacheAccess::getVideoShortId(FormatLink($string));
return ShortLinkAccess::getVideoShortId(FormatLink($string));
}

function FormatText($string) {
Expand Down
1 change: 0 additions & 1 deletion index.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php
include_once 'language.php';
include_once 'api/get_rbg_streams.php';
include_once 'api/CacheAccess.php';

function td($el) {
return "<td>$el</td>";
Expand Down
4 changes: 2 additions & 2 deletions video_only.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
include_once 'language.php';
include_once 'api/get_rbg_hls_link.php';
include_once 'api/CacheAccess.php';
include_once 'api/ShortLinkAccess.php';

$link = CacheAccess::getVideoUrl($_GET["s"]);
$link = ShortLinkAccess::getVideoUrl($_GET["s"]);
$hls_url = strlen($link) > 0 ? get_rbg_hls_link($link) : null;
?>

Expand Down
4 changes: 2 additions & 2 deletions watch.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
include_once 'language.php';
include_once 'api/get_rbg_stream_site.php';
include_once 'api/CacheAccess.php';
include_once 'api/ShortLinkAccess.php';

$link = CacheAccess::getVideoUrl($_GET["s"]);
$link = ShortLinkAccess::getVideoUrl($_GET["s"]);
if (strlen($link) > 0) {
$data = ParseInformation($link);
} else {
Expand Down

0 comments on commit 36bd806

Please sign in to comment.