本文整理汇总了PHP中Pimcore\Controller\Action\Admin::init方法的典型用法代码示例。如果您正苦于以下问题:PHP Admin::init方法的具体用法?PHP Admin::init怎么用?PHP Admin::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pimcore\Controller\Action\Admin
的用法示例。
在下文中一共展示了Admin::init方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
parent::init();
// only for admins
$this->checkPermission("adminer");
$this->adminerHome = PIMCORE_DOCUMENT_ROOT . '/vendor/vrana/adminer/';
// proxy for resources
$path = $this->getRequest()->getPathInfo();
$path = str_replace("/admin/external_adminer/", "", $path);
if (preg_match("@\\.(css|js|ico|png|jpg|gif)\$@", $path)) {
$filePath = $this->adminerHome . "/" . $path;
if (preg_match("@.css\$@", $path)) {
// it seems that css files need the right content-type (Chrome)
header("Content-Type: text/css");
}
if (file_exists($filePath)) {
echo file_get_contents($filePath);
if (preg_match("@default.css\$@", $path)) {
// append custom styles, because in Adminer everything is hardcoded
echo file_get_contents($this->adminerHome . "designs/konya/adminer.css");
echo file_get_contents(PIMCORE_DOCUMENT_ROOT . "/pimcore/static6/css/adminer-modifications.css");
}
}
exit;
}
}
示例2: init
public function init()
{
parent::init();
// PHP 7.0 compatibility of adminer (throws some warnings)
ini_set("display_errors", 0);
// only for admins
$this->checkPermission("adminer");
// call this to keep the session 'open' so that Adminer can write to it
$session = \Pimcore\Tool\Session::get();
$this->adminerHome = PIMCORE_DOCUMENT_ROOT . '/vendor/vrana/adminer/';
// proxy for resources
$path = $this->getRequest()->getPathInfo();
$path = str_replace("/admin/external_adminer/", "", $path);
if (preg_match("@\\.(css|js|ico|png|jpg|gif)\$@", $path)) {
$filePath = $this->adminerHome . "/" . $path;
// it seems that css files need the right content-type (Chrome)
if (preg_match("@.css\$@", $path)) {
header("Content-Type: text/css");
} elseif (preg_match("@.js\$@", $path)) {
header("Content-Type: text/javascript");
}
if (file_exists($filePath)) {
echo file_get_contents($filePath);
if (preg_match("@default.css\$@", $path)) {
// append custom styles, because in Adminer everything is hardcoded
echo file_get_contents($this->adminerHome . "designs/konya/adminer.css");
echo file_get_contents(PIMCORE_DOCUMENT_ROOT . "/pimcore/static6/css/adminer-modifications.css");
}
}
exit;
}
}
示例3: init
public function init()
{
parent::init();
// only for admins
$this->checkPermission("linfo");
$this->linfoHome = PIMCORE_DOCUMENT_ROOT . '/vendor/linfo/linfo/';
}
示例4: init
public function init()
{
parent::init();
$this->checkPermission("backup");
@ini_set("memory_limit", "-1");
$this->session = \Pimcore\Tool\Session::get("pimcore_backup");
}
示例5: init
public function init()
{
parent::init();
$this->protect();
// IE compatibility
//$this->getResponse()->setHeader("X-UA-Compatible", "IE=8; IE=9", true);
}
示例6: init
/**
* @throws \Exception
*/
public function init()
{
parent::init();
// check permissions
$notRestrictedActions = array();
if (!in_array($this->getParam("action"), $notRestrictedActions)) {
$this->checkPermission("documents");
}
}
示例7: init
public function init()
{
parent::init();
// check permissions
$notRestrictedActions = ["get-tree", "fieldcollection-list", "fieldcollection-tree", "fieldcollection-get", "get-class-definition-for-column-config", "objectbrick-list", "objectbrick-tree", "objectbrick-get"];
if (!in_array($this->getParam("action"), $notRestrictedActions)) {
$this->checkPermission("classes");
}
}
示例8: init
public function init()
{
parent::init();
// check permissions
$notRestrictedActions = ["persona-list"];
if (!in_array($this->getParam("action"), $notRestrictedActions)) {
$this->checkPermission("targeting");
}
}
示例9: init
public function init()
{
parent::init();
// check permissions
$notRestrictedActions = ["get-current-user", "update-current-user", "get-available-permissions", "get-minimal", "get-image", "upload-current-user-image"];
if (!in_array($this->getParam("action"), $notRestrictedActions)) {
$this->checkPermission("users");
}
}
示例10: init
public function init()
{
parent::init();
// recyclebin actions might take some time (save & restore)
$timeout = 600;
// 10 minutes
@ini_set("max_execution_time", $timeout);
set_time_limit($timeout);
// check permissions
$notRestrictedActions = array("add");
if (!in_array($this->getParam("action"), $notRestrictedActions)) {
$this->checkPermission("recyclebin");
}
}
示例11: init
public function init()
{
parent::init();
// clear the opcache (as of PHP 5.5)
if (function_exists("opcache_reset")) {
opcache_reset();
}
// clear the APC opcode cache (<= PHP 5.4)
if (function_exists("apc_clear_cache")) {
apc_clear_cache();
}
// clear the Zend Optimizer cache (Zend Server <= PHP 5.4)
if (function_exists('accelerator_reset')) {
return accelerator_reset();
}
$this->checkPermission("update");
}
示例12: init
public function init()
{
parent::init();
$this->dashboardHelper = new \Pimcore\Helper\Dashboard($this->getUser());
}
示例13: init
/**
*
*/
public function init()
{
parent::init();
}
示例14: init
public function init()
{
parent::init();
$this->checkPermission("plugins");
}
示例15: init
public function init()
{
if ($this->getParam("action") != "script") {
parent::init();
}
}