Cakephp Unit testing:using fixtures in components

2015-12-21 Thread Ravi Kanth
Hi, Iam writing test cases for one component ,need to use fixtures in compoment. my code is Class SampleComponentTest extends TestCase { public $component = null; public $controller = null; public $fixtures = ['app.cities','plugin.sampleplugin.states']; public function setUp() {

Re: Lazy loading components

2015-03-18 Thread Gonçalo Marrafa
; Mark > > > Am Mittwoch, 18. März 2015 11:53:14 UTC+1 schrieb Gonçalo Marrafa: > >> Hi there! >> >> Is there a way to enable lazy loading of components? As far as i can tell >> (i'm using 2.6.3) all components listed in $components variable are >> loaded a

Re: Lazy loading components

2015-03-18 Thread euromark
They need to be able to run initialize() and startup() before any action, so thats hard to do. And yes, micro-opt. without a real value IMO :) Mark Am Mittwoch, 18. März 2015 11:53:14 UTC+1 schrieb Gonçalo Marrafa: > > Hi there! > > Is there a way to enable lazy loading of compon

Lazy loading components

2015-03-18 Thread Gonçalo Marrafa
Hi there! Is there a way to enable lazy loading of components? As far as i can tell (i'm using 2.6.3) all components listed in $components variable are loaded and initialized when the controller is loaded. Shouldn't it use the same logic as models in which models are only

Re: Angular/Polymer web components and CakePHP

2014-09-22 Thread Jeremy Burns
gt; > Just my 2c > > T > > On Mon, Sep 22, 2014 at 2:27 PM, Jeremy Burns > wrote: > Canvassing some opinion... > > I'm just about to start a project that has an Angular and/or Polymer web > components front end, so the API only ever needs to send JSON respons

Re: Angular/Polymer web components and CakePHP

2014-09-22 Thread Dr. Tarique Sani
layer at a later date... Just my 2c T On Mon, Sep 22, 2014 at 2:27 PM, Jeremy Burns wrote: > Canvassing some opinion... > > I'm just about to start a project that has an Angular and/or Polymer web > components front end, so the API only ever needs to send JSON responses and >

Angular/Polymer web components and CakePHP

2014-09-22 Thread Jeremy Burns
Canvassing some opinion... I'm just about to start a project that has an Angular and/or Polymer web components front end, so the API only ever needs to send JSON responses and receive normal posts/get requests. As such, there is no need for the 'V' part of an MVC framework. I k

Re: Custom components not working on cakephp 3

2014-07-31 Thread Jipson Thomas
mplexOperation($amount1, $amount2) { >> return $amount1 + $amount2; >> } >> } >> >> >> And on my controller file I added the following code >> >> public $components = ['Paginator','Jtfilter']; >> >> When I am trying to access the c

Re: Custom components not working on cakephp 3

2014-07-31 Thread José Lorenzo
t; use Cake\Controller\Component; > class JtfilterComponent extends Component { > public function doComplexOperation($amount1, $amount2) { > return $amount1 + $amount2; > } > } > > > And on my controller file I added the following code > > public $component

Custom components not working on cakephp 3

2014-07-31 Thread Jipson Thomas
Hi , I have created a component using the following code on src/Controller/Component/JtfilterComponent.php file https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsub

Testing components

2014-06-06 Thread Jeremy Burns
I have a component that is called from the UsersController and a few others. Code in the component calls a find on the User model via the controller: $user = $this->Controller->User->findById($userId); How do I set up a reference to the UsersController inside the component test case so I can c

Re: Best Practice Question - Components

2013-11-06 Thread Reuben Helms
I would say that calculations, and verification of amounts would be perfect functionality to place on the model. You wouldn't normally need a controller to determine the sum of items in an order, so why put it in a controller. For a shopping cart, you still might use a model to store the cart con

Re: Best Practice Question - Components

2013-11-06 Thread Kristen M
Yeah, the point of the exercise is to do things the "Cake Way" and take advantage of all things automagical and Cake. ;) After puzzling over the docs for a bit and realizing it's not bad form to have a controller use multiple models, I decided that splitting the existing classes into a model a

Re: Best Practice Question - Components

2013-11-05 Thread Reuben
If you have existing class that work, then you could include them as Vendor code, and have your controllers call their find and save functions. However, doing things the CakePHP way, you'll probably want to convert those classes to Models, rather than Components. Models are where your bus

Best Practice Question - Components

2013-11-05 Thread Kristen M
unctions to verify the user has the funds to pay the toll, then debit the transaction. It SOUNDS like what I need to do is to create Banking & Item Components, then the other controllers can make use of them as needed. However, this would also require including various queries to chat wit

Re: Best Practise: Use Utilmethods in Controllers, Views, Components...

2013-03-18 Thread Kai Szymanski
Hi Lowbass, good idea! I will go this way. Also this solution seems to be very "maintain-friendly" ;) Thanks for your answer. Best regards, Kai. Am 17.03.2013 18:15, schrieb lowpass: > I used to put this sort of thing in bootstrap.php but lately I've been > putting a file in the app/Lib direc

