It will error out when you try to access a component that doesn't
exist. Adding an invalid string to an array should not cause CakePHP
to barf errors.

On Nov 12, 10:09 am, cricket <[email protected]> wrote:
> On Fri, Nov 12, 2010 at 5:05 AM, psybear83 <[email protected]> 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 = array('app.this_fixture_does_not_exist');
> > App::import('Lib', 'TheresNoSuchFileInLib');
>
> > All the three lines do not result in any error, and I guess there's
> > more of that like $uses or stuff, but I didn't investigate this any
> > further.
>
> It would have taken you all of ... four seconds? ... to add 'Foo' to
> some controller's $uses array and load up a route pointing to it.
>
> For those who can't bear the suspense: Cake will complain that the
> table for the model is missing. Remember that Cake can "virtualize" a
> model, so a missing model class is not necessarily a show-stopper.
>
> > Can anyone tell me why CakePHP just doesn't care about stuff like
> > that? Seems veeeery unresponsible to me...
>
> It's not that Cake "doesn't care"--it'll simply return false when, eg.
> failing to load a missing component. What's "unresponsible" is listing
> components, plugins, etc. that don't exist.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to