This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » plugins » General plug-ins » sfCommandLine : new plugin
icon4.gif  sfCommandLine : new plugin [message #40190] Fri, 23 November 2007 18:14 Go to next message
sorac  is currently offline sorac
Messages: 17
Registered: September 2007
Junior Member
Hi,

A release a new plugin for symfony : sfCommandLine

http://trac.symfony-project.com/wiki/sfCommandLinePlugin

The `sfCommandLine` provide a centralized way to launch batch script and passing them complex arguments.

It also allow to change the SP_APP, SP_ENVIRONMENT and SP_DEBUG directly from command line.

Please, leave any comment, bug or feature requests here !

Enjoy !
Re: sfCommandLine : new plugin [message #40310 is a reply to message #40190 ] Mon, 26 November 2007 16:48 Go to previous messageGo to next message
kupokomapa  is currently offline kupokomapa
Messages: 10
Registered: November 2007
Junior Member
http://svn.symfony-project.com/plugins/sfUtilitiesPlugin/tru nk/data/tasks/sfCommandLineTask.php

These are the changes I had to make in order for it to work. Also, I will send an email to the users list soon explaining why I am trying to merge plugins like this one to the sfUtilitiesPlugin.

Kupo
Re: sfCommandLine : new plugin [message #40314 is a reply to message #40310 ] Mon, 26 November 2007 17:33 Go to previous messageGo to next message
weaverryan  is currently offline weaverryan
Messages: 781
Registered: November 2007
Location: Nashville, TN
Faithful Member

this is the first I've heard of the utilities plugin. What else will you have in it? When will it be 1.1 ready - or ready at all?


Ryan Weaver
http://www.sympalphp.org
http://www.thatsquality.com
@weaverryan
Re: sfCommandLine : new plugin [message #40556 is a reply to message #40190 ] Thu, 29 November 2007 12:19 Go to previous messageGo to next message
sorac  is currently offline sorac
Messages: 17
Registered: September 2007
Junior Member
Hi,

I looked to your modifications and I plan to add them to my plug-in.

If you look for others plug-ins to add to sfUtilitiesPlugin, take a look to my others plug-ins :

http://trac.symfony-project.com/wiki/sfAdvancedLoggerPlugin :
A plug-in to log php errors and exceptions into symfony logger system.
It can also send by email or copy into file selected errors catch by the symfony logger.

http://trac.symfony-project.com/wiki/sfSecurityManagerPlugin :
A plug-in to manage the symfony project's security strategy from command line

In all case, I would be happy to see a reference to me in the code you get from my work.

Thanks
Re: sfCommandLine : new plugin [message #40620 is a reply to message #40556 ] Fri, 30 November 2007 00:22 Go to previous messageGo to next message
kupokomapa  is currently offline kupokomapa
Messages: 10
Registered: November 2007
Junior Member
Yes, I will but you did not put any name reference in the file nor in the README so I did not know how to reference it to you. If you see at the other plugins I started to incorporate I do keep all the references at the beginning of the files. I usually even do not put reference to me anywhere in my plugins as I do not believe in ownership of that stuff, I am happy if I others can benefit from my work.

So, please provide that reference and I will definitely use it.

Kiril
Re: sfCommandLine : new plugin [message #40622 is a reply to message #40190 ] Fri, 30 November 2007 00:34 Go to previous messageGo to next message
kupokomapa  is currently offline kupokomapa
Messages: 10
Registered: November 2007
Junior Member
Btw, If you do not mind me incorporating your plugins in sfUtilitiesPlugin, why not just start updating them in sfUtilitiesPlugin rather than me later having to update the code if you want to add more features. I hope you see my logic that there is no need to create a plugin just for one class functionality when even you can put that class in your lib folder, for example, and have it work properly. So on the description of that sfUtilitiesPlugin we can advise the users that if they just need one functionality from all, they can just take a certain class from the plugin and use it as is. That was my thinking to incorporate only "one file" plugins.

Tell me what you think.

Kiril
Re: sfCommandLine : new plugin [message #40659 is a reply to message #40190 ] Fri, 30 November 2007 11:22 Go to previous messageGo to next message
sorac  is currently offline sorac
Messages: 17
Registered: September 2007
Junior Member
Hi,

I perfectly understand the logic behind sfUtilitiesPlugin and it's why I want to contribut.

I would be happy to maintain my code directly in the sfUtilitiesPlugin repository, but I don't have any write access to the SVN.

For the reference, just add this :
ReCaptCha

I saw that you added the sfAdvancedLogger to the package. Many people said me that the documentation isn't clear and even didn't understand all the functionalities behind the plugin. So, if you have any questions or advises for a new documentation, you're welcome !

Thanks

[Updated on: Fri, 30 November 2007 11:23]

Re: sfCommandLine : new plugin [message #40662 is a reply to message #40659 ] Fri, 30 November 2007 11:58 Go to previous messageGo to next message
adrive  is currently offline adrive
Messages: 42
Registered: October 2005
Location: Slovakia
Member

One idea/feature request for this plugin:

It would be greate, if you can call module, action from cli without custom batch files.

for example:
symfony run --app=myApp --module=myModule --action=myAction --param1=value1 ... --debug


For example if no batch will be passed after run, the default batch will be executed wich will call forward method of CLI controller with module and anction agruments.
Re: sfCommandLine : new plugin [message #40683 is a reply to message #40190 ] Fri, 30 November 2007 18:10 Go to previous messageGo to next message
sorac  is currently offline sorac
Messages: 17
Registered: September 2007
Junior Member
Hi,

I release a new version !

First, I backported some change from kupokomapa.

Then, I added the hability to run module/action from command line.

Check the Wiki's plugin page from more informations and exemples.

Enjoy !

[Updated on: Fri, 30 November 2007 18:11]

Re: sfCommandLine : new plugin [message #44470 is a reply to message #40190 ] Wed, 30 January 2008 19:05 Go to previous messageGo to next message
aferber
Messages: 6
Registered: August 2006
Junior Member
Nice plugin Smile

However, I have some feature request:

Please make the default application and environment configurable in some way (project config?). Currently, I have to edit the plugin source code manually, which will be a (minor, alas) problem when updating the plugin.
Some fixtures [message #44503 is a reply to message #40190 ] Thu, 31 January 2008 10:56 Go to previous messageGo to next message
robocomp  is currently offline robocomp
Messages: 25
Registered: October 2007
Location: Russia, Taganrog
Junior Member

Hi! I have noticed a strange bug in this plugin.
After being installed through symfony plugin-install command, it works a little bit strange.
I can't run a module action using --module and --action options.

I have fixed this issue and here's the patch attached.

  • Attachment: patch.txt
    (Size: 1.11KB, Downloaded 149 time(s))


http://rbcmp.blogspot.com
http://robocomp.livejournal.com
http://robocomp.moikrug.ru
array as argument? [message #53370 is a reply to message #44503 ] Tue, 03 June 2008 14:12 Go to previous messageGo to next message
patrov  is currently offline patrov
Messages: 15
Registered: April 2008
Location: france
Junior Member

Hi everyone,

I'm using the excellent sfCommandline Plugin and i would like to know how to pass an array as argument.

I would like to do, if it possible, something like that

  $ ./symfony run test --array_of_values[] foobar1 foobar2 


or
  $ ./symfony run test --array_of_values[] foobar1 --array_of_value[] foobar2 



Thanks for any ideas.

Re: array as argument? [message #53432 is a reply to message #53370 ] Wed, 04 June 2008 12:00 Go to previous messageGo to next message
robocomp  is currently offline robocomp
Messages: 25
Registered: October 2007
Location: Russia, Taganrog
Junior Member

Hi, I have implemented this by means of passing a string of comma-separated values. Then I do simply split it by comma.

As to you suggestion, I think it's possible to capture not the last value of a parameter, if one parameter used more than once, but add all the consequitive values of a same parameter to an array.

But, as far as I know, the latter feature is not implemented yet.


http://rbcmp.blogspot.com
http://robocomp.livejournal.com
http://robocomp.moikrug.ru
Re: sfCommandLine : new plugin [message #53433 is a reply to message #44470 ] Wed, 04 June 2008 12:01 Go to previous messageGo to next message
robocomp  is currently offline robocomp
Messages: 25
Registered: October 2007
Location: Russia, Taganrog
Junior Member

Why can't you specify the env and app using command line options
--env --app ?


http://rbcmp.blogspot.com
http://robocomp.livejournal.com
http://robocomp.moikrug.ru
Re: sfCommandLine : new plugin [message #53439 is a reply to message #53433 ] Wed, 04 June 2008 13:57 Go to previous messageGo to next message
patrov  is currently offline patrov
Messages: 15
Registered: April 2008
Location: france
Junior Member

HI,

Thanks for the string of comma-separated ideas. I think that it will fit my need.

Thanks again. Symfonians rules Smile
Re: sfCommandLine : new plugin [message #55580 is a reply to message #53439 ] Sun, 06 July 2008 18:20 Go to previous messageGo to next message
patrov  is currently offline patrov
Messages: 15
Registered: April 2008
Location: france
Junior Member

Hi every one,
I'm using the SfCommandLine plugin for sending batch email with the --module NameOfMyModule and --action MyAction parameters. The trouble is everytime the action fails. In my error log i can see my login page asking for username and password.
I'm user the sfGardAuth plugin.
When i turn to off the is_secure parameter in my app/config/security everything works fine.

from
default
is_secure : on

to
default
is_secure : off


I have done a lot of tests: like

- turning off is_secure for NameOfMyModule in the app/config/security file.
-Turning off is_secure in my app security and turning on is_secure for default for all my modules

Nothing change i'm still having my login page on my log.

Now my question is of course how can i fix that?By the way can i login via the action that my batch have to call?

Thanks for any ideas.




Re: sfCommandLine : new plugin [message #55616 is a reply to message #55580 ] Mon, 07 July 2008 15:27 Go to previous messageGo to next message
robocomp  is currently offline robocomp
Messages: 25
Registered: October 2007
Location: Russia, Taganrog
Junior Member

Hi!

What do you mean by the following:
Quote:

By the way can i login via the action that my batch have to call?


I can guess, what you want to fix. AS far as I can see, you would like to let your batch run the action, and make this action insecure, so that anyone from the web could run it, right?

If it's so, when, I suppose, you simple need to set is_secure for the action your batch is supposed to run to off.

To do so, modify the security.yml for your module, and put their:
MyAction:
  is_secure:  off

Your module configuration file resides in module_dir/config/security.yml
If you want to disable the ability to run this action from the web, then you need to read about is_internal in a Module Configuration section
http://www.symfony-project.org/book/1_1/06-Inside-the-Contro ller-Layer#Module%20Configuration


http://rbcmp.blogspot.com
http://robocomp.livejournal.com
http://robocomp.moikrug.ru
Re: sfCommandLine : new plugin [message #55668 is a reply to message #55616 ] Tue, 08 July 2008 01:00 Go to previous message
patrov  is currently offline patrov
Messages: 15
Registered: April 2008
Location: france
Junior Member

Many thanks for your help.
I just turn to off is_secure for MyAction. Everything works well.

Thanks again. Cool
Previous Topic:SOLVED: sfPropelActAsNestedSetBehaviorPlugin: problem with getDescendants()
Next Topic:sfCaptchaGDPlugin
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software