Yii Framework Forum: yiic shell print html?!? - Yii Framework Forum

Jump to content

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

yiic shell print html?!? Rate Topic: -----

#1 User is offline   SRIT 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 28-November 09

Posted 05 December 2009 - 01:38 PM

Hy,

in my application I use an own Controller with a beforeAction method which will check the permissions of the user to see this fired document. If the user have not the permission to show this site the user will redirected to a notAllowed action in my core module if he isn't logged in the user will redirect to the login url in my application:
protected function beforeAction($action) {
        $module = (null !== $this->module) ? $this->module->id : '';
        $access =  $module.ucfirst($this->id).ucfirst($this->action->id);
        if(in_array($access, $this->allowedAccess())) {
            return true;
        }

        if(false === Yii::app()->user->checkAccess($access) && false === Yii::app()->user->isGuest) {
            return true;
        }
        elseif(false === Yii::app()->user->checkAccess($access) && true === Yii::app()->user->isGuest) {
            Yii::app()->request->redirect(Yii::app()->createUrl(Yii::app()->user->loginUrl));
        }
    }


With this method version the yiic shell will not prompt the shell but the profiling table?!? If i commented the line
Yii::app()->request->redirect(Yii::app()->createUrl(Yii::app()->user->loginUrl));
yiic shell will work fine. Any ideas to fix this problem?
0

#2 User is offline   jerry2801 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 504
  • Joined: 18-November 09

Posted 05 December 2009 - 10:44 PM

$this->redirect(Yii::app()->user->loginUrl);


?
0

#3 User is offline   Jiji Kurup 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 10-February 11

Posted 10 February 2011 - 08:05 AM

Hi.

I am facing the same issue.
When i execute >%YIIC SHELL command inside webapps folder, Output just displays index.html text on command prompt.

Can anyone fix this problem?
0

#4 User is offline   Jiji Kurup 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 10-February 11

Posted 16 February 2011 - 05:32 AM

Hi all,

I have resolved the issue.

the problem was with Date('Y') function mentioned in main.php(protected\views\layouts\main.php).

Add the following code at the top like "<?PHP date_default_timezone_set('UTC'); ?>".

Now the "yiic shell" will work fine
0

#5 User is offline   Jampire 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 53
  • Joined: 10-January 11
  • Location:Gomel, Belarus

Posted 16 February 2011 - 07:16 AM

Jiji Kurup

First of all, you choose wrong topic for your problem.


The problem is not in yii, but in your php.ini file. Find 'date.timezone' and set it to your time zone value, for example 'Europe/Minsk'


Posted Image
0

#6 User is offline   LjGww 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 22-April 11

Posted 22 April 2011 - 01:06 PM

changing php.ini - did not make any effect with "$yiic shell" printing html

<?PHP date_default_timezone_set('UTC'); ?> in main.php however make yiic shell working in spite of what has been set in php.ini

is this still bug, workaround, or quirk?

thank you for hint.

(I'm learning yii and finding it difficult to learn in spite of all claims that is easy. This quirk stopped me instatnly during followup of tutorial. Thank you all for already hitting this issue and existence of forum where I can find help)
0

#7 User is offline   1661design 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 17
  • Joined: 09-May 11
  • Location:New York

Posted 15 May 2011 - 09:33 AM

View PostLjGww, on 22 April 2011 - 01:06 PM, said:

changing php.ini - did not make any effect with "$yiic shell" printing html

<?PHP date_default_timezone_set('UTC'); ?> in main.php however make yiic shell working in spite of what has been set in php.ini

is this still bug, workaround, or quirk?

thank you for hint.

(I'm learning yii and finding it difficult to learn in spite of all claims that is easy. This quirk stopped me instatnly during followup of tutorial. Thank you all for already hitting this issue and existence of forum where I can find help)


Same issue here using Yii 1.1.6 and the TZ setting corrected the problem … thanks !

Easy or difficult, is relative and every tool has its peculiarities. I'm glad I got the book, that despite some minor glitches provides a glimpse to Yii potential :)

thanks again for your time saving comment !

Sergio

"Be kind whenever possible. It's always possible" - 14th DL
"Be kind whenever possible. It is always possible." - 14th DL

Mac OS X 10.6.7 - PHP Version 5.3.2 - PHPUnit 3.5.13 - Yii 1.1.7
0

#8 User is offline   CPzee 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 59
  • Joined: 11-November 11
  • Location:Sri Lanka

Posted 19 February 2013 - 04:10 AM

Some times this will happen because your runtime path dosent have proper permission.
Found anything useful???? Pls click +
Ubuntu 12.04--PHP 5.3.10(Yii v1.1.13)
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