Yii Framework Forum: Dynamically run console commands? - Yii Framework Forum

Jump to content

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

Dynamically run console commands? is this possible? Gii? Rate Topic: -----

#1 User is offline   Kochiro 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 29
  • Joined: 16-September 10
  • Location:Göteborg, Sweden

Posted 02 November 2010 - 07:06 PM

Is it possible to somehow run the "model" and "crud" command line statements from within Yii?

Is this something that can be done by accessing or extending Gii? I haven't had the time to dig into Gii yet so please excuse me if it is blatantly obvious there.

Thanks,
0

#2 User is offline   zaccaria 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 2,232
  • Joined: 04-October 09
  • Location:Moscow

Posted 03 November 2010 - 02:39 AM

Well, you can use exec or curl for execute a command or get a webpage, so you can run this commands..

The question is: what for?
0

#3 User is offline   Maurizio Domba Cerin 

  • Yii - Yesss It Is !!!
  • Yii
  • Group: Yii Dev Team
  • Posts: 4,367
  • Joined: 12-October 09
  • Location:Croatia

Posted 03 November 2010 - 02:58 AM

If I understand you, you are thinking about the "model" and "crud" command used in yiic...

Gii is a replacement for just that... take a look at the documentation - http://yiiframework....crud-operations
Find more about me.... btw. Do you know your WAN IP?
0

#4 User is offline   Kochiro 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 29
  • Joined: 16-September 10
  • Location:Göteborg, Sweden

Posted 03 November 2010 - 06:34 AM

I have some scenarios where I want to be able to dynamically expand my application based on a preset definition. So all the information that the model and crud commands need would already be available, I just need to run the commands. I've tried using exec, however because the yiic shell is interactive I couldn't figure out how to format the commands so that the shell actually got the command.

Gii I know is a replacement for the command line, however it is also an interactive webpage.

What I'm looking for is something more like (overly simplified and hopeful :D):

Yii::app()->createModel('name');

It must exist somewhere in the Gii code, I just thought I'd ask before digging through lots of code.

Thanks
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