Ребята всем привет ! Не могу разобраться в коде . Выходит ошибка !!! ( Думаю Данные устарели ...) Strict Standards: Non-static method Gpf_Contexts_Module::getContextInstance() should not be called statically, assuming $this from incompatible context in /home/virtwww/w_tele88-org_38dc9f0d/http/i/include/Gpf/ModuleBase.class.php on line 391 Strict Standards: Non-static method Gpf_Contexts_Module::getContextInstance() should not be called statically, assuming $this from incompatible context in /home/virtwww/w_tele88-org_38dc9f0d/http/i/include/Gpf/ModuleBase.class.php on line 392 Код (Text): ,,,,,, 391 $template->assign('jsResources', Gpf_Contexts_Module::getContextInstance()->getJsResources()); 392 $template->assign('jsScripts', Gpf_Contexts_Module::getContextInstance()->getJsScripts()); ,,,, Помогите что именно нужно исправить? Код (Text): public function getStyleSheets() { return $this->styleSheets; } protected function assignTemplateVariables(Gpf_Templates_Template $template) { $template->assign('title', $this->getTitle()); $template->assign('metaDescription', $this->getMetaDescription()); $template->assign('metaKeywords', $this->getMetaKeywords()); $template->assign('cachedData', Gpf_Rpc_CachedResponse::render()); $template->assign('stylesheets', $this->styleSheets); $template->assign('jsResources', Gpf_Contexts_Module::getContextInstance()->getJsResources()); $template->assign('jsScripts', Gpf_Contexts_Module::getContextInstance()->getJsScripts()); $template->assign('body', $this->body); $template->assign('faviconUrl', $this->getFaviconUrl()); } protected function authenticate() { $loginRequest = new Gpf_Auth_Service(); $loginRequest->authenticateNoRpc(); $loginRequest->registerLogin(); Gpf_Session::refreshAuthUser();
Код (Text): <?php /** * @copyright Copyright (c) 2007 Quality Unit s.r.o. * @author Michal Bebjak * @package GwtPhpFramework * @since Version 1.0.0 * * Licensed under the Quality Unit, s.r.o. Standard End User License Agreement, * Version 1.0 (the "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * http://www.qualityunit.com/licenses/license * */ /** * This plugin context class enables to add new constraints to table classes * which define the extension point. Currently it does not enable to remove * constraints hard coded in table classes as it could cause problems with * core functionality of application. * * @package GwtPhpFramework */ class Gpf_Contexts_Module extends Gpf_Plugins_Context { /** * @var array of resource urls */ private $jsResources = array(); /** * @var array of js scripts */ private $jsScripts = array(); /** * @var Gpf_Contexts_Module */ private static $instance = null; protected function __construct() { } /** * @return Gpf_Contexts_Module */ public function getContextInstance() { if (self::$instance == null) { self::$instance = new Gpf_Contexts_Module(); } return self::$instance; } /** * Add javascript resource url * * @param string $resource */ public function addJsResource($resource, $id = null) { $this->jsResources[$resource] = array('resource' => $resource, 'id' => $id); } /** * Get javascript resources array * * @return array */ public function getJsResources() { return $this->jsResources; } /** * Get javascripts array * * @return array */ public function getJsScripts() { return $this->jsScripts; } /** * Add javascript code * * @param string $sourceCode javascript source code, which should be added to main page header */ public function addJsScript($sourceCode) { $this->jsScripts[] = $sourceCode; } } ?>
PHP: public function getContextInstance() { замени на PHP: public static function getContextInstance() { и напиши в поддержку этой штуки, что они слово потеряли.
Да я исправил, но теперь появились другие ошибки. Strict Standards: Non-static method Gpf_Settings_Regional::getInstance() should not be called statically, assuming $this from incompatible context in /home/virtwww/w_tele88-org_38dc9f0d/http/i/include/Compiled/AffiliateLogin.php on line 12105 Strict Standards: Non-static method Gpf_Settings_Regional::getInstance() should not be called statically, assuming $this from incompatible context in /home/virtwww/w_tele88-org_38dc9f0d/http/i/include/Compiled/AffiliateLogin.php on line 12106 Strict Standards: Non-static method Gpf_Settings_Regional::getInstance() should not be called statically, assuming $this from incompatible context in /home/virtwww/w_tele88-org_38dc9f0d/http/i/include/Compiled/AffiliateLogin.php on line 12107 Strict Standards: Non-static method Gpf_Settings_Regional::getInstance() should not be called statically, assuming $this from incompatible context in /home/virtwww/w_tele88-org_38dc9f0d/http/i/include/Compiled/AffiliateLogin.php on line 12108 Strict Standards: Non-static method Gpf_Contexts_Module::getContextInstance() should not be called statically, assuming $this from incompatible context in /home/virtwww/w_tele88-org_38dc9f0d/http/i/include/Compiled/AffiliateLogin.php on line 8122 Strict Standards: Non-static method Gpf_Contexts_Module::getContextInstance() should not be called statically, assuming $this from incompatible context in /home/virtwww/w_tele88-org_38dc9f0d/http/i/include/Compiled/AffiliateLogin.php on line 8123 AffiliateLogin.php Код (Text): ,,,,,,,,, 12105 $this->addValue(Gpf_Settings_Gpf::REGIONAL_SETTINGS_THOUSANDS_SEPARATOR, Gpf_Settings_Regional::getInstance()->getThousandsSeparator()); $this->addValue(Gpf_Settings_Gpf::REGIONAL_SETTINGS_DECIMAL_SEPARATOR, Gpf_Settings_Regional::getInstance()->getDecimalSeparator()); $this->addValue(Gpf_Settings_Gpf::REGIONAL_SETTINGS_DATE_FORMAT, Gpf_Settings_Regional::getInstance()->getDateFormat()); $this->addValue(Gpf_Settings_Gpf::REGIONAL_SETTINGS_TIME_FORMAT, Gpf_Settings_Regional::getInstance()->getTimeFormat()); 12108 ,,,,,,,,, --------- Код (Text): ,,,,,, 8122 $template->assign('jsResources', Gpf_Contexts_Module::getContextInstance()->getJsResources()); $template->assign('jsScripts', Gpf_Contexts_Module::getContextInstance()->getJsScripts()); 8123 ,,,,,,,, class Gpf_Settings_Regional Поставил как вы писали : public static function getInstance() Но ошибка все равно есть Код (Text): <?php /** * @copyright Copyright (c) 2009 Quality Unit s.r.o. * @package GwtPhpFramework * @author Matej Kendera * @since Version 1.0.0 * $Id: EmailSettingsForms.class.php 25470 2009-09-25 10:05:33Z mjancovic $ * * Licensed under the Quality Unit, s.r.o. Standard End User License Agreement, * Version 1.0 (the "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * http://www.qualityunit.com/licenses/license * */ /** * @package GwtPhpFramework */ class Gpf_Settings_Regional { /** * @var Gpf_Settings_Regional */ private static $instance; private $thousandsSeparator, $decimalSeparator, $dateFormat, $timeFormat; /** * @return Gpf_Settings_Regional */ public static function getInstance() { if (self::$instance == null) { self::$instance = new Gpf_Settings_Regional(); } return self::$instance; } private function __construct() { $this->loadSettings(); } public function getThousandsSeparator() { return $this->thousandsSeparator; } public function getDecimalSeparator() { return $this->decimalSeparator; } public function getDateFormat() { return $this->dateFormat; } public function setDateFormat($format) { $this->dateFormat = $format; } public function getTimeFormat() { return $this->timeFormat; } private function loadSettings() { if (Gpf_Settings::get(Gpf_Settings_Gpf::REGIONAL_SETTINGS_IS_DEFAULT) == Gpf::YES) { try { $this->loadSettingsFromLanguage(); return; } catch (Gpf_Exception $e) { } } $this->thousandsSeparator = Gpf_Settings::get(Gpf_Settings_Gpf::REGIONAL_SETTINGS_THOUSANDS_SEPARATOR); $this->decimalSeparator = Gpf_Settings::get(Gpf_Settings_Gpf::REGIONAL_SETTINGS_DECIMAL_SEPARATOR); $this->dateFormat = Gpf_Settings::get(Gpf_Settings_Gpf::REGIONAL_SETTINGS_DATE_FORMAT); $this->timeFormat = Gpf_Settings::get(Gpf_Settings_Gpf::REGIONAL_SETTINGS_TIME_FORMAT); } /** * @throws Gpf_Exception */ private function loadSettingsFromLanguage() { $lang = Gpf_Lang_Dictionary::getInstance()->getLanguage(); if ($lang == null) { throw new Gpf_Exception('No language loaded'); } $this->thousandsSeparator = $lang->getThousandsSeparator(); $this->decimalSeparator = $lang->getDecimalSeparator(); $this->dateFormat = $lang->getDateFormat(); $this->timeFormat = $lang->getTimeFormat(); } } ?> class Gpf_Contexts_Module То же самое поставил : public static function getContextInstance() Но ошибка все равно есть Код (Text): <?php /** * @copyright Copyright (c) 2007 Quality Unit s.r.o. * @author Michal Bebjak * @package GwtPhpFramework * @since Version 1.0.0 * * Licensed under the Quality Unit, s.r.o. Standard End User License Agreement, * Version 1.0 (the "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * http://www.qualityunit.com/licenses/license * */ /** * This plugin context class enables to add new constraints to table classes * which define the extension point. Currently it does not enable to remove * constraints hard coded in table classes as it could cause problems with * core functionality of application. * * @package GwtPhpFramework */ class Gpf_Contexts_Module extends Gpf_Plugins_Context { /** * @var array of resource urls */ private $jsResources = array(); /** * @var array of js scripts */ private $jsScripts = array(); /** * @var Gpf_Contexts_Module */ private static $instance = null; protected function __construct() { } /** * @return Gpf_Contexts_Module */ public static function getContextInstance() { if (self::$instance == null) { self::$instance = new Gpf_Contexts_Module(); } return self::$instance; } /** * Add javascript resource url * * @param string $resource */ public function addJsResource($resource, $id = null) { $this->jsResources[$resource] = array('resource' => $resource, 'id' => $id); } /** * Get javascript resources array * * @return array */ public function getJsResources() { return $this->jsResources; } /** * Get javascripts array * * @return array */ public function getJsScripts() { return $this->jsScripts; } /** * Add javascript code * * @param string $sourceCode javascript source code, which should be added to main page header */ public function addJsScript($sourceCode) { $this->jsScripts[] = $sourceCode; } } ?>