} else {
$this->_dbh = @oci_connect($username, $password, $dsn, $options['charset']);
}
//Check if connection was successful
if (!$this->_dbh) {
$e = oci_error();
throw new Oci8\Exceptions\SqlException($e['message']);
}
{
// add fallback in case driver is not set, will use pdo instead
if ( !in_array($config['driver'], array('oci8', 'pdo-via-oci8', 'oracle')) ) {
return parent::createConnection($tns, $config, $options);
}
$options['charset'] = $config['charset'];
return new \yajra\Pdo\Oci8($tns, $config['username'], $config['password'], $options);
}
*/
public function connect(array $config)
{
$tns = $this->getDsn($config);
$options = $this->getOptions($config);
$connection = $this->createConnection($tns, $config, $options);
return $connection;
continue;
}
//Create a connector
$this->app['db']->extend($conn, function($config)
{
$connector = new Connectors\OracleConnector();
$connection = $connector->connect($config);
$db = new Oci8Connection($connection, $config["database"], $config["prefix"]);
// set oracle date format to match PHP's date
$config = $this->getConfig($name);
// First we will check by the connection name to see if an extension has been
// registered specifically for that connection. If it has we will call the
// Closure and pass it the config allowing it to resolve the connection.
if (isset($this->extensions[$name]))
{
return call_user_func($this->extensions[$name], $config, $name);
}
$name = $name ?: $this->getDefaultConnection();
// If we haven't created this connection, we'll create it based on the config
// provided in the application. Once we've created the connections we will
// set the "fetch mode" for PDO which determines the query return types.
if ( ! isset($this->connections[$name]))
{
$connection = $this->makeConnection($name);
$this->connections[$name] = $this->prepare($connection);
* Resolve a connection instance.
*
* @param string $connection
* @return \Illuminate\Database\Connection
*/
public static function resolveConnection($connection = null)
{
return static::$resolver->connection($connection);
}
/**
* Get the database connection for the model.
*
* @return \Illuminate\Database\Connection
*/
public function getConnection()
{
return static::resolveConnection($this->connection);
}
/**
* Get a new query builder instance for the connection.
*
* @return \Illuminate\Database\Query\Builder
*/
protected function newBaseQueryBuilder()
{
$conn = $this->getConnection();
$grammar = $conn->getQueryGrammar();
* Get a new query builder for the model's table.
*
* @param bool $excludeDeleted
* @return \Illuminate\Database\Eloquent\Builder|static
*/
public function newQuery($excludeDeleted = true)
{
$builder = $this->newEloquentBuilder($this->newBaseQueryBuilder());
// Once we have the query builders, we will set the model instances so the
public function __call($method, $parameters)
{
if (in_array($method, array('increment', 'decrement')))
{
return call_user_func_array(array($this, $method), $parameters);
}
$query = $this->newQuery();
return call_user_func_array(array($query, $method), $parameters);
* @param array $parameters
* @return mixed
*/
public static function __callStatic($method, $parameters)
{
$instance = new static;
return call_user_func_array(array($instance, $method), $parameters);
}
class ActaFallo extends Eloquent {
protected $table = 'ACTA_FALLO';
public static function relatoriafecha(){
$fechaE[''] = ' ';
$AFechasNuevas[''] = 'Seleccione :';
$fechaE += ActaFallo::orderBy('fecha', 'desc')
->where('fecha','>',('2008-01-01'))
->distinct()
class ActaFallo extends Eloquent {
protected $table = 'ACTA_FALLO';
public static function relatoriafecha(){
$fechaE[''] = ' ';
$AFechasNuevas[''] = 'Seleccione :';
$fechaE += ActaFallo::orderBy('fecha', 'desc')
->where('fecha','>',('2008-01-01'))
->distinct()
<?php
class DecisionController extends BaseController {
public function indexdecision() {
$fechaE = ActaFallo::relatoriafecha();
$tipofallo = ActaFallo::relatoriatipofallo();
return View::make('decision/index',array('fechaE'=> $fechaE)+array('tipofallo'=> $tipofallo));
}
* @param array $parameters
* @return \Symfony\Component\HttpFoundation\Response
*/
public function callAction($method, $parameters)
{
$this->setupLayout();
$response = call_user_func_array(array($this, $method), $parameters);
// If no response is returned from the controller action and a layout is being
* @param string $method
* @return mixed
*/
protected function call($instance, $route, $method)
{
$parameters = $route->parametersWithoutNulls();
return $instance->callAction($method, $parameters);
}
$response = $this->before($instance, $route, $request, $method);
// If no before filters returned a response we'll call the method on the controller
// to get the response to be returned to the router. We will then return it back
// out for processing by this router and the after filters can be called then.
if (is_null($response))
{
$response = $this->call($instance, $route, $method);
}
$request = $me->getCurrentRequest();
// Now we can split the controller and method out of the action string so that we
// can call them appropriately on the class. This controller and method are in
// in the Class@method format and we need to explode them out then use them.
list($class, $method) = explode('@', $controller);
return $d->dispatch($route, $request, $class, $method);
};
}
*
* @return mixed
*/
public function run()
{
$parameters = array_filter($this->parameters(), function($p) { return isset($p); });
return call_user_func_array($this->action['uses'], $parameters);
}
// Once we have successfully matched the incoming request to a given route we
// can call the before filters on that route. This works similar to global
// filters in that if a response is returned we will not call the route.
$response = $this->callRouteBefore($route, $request);
if (is_null($response))
{
$response = $route->run($request);
}
// If no response was returned from the before filter, we will call the proper
// route instance to get the response. If no route is found a response will
// still get returned based on why no routes were found for this request.
$response = $this->callFilter('before', $request);
if (is_null($response))
{
$response = $this->dispatchToRoute($request);
}
}
if ($this->runningUnitTests() && ! $this['session']->isStarted())
{
$this['session']->start();
}
return $this['router']->dispatch($this->prepareRequest($request));
}
{
try
{
$this->refreshRequest($request = Request::createFromBase($request));
$this->boot();
return $this->dispatch($request);
}
catch (\Exception $e)
* @param \Symfony\Component\HttpFoundation\Request $request
* @param int $type
* @param bool $catch
* @return \Symfony\Component\HttpFoundation\Response
*/
public function handle(SymfonyRequest $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
{
$response = $this->app->handle($request, $type, $catch);
$response->headers->set('X-Frame-Options', 'SAMEORIGIN', false);
if ($this->sessionConfigured())
{
$session = $this->startSession($request);
$request->setSession($session);
}
$response = $this->app->handle($request, $type, $catch);
// Again, if the session has been configured we will need to close out the session
* @param \Symfony\Component\HttpFoundation\Request $request
* @param int $type
* @param bool $catch
* @return \Symfony\Component\HttpFoundation\Response
*/
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
{
$response = $this->app->handle($request, $type, $catch);
foreach ($this->cookies->getQueuedCookies() as $cookie)
* @param \Symfony\Component\HttpFoundation\Request $request
* @param int $type
* @param bool $catch
* @return \Symfony\Component\HttpFoundation\Response
*/
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
{
return $this->encrypt($this->app->handle($this->decrypt($request), $type, $catch));
}
{
$this->app = $app;
$this->middlewares = $middlewares;
}
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
{
return $this->app->handle($request, $type, $catch);
}
* @param \Symfony\Component\HttpFoundation\Request $request
* @return void
*/
public function run(SymfonyRequest $request = null)
{
$request = $request ?: $this['request'];
$response = with($stack = $this->getStackedClient())->handle($request);
$response->send();
| Once we have the application, we can simply call the run method,
| which will execute the request and send the response back to
| the client's browser allowing them to enjoy the creative
| and wonderful application we have whipped up for them.
|
*/
$app->run();