phar:
///homepages
/39
/d619483163
/htdocs
/installations
/santeramoincolle
/2018
/application.phar
/library
/rdlowrey
/auryn
/lib
/CachingReflector.php
$lowParam = strtolower($param->name);
if ($function instanceof \ReflectionMethod) {
$lowClass = strtolower($function->class);
$lowMethod = strtolower($function->name);
$paramCacheKey = self::CACHE_KEY_CLASSES . "{$lowClass}.{$lowMethod}.param-{$lowParam}";
} else {
$lowFunc = strtolower($function->name);
$paramCacheKey = ($lowFunc !== '{closure}')
? self::CACHE_KEY_FUNCS . ".{$lowFunc}.param-{$lowParam}"
: null;
}
$typeHint = ($paramCacheKey === null) ? false : $this->cache->fetch($paramCacheKey);
if (false !== $typeHint) {
return $typeHint;
}
if ($reflectionClass = $param->getClass()) {
$typeHint = $reflectionClass->getName();
$classCacheKey = self::CACHE_KEY_CLASSES . strtolower($typeHint);
$this->cache->store($classCacheKey, $reflectionClass);
} else {
$typeHint = null;
}
$this->cache->store($paramCacheKey, $typeHint);
return $typeHint;
}
public function getFunction($functionName)
{
$lowFunc = strtolower($functionName);
$cacheKey = self::CACHE_KEY_FUNCS . $lowFunc;
$reflectedFunc = $this->cache->fetch($cacheKey);
if (false === $reflectedFunc) {
Arguments
"Method ReflectionParameter::getClass() is deprecated"
phar:
///homepages
/39
/d619483163
/htdocs
/installations
/santeramoincolle
/2018
/application.phar
/library
/rdlowrey
/auryn
/lib
/CachingReflector.php
$lowParam = strtolower($param->name);
if ($function instanceof \ReflectionMethod) {
$lowClass = strtolower($function->class);
$lowMethod = strtolower($function->name);
$paramCacheKey = self::CACHE_KEY_CLASSES . "{$lowClass}.{$lowMethod}.param-{$lowParam}";
} else {
$lowFunc = strtolower($function->name);
$paramCacheKey = ($lowFunc !== '{closure}')
? self::CACHE_KEY_FUNCS . ".{$lowFunc}.param-{$lowParam}"
: null;
}
$typeHint = ($paramCacheKey === null) ? false : $this->cache->fetch($paramCacheKey);
if (false !== $typeHint) {
return $typeHint;
}
if ($reflectionClass = $param->getClass()) {
$typeHint = $reflectionClass->getName();
$classCacheKey = self::CACHE_KEY_CLASSES . strtolower($typeHint);
$this->cache->store($classCacheKey, $reflectionClass);
} else {
$typeHint = null;
}
$this->cache->store($paramCacheKey, $typeHint);
return $typeHint;
}
public function getFunction($functionName)
{
$lowFunc = strtolower($functionName);
$cacheKey = self::CACHE_KEY_FUNCS . $lowFunc;
$reflectedFunc = $this->cache->fetch($cacheKey);
if (false === $reflectedFunc) {
phar:
///homepages
/39
/d619483163
/htdocs
/installations
/santeramoincolle
/2018
/application.phar
/library
/rdlowrey
/auryn
/lib
/Injector.php
return $this->make($class, $definition);
}
private function buildArgFromDelegate($paramName, $callableOrMethodStr)
{
if ($this->isExecutable($callableOrMethodStr) === false) {
throw InjectionException::fromInvalidCallable(
$this->inProgressMakes,
$callableOrMethodStr
);
}
$executable = $this->buildExecutable($callableOrMethodStr);
return $executable($paramName, $this);
}
private function buildArgFromTypeHint(\ReflectionFunctionAbstract $reflFunc, \ReflectionParameter $reflParam)
{
$typeHint = $this->reflector->getParamTypeHint($reflFunc, $reflParam);
if (!$typeHint) {
$obj = null;
} elseif ($reflParam->isDefaultValueAvailable()) {
$normalizedName = $this->normalizeName($typeHint);
// Injector has been told explicitly how to make this type
if (isset($this->aliases[$normalizedName]) ||
isset($this->delegates[$normalizedName]) ||
isset($this->shares[$normalizedName])) {
$obj = $this->make($typeHint);
} else {
$obj = $reflParam->getDefaultValue();
}
} else {
$obj = $this->make($typeHint);
}
return $obj;
}
phar:
///homepages
/39
/d619483163
/htdocs
/installations
/santeramoincolle
/2018
/application.phar
/library
/rdlowrey
/auryn
/lib
/Injector.php
foreach ($reflParams as $i => $reflParam) {
$name = $reflParam->name;
if (isset($definition[$i]) || array_key_exists($i, $definition)) {
// indexed arguments take precedence over named parameters
$arg = $definition[$i];
} elseif (isset($definition[$name]) || array_key_exists($name, $definition)) {
// interpret the param as a class name to be instantiated
$arg = $this->make($definition[$name]);
} elseif (($prefix = self::A_RAW . $name) && (isset($definition[$prefix]) || array_key_exists($prefix, $definition))) {
// interpret the param as a raw value to be injected
$arg = $definition[$prefix];
} elseif (($prefix = self::A_DELEGATE . $name) && isset($definition[$prefix])) {
// interpret the param as an invokable delegate
$arg = $this->buildArgFromDelegate($name, $definition[$prefix]);
} elseif (($prefix = self::A_DEFINE . $name) && isset($definition[$prefix])) {
// interpret the param as a class definition
$arg = $this->buildArgFromParamDefineArr($definition[$prefix]);
} elseif (!$arg = $this->buildArgFromTypeHint($reflFunc, $reflParam)) {
$arg = $this->buildArgFromReflParam($reflParam);
}
$args[] = $arg;
}
return $args;
}
private function buildArgFromParamDefineArr($definition)
{
if (!is_array($definition)) {
throw new InjectionException(
$this->inProgressMakes
// @TODO Add message
);
}
if (!isset($definition[0], $definition[1])) {
throw new InjectionException(
phar:
///homepages
/39
/d619483163
/htdocs
/installations
/santeramoincolle
/2018
/application.phar
/library
/rdlowrey
/auryn
/lib
/Injector.php
private function provisionInstance($className, $normalizedClass, array $definition)
{
try {
$ctor = $this->reflector->getCtor($className);
if (!$ctor) {
$obj = $this->instantiateWithoutCtorParams($className);
} elseif (!$ctor->isPublic()) {
throw new InjectionException(
$this->inProgressMakes,
sprintf(self::M_NON_PUBLIC_CONSTRUCTOR, $className),
self::E_NON_PUBLIC_CONSTRUCTOR
);
} elseif ($ctorParams = $this->reflector->getCtorParams($className)) {
$reflClass = $this->reflector->getClass($className);
$definition = isset($this->classDefinitions[$normalizedClass])
? array_replace($this->classDefinitions[$normalizedClass], $definition)
: $definition;
$args = $this->provisionFuncArgs($ctor, $definition, $ctorParams);
$obj = $reflClass->newInstanceArgs($args);
} else {
$obj = $this->instantiateWithoutCtorParams($className);
}
return $obj;
} catch (\ReflectionException $e) {
throw new InjectionException(
$this->inProgressMakes,
sprintf(self::M_MAKE_FAILURE, $className, $e->getMessage()),
self::E_MAKE_FAILURE,
$e
);
}
}
private function instantiateWithoutCtorParams($className)
{
$reflClass = $this->reflector->getClass($className);
phar:
///homepages
/39
/d619483163
/htdocs
/installations
/santeramoincolle
/2018
/application.phar
/library
/rdlowrey
/auryn
/lib
/Injector.php
}
$this->inProgressMakes[$normalizedClass] = count($this->inProgressMakes);
// isset() is used specifically here because classes may be marked as "shared" before an
// instance is stored. In these cases the class is "shared," but it has a null value and
// instantiation is needed.
if (isset($this->shares[$normalizedClass])) {
unset($this->inProgressMakes[$normalizedClass]);
return $this->shares[$normalizedClass];
}
if (isset($this->delegates[$normalizedClass])) {
$executable = $this->buildExecutable($this->delegates[$normalizedClass]);
$reflectionFunction = $executable->getCallableReflection();
$args = $this->provisionFuncArgs($reflectionFunction, $args);
$obj = call_user_func_array(array($executable, '__invoke'), $args);
} else {
$obj = $this->provisionInstance($className, $normalizedClass, $args);
}
$obj = $this->prepareInstance($obj, $normalizedClass);
if (array_key_exists($normalizedClass, $this->shares)) {
$this->shares[$normalizedClass] = $obj;
}
unset($this->inProgressMakes[$normalizedClass]);
return $obj;
}
private function provisionInstance($className, $normalizedClass, array $definition)
{
try {
$ctor = $this->reflector->getCtor($className);
if (!$ctor) {
$obj = $this->instantiateWithoutCtorParams($className);
phar:
///homepages
/39
/d619483163
/htdocs
/installations
/santeramoincolle
/2018
/application.phar
/application
/types
/Application.php
'ReddeRationem\\BilancioCivico\\Middlewares\\GetImageAsJpg',
[':directories' => [$configuration['imageDirectory'], __DIR__ . '/../images']]
);
$injector->define(
'ReddeRationem\\BilancioCivico\\Middlewares\\GetImageAsPng',
[':directories' => [$configuration['imageDirectory'], __DIR__ . '/../images']]
);
$injector->define(
'ReddeRationem\\BilancioCivico\\Middlewares\\GetStylesheetAsCss',
[':directories' => [$configuration['stylesheetDirectory'], __DIR__ . '/../stylesheets'], ':variables' => []]
);
$injector->define(
'ReddeRationem\\BilancioCivico\\Middlewares\\PostToContacts',
[':email' => $configuration['email']]
);
$injector->define(
'Relay\\RelayBuilder',
[
':resolver' => function ($middleware) use ($injector){
return $injector->make(...(array)$middleware);
}
]
);
$injector->define('Twig_Loader_Filesystem', [':paths' => [$configuration['pageDirectory'], __DIR__ . '/../pages']]);
// ////////////////////////////////////////////////////////////////////
$injector->delegate(
'FastRoute\\Dispatcher\\GroupCountBased',
function (RouteCollector $routeCollector){
return new Dispatcher($routeCollector->getData());
}
);
$injector->delegate('Zend\\Diactoros\\ServerRequest', 'Zend\\Diactoros\\ServerRequestFactory::fromGlobals');
// ////////////////////////////////////////////////////////////////////
$injector->prepare(
'FastRoute\\RouteCollector',
function (RouteCollector $routeCollector) use ($configuration){
$basePath = rtrim(parse_url($configuration['baseUrl'], PHP_URL_PATH), '/') . '/';
$authenticateMiddleware = $configuration['debug'] ? ['ReddeRationem\\BilancioCivico\\Middlewares\\Authenticate'] : [];
$cacheMiddleware = $configuration['debug'] ? [] : ['ReddeRationem\\BilancioCivico\\Middlewares\\Cache'];
$routeCollector->addRoute('GET', $basePath, array_merge($authenticateMiddleware, $cacheMiddleware, ['ReddeRationem\\BilancioCivico\\Middlewares\\GetHomeAsHtml']));
phar:
///homepages
/39
/d619483163
/htdocs
/installations
/santeramoincolle
/2018
/application.phar
/library
/relay
/relay
/src
/Runner.php
*
*/
protected function resolve($entry)
{
if (! $entry) {
// the default callable when the queue is empty
return function (
Request $request,
Response $response,
callable $next
) {
return $response;
};
}
if (! $this->resolver) {
return $entry;
}
return call_user_func($this->resolver, $entry);
}
}
phar:
///homepages
/39
/d619483163
/htdocs
/installations
/santeramoincolle
/2018
/application.phar
/library
/relay
/relay
/src
/Runner.php
*
*/
protected function resolve($entry)
{
if (! $entry) {
// the default callable when the queue is empty
return function (
Request $request,
Response $response,
callable $next
) {
return $response;
};
}
if (! $this->resolver) {
return $entry;
}
return call_user_func($this->resolver, $entry);
}
}
phar:
///homepages
/39
/d619483163
/htdocs
/installations
/santeramoincolle
/2018
/application.phar
/library
/relay
/relay
/src
/Runner.php
{
$this->queue = $queue;
$this->resolver = $resolver;
}
/**
*
* Calls the next entry in the queue.
*
* @param Request $request The incoming request.
*
* @param Response $response The outgoing response.
*
* @return Response
*
*/
public function __invoke(Request $request, Response $response)
{
$entry = array_shift($this->queue);
$middleware = $this->resolve($entry);
return $middleware($request, $response, $this);
}
/**
*
* Converts a queue entry to a callable, using the resolver if present.
*
* @param mixed|callable|MiddlewareInterface $entry The queue entry.
*
* @return callable|MiddlewareInterface
*
*/
protected function resolve($entry)
{
if (! $entry) {
// the default callable when the queue is empty
return function (
Request $request,
Response $response,
callable $next
phar:
///homepages
/39
/d619483163
/htdocs
/installations
/santeramoincolle
/2018
/application.phar
/application
/types
/Middlewares
/Debug.php
* You must retain the whole attribution (both the copyright line and the actual authors' list)
*/
declare(strict_types=1);
namespace ReddeRationem\BilancioCivico\Middlewares;
use \ErrorException;
use \Psr\Http\Message\ResponseInterface as Response;
use \Psr\Http\Message\ServerRequestInterface as Request;
use \Throwable;
use \Whoops\Run;
class Debug{
private $run = null;
public function __construct(Run $run){
$this->run = $run;
}
public function __invoke(Request $request, Response $response, callable $next) : Response{
try {
set_error_handler(function (int $number, string $message, string $file, int $line){
throw new ErrorException($message, 0, $number, $file, $line);
});
return $next($request, $response);
}
catch (Throwable $throwable){
$response = $response->withStatus(500);
ob_start();
$this->run->{$this->run::EXCEPTION_HANDLER}($throwable);
$response->getBody()->write(ob_get_clean());
return $response;
}
finally {
restore_error_handler();
}
}
}
phar:
///homepages
/39
/d619483163
/htdocs
/installations
/santeramoincolle
/2018
/application.phar
/library
/relay
/relay
/src
/Runner.php
$this->queue = $queue;
$this->resolver = $resolver;
}
/**
*
* Calls the next entry in the queue.
*
* @param Request $request The incoming request.
*
* @param Response $response The outgoing response.
*
* @return Response
*
*/
public function __invoke(Request $request, Response $response)
{
$entry = array_shift($this->queue);
$middleware = $this->resolve($entry);
return $middleware($request, $response, $this);
}
/**
*
* Converts a queue entry to a callable, using the resolver if present.
*
* @param mixed|callable|MiddlewareInterface $entry The queue entry.
*
* @return callable|MiddlewareInterface
*
*/
protected function resolve($entry)
{
if (! $entry) {
// the default callable when the queue is empty
return function (
Request $request,
Response $response,
callable $next
) {
phar:
///homepages
/39
/d619483163
/htdocs
/installations
/santeramoincolle
/2018
/application.phar
/application
/types
/Middlewares
/Emit.php
*
* BilancioCivico is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with BilancioCivico. If not, see <http://www.gnu.org/licenses/>.
*
* Supplemental term under GNU Affero General Public License version 3 section 7
*
* You must retain the whole attribution (both the copyright line and the actual authors' list)
*/
declare(strict_types=1);
namespace ReddeRationem\BilancioCivico\Middlewares;
use \Psr\Http\Message\ResponseInterface as Response;
use \Psr\Http\Message\ServerRequestInterface as Request;
class Emit{
public function __invoke(Request $request, Response $response, callable $next) : Response{
$response = $next($request, $response);
header('HTTP/' . $response->getProtocolVersion() . ' ' . $response->getStatusCode() . ' ' . $response->getReasonPhrase());
foreach ($response->getHeaders() as $k => $v){
header($k . ': ' . implode(', ', $v));
}
$response->getBody()->rewind();
while (!($response->getBody()->eof())){
echo $response->getBody()->read(1024);
}
return $response;
}
}
phar:
///homepages
/39
/d619483163
/htdocs
/installations
/santeramoincolle
/2018
/application.phar
/library
/relay
/relay
/src
/Runner.php
$this->queue = $queue;
$this->resolver = $resolver;
}
/**
*
* Calls the next entry in the queue.
*
* @param Request $request The incoming request.
*
* @param Response $response The outgoing response.
*
* @return Response
*
*/
public function __invoke(Request $request, Response $response)
{
$entry = array_shift($this->queue);
$middleware = $this->resolve($entry);
return $middleware($request, $response, $this);
}
/**
*
* Converts a queue entry to a callable, using the resolver if present.
*
* @param mixed|callable|MiddlewareInterface $entry The queue entry.
*
* @return callable|MiddlewareInterface
*
*/
protected function resolve($entry)
{
if (! $entry) {
// the default callable when the queue is empty
return function (
Request $request,
Response $response,
callable $next
) {
phar:
///homepages
/39
/d619483163
/htdocs
/installations
/santeramoincolle
/2018
/application.phar
/library
/relay
/relay
/src
/Relay.php
public function __construct(RunnerFactory $runnerFactory)
{
$this->runnerFactory = $runnerFactory;
}
/**
*
* Dispatches to a new Runner.
*
* @param Request $request The request.
*
* @param Response $response The response.
*
* @return Response
*
*/
public function __invoke(Request $request, Response $response)
{
$runner = $this->runnerFactory->newInstance();
return $runner($request, $response);
}
}
phar:
///homepages
/39
/d619483163
/htdocs
/installations
/santeramoincolle
/2018
/application.phar
/library
/rdlowrey
/auryn
/lib
/Executable.php
{
if (is_object($invocationObject)) {
$this->callableReflection = $reflection;
$this->invocationObject = $invocationObject;
} elseif ($reflection->isStatic()) {
$this->callableReflection = $reflection;
} else {
throw new \InvalidArgumentException(
'ReflectionMethod callables must specify an invocation object'
);
}
}
public function __invoke()
{
$args = func_get_args();
$reflection = $this->callableReflection;
if ($this->isInstanceMethod) {
return $reflection->invokeArgs($this->invocationObject, $args);
}
return $this->callableReflection->isClosure()
? $this->invokeClosureCompat($reflection, $args)
: $reflection->invokeArgs($args);
}
/**
* @TODO Remove this extra indirection when 5.3 support is dropped
*/
private function invokeClosureCompat($reflection, $args)
{
if (version_compare(PHP_VERSION, '5.4.0') >= 0) {
$scope = $reflection->getClosureScopeClass();
$closure = \Closure::bind(
$reflection->getClosure(),
$reflection->getClosureThis(),
$scope ? $scope->name : null
);
return call_user_func_array($closure, $args);
phar:
///homepages
/39
/d619483163
/htdocs
/installations
/santeramoincolle
/2018
/application.phar
/library
/rdlowrey
/auryn
/lib
/Injector.php
}
return $obj;
}
/**
* Invoke the specified callable or class::method string, provisioning dependencies along the way
*
* @param mixed $callableOrMethodStr A valid PHP callable or a provisionable ClassName::methodName string
* @param array $args Optional array specifying params with which to invoke the provisioned callable
* @throws \Auryn\InjectionException
* @return mixed Returns the invocation result returned from calling the generated executable
*/
public function execute($callableOrMethodStr, array $args = array())
{
list($reflFunc, $invocationObj) = $this->buildExecutableStruct($callableOrMethodStr);
$executable = new Executable($reflFunc, $invocationObj);
$args = $this->provisionFuncArgs($reflFunc, $args);
return call_user_func_array(array($executable, '__invoke'), $args);
}
/**
* Provision an Executable instance from any valid callable or class::method string
*
* @param mixed $callableOrMethodStr A valid PHP callable or a provisionable ClassName::methodName string
* @return \Auryn\Executable
*/
public function buildExecutable($callableOrMethodStr)
{
try {
list($reflFunc, $invocationObj) = $this->buildExecutableStruct($callableOrMethodStr);
} catch (\ReflectionException $e) {
throw InjectionException::fromInvalidCallable(
$this->inProgressMakes,
$callableOrMethodStr,
$e
);
}
phar:
///homepages
/39
/d619483163
/htdocs
/installations
/santeramoincolle
/2018
/application.phar
/library
/rdlowrey
/auryn
/lib
/Injector.php
}
return $obj;
}
/**
* Invoke the specified callable or class::method string, provisioning dependencies along the way
*
* @param mixed $callableOrMethodStr A valid PHP callable or a provisionable ClassName::methodName string
* @param array $args Optional array specifying params with which to invoke the provisioned callable
* @throws \Auryn\InjectionException
* @return mixed Returns the invocation result returned from calling the generated executable
*/
public function execute($callableOrMethodStr, array $args = array())
{
list($reflFunc, $invocationObj) = $this->buildExecutableStruct($callableOrMethodStr);
$executable = new Executable($reflFunc, $invocationObj);
$args = $this->provisionFuncArgs($reflFunc, $args);
return call_user_func_array(array($executable, '__invoke'), $args);
}
/**
* Provision an Executable instance from any valid callable or class::method string
*
* @param mixed $callableOrMethodStr A valid PHP callable or a provisionable ClassName::methodName string
* @return \Auryn\Executable
*/
public function buildExecutable($callableOrMethodStr)
{
try {
list($reflFunc, $invocationObj) = $this->buildExecutableStruct($callableOrMethodStr);
} catch (\ReflectionException $e) {
throw InjectionException::fromInvalidCallable(
$this->inProgressMakes,
$callableOrMethodStr,
$e
);
}
phar:
///homepages
/39
/d619483163
/htdocs
/installations
/santeramoincolle
/2018
/application.phar
/application
/types
/Application.php
);
$injector->prepare(
'Whoops\\Run',
function (Run $run) use ($injector){
$run->pushHandler($injector->make('Whoops\\Handler\\HandlerInterface'));
}
);
// ////////////////////////////////////////////////////////////////////
$injector->share($injector);
$injector->share('Relay\\RelayBuilder');
// ////////////////////////////////////////////////////////////////////
if (!file_exists($configuration['cacheDirectory'])){
mkdir($configuration['cacheDirectory'], 0755, true);
}
if (!file_exists($configuration['databaseFile'])){
copy(__DIR__ . '/../databases/database.sqlite', $configuration['databaseFile']);
}
// ////////////////////////////////////////////////////////////////////
$injector->execute($injector->make('Relay\\RelayBuilder')->newInstance([
'ReddeRationem\\BilancioCivico\\Middlewares\\Emit',
'ReddeRationem\\BilancioCivico\\Middlewares\\Debug',
'ReddeRationem\\BilancioCivico\\Middlewares\\Route'
]));
}
}
/homepages
/39
/d619483163
/htdocs
/installations
/santeramoincolle
/2018
/application.phar
<?php
declare(strict_types=1);
use \Auryn\Injector;
use \ReddeRationem\BilancioCivico\Application;
date_default_timezone_set('Europe/Rome');
include 'phar://application.phar/library/autoload.php';
$application = new Application();
$application->run(
__DIR__,
(isset($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['SCRIPT_NAME']), '/') . '/',
new Injector()
);
__HALT_COMPILER(); ?>
"V + application.phar .git/configx M��[x �%� .git/descriptionI M��[I 7�� .git/HEAD M��[ ]1��� .git/hooks/applypatch-msg.sample� M��[� �O� � .git/hooks/commit-msg.sample� M��[� ��� .git/hooks/post-update.sample� M��[� ���� .git/hooks/pre-applypatch.sample� M��[� �L� .git/hooks/pre-commit.samplej M��[j %0�\� .git/hooks/pre-push.sampleD M��[D ؏�� .git/hooks/pre-rebase.sampleW M��[W ,�.�� .git/hooks/pre-receive.sample M��[ ���� $ .git/hooks/prepare-commit-msg.sample� M��[� ��� .git/hooks/update.sample M��[ !D%�
.git/index�% M��[�% ]�z� .git/info/exclude� M��[� w=�!� .git/logs/HEAD{ M��[{ M�s� .git/logs/refs/heads/194/96� M��[� z荶 .git/logs/refs/heads/master� M��[� �b{C� "