/home
/sleva123
/public_html
/u
/src
/Hazzard
/Database
/Connection.php
$this->tablePrefix = $config['prefix'];
}
/**
* Create a new PDO connection.
*
* @param array $config
* @return PDO
*/
public function createConnection(array $config)
{
extract($config);
$dsn = "$driver:host={$hostname};dbname={$database}";
$options = array(
PDO::MYSQL_ATTR_INIT_COMMAND => "set names {$charset} collate {$collation}"
);
return new PDO($dsn, $username, $password, $options);
}
/**
* Begin a fluent query against a database table.
*
* @param string $table
* @return \Hazzard\Database\Query
*/
public function table($table)
{
$query = new Query($this);
return $query->from($table);
}
/**
* Get a new raw query expression.
*
* @param mixed $value
* @return \Hazzard\Database\Expression
/home
/sleva123
/public_html
/u
/src
/Hazzard
/Database
/Connection.php
$this->tablePrefix = $config['prefix'];
}
/**
* Create a new PDO connection.
*
* @param array $config
* @return PDO
*/
public function createConnection(array $config)
{
extract($config);
$dsn = "$driver:host={$hostname};dbname={$database}";
$options = array(
PDO::MYSQL_ATTR_INIT_COMMAND => "set names {$charset} collate {$collation}"
);
return new PDO($dsn, $username, $password, $options);
}
/**
* Begin a fluent query against a database table.
*
* @param string $table
* @return \Hazzard\Database\Query
*/
public function table($table)
{
$query = new Query($this);
return $query->from($table);
}
/**
* Get a new raw query expression.
*
* @param mixed $value
* @return \Hazzard\Database\Expression
/home
/sleva123
/public_html
/u
/src
/Hazzard
/Database
/Connection.php
* @var int
*/
protected $fetchMode = PDO::FETCH_CLASS;
/**
* The table prefix for the connection.
*
* @var string
*/
protected $tablePrefix = '';
/**
* Create a new connection instance.
*
* @param array $config
* @return void
*/
public function __construct(array $config)
{
$this->pdo = $this->createConnection($config);
$this->tablePrefix = $config['prefix'];
}
/**
* Create a new PDO connection.
*
* @param array $config
* @return PDO
*/
public function createConnection(array $config)
{
extract($config);
$dsn = "$driver:host={$hostname};dbname={$database}";
$options = array(
PDO::MYSQL_ATTR_INIT_COMMAND => "set names {$charset} collate {$collation}"
);
/home
/sleva123
/public_html
/u
/src
/Hazzard
/Database
/DatabaseServiceProvider.php
<?php namespace Hazzard\Database;
use Hazzard\Support\ServiceProvider;
class DatabaseServiceProvider extends ServiceProvider {
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->app->bindShared('db', function($app) {
$config = $app['config']['database'];
return new Connection($config);
});
Model::setConnection($this->app['db']);
}
}
/home
/sleva123
/public_html
/u
/vendor
/illuminate
/container
/Illuminate
/Container
/Container.php
}
/**
* Wrap a Closure such that it is shared.
*
* @param Closure $closure
* @return Closure
*/
public function share(Closure $closure)
{
return function($container) use ($closure)
{
// We'll simply declare a static variable within the Closures and if it has
// not been set we will execute the given Closures to resolve this value
// and return it back to these consumers of the method as an instance.
static $object;
if (is_null($object))
{
$object = $closure($container);
}
return $object;
};
}
/**
* Bind a shared Closure into the container.
*
* @param string $abstract
* @param \Closure $closure
* @return void
*/
public function bindShared($abstract, Closure $closure)
{
return $this->bind($abstract, $this->share($closure), true);
}
/**
* "Extend" an abstract type in the container.
/home
/sleva123
/public_html
/u
/vendor
/illuminate
/container
/Illuminate
/Container
/Container.php
return is_string($abstract) && strpos($abstract, '\\') !== 0;
}
/**
* Instantiate a concrete instance of the given type.
*
* @param string $concrete
* @param array $parameters
* @return mixed
*
* @throws BindingResolutionException
*/
public function build($concrete, $parameters = array())
{
// If the concrete type is actually a Closure, we will just execute it and
// hand back the results of the functions, which allows functions to be
// used as resolvers for more fine-tuned resolution of these objects.
if ($concrete instanceof Closure)
{
return $concrete($this, $parameters);
}
$reflector = new ReflectionClass($concrete);
// If the type is not instantiable, the developer is attempting to resolve
// an abstract type such as an Interface of Abstract Class and there is
// no binding registered for the abstractions so we need to bail out.
if ( ! $reflector->isInstantiable())
{
$message = "Target [$concrete] is not instantiable.";
throw new BindingResolutionException($message);
}
$constructor = $reflector->getConstructor();
// If there are no constructors, that means there are no dependencies then
// we can just resolve the instances of the objects right away, without
// resolving any other types or dependencies out of these containers.
if (is_null($constructor))
/home
/sleva123
/public_html
/u
/vendor
/illuminate
/container
/Illuminate
/Container
/Container.php
$abstract = $this->getAlias($abstract);
$this->resolved[$abstract] = true;
// If an instance of the type is currently being managed as a singleton we'll
// just return an existing instance instead of instantiating new instances
// so the developer can keep using the same objects instance every time.
if (isset($this->instances[$abstract]))
{
return $this->instances[$abstract];
}
$concrete = $this->getConcrete($abstract);
// We're ready to instantiate an instance of the concrete type registered for
// the binding. This will instantiate the types, as well as resolve any of
// its "nested" dependencies recursively until all have gotten resolved.
if ($this->isBuildable($concrete, $abstract))
{
$object = $this->build($concrete, $parameters);
}
else
{
$object = $this->make($concrete, $parameters);
}
// If the requested type is registered as a singleton we'll want to cache off
// the instances in "memory" so we can return it later without creating an
// entirely new instance of an object on each subsequent request for it.
if ($this->isShared($abstract))
{
$this->instances[$abstract] = $object;
}
$this->fireResolvingCallbacks($abstract, $object);
return $object;
}
/**
/home
/sleva123
/public_html
/u
/src
/Hazzard
/Foundation
/Application.php
}
/**
* Resolve the given type from the container.
*
* (Overriding \Illuminate\Container\Container::make)
*
* @param string $abstract
* @param array $parameters
* @return mixed
*/
public function make($abstract, $parameters = array())
{
$abstract = $this->getAlias($abstract);
if (isset($this->deferredServices[$abstract])) {
$this->loadDeferredProvider($abstract);
}
return parent::make($abstract, $parameters);
}
/**
* Set the application's deferred services.
*
* @param array $services
* @return void
*/
public function setDeferredServices(array $services)
{
$this->deferredServices = $services;
}
/**
* Get the service provider repository instance.
*
* @return \Hazzard\Foundation\ProviderRepository
*/
public function getProviderRepository()
{
/home
/sleva123
/public_html
/u
/vendor
/illuminate
/container
/Illuminate
/Container
/Container.php
/**
* Determine if a given offset exists.
*
* @param string $key
* @return bool
*/
public function offsetExists($key)
{
return isset($this->bindings[$key]);
}
/**
* Get the value at a given offset.
*
* @param string $key
* @return mixed
*/
public function offsetGet($key)
{
return $this->make($key);
}
/**
* Set the value at a given offset.
*
* @param string $key
* @param mixed $value
* @return void
*/
public function offsetSet($key, $value)
{
// If the value is not a Closure, we will make it one. This simply gives
// more "drop-in" replacement functionality for the Pimple which this
// container's simplest functions are base modeled and built after.
if ( ! $value instanceof Closure)
{
$value = function() use ($value)
{
return $value;
};
/home
/sleva123
/public_html
/u
/src
/Hazzard
/Database
/DatabaseServiceProvider.php
use Hazzard\Support\ServiceProvider;
class DatabaseServiceProvider extends ServiceProvider {
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->app->bindShared('db', function($app) {
$config = $app['config']['database'];
return new Connection($config);
});
Model::setConnection($this->app['db']);
}
}
/home
/sleva123
/public_html
/u
/src
/Hazzard
/Foundation
/Application.php
}
/**
* Register a service provider with the application.
*
* @param \Hazzard\Support\ServiceProvider|string $provider
* @param array $options
* @param bool $force
* @return \Hazzard\Support\ServiceProvider
*/
public function register($provider, $options = array(), $force = false)
{
if ($registered = $this->getRegistered($provider) && !$force)
return $registered;
if (is_string($provider)) {
$provider = $this->resolveProviderClass($provider);
}
$provider->register();
foreach ($options as $key => $value) {
$this[$key] = $value;
}
$this->markAsRegistered($provider);
return $provider;
}
/**
* Get the registered service provider instnace if it exists.
*
* @param \Hazzard\Support\ServiceProvider|string $provider
* @return \Hazzard\Support\ServiceProvider|null
*/
public function getRegistered($provider)
{
$name = is_string($provider) ? $provider : get_class($provider);
/home
/sleva123
/public_html
/u
/src
/Hazzard
/Foundation
/ProviderRepository.php
$this->manifestPath = $manifestPath;
}
/**
* Register the application service providers.
*
* @param array $providers
* @param string $path
* @return void
*/
public function load(Application $app, array $providers)
{
$manifest = $this->loadManifest();
if ($this->shouldRecompile($manifest, $providers)) {
$manifest = $this->compileManifest($app, $providers);
}
foreach ($manifest['eager'] as $provider) {
$app->register($this->createProvider($app, $provider));
}
$app->setDeferredServices($manifest['deferred']);
}
/**
* Compile the application manifest file.
*
* @param \Hazzard\Foundation\Application $app
* @param array $providers
* @return array
*/
protected function compileManifest(Application $app, $providers)
{
$manifest = $this->freshManifest($providers);
foreach ($providers as $provider) {
$instance = $this->createProvider($app, $provider);
if ($instance->isDeferred()) {
/home
/sleva123
/public_html
/u
/app
/init.php
/*
|--------------------------------------------------------------------------
| Register The Alias Loader
|--------------------------------------------------------------------------
*/
$aliases = $config['aliases'];
AliasLoader::getInstance($aliases)->register();
/*
|--------------------------------------------------------------------------
| Register The Core Service Providers
|--------------------------------------------------------------------------
*/
$providers = $config['providers'];
$app->getProviderRepository()->load($app, $providers);
/*
|--------------------------------------------------------------------------
| Register The Class Loader
|--------------------------------------------------------------------------
*/
$dirs = array(
$app['path'].'/models'
);
ClassLoader::getInstance($dirs)->register();
/*
|--------------------------------------------------------------------------
| Load The Events File
|--------------------------------------------------------------------------
*/
if (file_exists($app['path'].'/events.php')) {
/home
/sleva123
/public_html
/u
/index.php
<?
require_once 'app/init.php';
if (Auth::guest())
{
$uri=urlencode($_SERVER['REQUEST_URI']);
setcookie("ur",$uri,time()+7200,"/");
header("Location: https://www.sleva123.cz/u/login.php");
exit;
}
include("u.php");
require_once '../lib/db.php';
ob_start();
if(true) {
$ladujto=1;
if($_COOKIE["ur"]) {
$u=urldecode($_COOKIE["ur"]);
unset($_COOKIE["ur"]);
setcookie("ur", '', time() - 3600,"/");
header("Location: $u");
exit;
}