Yii Framework Forum: Running console command from web application - Yii Framework Forum

Jump to content

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

Running console command from web application Rate Topic: -----

#1 User is offline   Deepak Pradhan 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 209
  • Joined: 01-May 09
  • Location:Charlotte, NC

Posted 02 August 2010 - 08:40 AM

Has anyone tried to run a console command from web app?

I have few console commands that part of job sequence run by cron. Now I need a functionality to allow user run these job sequences on demand using the web app. Thoughts please.
0

#2 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,013
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 02 August 2010 - 10:11 AM

I would start here: http://de.php.net/ma...en/ref.exec.php
0

#3 User is offline   mech7 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 220
  • Joined: 26-March 09

Posted 02 August 2010 - 10:20 AM

Yes i use exec too to run some commands... error reporting can be a pain though. Epsecially if something goes wrong with the process.
0

#4 User is offline   Deepak Pradhan 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 209
  • Joined: 01-May 09
  • Location:Charlotte, NC

Posted 02 August 2010 - 03:43 PM

View Postmech7, on 02 August 2010 - 10:20 AM, said:

Yes i use exec too to run some commands... error reporting can be a pain though. Epsecially if something goes wrong with the process.


Thoughts are inline.

Thanks will do it with exec. My older scripts were using PHP active records that can be run both at command line and web-server. As well the process output could be captured in Yii's ajax call. However, it has it's own set of model files.
0

#5 User is offline   mech7 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 220
  • Joined: 26-March 09

Posted 02 August 2010 - 10:58 PM

View PostPradhan, on 02 August 2010 - 03:43 PM, said:

Thoughts are inline.

Thanks will do it with exec. My older scripts were using PHP active records that can be run both at command line and web-server. As well the process output could be captured in Yii's ajax call. However, it has it's own set of model files.


If it is about "normal" php functionality like your active record models, look into CConsoleCommand you can create some custom yii commands :)
0

#6 User is offline   Deepak Pradhan 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 209
  • Joined: 01-May 09
  • Location:Charlotte, NC

Posted 03 August 2010 - 11:02 AM

View Postmech7, on 02 August 2010 - 10:58 PM, said:

If it is about "normal" php functionality like your active record models, look into CConsoleCommand you can create some custom yii commands :)


Yes :),
I had to rewrite.
0

#7 User is offline   schmunk 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 566
  • Joined: 02-November 08
  • Location:Stuttgart, Germany

Posted 10 October 2011 - 05:34 AM

see http://www.yiiframew...ithout-a-shell/
Phundament - Yii Application Boilerplate with composer support
Fork on github

Follow phundament on Twitter

DevSystem: Mac OS X 10.7 - PHP 5.3 - Apache2 - Yii 1.1 / trunk - Firefox or Safari
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