Commit 6b6e25dd authored by tino.goratsch@hotmail.com's avatar [email protected]

- moved all core modules into it's own namespace to prepare an upcoming change

- fixed the installer because of the latest changes
parent 21b3f2ef
......@@ -75,7 +75,7 @@ class Application
define('ROOT_DIR_ABSOLUTE', HOST_NAME . ROOT_DIR);
define('ACP3_DIR', ACP3_ROOT_DIR . 'ACP3/');
define('CLASSES_DIR', ACP3_DIR . 'Core/');
define('MODULES_DIR', ACP3_DIR . 'Modules/');
define('MODULES_DIR', ACP3_DIR . 'Modules/ACP3/');
define('LIBRARIES_DIR', ACP3_ROOT_DIR . 'libraries/');
define('VENDOR_DIR', ACP3_ROOT_DIR . 'vendor/');
define('UPLOADS_DIR', ACP3_ROOT_DIR . 'uploads/');
......@@ -184,6 +184,8 @@ class Application
// Load system settings
$this->systemSettings = $this->container->get('core.config')->getSettings('system');
$this->container->get('core.auth')->authenticate();
$this->_setThemeConstants();
$this->container->get('core.view')->setRenderer('smarty');
......
<?php
namespace ACP3\Core;
use ACP3\Modules\Permissions;
use ACP3\Modules\ACP3\Permissions;
/**
* Access control lists
......@@ -48,8 +48,8 @@ class ACL
/**
* @param \ACP3\Core\Auth $auth
* @param \ACP3\Core\Modules $modules
* @param \ACP3\Modules\Permissions\Model $permissionsModel
* @param \ACP3\Modules\Permissions\Cache $permissionsCache
* @param \ACP3\Modules\ACP3\Permissions\Model $permissionsModel
* @param \ACP3\Modules\ACP3\Permissions\Cache $permissionsCache
*/
public function __construct(
Auth $auth,
......
......@@ -2,7 +2,7 @@
namespace ACP3\Core;
use ACP3\Core\Helpers\Secure;
use ACP3\Modules\Users;
use ACP3\Modules\ACP3\Users;
/**
* Class Auth
......@@ -57,7 +57,7 @@ class Auth
*/
protected $usersConfig;
/**
* @var \ACP3\Modules\Users\Model
* @var \ACP3\Modules\ACP3\Users\Model
*/
protected $usersModel;
/**
......@@ -69,7 +69,7 @@ class Auth
* @param \ACP3\Core\Session $session
* @param \ACP3\Core\Helpers\Secure $secureHelper
* @param \ACP3\Core\Config $config
* @param \ACP3\Modules\Users\Model $usersModel
* @param \ACP3\Modules\ACP3\Users\Model $usersModel
*/
public function __construct(
Session $session,
......@@ -81,15 +81,13 @@ class Auth
$this->secureHelper = $secureHelper;
$this->config = $config;
$this->usersModel = $usersModel;
$this->authenticate();
}
/**
* Findet heraus, falls der ACP3_AUTH Cookie gesetzt ist, ob der
* Seitenbesucher auch wirklich ein registrierter Benutzer des ACP3 ist
*/
protected function authenticate()
public function authenticate()
{
$settings = $this->config->getSettings('system');
......
<?php
namespace ACP3\Core;
use ACP3\Modules\Menus;
use ACP3\Modules\ACP3\Menus;
use Symfony\Component\DependencyInjection\Container;
/**
......@@ -62,7 +62,7 @@ class Breadcrumb
*/
protected $seoConfig;
/**
* @var \ACP3\Modules\Menus\Model
* @var \ACP3\Modules\ACP3\Menus\Model
*/
protected $menusModel;
......@@ -89,7 +89,7 @@ class Breadcrumb
}
/**
* @param \ACP3\Modules\Menus\Model $menusModel
* @param \ACP3\Modules\ACP3\Menus\Model $menusModel
*
* @return $this
*/
......
<?php
namespace ACP3\Core;
use ACP3\Modules\System;
use ACP3\Modules\ACP3\System;
/**
* Manages the various module settings
......@@ -10,7 +10,7 @@ use ACP3\Modules\System;
class Config
{
/**
* @var \ACP3\Modules\System\Model
* @var \ACP3\Modules\ACP3\System\Model
*/
protected $systemModel;
/**
......@@ -24,7 +24,7 @@ class Config
/**
* @param \ACP3\Core\Cache $coreCache
* @param \ACP3\Modules\System\Model $systemModel
* @param \ACP3\Modules\ACP3\System\Model $systemModel
*/
public function __construct(
Cache $coreCache,
......
<?php
namespace ACP3\Core;
use ACP3\Modules\System;
use ACP3\Modules\ACP3\System;
use Symfony\Component\DependencyInjection\Container;
/**
......@@ -27,7 +27,7 @@ class Modules
*/
protected $modulesCache;
/**
* @var \ACP3\Modules\System\Model
* @var \ACP3\Modules\ACP3\System\Model
*/
protected $systemModel;
/**
......@@ -44,7 +44,7 @@ class Modules
* @param \ACP3\Core\Lang $lang
* @param \ACP3\Core\XML $xml
* @param \ACP3\Core\Cache $modulesCache
* @param \ACP3\Modules\System\Model $systemModel
* @param \ACP3\Modules\ACP3\System\Model $systemModel
*/
public function __construct(
Container $container,
......
......@@ -3,8 +3,8 @@
namespace ACP3\Core\Modules;
use ACP3\Core;
use ACP3\Modules\System;
use ACP3\Modules\Permissions;
use ACP3\Modules\ACP3\System;
use ACP3\Modules\ACP3\Permissions;
use Symfony\Component\DependencyInjection\ContainerAware;
/**
......@@ -38,11 +38,11 @@ abstract class AbstractInstaller extends ContainerAware implements InstallerInte
*/
protected $aclCache;
/**
* @var \ACP3\Modules\System\Model
* @var \ACP3\Modules\ACP3\System\Model
*/
protected $systemModel;
/**
* @var \ACP3\Modules\Permissions\Model
* @var \ACP3\Modules\ACP3\Permissions\Model
*/
protected $permissionsModel;
/**
......@@ -64,8 +64,8 @@ abstract class AbstractInstaller extends ContainerAware implements InstallerInte
* @param \ACP3\Core\DB $db
* @param \ACP3\Core\XML $xml
* @param \ACP3\Core\Cache $aclCache
* @param \ACP3\Modules\System\Model $systemModel
* @param \ACP3\Modules\Permissions\Model $permissionsModel
* @param \ACP3\Modules\ACP3\System\Model $systemModel
* @param \ACP3\Modules\ACP3\Permissions\Model $permissionsModel
*/
public function __construct(
Core\DB $db,
......
<?php
namespace ACP3\Core;
use ACP3\Modules\Seo;
use ACP3\Modules\ACP3\Seo;
/**
* Class Request
......@@ -20,7 +20,7 @@ class Request extends \StdClass
*/
protected $config;
/**
* @var \ACP3\Modules\Seo\Model
* @var \ACP3\Modules\ACP3\Seo\Model
*/
protected $seoModel;
......@@ -61,7 +61,7 @@ class Request extends \StdClass
/**
* @param \ACP3\Core\Modules $modules
* @param \ACP3\Core\Config $config
* @param \ACP3\Modules\Seo\Model $seoModel
* @param \ACP3\Modules\ACP3\Seo\Model $seoModel
*/
public function __construct(
Modules $modules,
......
......@@ -3,7 +3,7 @@
namespace ACP3\Core;
use ACP3\Core\Router\Aliases;
use ACP3\Modules\System;
use ACP3\Modules\ACP3\System;
/**
* Class Router
......
......@@ -2,7 +2,7 @@
namespace ACP3\Core\Router;
use ACP3\Core;
use ACP3\Modules\Seo;
use ACP3\Modules\ACP3\Seo;
/**
* Class Aliases
......@@ -10,17 +10,21 @@ use ACP3\Modules\Seo;
*/
class Aliases
{
/**
* @var \ACP3\Modules\ACP3\Seo\Cache
*/
protected $seoCache;
/**
* @var array
*/
protected $seoCache = [];
protected $aliasesCache = [];
/**
* @param \ACP3\Modules\Seo\Cache $seoCache
* @param \ACP3\Modules\ACP3\Seo\Cache $seoCache
*/
public function __construct(Seo\Cache $seoCache)
{
$this->seoCache = $seoCache->getCache();
$this->seoCache = $seoCache;
}
/**
......@@ -33,9 +37,13 @@ class Aliases
*/
public function getUriAlias($path, $emptyOnNoResult = false)
{
if ($this->aliasesCache === []) {
$this->aliasesCache = $this->seoCache->getCache();
}
$path .= !preg_match('/\/$/', $path) ? '/' : '';
return !empty($this->seoCache[$path]['alias']) ? $this->seoCache[$path]['alias'] : ($emptyOnNoResult === true ? '' : $path);
return !empty($this->aliasesCache[$path]['alias']) ? $this->aliasesCache[$path]['alias'] : ($emptyOnNoResult === true ? '' : $path);
}
/**
......
......@@ -31,11 +31,11 @@ class SEO
*/
protected $config;
/**
* @var \ACP3\Modules\Seo\Cache
* @var \ACP3\Modules\ACP3\Seo\Cache
*/
protected $seoCache;
/**
* @var \ACP3\Modules\Seo\Model
* @var \ACP3\Modules\ACP3\Seo\Model
*/
protected $seoModel;
......@@ -65,18 +65,18 @@ class SEO
* @param \ACP3\Core\Request $request
* @param \ACP3\Core\Router\Aliases $aliases
* @param \ACP3\Core\Helpers\Forms $formsHelper
* @param \ACP3\Modules\Seo\Cache $seoCache
* @param \ACP3\Modules\ACP3\Seo\Cache $seoCache
* @param \ACP3\Core\Config $config
* @param \ACP3\Modules\Seo\Model $seoModel
* @param \ACP3\Modules\ACP3\Seo\Model $seoModel
*/
public function __construct(
Lang $lang,
Request $request,
Aliases $aliases,
Forms $formsHelper,
\ACP3\Modules\Seo\Cache $seoCache,
\ACP3\Modules\ACP3\Seo\Cache $seoCache,
Config $config,
\ACP3\Modules\Seo\Model $seoModel)
\ACP3\Modules\ACP3\Seo\Model $seoModel)
{
$this->lang = $lang;
$this->request = $request;
......
......@@ -2,7 +2,7 @@
namespace ACP3\Core\Validator\Rules\Router;
use ACP3\Core;
use ACP3\Modules\Seo;
use ACP3\Modules\ACP3\Seo;
/**
* Class Aliases
......@@ -15,13 +15,13 @@ class Aliases
*/
protected $routerValidator;
/**
* @var \ACP3\Modules\Seo\Model
* @var \ACP3\Modules\ACP3\Seo\Model
*/
protected $seoModel;
/**
* @param \ACP3\Core\Validator\Rules\Router $routerValidator
* @param \ACP3\Modules\Seo\Model $seoModel
* @param \ACP3\Modules\ACP3\Seo\Model $seoModel
*/
public function __construct(
Core\Validator\Rules\Router $routerValidator,
......
......@@ -19,7 +19,7 @@ class CKEditor extends Textarea
*/
private $view;
/**
* @var \ACP3\Modules\Emoticons\Model
* @var \ACP3\Modules\ACP3\Emoticons\Model
*/
private $emoticonsModel;
......@@ -41,11 +41,11 @@ class CKEditor extends Textarea
}
/**
* @param \ACP3\Modules\Emoticons\Model $emoticonsModel
* @param \ACP3\Modules\ACP3\Emoticons\Model $emoticonsModel
*
* @return $this
*/
public function setEmoticonsModel(\ACP3\Modules\Emoticons\Model $emoticonsModel)
public function setEmoticonsModel(\ACP3\Modules\ACP3\Emoticons\Model $emoticonsModel)
{
$this->emoticonsModel = $emoticonsModel;
......
......@@ -15,7 +15,7 @@ class Textarea extends AbstractWYSIWYG
*/
private $modules;
/**
* @var \ACP3\Modules\Emoticons\Helpers
* @var \ACP3\Modules\ACP3\Emoticons\Helpers
*/
private $emoticonsHelpers;
......@@ -32,7 +32,7 @@ class Textarea extends AbstractWYSIWYG
*
* @return $this
*/
public function setEmoticonsHelpers(\ACP3\Modules\Emoticons\Helpers $emoticonsHelpers)
public function setEmoticonsHelpers(\ACP3\Modules\ACP3\Emoticons\Helpers $emoticonsHelpers)
{
$this->emoticonsHelpers = $emoticonsHelpers;
......
<?php
namespace ACP3\Modules\Acp\Controller\Admin;
namespace ACP3\Modules\ACP3\Acp\Controller\Admin;
use ACP3\Core;
/**
* Class Index
* @package ACP3\Modules\Acp\Controller\Admin
* @package ACP3\Modules\ACP3\Acp\Controller\Admin
*/
class Index extends Core\Modules\Controller\Admin
{
......
<?php
namespace ACP3\Modules\Acp;
namespace ACP3\Modules\ACP3\Acp;
use ACP3\Core\Modules;
/**
* Class Installer
* @package ACP3\Modules\Acp
* @package ACP3\Modules\ACP3\Acp
*/
class Installer extends Modules\AbstractInstaller
{
......
services:
acp.controller.admin.index:
class: ACP3\Modules\Acp\Controller\Admin\Index
class: ACP3\Modules\ACP3\Acp\Controller\Admin\Index
parent: core.modules.controller.admin
acp.installer:
class: ACP3\Modules\Acp\Installer
class: ACP3\Modules\ACP3\Acp\Installer
parent: core.modules.abstractInstaller
<?php
namespace ACP3\Modules\Articles;
namespace ACP3\Modules\ACP3\Articles;
use ACP3\Core;
/**
* Class Cache
* @package ACP3\Modules\Articles
* @package ACP3\Modules\ACP3\Articles
*/
class Cache extends Core\Modules\AbstractCacheStorage
{
const CACHE_ID = 'list_id_';
/**
* @var \ACP3\Modules\Articles\Model
* @var \ACP3\Modules\ACP3\Articles\Model
*/
protected $articlesModel;
......
<?php
namespace ACP3\Modules\Articles\Controller\Admin;
namespace ACP3\Modules\ACP3\Articles\Controller\Admin;
use ACP3\Core;
use ACP3\Modules\Articles;
use ACP3\Modules\Menus;
use ACP3\Modules\ACP3\Articles;
use ACP3\Modules\ACP3\Menus;
/**
* Class Index
* @package ACP3\Modules\Articles\Controller\Admin
* @package ACP3\Modules\ACP3\Articles\Controller\Admin
*/
class Index extends Core\Modules\Controller\Admin
{
......@@ -18,27 +18,27 @@ class Index extends Core\Modules\Controller\Admin
protected $date;
/**
* @var \ACP3\Modules\Articles\Model
* @var \ACP3\Modules\ACP3\Articles\Model
*/
protected $articlesModel;
/**
* @var \ACP3\Modules\Articles\Cache
* @var \ACP3\Modules\ACP3\Articles\Cache
*/
protected $articlesCache;
/**
* @var \ACP3\Modules\Articles\Validator
* @var \ACP3\Modules\ACP3\Articles\Validator
*/
protected $articlesValidator;
/**
* @var \ACP3\Modules\Menus\Cache
* @var \ACP3\Modules\ACP3\Menus\Cache
*/
protected $menusCache;
/**
* @var \ACP3\Modules\Menus\Helpers
* @var \ACP3\Modules\ACP3\Menus\Helpers
*/
protected $menusHelpers;
/**
* @var \ACP3\Modules\Menus\Model
* @var \ACP3\Modules\ACP3\Menus\Model
*/
protected $menusModel;
/**
......@@ -49,9 +49,9 @@ class Index extends Core\Modules\Controller\Admin
/**
* @param \ACP3\Core\Context\Admin $context
* @param \ACP3\Core\Date $date
* @param \ACP3\Modules\Articles\Model $articlesModel
* @param \ACP3\Modules\Articles\Cache $articlesCache
* @param \ACP3\Modules\Articles\Validator $articlesValidator
* @param \ACP3\Modules\ACP3\Articles\Model $articlesModel
* @param \ACP3\Modules\ACP3\Articles\Cache $articlesCache
* @param \ACP3\Modules\ACP3\Articles\Validator $articlesValidator
* @param \ACP3\Core\Helpers\Secure $secureHelper
*/
public function __construct(
......@@ -72,7 +72,7 @@ class Index extends Core\Modules\Controller\Admin
}
/**
* @param \ACP3\Modules\Menus\Cache $menusCache
* @param \ACP3\Modules\ACP3\Menus\Cache $menusCache
*
* @return $this