mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
46 lines
1.1 KiB
PHP
46 lines
1.1 KiB
PHP
<?php defined('BASEPATH') or exit('No direct script access allowed');
|
|
|
|
/***
|
|
* Paths Library to return specific paths
|
|
*/
|
|
class Paths
|
|
{
|
|
// generic function for return eQsl path //
|
|
function getPathEqsl()
|
|
{
|
|
$CI = &get_instance();
|
|
$CI->load->model('Eqsl_images');
|
|
return $CI->Eqsl_images->get_imagePath();
|
|
}
|
|
|
|
// generic function for return Qsl path //
|
|
function getPathQsl()
|
|
{
|
|
$CI = &get_instance();
|
|
$CI->load->model('Qsl_model');
|
|
return $CI->Qsl_model->get_imagePath();
|
|
}
|
|
|
|
function make_update_path($path) {
|
|
|
|
$CI = & get_instance();
|
|
|
|
$path = "updates/" . $path;
|
|
$datadir = $CI->config->item('datadir');
|
|
if(!$datadir) {
|
|
return $path;
|
|
}
|
|
return $datadir . "/" . $path;
|
|
}
|
|
|
|
function cache_buster($filepath) {
|
|
$fullpath = $_SERVER['DOCUMENT_ROOT'] . $filepath;
|
|
if (file_exists($fullpath)) {
|
|
return base_url($filepath) . '?v=' . filemtime($fullpath);
|
|
} else {
|
|
log_message('error', 'CACHE BUSTER - File does not exist: ' . $filepath);
|
|
}
|
|
return base_url($filepath);
|
|
}
|
|
}
|