/home
/ski2freedom
/public_html
/site
/plugins
/imagekit
/lib
/lazythumb.php
if(!str::startsWith($path, $thumbs)) {
$path = $thumbs . DS . $path;
}
$jobfile = static::jobfile($path);
if(!$thumbinfo = @include($jobfile)) {
// Abort, if there is no matching jobfile for the
// requested thumb.
return false;
}
// This option is a closure by default, which cannot be
// restored. Currently, we can only restore it by
// overriding it the the default option of the thumb
// class. So this does not work, when a custom
// 'destination' option was set for this particular
// thumbnail or the option has been changed between
// jobfile creation and execution of this method.
$thumbinfo['options']['destination'] = thumb::$defaults['destination'];
if (!is_null($thumbinfo['source']['page'])) {
// Try to relocate the image and get it’s association
// with the original parent page or site
if ($thumbinfo['source']['page'] === '') {
// Image was uploaded to the "content" directory
$image = site()->image($thumbinfo['source']['filename']);
} else {
// Image belongs to a specific page
$image = page($thumbinfo['source']['page'])->image($thumbinfo['source']['filename']);
}
if(!$image) {
// If source image does not exist any more, remove
// the jobfile.
f::remove($jobfile);
return false;
}
} else {
// If the image does not belong to a specific page,
/home
/ski2freedom
/public_html
/site
/plugins
/imagekit
/lib
/lazythumb.php
if(!str::startsWith($path, $thumbs)) {
$path = $thumbs . DS . $path;
}
$jobfile = static::jobfile($path);
if(!$thumbinfo = @include($jobfile)) {
// Abort, if there is no matching jobfile for the
// requested thumb.
return false;
}
// This option is a closure by default, which cannot be
// restored. Currently, we can only restore it by
// overriding it the the default option of the thumb
// class. So this does not work, when a custom
// 'destination' option was set for this particular
// thumbnail or the option has been changed between
// jobfile creation and execution of this method.
$thumbinfo['options']['destination'] = thumb::$defaults['destination'];
if (!is_null($thumbinfo['source']['page'])) {
// Try to relocate the image and get it’s association
// with the original parent page or site
if ($thumbinfo['source']['page'] === '') {
// Image was uploaded to the "content" directory
$image = site()->image($thumbinfo['source']['filename']);
} else {
// Image belongs to a specific page
$image = page($thumbinfo['source']['page'])->image($thumbinfo['source']['filename']);
}
if(!$image) {
// If source image does not exist any more, remove
// the jobfile.
f::remove($jobfile);
return false;
}
} else {
// If the image does not belong to a specific page,
/home
/ski2freedom
/public_html
/site
/plugins
/imagekit
/lib
/component
/thumb.php
// thumbs directory.
$base = ltrim(substr($this->kirby->roots->thumbs(), strlen($this->kirby->roots->index())), DS);
// Setup optimizer if enabled.
if($this->kirby->option('imagekit.optimize')) {
optimizer::register();
}
$this->kirby->set('route', [
'pattern' => "{$base}/(:all)", // $base = 'thumbs' by default
'action' => function ($path) {
if($this->kirby->option('imagekit.complain')) {
complainingthumb::enableSendError();
complainingthumb::setErrorFormat('image');
}
// Try to load a jobfile for given thumb url and
// execute if exists
$thumb = lazythumb::process($path);
if($thumb) {
// Serve the image, if everything went fine :-D
$root = $thumb->result->root();
// Make sure, we’re sending a 200 status, telling
// the browser that everything’s okay.
header::status(200);
// Don’t tell anyone that this image was just
// created by PHP ;-)
header_remove('X-Powered-By');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s', f::modified($root)) . ' GMT');
header('Content-Type: ' . f::mime($root));
header('Content-Length: ' . f::size($root));
// Send file and stop script execution
readfile($root);
/home
/ski2freedom
/public_html
/kirby
/vendor
/getkirby
/toolkit
/helpers.php
/**
* Facepalm typo alias
* @see csrf()
*/
function csfr() {
return call('csrf', func_get_args());
}
/**
* Shortcut for call_user_func_array with a better handling of arguments
*
* @param mixed $function
* @param mixed $arguments
* @return mixed
*/
function call($function, $arguments = array()) {
if(!is_callable($function)) return false;
if(!is_array($arguments)) $arguments = array($arguments);
return call_user_func_array($function, $arguments);
}
/**
* Parses yaml structured text
*
* @param $string
* @return array
*/
function yaml($string) {
return yaml::decode($string);
}
/**
* Simple email sender helper
*
* @param array $params
* @return Email
*/
function email($params = array()) {
return new Email($params);
/home
/ski2freedom
/public_html
/kirby
/kirby.php
// load all plugins
$this->plugins();
// start the router
$this->router = new Router($this->routes());
$this->route = $this->router->run(trim($this->path(), '/'));
// check for a valid route
if(is_null($this->route)) {
header::status('500');
header::type('json');
die(json_encode(array(
'status' => 'error',
'message' => 'Invalid route or request method'
)));
}
// call the router action with all arguments from the pattern
$response = call($this->route->action(), $this->route->arguments());
// load all language variables
// this can only be loaded once the router action has been called
// otherwise the current language is not yet available
$this->localize();
// build the response
$this->response = $this->component('response')->make($response);
// store the current language in the session
if(
$this->option('language.detect') &&
$this->site()->multilang() &&
$this->site()->language()
) {
s::set('kirby_language', $this->site()->language()->code());
}
return $this->response;
/home
/ski2freedom
/public_html
/index.php
<?php
define('DS', DIRECTORY_SEPARATOR);
// load kirby
require(__DIR__ . DS . 'kirby' . DS . 'bootstrap.php');
// check for a custom site.php
if(file_exists(__DIR__ . DS . 'site.php')) {
require(__DIR__ . DS . 'site.php');
} else {
$kirby = kirby();
}
// render
echo $kirby->launch();