Jump to content

Recommended Posts

So my silex application did run for a good time, but now it's disfunctional, and I do not know exactly why, because I believe nothing changed..

 

It should be a little website with administration page.

- This is a snippet of the code, the total code is still in concept phase.

- For the full code: http://pastebin.com/myXwF4nT

- Other code parts on request.

- Controller::invoke() is called from the index.php

 

Thanks in advance!

 

require_once __DIR__.'/vendor/autoload.php';
require_once __DIR__.'/const.php';
require_once __DIR__.'/route.php';
require_once __DIR__.'/../model/database.php';

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\HttpKernelInterface;

class Controller
{
public static $appProvider = null;
public static $expireTime = 5400;
public static $timeStamp = null;
public static $routeArray = null;
public static $routeMatched = null;
public static $subRouteMatched = null;

public static function getSilex()
{
if(self::$appProvider == null)
{
self::$appProvider = new Silex\Application();
// Twig Service Provider
self::$appProvider->register(
new Silex\Provider\TwigServiceProvider(),
array('twig.path' => __DIR__.'/../view/',
 'twig.options' => array('cache' => __DIR__.'/../cache'),));
self::$appProvider['debug'] = true;
}
return self::$appProvider;
}

public static function invoke()
{
// example
$silex = self::getSilext()->run();
}
....
}

Edited by Zoombat
  • 3 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.