Re: Why are there no logs?!

2010-09-13 Thread Joshua Muheim
Oh, I found it (Console App).

On Sat, Sep 11, 2010 at 2:05 AM, mark_story  wrote:
> The true just enables logging all errors.  It does not enable logging
> page render statistics and other information.  Finding access data can
> be done from looking at your webserver logs.
>
> -Mark
>
> On Sep 10, 5:27 pm, Andy Dirnberger  wrote:
>> Which is not what I asked. From core.php:
>>
>> /**
>>  * CakePHP Log Level:
>>  *
>>  * In case of Production Mode CakePHP gives you the possibility to
>> continue logging errors.
>>  *
>>  * The following parameters can be used:
>>  *  Boolean: Set true/false to activate/deactivate logging
>>  *    Configure::write('log', true);
>>  *
>>  *  Integer: Use built-in PHP constants to set the error level (see
>> error_reporting)
>>  *    Configure::write('log', E_ERROR | E_WARNING);
>>  *    Configure::write('log', E_ALL ^ E_NOTICE);
>>  */
>>         Configure::write('log', true);
>>
>> On Sep 10, 9:30 am, Joshua Muheim  wrote:
>>
>>
>>
>>
>>
>>
>>
>> > as mentioned above i use
>>
>> > define('LOG_ERROR', 2);
>>
>> > On Fri, Sep 10, 2010 at 3:11 PM, Andy Dirnberger
>>
>> >  wrote:
>> > > What are you using for the log setting in core.php?
>>
>> > > On Sep 10, 7:52 am, psybear83  wrote:
>> > >> Hi everybody
>>
>> > >> From Ruby On Rails I'm used that while developing my log files are
>> > >> full of informations about what pages were rendered etc.
>>
>> > >> In CakePHP I'm missing this - I don't even seem to have a log file in
>> > >> my app/tmp/logs directory? Is this normal? I have set
>>
>> > >> define('LOG_ERROR', 2);
>>
>> > >> is this OK? Am I missing anything else?
>>
>> > >> Thanks a lot
>> > >> Josh
>>
>> > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp 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 cake-php@googlegroups.com
>> > > To unsubscribe from this group, send email to
>> > > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
>> > > athttp://groups.google.com/group/cake-php?hl=en
>
> 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 cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en
>

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Why are there no logs?!

2010-09-13 Thread Joshua Muheim
Thanks for the information, Mark. I'm on OSX, can you tell me where to
get the logs of Apache?

On Sat, Sep 11, 2010 at 2:05 AM, mark_story  wrote:
> The true just enables logging all errors.  It does not enable logging
> page render statistics and other information.  Finding access data can
> be done from looking at your webserver logs.
>
> -Mark
>
> On Sep 10, 5:27 pm, Andy Dirnberger  wrote:
>> Which is not what I asked. From core.php:
>>
>> /**
>>  * CakePHP Log Level:
>>  *
>>  * In case of Production Mode CakePHP gives you the possibility to
>> continue logging errors.
>>  *
>>  * The following parameters can be used:
>>  *  Boolean: Set true/false to activate/deactivate logging
>>  *    Configure::write('log', true);
>>  *
>>  *  Integer: Use built-in PHP constants to set the error level (see
>> error_reporting)
>>  *    Configure::write('log', E_ERROR | E_WARNING);
>>  *    Configure::write('log', E_ALL ^ E_NOTICE);
>>  */
>>         Configure::write('log', true);
>>
>> On Sep 10, 9:30 am, Joshua Muheim  wrote:
>>
>>
>>
>>
>>
>>
>>
>> > as mentioned above i use
>>
>> > define('LOG_ERROR', 2);
>>
>> > On Fri, Sep 10, 2010 at 3:11 PM, Andy Dirnberger
>>
>> >  wrote:
>> > > What are you using for the log setting in core.php?
>>
>> > > On Sep 10, 7:52 am, psybear83  wrote:
>> > >> Hi everybody
>>
>> > >> From Ruby On Rails I'm used that while developing my log files are
>> > >> full of informations about what pages were rendered etc.
>>
>> > >> In CakePHP I'm missing this - I don't even seem to have a log file in
>> > >> my app/tmp/logs directory? Is this normal? I have set
>>
>> > >> define('LOG_ERROR', 2);
>>
>> > >> is this OK? Am I missing anything else?
>>
>> > >> Thanks a lot
>> > >> Josh
>>
>> > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp 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 cake-php@googlegroups.com
>> > > To unsubscribe from this group, send email to
>> > > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
>> > > athttp://groups.google.com/group/cake-php?hl=en
>
> 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 cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en
>

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Cake can't connect to DB but only shows an error that there's missing a table!

2010-09-13 Thread Joshua Muheim
Right, MySQL on OSX.

On Sat, Sep 11, 2010 at 1:25 AM, francky06l  wrote:
> MySql on Mac probably ?
>
> On Sep 9, 2:13 pm, Joshua Muheim  wrote:
>> OK, at least I now found out what was the problem for CakePHP not
>> being able to connect to MySQL: more coincidentally I found the
>> following link:
>>
>> http://soledadpenades.com/2006/08/06/wrong-location-of-mysqlsock/
>>
>> that states that CakePHP looks in
>>
>> /var/mysql/mysql.sock
>>
>> for the mysql socket, and that normally this one is in
>>
>> /tmp/mysql.sock.
>>
>> So I created a soft link, and now it works. But I am very disappointed
>> with the error messages in CakePHP...
>>
>> On Thu, Sep 9, 2010 at 2:00 PM, psybear83  wrote:
>> > Hi everybody
>>
>> > I have overtaken a CakePHP application that I have to optimize now. I
>> > have installed it on my computer, but I could't get it to run properly
>> > yet.
>>
>> > It tells me that " Database table acos for model Aco was not found.",
>> > but the real problem is, that it can't connect to the DB! Somehow it
>> > doesn't complain about that, but as soon as there's a table needed, it
>> > notices that there isn't any.
>>
>> > I guess this is quite unclean, IMHO it should complain that it can't
>> > connect to the DB.
>>
>> > Is this normal?
>>
>> > Thanks for help
>> > Josh
>>
>> > Check out the new CakePHP Questions sitehttp://cakeqs.organd 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 cake-php@googlegroups.com
>> > To unsubscribe from this group, send email to
>> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
>> > athttp://groups.google.com/group/cake-php?hl=en
>
> 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 cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en
>

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Folder structure: why are there so many webroot or vendors folders?

