#0 -
{core}/classes/Response/Image.php
[89]:
Tell_Response_Image->fileInfo($file)
* @return void
*/
public function __construct($file)
{
$this->file = $file;
$this->meta = $this->fileInfo($this->file);
}
/**
* Send image to browser as a file download.
* ---
#1 -
{core}/classes/App.php
[178]:
Tell_Response_Image->__construct($file)
* @return object Instance of Tell_Response_Image.
*/
public function image(string $file)
: Tell_Response_Image
{
return new Tell_Response_Image($file);
}
/**
* Compose an HTTP >> inspection response.
* ---
#2 -
{app}/call/index.php
[28]:
Tell_App->image(string $file)
->scale($width, $height)
->embed('example.jpg');
}
// (object) Smart crop image
return $this->image($base . '/' . $image['image_path'])
->conform($width, $height)
->embed('example.jpg');
});
// http://{host}/product/123/view
#3 -
{core}/classes/Container.php
[521]:
App->{closure}()
// (array) [reference] $init, [reference] $class, [reference] $invoke
$parts = $this->codify($call, $chain, $init, $class, $invoke);
// (mixed) Call a closure or native PHP function
if ($invoke) {
return $invoke(...$this->inject(new ReflectionFunction($invoke))($args));
}
// Instantiate a class, or passthru an already-instantiated instance of class
if ($class && empty($parts)) {
// (object) Just a passthru; nothing needs resolved; safely stop here
#4 -
{core}/classes/App/Proxy.php
[99]:
Tell_Container->resolve($call, ...$args)
/**
* @see Tell_Container->resolve()
*/
public function resolve($call, ...$args)
{
return $this->ioc->resolve($call, ...$args);
}
/**
* @see Tell_Container->use()
*/
#5 -
{core}/classes/Call/Abstract.php
[177]:
Tell_App_Proxy->resolve($call, ...$args)
// Start a nested output buffer
ob_start();
// (mixed) Invoke caller (usually returns an instance of Tell_Response_Interface)
$result = $this->app->resolve($fn, ...$params);
// (string) Caller's output buffer (usually empty)
$buffer = ob_get_clean();
// (object) Convert Tell_Response_Factory to Tell_Response_Interface
#6 -
{core}/classes/Call/Generic.php
[167]:
Tell_Call_Abstract->resolve(array $params, $fn = NULL)
if ($result = $this->eventBefore([$this->before, $params])) {
return $this->response->push($result);
}
// Make the call and apply 'after' middleware to it
$this->eventAfter([$this->after, $params, $this->resolve($params, $fn)]);
})->bindTo($this, $this);
// (object) Instance of self for chainability
return $this;
}
#7 -
{core}/classes/Call/Abstract.php
[120]:
Tell_Call_Generic->{closure}()
// Clear queue first to prevent duplicate calls during uncaught exceptions
static::$queue = NULL;
// Attempt call
$fn->__invoke();
}
}
/**
* Initialize call handler.
#8 -
{core}/classes/Call/Abstract.php
[120]:
Closure->__invoke()
// Clear queue first to prevent duplicate calls during uncaught exceptions
static::$queue = NULL;
// Attempt call
$fn->__invoke();
}
}
/**
* Initialize call handler.
#9 -
{core}/classes/Call/Abstract.php
[133]:
Tell_Call_Abstract::finish()
* @return void
*/
public function __construct(Tell_App $app)
{
// If a caller is exists in the queue, try invoking it now
static::finish();
// (object...) Apply dependencies
$this->app = $app;
$this->event = $app->pull(Tell_Event::class);
$this->router = $app->pull(Tell_Router::class);
#10 -
{core}/classes/Call/Generic.php
[34]:
Tell_Call_Abstract->__construct(Tell_App $app)
{
// (string) URI pattern to test against
$this->uri = $uri;
// Tell_Call_Abstract->__construct()
parent::__construct($app);
}
/**
* Shorthand GET;HEAD;POST;PUT;DELETE;PATCH caller.
* ---
#11 -
{core}/classes/Container.php
[474]:
ReflectionMethod->invokeArgs(object $object, array $args)
$this->antiCsrf();
}
// Generate and apply instantiation routine to class instance
if ($construct) {
$construct->invokeArgs($obj, $this->inject($construct)->__invoke($args));
}
// The class implements the shared interface; place instance in container
if ($obj instanceof Tell_Container_Shared && ! $this->contains($class)) {
$this->push($obj);
#12 -
{core}/classes/Container.php
[447]:
Tell_Container->{closure}()
: object
{
try {
// (object) Use an existing instantiation routine for this class
if ($routine = $this->routine($class)) {
return $this->trigger($class, $routine(...$args));
}
// (object; object) Get reflection of __construct()
$reflect = new ReflectionClass($class);
$construct = $reflect->getConstructor();
#13 -
{core}/classes/App/Proxy.php
[20]:
Tell_Container->factory(string $class, ...$args)
* @see Tell_Call_Generic->__construct()
*/
public function call(...$args)
: Tell_Call_Generic
{
return $this->ioc->factory(Tell_Call_Generic::class, ...$args);
}
/**
* @see Tell::config()
*/
#14 -
{app}/call/index.php
[34]:
Tell_App_Proxy->call(...$args)
->conform($width, $height)
->embed('example.jpg');
});
// http://{host}/product/123/view
$app->call('product/{id}/view')->get(function (Build_Cart $cart, $id) {
return $this->format('store.product')
->using('cart', $cart)
->using('id', $id);
});
#15 -
{core}/classes/Router.php
[386]:
require()
(static function() {
// $app = Tell_App
extract(func_get_arg(1));
// First argument is $file
require func_get_arg(0);
})->bindTo(NULL, NULL)($file, ['app' => $this->app]);
// Don't load router in isolation (likely an internal framework route)
} else {
// (object) Instance of Tell_App
$app = $this->app;
#16 -
{core}/classes/Router.php
[387]:
{closure}()
// $app = Tell_App
extract(func_get_arg(1));
// First argument is $file
require func_get_arg(0);
})->bindTo(NULL, NULL)($file, ['app' => $this->app]);
// Don't load router in isolation (likely an internal framework route)
} else {
// (object) Instance of Tell_App
$app = $this->app;
#17 -
{core}/classes/Router.php
[205]:
Tell_Router->forge(string $file, bool $isolate = FALSE)
// (bool) Used to check whether $this->file forged below contains any callers
$this->attempted = FALSE;
// URI doesn't match a reserved route, so try calling $this->file
if ( ! $this->found && is_file($this->file)) {
$this->forge($this->file, TRUE);
}
// If caller in limbo, try calling it (usually last caller in $this->file)
Tell_Call_Abstract::finish();
#18 -
{core}/classes/App.php
[55]:
Tell_Router->run()
* @return void
*/
public function route()
: void
{
$this->router->run();
}
/**
* Abort the current HTTP request.
* ---
#19 -
{core}/classes/App.php
[43]:
Tell_App->route()
// $ php src/public/index.php -v | $ php src/public/index.php jobs:run | etc
if ($this->req->isCli()) {
(new Tell_Console($this))->run();
// Normal HTTP request
} else {
$this->route();
}
}
/**
* Route the current HTTP request.
#20 -
{root}/content/index.php
[34]:
Tell_App->delegate()
set_time_limit(5);
}
// Delegate the current command or HTTP request (allow __FILE__ to be included without delegation)
if (Tell::is('index.php')) {
App::instance()->delegate();
}