繁体   English   中英

Joomla 3.8 与 PHP 7 问题

[英]Joomla 3.8 with PHP 7problems

我目前正在为我的网站强制从 PHP 5.6 过渡到 7.1(或 7.2,两者都是一个选项)。 我有两个网站,一个工作正常,但另一个没有在 7.1 或 .2 上运行。

我收到以下错误消息:

[Thu Oct 25 09:25:21.985120 2018] [:error] [pid 12006] PHP Deprecated: Non-static method Joomla\\CMS\\Application\\CMSApplication::getMenu() should not be called statically, assuming $this from incompatible context in /home/public/sites/www.modderaandebanden.nl/libraries/src/Application/SiteApplication.php on line 275
[Thu Oct 25 09:25:21.985130 2018] [:error] [pid 12006] PHP Strict Standards: Only variables should be assigned by reference in /home/public/sites/www.modderaandebanden.nl/templates/siteground-j16-1/templates.php on line 15

我在所有页面上都遇到了问题(它到处使用相同的模板)。 这是我打开当前使用的 Siteground J16-1 模板的 templates.php 时得到的:

<?if( $sg == 'banner' ):?>

    <?php if (JRequest::getVar('view') == 'frontpage'):?>

    <!-- SIDE BEGIN --><!-- SIDE END -->

    <?php endif?>

<?else:?>

    <?php echo $app->getCfg('sitename'); ?>, Powered by <a href="http://joomla.org/" class="sgfooter" target="_blank">Joomla!</a>



    <?php $menu = &JSite::getMenu();

    if ($menu->getActive() == $menu->getDefault()) :?>

        <!-- FOOTER BEGIN --><a href="http://www.siteground.com/cpanel-hosting.htm" target="_blank">Hosting with cPanel by SiteGround</a><!-- FOOTER END -->

    <?php endif ?>



<?endif;?>

请让我知道这是否可以澄清问题。 请原谅我的无礼... :-D

www.modderaandebanden.nl 是我的网站。

谁能告诉我这里发生了什么。 它是不适合与 PHP 7 一起使用的模板吗?

提前致谢

这是警告和通知。 这不是错误!

通常您可以隐藏它:Joomla 配置 > 服务器选项卡 > 错误报告 -- 将其设置为最小值或无。

您也可以在服务器 php.ini 配置文件中修改此设置,或在网站根文件夹中的 php.ini 文件中进行设置(仅在某些服务器上可用)。

但最后您应该修复您的代码以使用新的 Joomla 框架方法。 例如要获取菜单,请使用:

// Get Joomla! instance
$jAp = JFactory::getApplication();
// Get variables
$menu = $jAp->getMenu();

看看这个获取变量: https : //docs.joomla.org/Retrieving_request_data_using_JInput

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM