Refactor Appbox

This commit is contained in:
Romain Neutron
2012-02-21 15:56:34 +01:00
parent 566b8fc6be
commit 80f22ca1fc
4 changed files with 12 additions and 19 deletions

View File

@@ -14,18 +14,14 @@
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
*/ */
require_once __DIR__ . "/../../lib/bootstrap.php";
$appbox = appbox::get_instance(); /* @var $Core \Alchemy\Phrasea\Core */
$Core = require_once __DIR__ . "/../../lib/bootstrap.php";
$appbox = appbox::get_instance($Core);
$session = $appbox->get_session(); $session = $appbox->get_session();
$registry = $appbox->get_registry(); $registry = $appbox->get_registry();
$user = User_Adapter::getInstance($session->get_usr_id(), $appbox); $user = $Core->getAuthenticatedUser();
$lng = Session_Handler::get_locale();
$ses_id = $session->get_ses_id();
$usr_id = $session->get_usr_id();
if (!isset($parm)) if (!isset($parm))
{ {

View File

@@ -15,19 +15,17 @@
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
*/ */
/* @var $Core \Alchemy\Phrasea\Core */
$Core = require_once __DIR__ . "/../../lib/bootstrap.php"; $Core = require_once __DIR__ . "/../../lib/bootstrap.php";
$em = $Core->getEntityManager(); $em = $Core->getEntityManager();
$appbox = appbox::get_instance(); $appbox = appbox::get_instance($Core);
$session = $appbox->get_session();
$registry = $appbox->get_registry(); $registry = $appbox->get_registry();
$user = User_Adapter::getInstance($session->get_usr_id(), $appbox); $user = $Core->getAuthenticatedUser();
$lng = Session_Handler::get_locale(); $lng = Session_Handler::get_locale();
$usr_id = $session->get_usr_id();
$output = ''; $output = '';
$request = http_request::getInstance(); $request = http_request::getInstance();

View File

@@ -15,14 +15,13 @@
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
*/ */
$appbox = appbox::get_instance(); $Core = \bootstrap::getCore();
$appbox = appbox::get_instance($Core);
$session = $appbox->get_session(); $session = $appbox->get_session();
$registry = $appbox->get_registry();
$th_size = $user->getPrefs('images_size'); $th_size = $user->getPrefs('images_size');
$user = User_Adapter::getInstance($session->get_usr_id(), $appbox); $user = $Core->getAuthenticatedUser();
$ACL = $user->ACL();
$RN = array("\r\n", "\n", "\r"); $RN = array("\r\n", "\n", "\r");

View File

@@ -15,7 +15,7 @@
* @link www.phraseanet.com * @link www.phraseanet.com
*/ */
$Core = require_once __DIR__ . "/../../lib/bootstrap.php"; $Core = require_once __DIR__ . "/../../lib/bootstrap.php";
$appbox = appbox::get_instance(); $appbox = appbox::get_instance($Core);
$session = $appbox->get_session(); $session = $appbox->get_session();
$registry = $appbox->get_registry(); $registry = $appbox->get_registry();