Re: Best Practise: Use Utilmethods in Controllers, Views, Components...

2013-03-17 Thread godjen99
I've been doing the same as cricket, an additional perk is it's easier to maintain, cleaner and easier to unit test. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Grou

Re: Best Practise: Use Utilmethods in Controllers, Views, Components...

2013-03-17 Thread lowpass
I used to put this sort of thing in bootstrap.php but lately I've been putting a file in the app/Lib directory and including it at the end of bootstrap. On Fri, Mar 15, 2013 at 11:44 AM, kaiszy wrote: > Hi! > > I have several Utility Routines that i wan't to use in all Objects (Models, > Controll

Best Practise: Use Utilmethods in Controllers, Views, Components...

2013-03-15 Thread kaiszy
Hi! I have several Utility Routines that i wan't to use in all Objects (Models, Controllers, Views,...). For example i have a small Method called "getDataFromArray" that fetch a element from an Array or throws a CakeException if the key doesnt exists. Because of DRY i wan't to use it in *. Wh

Re: Problem with using components when Importing a Controller

2013-02-21 Thread euromark
ntrollers this way. >> You need to refactor those controller methods into clean model methods >> and only re-use those. >> > > Since we are talking about sending e-mails which uses the Email component > the only options are to abuse controllers or models (as models are no

Re: Problem with using components when Importing a Controller

2013-02-21 Thread david . suna
which uses the Email component the only options are to abuse controllers or models (as models are not supposed to use components). I can try moving the code into the model and using App::Import to get the Email component and see if it is set up correctly that way. I have a work around as I sho

Re: Problem with using components when Importing a Controller

2013-02-21 Thread euromark
h I am accessing using > App::Import('Controller', 'EmailNotifications'); > > The EmailNotifications controller uses the Email component > var $components = array('Email', 'RequestHandler'); > > When I import the controller I use the followi

Problem with using components when Importing a Controller

2013-02-21 Thread david . suna
I have a controller EmailNotifications which I am accessing using App::Import('Controller', 'EmailNotifications'); The EmailNotifications controller uses the Email component var $components = array('Email', 'RequestHandler'); When I import

Re: Use Configure::read in $components

2013-02-20 Thread euromark
t the settings that's why this is not in bootstrap > > Le mercredi 20 février 2013 12:12:16 UTC+1, Julien Itard a écrit : >> >> Hello, >> it seems that i can't use Configure::read() here, it return an empty >> string.. >> >> My code : >>

Re: Use Configure::read in $components

2013-02-20 Thread Julien Itard
here, it return an empty > string.. > > My code : > > public function constructClasses() { > $this->components['TeamSpeak3.TeamSpeak3'] = array( > 'uri' => > 'serverquery://'.Configure::read("Settings.teamspeak_query_user").'

Re: Use Configure::read in $components

2013-02-20 Thread Julien Itard
Hello, it seems that i can't use Configure::read() here, it return an empty string.. My code : public function constructClasses() { $this->components['TeamSpeak3.TeamSpeak3'] = array( 'uri' => 'serverquery://'.Configure::read("Setti

Re: Use Configure::read in $components

2013-02-20 Thread euromark
unless he needs the uri in initialized() than this would be too late. then one might have to overwrite constructClasses(): public function constructClasses() { $this->components['TeamSpeak3.TeamSpeak3'] = array( 'uri' => Configure::read('Settings.ts_u

Re: Use Configure::read in $components

2013-02-19 Thread lowpass
On Tue, Feb 19, 2013 at 4:00 PM, Julien Itard wrote: > Hi there, > here is my AppController : > > public $components = array( > 'TeamSpeak3.TeamSpeak3' => array( > 'uri' => Configure::read('Settings.ts_uri) >

Use Configure::read in $components

2013-02-19 Thread Julien Itard
Hi there, here is my AppController : public $components = array( 'TeamSpeak3.TeamSpeak3' => array( 'uri' => Configure::read('Settings.ts_uri) ) ); I need to use a configure here but it doesn't work ... any idea ? Thx fro

Re: Git submodule for behaviors/components/helpers

2013-02-08 Thread Vanja Dizdarević
Makes perfect sense when someone else says it... :D :D I was just unsure if Plugin/behaviors work without PluginAppModel or sth else to work properly... Thanks Tiago, I'm a happy little baker now... -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/C

Re: Git submodule for behaviors/components/helpers

2013-02-08 Thread Thiago Belem
havior.php > > Checking out the repo as a plugin might work? > >/project/$ git submodule add url-to-repo app/Plugin/StateMachine > >and then init the behavior as $actsAs => "StateMachine.StateMachine" > > But I'm not sure if this is good practice... >

Git submodule for behaviors/components/helpers

2013-02-08 Thread Vanja Dizdarević
actsAs => "StateMachine.StateMachine" But I'm not sure if this is good practice... How would you guys do this? (The same goes for Components and Helpers) P.S.: I know that it's easier to just download the file and put it in app/Behaviors, but I am making a deployment version for many

Re: Components vs Helpers vs Utilities

2013-01-25 Thread lowpass
On Fri, Jan 25, 2013 at 4:53 PM, tron wrote: > Im trying to wrap my head around utilzing some functionality at all levels > of MVC. Right now, I'm writing a component that performs several date > functions for my app (the date utility is insufficient for what Im doing). > The problem is I need the

Re: Components vs Helpers vs Utilities

2013-01-25 Thread Michael Gaiser
I am having difficulty thinking of a time when I would need the same function to be called in my model and my view. On my current project, I am also needing to manipulate my dates as I have a non standard way of saving them in the database. What I have done is manipulated them in the controller usi

Components vs Helpers vs Utilities

2013-01-25 Thread tron
Im trying to wrap my head around utilzing some functionality at all levels of MVC. Right now, I'm writing a component that performs several date functions for my app (the date utility is insufficient for what Im doing). The problem is I need the these functions in both my models and views as we

Problem with reusing components

2012-07-11 Thread unskilled
Hello For a couple of hours I am having a hard time to use one component in another. I used the steps from the cookbook but when i call the method of a component i get an error - calling a member of a non object. I'm really frustrated and really dont know what to do. Both component

Re: cakephp 2.0.4: How to use Session Component in Plugin Components?

2012-01-03 Thread Salines
Ok, now works. Thanks -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@

Re: cakephp 2.0.4: How to use Session Component in Plugin Components?

2012-01-03 Thread 清水紘己
You should make the component extend 'Component' class. 2012/1/3 Salines : > http://bin.cakephp.org/view/1662957875 > > -- > Our newest site for the community: CakePHP Video Tutorials > http://tv.cakephp.org > Check out the new CakePHP Questions site http://ask.cakephp.org and help > others with t

Re: cakephp 2.0.4: How to use Session Component in Plugin Components?

2012-01-03 Thread Salines
http://bin.cakephp.org/view/1662957875 -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-

Re: cakephp 2.0.4: How to use Session Component in Plugin Components?

2012-01-03 Thread Salines
No, I did not forget to add I modify Neil Crookes twitter component to use in CakePHP 2.0.x -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.

Re: cakephp 2.0.4: How to use Session Component in Plugin Components?

2012-01-02 Thread euromark
did you forget to add var $components = array('Session') to this component? that's probably it On 3 Jan., 02:04, Salines wrote: > Undefined property: TwitterAuthComponent::$Session > [*APP/Plugin/Twitter/Controller/Component/TwitterAuthComponent.php*, line > *133*] &g

Re: cakephp 2.0.4: How to use Session Component in Plugin Components?

2012-01-02 Thread Salines
Undefined property: TwitterAuthComponent::$Session [*APP/Plugin/Twitter/Controller/Component/TwitterAuthComponent.php*, line *133*] Fatal error: Call to a member function check() on a non-object in /home/nix/localhost.dev/cms/Plugin/Twitter/Controller/Component/TwitterAuthComponent.php on li

cakephp 2.0.4: How to use Session Component in Plugin Components?

2012-01-02 Thread Salines
Hello, i have trouble to use Session component inside my plugin components. How to load session component? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP

Re: using components inside custom authorize object (CakePHP 2)

2011-10-26 Thread majna
or $this->controller()->Components->Session->read() -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this

Re: Question about why components etc are added the way they are

2011-10-26 Thread AD7six
On Oct 26, 6:21 am, Greg Skerman wrote: > I've been asked a question to which I don't immediately have a (good) > answer... > > why is it in cake that this: > > public $components = array('AuthComponent'); > > is preferred over >

Re: Question about why components etc are added the way they are

2011-10-26 Thread vaughany
My 2p, as a newbie to Cake: As a failrly old hand at PHP but someone who has avoided OOP (and MVC) up 'til recently, seeing: public $components = array('AuthComponent'); makes prefect sense to me, whereas using the constructpr functions seems... odd, complex and unnecessary. I

Re: using components inside custom authorize object (CakePHP 2)

2011-10-26 Thread Mohammad Naghavi
I actually came to this: $this->_Collection->Session->read(''); as I'm sure that Session is always loaded because I have it in my AppController, but I wasn't sure if accessing _Collection directly is the right way to do or not. thanks anyway :) -- Our newest site for the community: CakeP

Re: using components inside custom authorize object (CakePHP 2)

2011-10-26 Thread designv...@gmail.com
I used: CakeSession::write('Auth.Plugins', $user_plugins); Should I be using: $session = $this->_Collection->load('Session'); $session->write('Auth.Plugins', $user_plugins); ? TIA d//t On Oct 25, 10:23 pm, José Lorenzo wrote: > In any method of your custom object you ca do something like th

Question about why components etc are added the way they are

2011-10-25 Thread Greg Skerman
I've been asked a question to which I don't immediately have a (good) answer... why is it in cake that this: public $components = array('AuthComponent'); is preferred over public $Auth; public function __construct() { $this->Auth = new AuthComponent(); } I actua

Re: using components inside custom authorize object (CakePHP 2)

2011-10-25 Thread José Lorenzo
In any method of your custom object you ca do something like this, it will load the component or return the already instantiated one. $session = $this->_Collection->load('Session'); -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP

using components inside custom authorize object (CakePHP 2)

2011-10-25 Thread Mohammad Naghavi
Hi again, I was working on a custom authorize object in conjunction with new Auth component, that I ran into the need to use Session component there, I tried to use $components array but it didn't worked. I suppose there should be a way to do that, can anybody help me? -- Our newest sit

migrating components to 2.0

2011-10-20 Thread euromark
the migration guide states the new params of components class PrgComponent extends Component { function __construct(ComponentCollection $collection, $settings = array()) { parent::__construct($collection, $settings); } } but if you have old components you used in shells, etc you

Re: call components from shell.

2011-10-07 Thread iphone5
Never mind i decided to do php way in shell if (! $conn = mysql_connect( 'localhost', $db_name, $db_pwd ) ) { echo 'Could not connect to mysql'; continue; }else{ $this -> connection = $conn; } if( mysql_select_db( $db_name, $conn ) ){ -- Our newest site for the community: CakePHP

Re: call components from shell.

2011-10-06 Thread iphone5
Also Can't even save the model in cake. $rpg[ 'ReviewPanelGroup' ][ 'account_id' ] = $account_id; $rpg[ 'ReviewPanelGroup' ][ 'department_id' ] = $department_id; $rpg[ 'ReviewPanelGroup' ][ 'survey_id' ] = $review_id; $this -> ReviewPanelGroup -> save( $rpg ); Is there anyway to split out the SQ

call components from shell.

2011-10-06 Thread iphone5
etDataSource - Non-existent data source In the shell I call the component like this $this -> controller = new AppController(); $this -> controller -> components = $this-> components; $this -> empManager = new EmployeeManagerComponent(null); $this -> empManager -> startup( $th

Re: Load components in components

2011-08-15 Thread Điển vũ
Thanks a lot. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegro

Re: Load components in components

2011-08-15 Thread Điển vũ
I asked in cakephp IRC, A person answer is not: > [11:05] it will not be slow, I believe it passes those around via reference > >[11:05] so you have nothing to worry about -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Question

Re: Load components in components

2011-08-15 Thread Điển vũ
if i use and create much components and that components use other components .It will make app is very slow? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP

Load components in components

2011-08-13 Thread Điển vũ
in app_controller.php load Session, Auth components. And in posts_controller.php, i use CustomComponent with $components = array('Session','Auth'); Then do CustomComponent must reload Session, Auth? -- Our newest site for the community: CakePHP Video Tutorials http://t

Re: Why cake not build a good procedure for load components behaviour , help ?

2011-08-10 Thread vcrack
oller.. developer plugin never know my AppController? it's will be "loss couple" if cake create a function for Hook components, helper.. and each plugin never have dependent with core app.. :-) thanks in advance.. Jan On Aug 10, 10:08 pm, euromark wrote: > as far as I know, this i

Re: small bug in auth components

2011-08-10 Thread Inteiro
Try $this->Auth->fields['username'] = 'email'; On 10 aug, 00:58, muslimbit wrote: > There is an error in the auth components when i init the username auth > field only in beforfilter function : > > $this->Auth->fields = array( >             &#x

Re: Why cake not build a good procedure for load components behaviour , help ?

2011-08-10 Thread euromark
> But, I have a question.. > > Why cake doesn't make a function  to hook Components, Helpers, > Behaviour? > Why only create a attribute var $components, var $helpers , var > $actsAs ? > it's likely will override with child class.. > > for example, in my project.

Why cake not build a good procedure for load components behaviour , help ?

2011-08-10 Thread vcrack
cake doesn't make a function to hook Components, Helpers, Behaviour? Why only create a attribute var $components, var $helpers , var $actsAs ? it's likely will override with child class.. for example, in my project. I have a AutoLogin Component.. I wanna use this components to all contr

Re: small bug in auth components

2011-08-10 Thread John Andersen
CakePHP book for a short description of the fields variable at: http://book.cakephp.org/#!/view/1267/fields Please clarify what you are trying to do :) Enjoy, John On 10 Aug., 00:58, muslimbit wrote: > There is an error in the auth components when i init the username auth > field o

small bug in auth components

2011-08-10 Thread muslimbit
There is an error in the auth components when i init the username auth field only in beforfilter function : $this->Auth->fields = array( 'username' => 'email' ); i get a notice : Notice (8): Undefined index: password [CORE\cake\libs\controll

Re: List of PlugIns, Behaviours, Components and Helpers

2011-06-30 Thread Sam Sherlock
http://cakepackages.com/ By Jose diaz gonzalezgonzalez the code is available on github too - S On 30 Jun 2011 12:42, "Jens Dittrich" wrote: > Does anyone know a List somewhere in the web of cakePHP PlugIns, Components, > Behaviours and Helpers besides the ones delivered in the

Re: List of PlugIns, Behaviours, Components and Helpers

2011-06-30 Thread euromark
i only know of http://cakepackages.com/ which is buggy, partly outdated and not really actively maintained but might still be helpful On 30 Jun., 13:42, Jens Dittrich wrote: > Does anyone know a List somewhere in the web of cakePHP PlugIns, Components, > Behaviours and Helpers besides th

List of PlugIns, Behaviours, Components and Helpers

2011-06-30 Thread Jens Dittrich
Does anyone know a List somewhere in the web of cakePHP PlugIns, Components, Behaviours and Helpers besides the ones delivered in the CakePHP release? Googleing the web and searching through GitHub repositories of some developers is always an option, but a kind of central list with the

Re: Why Can't Components See Methods from App_Controller?

2011-04-07 Thread cricket
t; once you roll into a component. > > Why is this the case (interested in the theory behind this part of the > MVC), and is there a best practice way to access things from the > app_controller in a component? Components don't extend controllers. But the controller is passed to the

Why Can't Components See Methods from App_Controller?

2011-04-07 Thread David
I've got a component to do some common functions for a number of controllers. When I'm in those controllers, I can use globally-common functions from the app_controller. But when I'm in a component called by a controller, those functions from the app_controller aren't available. Isn't that sort

Re: Bug when using ClassRegistry::init for Components

2011-03-22 Thread euromark
i usually use App::import('Component', 'Plugin.Something'); and manually create a new object On 23 Mrz., 00:35, labianchin wrote: > Hi, guys. > > I pretend to load and initialize a component (e.g. > SomethingComponent), so I use something like: > ClassRegistry::init('Plugin.Something', 'Componen

Bug when using ClassRegistry::init for Components

2011-03-22 Thread labianchin
Hi, guys. I pretend to load and initialize a component (e.g. SomethingComponent), so I use something like: ClassRegistry::init('Plugin.Something', 'Component') The problem is that as in the line 140 of the file class-registry (http://api.cakephp.org/view_source/class-registry/#line-99) we have

Re: Loading components inside components and keeping the initialize() stack order

2011-02-22 Thread Pixelastic
de-land, here is what I mean. > > > class FoosController extends AppController { > >         var $components = array('MainComponent); > > > } > > > class MainComponent extends Object { > >         var $components = array('SecondaryCompon

Re: Loading components inside components and keeping the initialize() stack order

2011-02-16 Thread Miles J
t; I want to call some of SecondaryComponent::specialMethod() in > MainComponent::initialize(), but this method can only correctly work > if SecondaryComponent::initialize() is itself called first. > > Diving into code-land, here is what I mean. > > class FoosController extends AppCon

Loading components inside components and keeping the initialize() stack order

2011-02-16 Thread Pixelastic
iving into code-land, here is what I mean. class FoosController extends AppController { var $components = array('MainComponent); } class MainComponent extends Object { var $components = array('SecondaryComponent'); function initialize(&a

Re: Setting up initialization values to components, AuthComponent

2011-01-17 Thread Santiago Basulto
Ok, i've found how to initialize parameters for the controller. It was not difficult, actually, it's in the book. I paste my code here: lass AppController extends Controller { var $components = array( 'Auth' => array( &#x

Setting up initialization values to components, AuthComponent

2011-01-17 Thread Santiago Basulto
Hello people! I'm facing a problem with Auth component. I've a minor level of security in my site, that is checked in the isAuthorized() method of my AppController. I've there a simple switch that checks some options. The thing is that i need to declare a beforeFilter() in every controller and se

Re: How do you guys structure your shared components/behaviors/plugins repository (Subversion)? --psybear

2011-01-04 Thread Joshua Muheim
luded once you add > them to the $helpers, $components array, etc. A great example is the > CakeDC utils plugin: https://github.com/CakeDC/utils > > On Jan 4, 7:42 am, Joshua Muheim wrote: >> @Mark: this does seem very pragmatic. But what if you want to provide >> you

Re: How do you guys structure your shared components/behaviors/plugins repository (Subversion)? --psybear

2011-01-04 Thread Miles J
@Joshua - Yes but if you put everything into a single plugin, then the problem is solved. You are *not* including all those files in the app, you are just making them available. They are included once you add them to the $helpers, $components array, etc. A great example is the CakeDC utils plugin

Re: How do you guys structure your shared components/behaviors/plugins repository (Subversion)? --psybear

2011-01-04 Thread Joshua Muheim
eim wrote: >> Short answer! I will look into it. Thanks. :-) >> >> >> >> >> >> >> >> On Tue, Jan 4, 2011 at 1:12 PM, AD7six wrote: >> >> > On Jan 4, 12:33 pm, psybear83 wrote: >> >> Hey everybody >> >> &g

Re: How do you guys structure your shared components/behaviors/plugins repository (Subversion)? --psybear

2011-01-04 Thread euromark
> > On Jan 4, 12:33 pm, psybear83 wrote: > >> Hey everybody > > >> I wonder how to structure my shared components, behaviors, plugins > >> etc. in my Subversion repository? I include them as externals in many > >> different projects, and because I can

Re: How do you guys structure your shared components/behaviors/plugins repository (Subversion)? --psybear

2011-01-04 Thread Joshua Muheim
Short answer! I will look into it. Thanks. :-) On Tue, Jan 4, 2011 at 1:12 PM, AD7six wrote: > > > On Jan 4, 12:33 pm, psybear83 wrote: >> Hey everybody >> >> I wonder how to structure my shared components, behaviors, plugins >> etc. in my Subversion repositor

Re: How do you guys structure your shared components/behaviors/plugins repository (Subversion)? --psybear

2011-01-04 Thread AD7six
On Jan 4, 12:33 pm, psybear83 wrote: > Hey everybody > > I wonder how to structure my shared components, behaviors, plugins > etc. in my Subversion repository? I include them as externals in many > different projects, and because I can't point to single files as >

How do you guys structure your shared components/behaviors/plugins repository (Subversion)? --psybear

2011-01-04 Thread psybear83
Hey everybody I wonder how to structure my shared components, behaviors, plugins etc. in my Subversion repository? I include them as externals in many different projects, and because I can't point to single files as externals (but only to directories) I can't simply use a stru

Configure before components initialize - startupProcess() or constructClasses() a good idea?

2010-11-29 Thread odd
uld always throw permission errors when trying to access/delete session temp files, etc. To make a long story short, components may cause/require the session to start on initialization (popular ex. DebugKit), and so one needs to do the configuration earlier. Am i right that the only o

Re: CakePHP should be more strict with unclean configuration, e.g. when specifying missing components! --psybear

2010-11-16 Thread Joshua Muheim
>> >> > On Nov 12, 5:05 am, psybear83 wrote: >> >> Hi all >> >> >> I don't get it why CakePHP doesn't complain about stuff like when one >> >> specifies missing components or fixtures: >> >> >> var $components = ar

Re: CakePHP should be more strict with unclean configuration, e.g. when specifying missing components! --psybear

2010-11-16 Thread Miles J
ould check the > > return value of the method. > > > -Mark > > > On Nov 12, 5:05 am, psybear83 wrote: > >> Hi all > > >> I don't get it why CakePHP doesn't complain about stuff like when one > >> specifies missing c

Re: CakePHP should be more strict with unclean configuration, e.g. when specifying missing components! --psybear

2010-11-16 Thread Joshua Muheim
7;t complain about stuff like when one >> specifies missing components or fixtures: >> >> var $components = array('SomeNotExistingComponent'); >> var $fixtures = array('app.this_fixture_does_not_exist'); >> App::import('Lib', 'TheresNoSu

Re: A Matter of Discipline (Components and Models)

2010-11-14 Thread cricket
['SampleModel']['id']) > 5.) Save $this->data into the final model. > > I'm thinking of doing an App::import('Model') inside my custom > component, OR doing an App::import('Component') in my lookup model, > since "fat models and skinny

A Matter of Discipline (Components and Models)

2010-11-14 Thread O.J. Tibi
ing an App::import('Model') inside my custom component, OR doing an App::import('Component') in my lookup model, since "fat models and skinny controllers" is an often preached discipline. These approaches feel dirty because accessing a model inside a component, and a

Re: CakePHP should be more strict with unclean configuration, e.g. when specifying missing components! --psybear

2010-11-13 Thread mark_story
stuff like when one > specifies missing components or fixtures: > > var $components = array('SomeNotExistingComponent'); > var $fixtures = array('app.this_fixture_does_not_exist'); > App::import('Lib', 'TheresNoSuchFileInLib'); > > All the three li

Re: CakePHP should be more strict with unclean configuration, e.g. when specifying missing components! --psybear

2010-11-12 Thread Miles J
t get it why CakePHP doesn't complain about stuff like when one > > specifies missing components or fixtures: > > > var $components = array('SomeNotExistingComponent'); > > var $fixtures = array('app.this_fixture_does_not_exist'); > > App::import('

Re: CakePHP should be more strict with unclean configuration, e.g. when specifying missing components! --psybear

2010-11-12 Thread cricket
On Fri, Nov 12, 2010 at 5:05 AM, psybear83 wrote: > Hi all > > I don't get it why CakePHP doesn't complain about stuff like when one > specifies missing components or fixtures: > > var $components = array('SomeNotExistingComponent'); > var $fixtures

CakePHP should be more strict with unclean configuration, e.g. when specifying missing components! --psybear

2010-11-12 Thread psybear83
Hi all I don't get it why CakePHP doesn't complain about stuff like when one specifies missing components or fixtures: var $components = array('SomeNotExistingComponent'); var $fixtures = array('app.this_fixture_does_not_exist'); App::import('Lib', '

Re: beforeFilter() after initialization of components but before beforeRender? --psybear

2010-11-12 Thread Joshua Muheim
Well, I found a way to implement another controller hook that is called between initialization of components and execution of action logic: _afterComponentsInitialization(); } } You think this is a good way? :-) On Fri, Nov 12, 2010 at 10:59 AM, Joshua Muheim wrote: > Oh, and by the way:

Re: beforeFilter() after initialization of components but before beforeRender? --psybear

2010-11-12 Thread Joshua Muheim
to set it in a beforeFilter(). > >  function _prepareUser() { >    $this->user = new UserProxy($this->SimpleAuth, $this->SimpleAcl); >    $this->set('user', $this->user); >  } > > This requires the SimpleAuth and SimpleAcl components to already be >

Re: beforeFilter() after initialization of components but before beforeRender? --psybear

2010-11-12 Thread Joshua Muheim
gt;user = new UserProxy($this->SimpleAuth, $this->SimpleAcl); $this->set('user', $this->user); } This requires the SimpleAuth and SimpleAcl components to already be initalized, because in $this->auth->getActiveUser() in the constructor of UserProxy the SimpleAuth comp

Re: beforeFilter() after initialization of components but before beforeRender? --psybear

2010-11-11 Thread Miles J
Also forgot to mention that there is an afterFilter() as well. On Nov 11, 10:30 am, Miles J wrote: > Components are initialized before they get to beforeFilter(), so > beforeFilter() should work fine. > > https://github.com/cakephp/cakephp/blob/master/cake/libs/controller/c... >

Re: beforeFilter() after initialization of components but before beforeRender? --psybear

2010-11-11 Thread Miles J
Components are initialized before they get to beforeFilter(), so beforeFilter() should work fine. https://github.com/cakephp/cakephp/blob/master/cake/libs/controller/controller.php#L525 On Nov 11, 9:24 am, Bogdan Bursuc wrote: > Why do you need one ? > > > > On Thu, Nov 11,

Re: beforeFilter() after initialization of components but before beforeRender? --psybear

2010-11-11 Thread Bogdan Bursuc
Why do you need one ? On Thu, Nov 11, 2010 at 7:18 PM, psybear83 wrote: > Hi all > > Is there a filter that runs after the initialization of components but > before beforeRender? > > Thanks for help > Josh > > Check out the new CakePHP Questions site http://cakeqs

  1   2   3   4   >