Yii Framework Forum: getIsSecureConnection in 1.05 to 1.1 upgrade PROBLEM!!! - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

getIsSecureConnection in 1.05 to 1.1 upgrade PROBLEM!!! HELP ME!!! PLEASE!!! Rate Topic: -----

#1 User is offline   greg 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 08-September 09

Posted 10 April 2010 - 05:52 AM

I use getIsSecureConnection to recognise http/https connection in my application with Yii 1.0.5. It works OK.
After upgrade to 1.1.0 (r. 1700) I'm disappointed with the problem in above function - it is unknown by SiteController:
The code (fragment of .../protected/views/site/index.php):

if($secure=$this->getIsSecureConnection()) {......


The CExcepion listing:

CException
Description
SiteController does not have a method named "getIsSecureConnection".
Source File
/home/gbk/Instalki/yii-1.1.0.r1700/framework/base/CComponent.php(237)
00225: * @since 1.0.2
00226: */
00227: public function __call($name,$parameters)
00228: {
00229: if($this->_m!==null)
00230: {
00231: foreach($this->_m as $object)
00232: {
00233: if($object->getEnabled() && method_exists($object,$name))
00234: return call_user_func_array(array($object,$name),$parameters);
00235: }
00236: }
00237: throw new CException(Yii::t('yii','{class} does not have a method named "{name}".',
00238: array('{class}'=>get_class($this), '{name}'=>$name)));

Stack Trace

#0 [internal function]: CComponent->__call('getIsSecureConn...', Array)
#1 /home/gbk/Instalki/Projekty_Symfony/ipoba/web/protected/views/site/index.php(4): SiteController->getIsSecureConnection()
#2 /home/gbk/Instalki/yii-1.1.0.r1700/framework/web/CBaseController.php(119): require('/home/gbk/Insta...')
#3 /home/gbk/Instalki/yii-1.1.0.r1700/framework/web/CBaseController.php(88): CBaseController->renderInternal('/home/gbk/Insta...', NULL, true)
#4 /home/gbk/Instalki/yii-1.1.0.r1700/framework/web/CController.php(732): CBaseController->renderFile('/home/gbk/Insta...', NULL, true)
#5 /home/gbk/Instalki/yii-1.1.0.r1700/framework/web/CController.php(671): CController->renderPartial('index', NULL, true)
#6 /home/gbk/Instalki/Projekty_Symfony/ipoba/web/protected/controllers/SiteController.php(32): CController->render('index')
#7 /home/gbk/Instalki/yii-1.1.0.r1700/framework/web/actions/CInlineAction.php(32): SiteController->actionIndex()
#8 /home/gbk/Instalki/yii-1.1.0.r1700/framework/web/CController.php(300): CInlineAction->run()
#9 /home/gbk/Instalki/yii-1.1.0.r1700/framework/web/CController.php(278): CController->runAction(Object(CInlineAction))
#10 /home/gbk/Instalki/yii-1.1.0.r1700/framework/web/CController.php(257): CController->runActionWithFilters(Object(CInlineAction), Array)
#11 /home/gbk/Instalki/yii-1.1.0.r1700/framework/web/CWebApplication.php(320): CController->run('')
#12 /home/gbk/Instalki/yii-1.1.0.r1700/framework/web/CWebApplication.php(120): CWebApplication->runController('')
#13 /home/gbk/Instalki/yii-1.1.0.r1700/framework/base/CApplication.php(135): CWebApplication->processRequest()
#14 /home/gbk/Instalki/Projekty_Symfony/ipoba/web/index.php(11): CApplication->run()
#15 {main}

WHY??? getIsSecureConnection is known in 1.0.5 (http/https switching by url prefix works excellent) and unknown in 1.1.0???
How to solve the problem?
Thanks for any ideas in advance.
Greg

0

#2 User is offline   Y!! 

  • Advanced Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 978
  • Joined: 18-June 09

Posted 10 April 2010 - 06:13 AM

getIsSecureConnection() is part of the request component:

Yii::app()->request->getIsSecureConnection();

1

#3 User is offline   greg 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 08-September 09

Posted 10 April 2010 - 07:34 AM

View PostY!!, on 10 April 2010 - 06:13 AM, said:

getIsSecureConnection() is part of the request component:

Yii::app()->request->getIsSecureConnection();


Thanks a lot - quick and accurate shot!!! It works - well done!!!
As a newbie may I ask Advanced Member for 2-3 sentences of comment, please? What's changed in construction/structure of Yii that my initial code is not valid any more? How could I find the solution of that problem myself? I appreciate Your so fast and efficient help.
Greg from Poland
(Who is my benefactor? :)

Attached File(s)

  • Attached File  gbk.gif (28.94K)
    Number of downloads: 6

0

#4 User is offline   Y!! 

  • Advanced Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 978
  • Joined: 18-June 09

Posted 10 April 2010 - 03:15 PM

To my knowledge, this never did worked. So I don't know how you got it to work with 1.05.

However, in general you should always read the UPGRADE file for introductions about how to upgrade your application. Everything you need to know is in there. :)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users