Log message #3149114

# At Username Text
# Jan 29th 2014, 20:46 ten1 requestAction() being made from pure clarified Satan and not to be used except by the brave, bold, needful, and exceptionally stupid
# Jan 29th 2014, 20:46 todds nif: just do the curl call.
# Jan 29th 2014, 20:45 ten1 requestAction() should be possible, in anything that extends Object
# Jan 29th 2014, 20:45 nif except the curl option?
# Jan 29th 2014, 20:45 feens ...it's either a) fix the problem, or b) figure out how to solve the maze you've constructed
# Jan 29th 2014, 20:44 feens ya, but you're looking for an answer that doesn't really exist
# Jan 29th 2014, 20:44 ten1 see previous comment
# Jan 29th 2014, 20:44 nif ok. i get that. can we move on from it? awareness of it has been there for a while, but like i said, low budget, no time and learning a new framework all contributed to this. everyone has to start somewhere, otherwise they may never reach those higher places where they get to tell other people how they screwed up. but i have a deadline and i have to get this working. next time i will do better
# Jan 29th 2014, 20:43 ten1 it would be compounding error with worse error
# Jan 29th 2014, 20:43 feens ya...you basically asking a question that can't really be answered..."how do I make my poorly written code do this?"...and expecting a simple answer in return
# Jan 29th 2014, 20:43 ten1 you could try a requestAction, and may whatever powers govern code have mercy on you
# Jan 29th 2014, 20:43 todds ten1 the glass is half FULL!
# Jan 29th 2014, 20:42 ten1 I wish there was some answer that would make things okay here, but you have screwed up very badly
# Jan 29th 2014, 20:42 nif i know. like i said, this isn't built well. but i don't have the option of rewriting it and so i am desperately trying to find a way to do this
# Jan 29th 2014, 20:42 todds nif: yeah, what you're describing sounds like a mess. In you're case, I'd recommend a re-write. But if you're not going to do that, then the most direct route (easiest) is to do that curl call instead.
# Jan 29th 2014, 20:42 feens controllers aren't meant to do work like that...they're just supposed to direct traffic per se
# Jan 29th 2014, 20:41 feens ya....that's not so good
# Jan 29th 2014, 20:41 nif it is... but the component uses a different controller to get some work done
# Jan 29th 2014, 20:41 feens I'm assuming calling a controller via a component opening a whole can of worms
# Jan 29th 2014, 20:41 ten1 components should indeed not call controllers
# Jan 29th 2014, 20:41 feens ...isn't the purpose of a comment to be used in a controller (not called by one)?
# Jan 29th 2014, 20:40 ten1 you can think of the shell as being equivalent to the controller in this case. It's theoretically possible to call controller actions from the shell but not pleasant. Curl is possible, but again: rewrite this
# Jan 29th 2014, 20:39 todds the most direct route would probably be to do as feens suggests and just do a curl callâ?¦though it makes me cringe that you're gonna go through the web stack to execute local code.
# Jan 29th 2014, 20:39 todds nif: the reason you're getting an error is probably because you're not passing a component colleciton from the shell.
# Jan 29th 2014, 20:38 feens nif: well, if you're just trying to call the controller, why not just do like a curl call
# Jan 29th 2014, 20:38 nif ok... i know this hasn't been built in the best way... time and budget constraints and taking up a new framework saw to that. however, i cannot change the way it is built now. i kind of have to make this work and with minimal changes to the app code that exists now. moving stuff to the model could throw the whole thing out. is there no way to make this work as is? and then i promise to build it better next time! :)
# Jan 29th 2014, 20:37 todds )
# Jan 29th 2014, 20:37 ten11 ten11 ? oops
# Jan 29th 2014, 20:37 todds nif: what ten11 said. you'll want to move those methods to the model.
# Jan 29th 2014, 20:36 ten11 !tell nif about goodcake
# Jan 29th 2014, 20:36 ten11 the side benefit of this is that you get to do $uses = array('Modelname'); in your shell and have access to it there
# Jan 29th 2014, 20:35 ten11 almost all of it
# Jan 29th 2014, 20:35 ten11 your functionality should be part of the model layer
# Jan 29th 2014, 20:35 nif sorry, to clarify, this is the first time i am creating a shell like this.
# Jan 29th 2014, 20:35 nif ok... but the method in the controller that the component calls is used in several places in my app... wouldn't that affect it?
# Jan 29th 2014, 20:34 nif not that i know of? i have functionality in my app that i need to call at intervals. the idea is that i would create a shell and then run a cron on it. as far as i know this is the only way to get that done?
# Jan 29th 2014, 20:33 todds nif: You'll want to move any code that needs to be referenced by both a component and the shell to your app lib. Components are intended for use by controllers.
# Jan 29th 2014, 20:32 feens I would think hat semantically a shell probably shouldn't call a controller...doesn't that kind of defeat the purpose of using a shell?
# Jan 29th 2014, 20:27 todds nif: http://book.cakephp.org/2.0/en/console-and-shells.html#creating-a-shell
# Jan 29th 2014, 20:22 nif I need a little help with running my app from a shell file... can anyone help?
# Jan 29th 2014, 20:22 nif Hi there,