2010-09-13 Thread Joshua Muheim
Thanks for the information!

On Fri, Sep 10, 2010 at 7:12 PM, Miles J  wrote:
> Vendors within an app are specific to that app.
> Vendors outside of the app apply to all apps.
>
> The same goes for plugins.
>
> On Sep 10, 3:49 am, euromark  wrote:
>> what are the advantages of an apartment-sharing community? :)
>> well same goes for apps and their cake and vendors folders
>>
>> On 10 Sep., 11:25, Joshua Muheim  wrote:
>>
>> > *thinking*... didn't help ;-)
>>
>> > On Fri, Sep 10, 2010 at 11:03 AM, AD7six  wrote:
>>
>> > > On Sep 10, 10:42 am, psybear83  wrote:
>> > >> Oh, my fault, there's only a webroot folder under app!
>>
>> > >> But still, what about the two vendors folders? :-)
>>
>> > > Build 2 apps (root/app, root/app2, root/cake) and think about it ;)
>>
>> > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp 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 cake-php@googlegroups.com
>> > > To unsubscribe from this group, send email to
>> > > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
>> > > athttp://groups.google.com/group/cake-php?hl=en
>
> 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 cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en
>

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: possible to create fixtures to be used in every test case?

2010-09-13 Thread j.blotus
lazy loading sounds good, i will have to give that a look

