1
0
mirror of https://github.com/devfake/flox.git synced 2024-11-15 14:42:31 +01:00
flox/backend/app/helpers.php
Viktor Geringer 7059f55d44
Update dependencies (#97)
* update webpack and vue

* Update Laravel

Fix tests.
Swap native php error log with Laravel's (disable on testing).
Remove Laravel Scout.

* fluent routing and decrease dbal version

* update to php 7.1
2017-11-03 13:53:28 +01:00

35 lines
670 B
PHP

<?php
function increaseTimeLimit()
{
set_time_limit(config('app.PHP_TIME_LIMIT'));
}
function getFileName($file)
{
return $file->changed->name ?? $file->name;
}
function mediaType($mediaType)
{
return $mediaType == 'movies' ? 'movie' : 'tv';
}
function getSlug($title)
{
return str_slug($title) != '' ? str_slug($title) : 'no-slug-available';
}
// There is no 'EN' region in TMDb.
function getRegion($translation)
{
return strtolower($translation) == 'en' ? 'us' : $translation;
}
function logInfo($message, $context = [])
{
if( ! app()->runningUnitTests()) {
info($message, $context);
}
}