On Sep 13, 11:52 pm, nurvzy  wrote:
> If you use lazy_loading you can get past this, only unit test what
> each model will actually use, instead of having to load all fixtures
> for each because of the default model chaining behavior required for
> PHP4 support.
>
> An alternative I've found useful prior to lazy_loading was creating a
> BaseCase that extends CakeTestCase and loads all your fixtures in
> there.  Then simply extend your BaseCase when doing model testing,
> easy as pie.
>
> class BaseCase extends CakeTestCase{
>   var $fixtures = array(
>     //..fixtures here
>   );
>
> }
>
> Then with any new test I would just make sure to require BaseCase and
> extend it.
> require_once(dirname(__FILE__) . 'base_case.php');
>
> class ModelTestCase extends BaseCase {
>   //Tests go here.
>
> }
>
> But this was all prior to lazy_loading.   If you use lazy_loading
> (http://github.com/Phally/lazy_model) you can just use what table your
> model test will actually use ignoring the rest, a much more efficient
> approach to testing.
>
> Hope that helps,
> Nick
>
> On Sep 13, 1:32 pm, "j.blotus"  wrote:
>
>
>
> > When I am testing a model, every time I create a new model in my
> > application, I have to add it in to my $fixtures array for each test
> > case, or I get missing table errors when testing.
>
> > Is it possible to define $fixtures in just one spot?
>
> > maybe app_cake_test_case or something like that?
>
> > This can become a big problem the more tests I write.
>
> > My current array =
>
> > var $fixtures = array(
> >         'app.booking',
> >         'app.listing',
> >         'app.instant_payment_notification',
> >         'app.transaction',
> >         'app.package',
> >         'app.promo_code',
> >         'app.note',
> >         'app.inquiry',
> >         'app.event',
> >         'app.event_type',
> >         'app.publisher',
> >         'app.report',
> >         'app.country',
> >         'app.state',
> >         'app.region',
> >         'app.city',
> >         'app.user',
> >         'app.review',
> >         'app.image',
> >         'app.deal',
> >         'app.visit'
> >     );

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Returning routed controller and action

2010-09-13 Thread Dr. Loboto
If I understand your needs you may use $this->params of controller.

pr($this->params); // when accessed as /users/register
Array
(
[pass] => Array
(
)

[named] => Array
(
)

[controller] => users
[action] => register
[plugin] =>
[url] => Array
(
[ext] => html
[url] => users/register
)

[form] => Array
(
)

[isAjax] =>
)

pr($this->params); // when accessed by route as /signon
Array
(
[pass] => Array
(
)

[named] => Array
(
)

[plugin] =>
[controller] => users
[action] => register
[url] => Array
(
[ext] => html
[url] => signon
)

[form] => Array
(
)

[isAjax] =>
)

On Sep 13, 9:10 pm, Greg Skerman  wrote:
> Hi,
>
> I'm building an auth system simillar to authake, which matches the current
> URL to a regular expression to determine if access allowed or not.
>
> For simplicities sake I need it to be routes aware, i.e. if controller
> "pages" and action "view" and parameter "home" routes to /page/home i need
> /page/* to be accepted by my authentication system rather than the full
> controller/action/parameter. This will be especially useful with site admin
> as I can allow /admin/* for all admin actions, instead of having to have
> /controller/admin_* defined for each controller being used.
>
> Is there a way to pass the URL and return the controller and view it routes
> to? if so can somebody point me in the right direction?
>
> Hope this makes sense :S

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Application Design Advice Needed

2010-09-13 Thread Dr. Loboto
One "users" table with basic info needed for authentication and common
for both types of users, plus separate "profile" tables as needed. If
all admins info fit "users" table you need only "coaches" table with
their additional data.

On Sep 13, 7:01 pm, veganista  wrote:
> Hello Folks,
>
> I'm looking for some advice on application design.
>
> My application has a couple of types of users. Admins and Coaches, now
> for my admins i only need very basic info (username, email, password)
> but for my coaches i require a much more in depth information that i
> can use on their profiles.
>
> My idea was to have a users table that i use with the auth component
> and have a profile table that will be linked to a user.
>
> I'm not sure if this is the best way to go about it or not. Should i
> really have 2 tables, one for admins and one for coaches?
>
> Can someone help? Thanks

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Bootstrapping in 1.3

2010-09-13 Thread Dr. Loboto
For such installation you must provide more precise paths to
App::build:

App::build(
array (
'controllers' => array (
CONTROLLERS,
CAKE_CORE_INCLUDE_PATH.DS.'shares'.DS.'controllers'.DS,
),
)
);

And yes, Cake 1.2 have different behavior and place "local" path
always first in line (and it seems much more reasonable for me
personally).

On Sep 13, 9:20 pm, Corie  wrote:
> The bootstrap in 1.3 doesn't seem to function like it did in 1.2,
> where I could use a shared directory to use controllers, models, etc.
> when the local app/ one was not available. Now when I use the same
> method, the shared file is always used, regardless of the existence of
> the local one.
>
> Here's what I have in boostrap.php:
>
> App::build(array(
>         'controllers' => array(CAKE_CORE_INCLUDE_PATH . DS . 'shares' . DS .
> 'controllers' . DS)
> ));
>
> I used pages_controller.php to test. The /shares/controllers/
> pages_controller.php is always used even if /app/controllers/
> pages_controller.php exists. I also tried adding /app/controllers/ to
> the controllers array first and second and got the same result.
>
> Bootstrapping still works to pull in extra files, but has it really
> lost this great feature?
>
> -Corie

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Fatal Error::

2010-09-13 Thread Dr. Loboto
Just do not pass strings as $options parameter. It must be array.

On Sep 14, 6:55 am, "Dave Maharaj"  wrote:
> Server info says PHP 5.2
>
> My guess is it was something I did and forgot to check after a change. But
> it's all working fine now.
> Not sure why the HTML helper threw an error since its never ever touched.

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: possible to create fixtures to be used in every test case?

2010-09-13 Thread nurvzy
If you use lazy_loading you can get past this, only unit test what
each model will actually use, instead of having to load all fixtures
for each because of the default model chaining behavior required for
PHP4 support.

An alternative I've found useful prior to lazy_loading was creating a
BaseCase that extends CakeTestCase and loads all your fixtures in
there.  Then simply extend your BaseCase when doing model testing,
easy as pie.

class BaseCase extends CakeTestCase{
  var $fixtures = array(
//..fixtures here
  );
}

Then with any new test I would just make sure to require BaseCase and
extend it.
require_once(dirname(__FILE__) . 'base_case.php');

class ModelTestCase extends BaseCase {
  //Tests go here.
}


But this was all prior to lazy_loading.   If you use lazy_loading
(http://github.com/Phally/lazy_model) you can just use what table your
model test will actually use ignoring the rest, a much more efficient
approach to testing.

Hope that helps,
Nick

On Sep 13, 1:32 pm, "j.blotus"  wrote:
> When I am testing a model, every time I create a new model in my
> application, I have to add it in to my $fixtures array for each test
> case, or I get missing table errors when testing.
>
> Is it possible to define $fixtures in just one spot?
>
> maybe app_cake_test_case or something like that?
>
> This can become a big problem the more tests I write.
>
> My current array =
>
> var $fixtures = array(
>         'app.booking',
>         'app.listing',
>         'app.instant_payment_notification',
>         'app.transaction',
>         'app.package',
>         'app.promo_code',
>         'app.note',
>         'app.inquiry',
>         'app.event',
>         'app.event_type',
>         'app.publisher',
>         'app.report',
>         'app.country',
>         'app.state',
>         'app.region',
>         'app.city',
>         'app.user',
>         'app.review',
>         'app.image',
>         'app.deal',
>         'app.visit'
>     );

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


URL Validation

2010-09-13 Thread Dave Maharaj
Anyone know how to strip everything from a url so your left with
http://www.site.com ?

So if user enters http://www.site.com/something or www.site.com/anything 

 

So basically remove everything after the domain extension and add http: to
the www if it was left out.

 

Thanks,

 

Dave

 

 

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: possible to create fixtures to be used in every test case?

2010-09-13 Thread euromark
tell me about it :)
i stopped model testing because of this


On 14 Sep., 02:08, "j.blotus"  wrote:
> not only annoying, but does not scale. any tests will break if you add
> a new related model to one that already has test cases.
>
> maybe have all tests extend a custom TestCase class (which extends
> CakeTestCase), that should work and that way they should pick up the
> inheritance
>
> On Sep 13, 5:32 pm, euromark  wrote:
>
>
>
> > i know exactly what you mean :)
> > its really annoying to need to declare like all possibly related
> > fixtures
>
> > maybe some shell script that creates a class you could use?
> > or a function which outputs all possible ones and can be assigned to
> > $fixtures?
>
> > On 13 Sep., 21:32, "j.blotus"  wrote:
>
> > > When I am testing a model, every time I create a new model in my
> > > application, I have to add it in to my $fixtures array for each test
> > > case, or I get missing table errors when testing.
>
> > > Is it possible to define $fixtures in just one spot?
>
> > > maybe app_cake_test_case or something like that?
>
> > > This can become a big problem the more tests I write.
>
> > > My current array =
>
> > > var $fixtures = array(
> > >         'app.booking',
> > >         'app.listing',
> > >         'app.instant_payment_notification',
> > >         'app.transaction',
> > >         'app.package',
> > >         'app.promo_code',
> > >         'app.note',
> > >         'app.inquiry',
> > >         'app.event',
> > >         'app.event_type',
> > >         'app.publisher',
> > >         'app.report',
> > >         'app.country',
> > >         'app.state',
> > >         'app.region',
> > >         'app.city',
> > >         'app.user',
> > >         'app.review',
> > >         'app.image',
> > >         'app.deal',
> > >         'app.visit'
> > >     );

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: possible to create fixtures to be used in every test case?

2010-09-13 Thread j.blotus
not only annoying, but does not scale. any tests will break if you add
a new related model to one that already has test cases.

maybe have all tests extend a custom TestCase class (which extends
CakeTestCase), that should work and that way they should pick up the
inheritance

On Sep 13, 5:32 pm, euromark  wrote:
> i know exactly what you mean :)
> its really annoying to need to declare like all possibly related
> fixtures
>
> maybe some shell script that creates a class you could use?
> or a function which outputs all possible ones and can be assigned to
> $fixtures?
>
> On 13 Sep., 21:32, "j.blotus"  wrote:
>
>
>
> > When I am testing a model, every time I create a new model in my
> > application, I have to add it in to my $fixtures array for each test
> > case, or I get missing table errors when testing.
>
> > Is it possible to define $fixtures in just one spot?
>
> > maybe app_cake_test_case or something like that?
>
> > This can become a big problem the more tests I write.
>
> > My current array =
>
> > var $fixtures = array(
> >         'app.booking',
> >         'app.listing',
> >         'app.instant_payment_notification',
> >         'app.transaction',
> >         'app.package',
> >         'app.promo_code',
> >         'app.note',
> >         'app.inquiry',
> >         'app.event',
> >         'app.event_type',
> >         'app.publisher',
> >         'app.report',
> >         'app.country',
> >         'app.state',
> >         'app.region',
> >         'app.city',
> >         'app.user',
> >         'app.review',
> >         'app.image',
> >         'app.deal',
> >         'app.visit'
> >     );

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


RE: Fatal Error::

2010-09-13 Thread Dave Maharaj
Server info says PHP 5.2

My guess is it was something I did and forgot to check after a change. But
it's all working fine now. 
Not sure why the HTML helper threw an error since its never ever touched.



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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Fatal Error::

2010-09-13 Thread Miles J
That's weird. What version of PHP are you running?

On Sep 13, 12:06 pm, "Dave Maharaj"  wrote:
> No luck.
> I just went to my backup copy from last night. Easier  :)
>
> Thanks.

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: possible to create fixtures to be used in every test case?

2010-09-13 Thread euromark
i know exactly what you mean :)
its really annoying to need to declare like all possibly related
fixtures

maybe some shell script that creates a class you could use?
or a function which outputs all possible ones and can be assigned to
$fixtures?


On 13 Sep., 21:32, "j.blotus"  wrote:
> When I am testing a model, every time I create a new model in my
> application, I have to add it in to my $fixtures array for each test
> case, or I get missing table errors when testing.
>
> Is it possible to define $fixtures in just one spot?
>
> maybe app_cake_test_case or something like that?
>
> This can become a big problem the more tests I write.
>
> My current array =
>
> var $fixtures = array(
>         'app.booking',
>         'app.listing',
>         'app.instant_payment_notification',
>         'app.transaction',
>         'app.package',
>         'app.promo_code',
>         'app.note',
>         'app.inquiry',
>         'app.event',
>         'app.event_type',
>         'app.publisher',
>         'app.report',
>         'app.country',
>         'app.state',
>         'app.region',
>         'app.city',
>         'app.user',
>         'app.review',
>         'app.image',
>         'app.deal',
>         'app.visit'
>     );

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Bootstrapping in 1.3

2010-09-13 Thread Corie
In my server environment there are several sites. Most don't need much
customization and use the same shared controller. But some do need
customization and so I make a local copy of the controller and make
the modifications. I need the bootstrap to load the local file if it
exists, otherwise load the shared file.

-Corie

On Sep 13, 1:10 pm, Miles J  wrote:
> Enlighten me, but why would you need a shared and local version of the
> same controller? It should be one or the other.
>
> On Sep 13, 7:20 am, Corie  wrote:
>
> > The bootstrap in 1.3 doesn't seem to function like it did in 1.2,
> > where I could use a shared directory to use controllers, models, etc.
> > when the local app/ one was not available. Now when I use the same
> > method, the shared file is always used, regardless of the existence of
> > the local one.
>
> > Here's what I have in boostrap.php:
>
> > App::build(array(
> >         'controllers' => array(CAKE_CORE_INCLUDE_PATH . DS . 'shares' . DS .
> > 'controllers' . DS)
> > ));
>
> > I used pages_controller.php to test. The /shares/controllers/
> > pages_controller.php is always used even if /app/controllers/
> > pages_controller.php exists. I also tried adding /app/controllers/ to
> > the controllers array first and second and got the same result.
>
> > Bootstrapping still works to pull in extra files, but has it really
> > lost this great feature?
>
> > -Corie

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


possible to create fixtures to be used in every test case?

2010-09-13 Thread j.blotus
When I am testing a model, every time I create a new model in my
application, I have to add it in to my $fixtures array for each test
case, or I get missing table errors when testing.

Is it possible to define $fixtures in just one spot?

maybe app_cake_test_case or something like that?

This can become a big problem the more tests I write.

My current array =

var $fixtures = array(
'app.booking',
'app.listing',
'app.instant_payment_notification',
'app.transaction',
'app.package',
'app.promo_code',
'app.note',
'app.inquiry',
'app.event',
'app.event_type',
'app.publisher',
'app.report',
'app.country',
'app.state',
'app.region',
'app.city',
'app.user',
'app.review',
'app.image',
'app.deal',
'app.visit'
);

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Routing with prefixes not working

2010-09-13 Thread Felix Fennell
Hi, sorry for the late reply.

The rules together seem to do the trick, everything works as I expect,
thanks for your help.

Felix

On 10 September 2010 18:49, cricket  wrote:
> On Fri, Sep 10, 2010 at 3:55 AM, Felix  wrote:
>> Hi - just a quick question,
>>
>> I have a controller called terms with two normal actions (index, view)
>> and four prefixed actions (protected_index, protected_add,
>> protected_edit, protected_delete). However I want to use a alias
>> (glossary) so if I visit 'example.com/glossary' cake goes to
>> 'example.com/terms/index' and if I go to 'example.com/protected/
>> glossary/add' cake goes to 'example.com/protected/terms/add'.
>>
>> This seems quite simple, I found this in the cook book:
>>
>> Router::connect(
>>    '/cooks/:action/*', array('controller' => 'users', 'action' =>
>> 'index')
>> );
>>
>> Where 'cooks' is an alias for the 'users' controller. So I tried to
>> use:
>>
>> Router::connect('/glossary/:action/*', array('controller' => 'terms',
>> 'action' => 'index'));
>>
>> But two things don't work:
>>
>> 1 - if I go to 'example.com/glossary' I get a missing controller
>> error. (I thought it would go to 'example.com/terms/index'.
>
> Because that route expects an action, which you didn't provide. But,
> as you want any action to go to index, you can do:
>
> '/glossary/*',
> array('controller' => 'terms', 'action' => 'index')
>
> 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 cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en
>

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Current players of club: Paginate problems

2010-09-13 Thread DerBjörn
Hi,

i want to show all current players of a club, but i have problems to
show them with the paginator. By the way i am not so sure about my way
of coding here:

First of all i have 2 HABTM assoziations in my club model:

var $hasAndBelongsToMany = array(
'CurrentPlayers' => array(
'className' => 'Player',
'joinTable' => 'clubs_players',
'foreignKey' => 'club_id',
'associationForeignKey' => 'player_id',
'unique' => true,
'conditions' => 'start_datetime <= CURRENT_TIMESTAMP AND
end_datetime > CURRENT_TIMESTAMP',
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
'finderQuery' => '',
'deleteQuery' => '',
'insertQuery' => ''
),
'AllPlayers' => array(
'className' => 'Player',
'joinTable' => 'clubs_players',
'foreignKey' => 'club_id',
'associationForeignKey' => 'player_id',
'unique' => true,
'conditions' => '',
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
'finderQuery' => '',
'deleteQuery' => '',
'insertQuery' => ''
),
);

1.) I am not so sure about if it really makes sense to work with two
assoziation here and not only with 'AllPlayers' and use then in the
find()-method a filter for the start- and end-datetimes... What do you
think?

My controller method for players looks like:

function index($club_id = null, $country_id = null, $state_id = null,
$city_id = null) {

$paginate = array();

if($club_id>0){
$this->Club = ClassRegistry::init('Club');
$this->Club->recursive = 1;
$club = $this->Club->find('first', array('conditions' =>
array('Club.id' => $club_id)));
$paginate = $club['CurrentPlayers'];
echo pr($paginate);
}
elseif($city_id>0){
$paginate = array('Player.city_id' => $city_id);
}
elseif($state_id>0){
$paginate = array('Player.state_id' => $state_id);
}
elseif($country_id>0){
$paginate = array('Player.country_id' => $country_id);
}

$players = $this->paginate('Player', $paginate);

$this->set('players', $players);
}

2.) Do i really have to work with ClassRegistry::init() or how do i
access to the club?
I am getting following error with paginate:
"SQL Error: 1052: Column 'id' in where clause is ambiguous"

Unfortunately i cannot work with something like

elseif($club_id>0){
$paginate = array('Club.id' => $club_id);
}

cause Club or ClubPlayers is unknown in the query or how i make it
known for Player properly?

Thanks for any help :)

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


RE: Fatal Error::

2010-09-13 Thread Dave Maharaj
No luck. 
I just went to my backup copy from last night. Easier  :)

Thanks.

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: ACL and permissions arent working properly

2010-09-13 Thread Rob
I'm gonna go ahead and bump this because I'm desperate and now
slightly crazier than when I started this thread.

-Rob

On Sep 7, 12:51 am, Rob  wrote:
> Im still struggling with this, today I tried doing some testing by
> using Acl->check
>
> When I ran this to see
> e($this->Acl->check('admin', 'Campaigns'));
> it returned 1, which was correct, but when I checked any other group
> e($this->Acl->check('mod', 'Campaigns'));
> e($this->Acl->check('clients', 'Campaigns'));
> nothing was returned, no errors, no value, and nothing in the log,
> just a blank screen.  I don't understand what this means though.
>
> On Sep 2, 1:30 pm, Rob  wrote:
>
> > Nope, just regular id's
>
> > On Sep 2, 12:18 pm, Anthony  wrote:
>
> > > Are you useing UUID keys for the users or groups id?  If so you need
> > > to modify one of the three tables but I don't know which off the top
> > > of my head.
>
> > > On Sep 1, 2:27 pm, Rob  wrote:
>
> > > > Yes, that's it.
>
> > > > Just a quick update, I rebuilt my ACO table and aco_aro table seeing
> > > > if I might have fouled something up when tinkering around, but it
> > > > still has the same results.
> > > > Auth seems to work just fine, users are required to login on pages
> > > > where they should have to, and I can get things like user group and
> > > > user id from $this->Auth->user
> > > > I don't understand what could have gone wrong with acl though.
>
> > > > -Rob
>
> > > > On Sep 1, 12:10 pm, Anthony  wrote:
>
> > > > > If you followed the Auth and ACL examples from the handbook hes
> > > > > referring to the build_acl action.
>
> > > > >http://book.cakephp.org/view/1549/An-Automated-tool-for-creating-ACOs
>
> > > > > On Sep 1, 10:54 am, Rob  wrote:
>
> > > > > > Hey,
> > > > > > This is my AppController
>
> > > > > > class AppController extends Controller{
> > > > > >         var $components = array('Acl', 'Auth', 'Session');
> > > > > >         function beforeFilter(){
> > > > > >                 $this->Auth->Authorize = 'actions';
> > > > > >                 $this->Auth->loginAction = array('controller' => 
> > > > > > 'users', 'action'
> > > > > > => 'login');
> > > > > >                 $this->Auth->logoutRedirect = array('controller' => 
> > > > > > 'users',
> > > > > > 'action' => 'login');
> > > > > >                 $this->Auth->loginRedirect = array('controller' => 
> > > > > > 'cps', 'action'
> > > > > > => 'panel');
> > > > > >                 $this->Auth->actionPath = 'controllers/';
> > > > > >                 $this->Auth->allowedActions = array('display');
> > > > > >         }
>
> > > > > > }
>
> > > > > > and I don't have an initACL function, it wasn't mentioned at all in
> > > > > > the tutorial I followed...I have initDB where I set allow and deny, 
> > > > > > is
> > > > > > that similar?
>
> > > > > >         function initDB(){
> > > > > >                 $group =& $this->User->Group;
>
> > > > > >                 $group->id = 2;
> > > > > >                 $this->Acl->deny($group, 'controllers');
>
> > > > > >                 $group->id = 3;
> > > > > >                 $this->Acl->deny($group, 'controllers');
> > > > > >                 $this->Acl->allow($group, 
> > > > > > 'controllers/Campaigns/add');
> > > > > >                 $this->Acl->allow($group, 
> > > > > > 'controllers/Campaigns/index');
> > > > > >                 $this->Acl->allow($group, 'controllers/Ads/view');
> > > > > >                 $this->Acl->allow($group, 'controllers/Users/view');
> > > > > >                 $this->Acl->allow($group, 'controllers/Cps/panel');
> > > > > >                 $this->Acl->allow($group, 'controllers/Pages');
>
> > > > > >                 echo "done";
> > > > > >                 exit;
>
> > > > > >         }
>
> > > > > > On Sep 1, 2:39 am, "gome$"  wrote:
>
> > > > > > > hi,
> > > > > > > It won't affect auth permanently.
> > > > > > > Show me your AppControler source code and initACL function.

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Fatal Error::

2010-09-13 Thread Miles J
Try changing to this and see if you get the same error:

$options = $options + array('inline' => true);

On Sep 13, 10:16 am, "Dave Maharaj"  wrote:
> All of a sudden I am getting a
>
> Fatal error: Unsupported operand types in
> /1.3.4/cake/libs/view/helpers/html.php on line 337
>
> Which that line is : $options += array('inline' => true);
>
> Not sure where or why now this is showing. Any ideas? Debug 0, 1 ,2 shows
> nothing different only the error.
>
> Thanks
>
> Dave

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Fatal Error::

2010-09-13 Thread Dave Maharaj
All of a sudden I am getting a 

Fatal error: Unsupported operand types in
/1.3.4/cake/libs/view/helpers/html.php on line 337

 

Which that line is : $options += array('inline' => true);

 

Not sure where or why now this is showing. Any ideas? Debug 0, 1 ,2 shows
nothing different only the error.

 

Thanks

 

Dave

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Bootstrapping in 1.3

2010-09-13 Thread Miles J
Enlighten me, but why would you need a shared and local version of the
same controller? It should be one or the other.

On Sep 13, 7:20 am, Corie  wrote:
> The bootstrap in 1.3 doesn't seem to function like it did in 1.2,
> where I could use a shared directory to use controllers, models, etc.
> when the local app/ one was not available. Now when I use the same
> method, the shared file is always used, regardless of the existence of
> the local one.
>
> Here's what I have in boostrap.php:
>
> App::build(array(
>         'controllers' => array(CAKE_CORE_INCLUDE_PATH . DS . 'shares' . DS .
> 'controllers' . DS)
> ));
>
> I used pages_controller.php to test. The /shares/controllers/
> pages_controller.php is always used even if /app/controllers/
> pages_controller.php exists. I also tried adding /app/controllers/ to
> the controllers array first and second and got the same result.
>
> Bootstrapping still works to pull in extra files, but has it really
> lost this great feature?
>
> -Corie

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Advanced Question: Model Behavior

2010-09-13 Thread BrendonKoz
I've written a Model Behavior that automatically encrypts and decrypts
the data of the specified fields set within the behavior's settings
for that model.

For instance: Profile.email
In the database, the data may read something like: $E
$e430d8d661b5cad93e125c5e188d438e5a9e3df3b385ac0e4cd20e2530bf3ee5
When viewed via the website under the baked Profile controller without
any extra work (other than the behavior, by default) it would read:
em...@example.com

The problem I'm having is that I'd like it to be encrypted in the
database for security concerns. Unfortunately, it seems that a Model's
behavior is only called when referring specifically to that model.
When querying related models from their respective controller and
requesting that data in a custom query (using Cake's find), the data
is not decrypted, it remains encrypted. It seems as if the related
model's behaviors are not activated.

Is there a way to circumvent or solve this issue?

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Application Design Advice Needed

2010-09-13 Thread veganista
Hello Folks,

I'm looking for some advice on application design.

My application has a couple of types of users. Admins and Coaches, now
for my admins i only need very basic info (username, email, password)
but for my coaches i require a much more in depth information that i
can use on their profiles.

My idea was to have a users table that i use with the auth component
and have a profile table that will be linked to a user.

I'm not sure if this is the best way to go about it or not. Should i
really have 2 tables, one for admins and one for coaches?

Can someone help? Thanks

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


JsHelper - Quotes issues

2010-09-13 Thread Daniel M. Ivasse
Hi

I have two issues on JsHelper.
Could someone help me, please?

1) The key "data" in $options parameter of "request" function outputs
a javascript code between quotes. So when I use something like data =>
$js->get("#myForm")->
serializeForm() it doesn't work. In "submit" function the data
parameter is right, but it also happens in "link" function. Is there
any mistake in my use?


Example:

This code:

echo $js->submit( "Submit button", array( "url" => "/controller1/
action1", "update" => "#myDiv" ) );

Results in this javascript code:

$("#submit-709077").bind("click", function (event) {$.ajax({data:$
("#submit-709077").closest("form").serialize() ...

While these:

echo $js->link( "my link", "/controller1/action1", "update" =>
"#myDiv", "data" => $js->serializeForm( array( "isForm" => true,
"inline" => true ) ) );
echo $js->request( "/controller1/action1", array( "update" =>
"#myDiv", "data" => $js->serializeForm() ) );

Result in these:

... $.ajax( {data:"$(\"#myForm\").serialize()" }
... $.ajax({data:$("#link-709077").closest("form").serialize() ...



2) Strings in javascript code are always written between double quotes
as the html tag attributes. When something like this "'onclick' => $js-
>request..." is used in a htmlAttributes array, the quotes remain
unpaired. Is there any configuration to use single quotes instead of
double quotes?



Thanks!

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Scaffold: when doing tests with SimpleTest it directs to index (instead of view)!

2010-09-13 Thread psybear83
Hey everybody

I have a weird problem...

I have a scaffold, and as we all know, after creating or editing a
scaffolded model one is directed to the object's view action. So far,
so good.

But I'm experiencing now, that when doing web tests using SimpleTest,
I am directed to the home page of my website! E.g. i'm directed to
myapp.localhost instead of myapp.localhost/people/view/123!

Has anybody an idea, what could be the problem?

Thanks Josh

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


RE: passing form data to my controller

2010-09-13 Thread Dave Maharaj
I try:)

I missed your earlier posts so explain to me what your trying to do exactly?
Form submit->data to controller-> display what was submitted on the same
page your on?

-Original Message-
From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] 
Sent: September-13-10 1:04 PM
To: CakePHP
Subject: Re: passing form data to my controller

dave...you have no idea how your torturing me. seriously. I am trying
to figure this out for 2 weeks now and its makin me crazy...i've never
been closer to givng up

i will look into your hint, but do you mind helping me with a little
code or specifics?

thx a LOT



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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Mdy date validation fails for Sep instead of Sept

2010-09-13 Thread Imaginextra
I came across the same problem ... The way I found to fix it was to
change line 403 in cake>libs>model>validation.php (Cakephp 1.3.4)
from

$regex['Mdy'] = '/^(?:(((Jan(uary)?|Ma(r(ch)?|y)|Jul(y)?|Aug(ust)?|
Oct(ober)?|Dec(ember)?)\\ 31)|((Jan(uary)?|Ma(r(ch)?|y)|Apr(il)?|
Ju((ly?)|(ne?))|Aug(ust)?|Oct(ober)?|(Sept|Nov|Dec)(ember)?)\\ (0?
[1-9]|([12]\\d)|30))|(Feb(ruary)?\\ (0?[1-9]|1\\d|2[0-8]|(29(?=,?\\
((1[6-9]|[2-9]\\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|
[3579][26])00)))\\,?\\ ((1[6-9]|[2-9]\\d)\\d{2}))$/';

to

$regex['Mdy'] = '/^(?:(((Jan(uary)?|Ma(r(ch)?|y)|Jul(y)?|Aug(ust)?|
Oct(ober)?|Dec(ember)?)\\ 31)|((Jan(uary)?|Ma(r(ch)?|y)|Apr(il)?|
Ju((ly?)|(ne?))|Aug(ust)?|Oct(ober)?|Sep(tember)?|(Nov|Dec)(ember)?)\\
(0?[1-9]|([12]\\d)|30))|(Feb(ruary)?\\ (0?[1-9]|1\\d|2[0-8]|(29(?=,?\\
((1[6-9]|[2-9]\\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|
[3579][26])00)))\\,?\\ ((1[6-9]|[2-9]\\d)\\d{2}))$/';

not recommended to mess with the core but it works.


On Aug 4, 5:03 pm, Brenda  wrote:
> I have event_date in my model, with this validation rule:
>
>         'event_date' => array(
>             'rule' => array(
>                 'date', array('Mdy')
>             ),
>             'required' => true,
>             'allowEmpty' => false,
>             'message' => 'Please enter a valid date.'
>         )
>
> Entering Sept 1, 2010 validates, but Sep 1, 2010 does not. Is that
> correct behavior?
>
> Thank you.

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: passing form data to my controller

2010-09-13 Thread Tomfox Wiranata
dave...you have no idea how your torturing me. seriously. I am trying
to figure this out for 2 weeks now and its makin me crazy...i've never
been closer to givng up

i will look into your hint, but do you mind helping me with a little
code or specifics?

thx a LOT



On 13 Sep., 15:44, "Dave Maharaj"  wrote:
> Well when you type in a field and you check say the username field in real
> time using ajax to make sure it is unique your sending form data to the
> controller. Sometimes you just have to figure it out on your own and forget
> the helpers. Trust me it can be done to pass the form  data to the
> controller when you "submit a form using ajax" <-hint  google it
>
> -Original Message-
> From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com]
> Sent: September-13-10 5:56 AM
> To: CakePHP
> Subject: Re: passing form data to my controller
>
> well I used jquery before to just reload that DIV after a file got
> uploaded and it worked fine. In the end I just needed to render the
> result.
> but when I added an ajax link in that rendered view to delete a file,
> It didnt work. AJAX just would not work. as soon as I abandoned jquery
> and just used AJAX->link it worked and I just had to make the file
> upload work with AJAX too.
>
> this seems hopeless.??
>
> On 13 Sep., 10:15, Tomfox Wiranata  wrote:
> > so there is no way to pass the file data from my form to my controller
> > function???
> > because the controller function actually uploads the file, it just
> > needs the data
>
> > that would suck...
>
> > On 13 Sep., 02:00, cricket  wrote:
>
> > > Files cannot be upload with AJAX. The only way to do it without
> > > reloading the page is to set the target of the form to a hidden
> > > iframe, then fetch the response from there.
>
> > > On Sun, Sep 12, 2010 at 11:26 AM, Tomfox Wiranata
>
> > >  wrote:
> > > > Hi everyone,
>
> > > > I use a form to upload files and currently i do this with jquery to
> > > > simulate ajax, so if I want to pass the file data to my jquery
> > > > function I do this:
>
> > > >  > > > type="button">Upload
>
> > > > But I want to switch to AJAX and I dont know how to pass the form data
> > > > within an ajax link:
>
> > > > echo $form->create('Links',
>
> array('name'=>'uploadAttachmentsForm','id'=>'uploadAttachmentsForm','type'=>
> 'file'));
> > > > echo $form->file('Links');
>
> > > > echo $ajax->link('Upload', '/links/processattachment'.this.form,
> > > >                                 array('update' =>
> 'attachments_content')
> > > >                                );
> > > > echo $form->end();
>
> > > > aware that "$ajax->link('Upload', '/links/
> > > > processattachment'.this.form," is far away from right I stil gave it a
> > > > shot.
>
> > > > Can someone help me? Thank you. I appreciate it.
>
> > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp
> 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 cake-php@googlegroups.com
> > > > To unsubscribe from this group, send email to
> > > > cake-php+unsubscr...@googlegroups.com For more options, visit this
> group athttp://groups.google.com/group/cake-php?hl=en
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd 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 cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Bootstrapping in 1.3

2010-09-13 Thread Corie
The bootstrap in 1.3 doesn't seem to function like it did in 1.2,
where I could use a shared directory to use controllers, models, etc.
when the local app/ one was not available. Now when I use the same
method, the shared file is always used, regardless of the existence of
the local one.

Here's what I have in boostrap.php:

App::build(array(
'controllers' => array(CAKE_CORE_INCLUDE_PATH . DS . 'shares' . DS .
'controllers' . DS)
));

I used pages_controller.php to test. The /shares/controllers/
pages_controller.php is always used even if /app/controllers/
pages_controller.php exists. I also tried adding /app/controllers/ to
the controllers array first and second and got the same result.

Bootstrapping still works to pull in extra files, but has it really
lost this great feature?

-Corie

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Returning routed controller and action

2010-09-13 Thread Greg Skerman
Hi,

I'm building an auth system simillar to authake, which matches the current
URL to a regular expression to determine if access allowed or not.

For simplicities sake I need it to be routes aware, i.e. if controller
"pages" and action "view" and parameter "home" routes to /page/home i need
/page/* to be accepted by my authentication system rather than the full
controller/action/parameter. This will be especially useful with site admin
as I can allow /admin/* for all admin actions, instead of having to have
/controller/admin_* defined for each controller being used.

Is there a way to pass the URL and return the controller and view it routes
to? if so can somebody point me in the right direction?

Hope this makes sense :S

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


RE: passing form data to my controller

2010-09-13 Thread Dave Maharaj
Well when you type in a field and you check say the username field in real
time using ajax to make sure it is unique your sending form data to the
controller. Sometimes you just have to figure it out on your own and forget
the helpers. Trust me it can be done to pass the form  data to the
controller when you "submit a form using ajax" <-hint  google it



-Original Message-
From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] 
Sent: September-13-10 5:56 AM
To: CakePHP
Subject: Re: passing form data to my controller

well I used jquery before to just reload that DIV after a file got
uploaded and it worked fine. In the end I just needed to render the
result.
but when I added an ajax link in that rendered view to delete a file,
It didnt work. AJAX just would not work. as soon as I abandoned jquery
and just used AJAX->link it worked and I just had to make the file
upload work with AJAX too.

this seems hopeless.??

On 13 Sep., 10:15, Tomfox Wiranata  wrote:
> so there is no way to pass the file data from my form to my controller
> function???
> because the controller function actually uploads the file, it just
> needs the data
>
> that would suck...
>
> On 13 Sep., 02:00, cricket  wrote:
>
> > Files cannot be upload with AJAX. The only way to do it without
> > reloading the page is to set the target of the form to a hidden
> > iframe, then fetch the response from there.
>
> > On Sun, Sep 12, 2010 at 11:26 AM, Tomfox Wiranata
>
> >  wrote:
> > > Hi everyone,
>
> > > I use a form to upload files and currently i do this with jquery to
> > > simulate ajax, so if I want to pass the file data to my jquery
> > > function I do this:
>
> > >  > > type="button">Upload
>
> > > But I want to switch to AJAX and I dont know how to pass the form data
> > > within an ajax link:
>
> > > echo $form->create('Links',
> > >
array('name'=>'uploadAttachmentsForm','id'=>'uploadAttachmentsForm','type'=>
'file'));
> > > echo $form->file('Links');
>
> > > echo $ajax->link('Upload', '/links/processattachment'.this.form,
> > >                                 array('update' =>
'attachments_content')
> > >                                );
> > > echo $form->end();
>
> > > aware that "$ajax->link('Upload', '/links/
> > > processattachment'.this.form," is far away from right I stil gave it a
> > > shot.
>
> > > Can someone help me? Thank you. I appreciate it.
>
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp
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 cake-php@googlegroups.com
> > > To unsubscribe from this group, send email to
> > > cake-php+unsubscr...@googlegroups.com For more options, visit this
group athttp://groups.google.com/group/cake-php?hl=en

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Question about Media Plugin of David Persson

2010-09-13 Thread marco.rizze...@gmail.com
I try to resolve this error with this setting in core.php :

Media_Info::config(array(
'document' => array('Document'),
'image' => array('ImageBasic'),
'generic' => array('Generic')
));

But I get this error:

Fatal error: Media_Info_Generic::require_once() [function.require]:
Failed opening required 'c:\.\plugins\media\libs\mm\src\Media\Info/
Adapter/Document.php' in C:\.\plugins\media\libs\mm\src\Media\Info
\Generic.php on line 54

Someone can help me about this?

Thanks
On 30 Ago, 18:25, "marco.rizze...@gmail.com"
 wrote:
> Hi
> I use MediaPlugin of David Persson.
> All works perfectly.
> I have only this question about the use of this plugin
> How can I set the plugin to use .zip file , .7zip file , .rar file
>
> For the moment I get always this error :
>
> Fatal error: Uncaught exception 'Exception' with message 'No adapters
> configured for media name `generic`.' in .Media\Info.php:57
>
> Can someone give me some suggestions?
> Many Thanks
> Marco

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: passing form data to my controller

2010-09-13 Thread Tomfox Wiranata
well I used jquery before to just reload that DIV after a file got
uploaded and it worked fine. In the end I just needed to render the
result.
but when I added an ajax link in that rendered view to delete a file,
It didnt work. AJAX just would not work. as soon as I abandoned jquery
and just used AJAX->link it worked and I just had to make the file
upload work with AJAX too.

this seems hopeless.??

On 13 Sep., 10:15, Tomfox Wiranata  wrote:
> so there is no way to pass the file data from my form to my controller
> function???
> because the controller function actually uploads the file, it just
> needs the data
>
> that would suck...
>
> On 13 Sep., 02:00, cricket  wrote:
>
> > Files cannot be upload with AJAX. The only way to do it without
> > reloading the page is to set the target of the form to a hidden
> > iframe, then fetch the response from there.
>
> > On Sun, Sep 12, 2010 at 11:26 AM, Tomfox Wiranata
>
> >  wrote:
> > > Hi everyone,
>
> > > I use a form to upload files and currently i do this with jquery to
> > > simulate ajax, so if I want to pass the file data to my jquery
> > > function I do this:
>
> > >  > > type="button">Upload
>
> > > But I want to switch to AJAX and I dont know how to pass the form data
> > > within an ajax link:
>
> > > echo $form->create('Links',
> > > array('name'=>'uploadAttachmentsForm','id'=>'uploadAttachmentsForm','type'=>'file'));
> > > echo $form->file('Links');
>
> > > echo $ajax->link('Upload', '/links/processattachment'.this.form,
> > >                                 array('update' => 'attachments_content')
> > >                                );
> > > echo $form->end();
>
> > > aware that "$ajax->link('Upload', '/links/
> > > processattachment'.this.form," is far away from right I stil gave it a
> > > shot.
>
> > > Can someone help me? Thank you. I appreciate it.
>
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp 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 cake-php@googlegroups.com
> > > To unsubscribe from this group, send email to
> > > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > > athttp://groups.google.com/group/cake-php?hl=en

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: passing form data to my controller

2010-09-13 Thread Tomfox Wiranata
so there is no way to pass the file data from my form to my controller
function???
because the controller function actually uploads the file, it just
needs the data

that would suck...

On 13 Sep., 02:00, cricket  wrote:
> Files cannot be upload with AJAX. The only way to do it without
> reloading the page is to set the target of the form to a hidden
> iframe, then fetch the response from there.
>
> On Sun, Sep 12, 2010 at 11:26 AM, Tomfox Wiranata
>
>  wrote:
> > Hi everyone,
>
> > I use a form to upload files and currently i do this with jquery to
> > simulate ajax, so if I want to pass the file data to my jquery
> > function I do this:
>
> >  > type="button">Upload
>
> > But I want to switch to AJAX and I dont know how to pass the form data
> > within an ajax link:
>
> > echo $form->create('Links',
> > array('name'=>'uploadAttachmentsForm','id'=>'uploadAttachmentsForm','type'=>'file'));
> > echo $form->file('Links');
>
> > echo $ajax->link('Upload', '/links/processattachment'.this.form,
> >                                 array('update' => 'attachments_content')
> >                                );
> > echo $form->end();
>
> > aware that "$ajax->link('Upload', '/links/
> > processattachment'.this.form," is far away from right I stil gave it a
> > shot.
>
> > Can someone help me? Thank you. I appreciate it.
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd 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 cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php?hl=en

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: disable/enable form elements dynamically

2010-09-13 Thread Andrei Mita
This is not a CakePHP specific question. Did you try a google search?


On Mon, Sep 13, 2010 at 9:46 AM, Muthuvel Subramani
wrote:

> how to disable/enable form elements dynamically in cakephp
>
> 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 cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en