Re: Responding quickly as a WebService?

2008-05-08 Thread [EMAIL PROTECTED]


You are probably right about that. I am hoping to have to do that a
bit later rather than sooner though. :)
I figured out why my echoes wouldn't flush... It is typical really :)

With autoRender = false I have tried a small test like this:
echo 'Hi there';
flush();
@ob_flush();
sleep(3);
// no more echoes.

When I browsed this action (or curled it) I never saw anything before
the 3 seconds were up. And like I said earlier, I have also added
several other combinations of ob_* and flush calls to the mix with no
change. Then it struck me that I probably needed to echo this instead:

echo Hi there \n; // notice the newline added to the end of the
string.

Now I can see the reply before the 3 seconds begin.

/Martin


On May 7, 4:20 pm, Dardo Sordi Bogado [EMAIL PROTECTED] wrote:
 Well, I think you can put $this-autoRender = false; an do echo but
 the real thing you should consider is implementing some batch
 processing and a queue system if you are planing to grow that big.

 On Wed, May 7, 2008 at 11:02 AM, [EMAIL PROTECTED]

 [EMAIL PROTECTED] wrote:

   I will not know that. but once I know that the contents of the POST
   looks OK I want to reply... anything that happens after that (database
   problem or some other internal error) is my fault and not an issue
   relevant to the external server.

   I just need to sign for the package before opening and examining all
   the contents. If an item is missing the messenger can't do anything
   about that. I still need to call whoever send the package to get that
   corrected. (feeble analogy, I know)

   There is no way I can keep the external server hanging while I
   possible look through 300'000 of rows of data, call other external
   systems or some other time-expensive task. When logs and data grow I
   can see it becoming a real problem very quickly. On day one I know we
   will have to assign these incoming calls to one of 380'000 users
   stored in our MySQL database.

   On May 7, 2:28 pm, dr. Hannibal Lecter [EMAIL PROTECTED] wrote:
    I don't understand. How can you know it's All OK if your processing
    is not done yet??

    On May 7, 12:38 pm, [EMAIL PROTECTED]

    [EMAIL PROTECTED] wrote:
     Hi everyone,

     I am trying to improve the performance of an API I provide to other
     systems. Requests that post data to my application now have to wait
     for my processing to finish (parsing, saving model-data...) before
     they see a simple All OK response.

     Since the processing is governed by the controller I thought that I
     could echo the response and then flush the buffers and never render
     any final view for these actions. But... I can get it to work. I have
     tried many combinations of ob_* calls and flushes, following both old
     code I have used for outputting images and a few examples and hits
     found online and at php.net.

     Maybe flushing is not enough? I am a bit lost here. Has anyone got any
     example to share where they can let the browser (or other script) see
     the results before all processing is complete?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Database wont update fast enough

2008-05-08 Thread laeffe

Since cake uses the MVC pattern which incorporates a Model which in
turn is an abstraction of your data source. So in order to do it by
the MVC pattern and getting closer to the cake way you need to
utilize your models instead.

I would write something like this:

foreach($file_list as $file) {
   //read file contents
   //search to see if record exists
   $user = $this-User-find(*stuffs*);
   $user_id = $user[User][id];

   $tmpData = array(email = $user[User][email]);

   $this-Modeltoinserto-create();
   if(!$this-Modeltoinserto-save($tmpData)) {
  echo QQ;
   }
}

//Laeffe


On 7 Maj, 13:09, Unite [EMAIL PROTECTED] wrote:
 Whats not cakephp except the INSERT INTO. Yes i would use save but i
 was trying everything to see if i can get it to work. And most of it
 isnt the actual code just something i made up so i can illustrate the
 problem.

 How do you stop cake caching the queries?

 On May 7, 1:05 pm, Marcin Domanski [EMAIL PROTECTED] wrote:

foreach($file_list as $file) {
  //read file contents
  //search to see if record exists
 $user_id = $this-User-query(SELECT id FROM users WHERE
emailaddress = '[EMAIL PROTECTED]');
  //if record does not exist write record to db
 $this-User-query(INSERT INTO users (emailaddress) VALUES
('[EMAIL PROTECTED]'));
  //get last record inserted
 $temp = $this-User-query(SELECT last_insert_id());
}

  Are you kidding ? this is not even close to cakephp i would be ashamed
  to show such code on this group.

On the first loop everything works 100%.
On the second loop even though the email address has been inserted and
is in the DB (supposedly) $user_id still returns empty as if nothing
is there. I put in the sleep command to see if maybe php is running
faster than the database is updating but this has no effect. What can
I do to make sure that all query processes have been completed before
it starts the next loop?

  maybe cake is caching the queries ?

  --
  Marcin Domanskihttp://kabturek.info
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Cake best practices for mobile browser development

2008-05-08 Thread David

Hey folks,

I'm very new to Cake and couldn't find this satisfactorily addressed
elsewhere:

I'm developing an application for both mobile and desktop browsers. On
the user end, I'd like this to be seamless, so no /mobile etc. Just
curious as to be best practice for accomplishing this.

First, I'm assuming I should use the the Request Handler's isMobile()
function, and then use beforeRender()  to set the layout to the mobile
version. But what about the actual view? Should I use switches inside
each view? Is it, perhaps, better practice to use render() to change
the view altogether to a separate mobile version?

In addition, just how unreliable is the isMobile() function? Is it
really worthwhile to setup a WURFL-based browser checker as a vendor?

Thanks in advance for your help!

-David
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: find('all') combine problem

2008-05-08 Thread Grant Cox

$teams = $this-Team-find('all', array('fields' =
array('Team.id','Team.firstName','Team.lastName')));
$team_list = Set::combine($teams, '{n}.Team.id', array('%s %s',
'{n}.Team.firstName', '{n}.Team.lastName'));



On May 8, 3:48 pm, jwerd [EMAIL PROTECTED] wrote:
 I always follow the CakePHP standards and the way to utilize the
 automagic part of CakePHP but sometimes I run into a problem where I
 have an existing database and it's just not possible to change the
 structure and thus I have to find a way around it, somehow.

 Picture this:

 3 Tables

 projects
 id
 name
 bla
 bla1
 bla2

 projects_teams
 project_id
 team_id

 teams
 id
 firstName
 lastName
 title

 everything's ok until we get to the teams part, where cake likes to
 automagically use the title column from the table.  I however need it
 to display firstName and lastName within the projects view.

 http://www.nabble.com/How-to-make-findAll()-retrieve-just-some-fields...

 I found this article here, which explains I have to use find('all)
 instead of automagic find('list), and everything is fine with how
 that's done, however, when i get to the point of gluing firstName and
 lastName together I'm stuck for the value of the select I'm stuck.
 Can someone help me?

 $teams = $this-Team-find(all,array('fields' =
 array('Team.id','Team.firstName', 'Team.lastName')));

 $result = Set::combine($subdivisions,
 '{n}.Team.id','{n}.Team.firstName');

 Please help.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: find('all') combine problem

2008-05-08 Thread grigri

Here ya go:

$teams = $this-Team-find('all', array(
  'fields' = array('id', 'firstName', 'lastName'),
  'recursive' = -1
));
$result = Set::combine(
  $teams,
  '{n}.Team.id',
  array('%s %s', '{n}.Team.firstName', '{n}.Team.lastName')
);

See 
http://groups.google.com/group/cake-php/browse_thread/thread/77ce83191ecc7894
for more Set::combine() stuff

On May 8, 6:48 am, jwerd [EMAIL PROTECTED] wrote:
 I always follow the CakePHP standards and the way to utilize the
 automagic part of CakePHP but sometimes I run into a problem where I
 have an existing database and it's just not possible to change the
 structure and thus I have to find a way around it, somehow.

 Picture this:

 3 Tables

 projects
 id
 name
 bla
 bla1
 bla2

 projects_teams
 project_id
 team_id

 teams
 id
 firstName
 lastName
 title

 everything's ok until we get to the teams part, where cake likes to
 automagically use the title column from the table.  I however need it
 to display firstName and lastName within the projects view.

 http://www.nabble.com/How-to-make-findAll()-retrieve-just-some-fields...

 I found this article here, which explains I have to use find('all)
 instead of automagic find('list), and everything is fine with how
 that's done, however, when i get to the point of gluing firstName and
 lastName together I'm stuck for the value of the select I'm stuck.
 Can someone help me?

 $teams = $this-Team-find(all,array('fields' =
 array('Team.id','Team.firstName', 'Team.lastName')));

 $result = Set::combine($subdivisions,
 '{n}.Team.id','{n}.Team.firstName');

 Please help.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cake best practices for mobile browser development

2008-05-08 Thread Marcin Domanski

Hey

  I'm developing an application for both mobile and desktop browsers. On
  the user end, I'd like this to be seamless, so no /mobile etc. Just
  curious as to be best practice for accomplishing this.
thats always the best option although i see additionally  many ppl
using m.example.com , setting a cookie etc and not checking every
request. imo its best to use both ways.

  First, I'm assuming I should use the the Request Handler's isMobile()
  function, and then use beforeRender()  to set the layout to the mobile
  version.
yes
 But what about the actual view?
 Should I use switches inside
  each view? Is it, perhaps, better practice to use render() to change
  the view altogether to a separate mobile version?

Why do you want to switch things in the view  ? It depends what mobile
devices are we talking about - if you want to support the _old_
160x160 then you would probably have to make a light version of
everything. But if you're thinking about something more advanced
(opera mini etc) then i would only use simpler css in the layout, no
js most of the time etc.

The problem with mobiles is that there are multiple resolutions,
browsers are even worst than on the desktop (that's changing
fortunately).
I don't know what's you target but generally - lower specs - more work.

I (most of the time) used only different layouts most of the time
(different sidebar, navigation etc). Using different views would be a
pain but sometimes it is a requirement so that's always an option -
you could automate that (automatically adding _mobile to template
name, or changing the view class )

  In addition, just how unreliable is the isMobile() function? Is it
  really worthwhile to setup a WURFL-based browser checker as a vendor?
isMobile checks the user agent you can look what UA it does support in
the code. WURFL is way more advanced - depends if you need to check
for specific functions.




-- 
Marcin Domanski
http://kabturek.info

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Open Flash Charts in Cake

2008-05-08 Thread Marcin Domanski

i always used libchart [1] - quick, easy , nicely written

[1] http://naku.dohcrew.com/libchart/pages/introduction/

On Thu, May 8, 2008 at 7:13 AM, Elmo [EMAIL PROTECTED] wrote:

  Also check out this blog entry about App::import():

  http://cakebaker.42dh.com/2008/03/26/loading-vendor-files/


  On Apr 21, 2:23 pm, ScottieBoy4 [EMAIL PROTECTED] wrote:


  I've found a really slick library for generating flash charts and
   graphs w/a PHP wrapper.  I can get it to work outside of cake, but not
   inside.  Has any one used the Open Flash Charts code in Cake?
  




-- 
Marcin Domanski
http://kabturek.info

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cake best practices for mobile browser development

2008-05-08 Thread David

Thanks for the response! The view in a desktop browser would be
significantly more robust (i.e. complex), so it would not be able to
display properly in most mobile browsers (except in the iphone's
safari). By switching, I meant maintaing one .ctp file for
everything and having an isMobile in each to determine how things are
rendered. I guess using a different views class is the cleanest way to
do this. Render() is the right function, is it not?

On May 8, 4:11 am, Marcin Domanski [EMAIL PROTECTED] wrote:
 Hey

   I'm developing an application for both mobile and desktop browsers. On
   the user end, I'd like this to be seamless, so no /mobile etc. Just
   curious as to be best practice for accomplishing this.

 thats always the best option although i see additionally  many ppl
 using m.example.com , setting a cookie etc and not checking every
 request. imo its best to use both ways.

   First, I'm assuming I should use the the Request Handler's isMobile()
   function, and then use beforeRender()  to set the layout to the mobile
   version.
 yes
  But what about the actual view?
  Should I use switches inside
   each view? Is it, perhaps, better practice to use render() to change
   the view altogether to a separate mobile version?

 Why do you want to switch things in the view  ? It depends what mobile
 devices are we talking about - if you want to support the _old_
 160x160 then you would probably have to make a light version of
 everything. But if you're thinking about something more advanced
 (opera mini etc) then i would only use simpler css in the layout, no
 js most of the time etc.

 The problem with mobiles is that there are multiple resolutions,
 browsers are even worst than on the desktop (that's changing
 fortunately).
 I don't know what's you target but generally - lower specs - more work.

 I (most of the time) used only different layouts most of the time
 (different sidebar, navigation etc). Using different views would be a
 pain but sometimes it is a requirement so that's always an option -
 you could automate that (automatically adding _mobile to template
 name, or changing the view class )

   In addition, just how unreliable is the isMobile() function? Is it
   really worthwhile to setup a WURFL-based browser checker as a vendor?

 isMobile checks the user agent you can look what UA it does support in
 the code. WURFL is way more advanced - depends if you need to check
 for specific functions.

 --
 Marcin Domanskihttp://kabturek.info
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cake best practices for mobile browser development

2008-05-08 Thread [EMAIL PROTECTED]


I am actually of the opposite opinion regarding /mobile and
m.example.com.
I remember seeing sites use: m.example.com, wap.example.com,
mob.example.com, mobile.example.com
The result for me is that I hardly ever bother trying to guess which
one is used and thuss do not use the mobile verson of the site. IMHO
the site should automatically adapt to the smaller screen and less
capable browser. And for most normal websites contain the same content
(eg news, products, contact info...) formatted for smaller screens.

David, you should look at viewPath and layoutPath. You can switch
these in a similar way to what is done for json or xml requests. (no,
I don't have any working code to paste, sorry) Check out this post for
how it is setup for json.

http://groups.google.com/group/cake-php/browse_thread/thread/3c5c74d233438c25/83ae4daddcaaccb5?lnk=gstq=viewpath#3a2068bddfc37cc5

You could possibly even use extension parsing once the mobile browser
has been detected www.example.com/products.wap or something similar.
Look for parseExtension in the manual for a start.



On May 8, 10:11 am, Marcin Domanski [EMAIL PROTECTED] wrote:
 Hey

   I'm developing an application for both mobile and desktop browsers. On
   the user end, I'd like this to be seamless, so no /mobile etc. Just
   curious as to be best practice for accomplishing this.

 thats always the best option although i see additionally  many ppl
 using m.example.com , setting a cookie etc and not checking every
 request. imo its best to use both ways.

   First, I'm assuming I should use the the Request Handler's isMobile()
   function, and then use beforeRender()  to set the layout to the mobile
   version.
 yes
  But what about the actual view?
  Should I use switches inside
   each view? Is it, perhaps, better practice to use render() to change
   the view altogether to a separate mobile version?

 Why do you want to switch things in the view  ? It depends what mobile
 devices are we talking about - if you want to support the _old_
 160x160 then you would probably have to make a light version of
 everything. But if you're thinking about something more advanced
 (opera mini etc) then i would only use simpler css in the layout, no
 js most of the time etc.

 The problem with mobiles is that there are multiple resolutions,
 browsers are even worst than on the desktop (that's changing
 fortunately).
 I don't know what's you target but generally - lower specs - more work.

 I (most of the time) used only different layouts most of the time
 (different sidebar, navigation etc). Using different views would be a
 pain but sometimes it is a requirement so that's always an option -
 you could automate that (automatically adding _mobile to template
 name, or changing the view class )

   In addition, just how unreliable is the isMobile() function? Is it
   really worthwhile to setup a WURFL-based browser checker as a vendor?

 isMobile checks the user agent you can look what UA it does support in
 the code. WURFL is way more advanced - depends if you need to check
 for specific functions.

 --
 Marcin Domanskihttp://kabturek.info
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Warning message infecting thumbnail images occasionally

2008-05-08 Thread acoustic_overdrive

Actually ignore that last one, I had the permissions set wrongly on
this second server.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Max number of save()'s in a loop

2008-05-08 Thread Kyle Decot

I have a loop that I am running a $this-Word-save() in, and I need
to be able to do the maximum of loops possible but it gets through
about 4000 loops and then just stops. I've instructed the loop to go
until it reaches 50,000 so I'm not sure why it's doing this. Any
ideas ?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Max number of save()'s in a loop

2008-05-08 Thread Dr. Tarique Sani
On Thu, May 8, 2008 at 2:48 PM, Kyle Decot [EMAIL PROTECTED] wrote:


 I have a loop that I am running a $this-Word-save() in, and I need
 to be able to do the maximum of loops possible but it gets through
 about 4000 loops and then just stops. I've instructed the loop to go
 until it reaches 50,000 so I'm not sure why it's doing this. Any
 ideas ?


Have you handled all the timeouts?

Tarique

-- 
=
Cheesecake-Photoblog: http://cheesecake-photoblog.org
PHP for E-Biz: http://sanisoft.com
=

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Warning message infecting thumbnail images occasionally

2008-05-08 Thread acoustic_overdrive

I thought permissions had fixed it but it was actually due to me
setting debug to 0.

If debug is  0, I still get random warnings from the cache engine
every so often which corrupt my thumbnails. They are always to do with
that particular file:

cache/persistent/cake_core_object_map

I have tried deleting all cache files but it didn't help.



--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Strange habtm problem - saving in other tables

2008-05-08 Thread largon

If I comment out other habtm relationships, leaving only
var $hasAndBelongsToMany = array(
'HasAsFriend' = array(
'className' = 'User',
'joinTable' = 'friends',
'foreignKey' = 'user_id',
'associationForeignKey' = 'friend_id',
'uniq' = false,
'conditions' = '',
),
);
in my User model, then the save() will go flawlessly.

However, if I leave those relationships in User model, then the data
is inserted into
other tables even if I manually unbindModel() them before calling
$this-User-save().

I'm confused. Is there anyone who knows why this is happening? Or
maybe I should
just use a $this-User-query() to do the saving job and insert the
data in the right table? :(


On 5月8日, 上午6時13分, largon [EMAIL PROTECTED] wrote:
 Hi,

 I'm on a project that users can add other users as friends, families,
 or block them.
 So I've set up some habtm behaviors for that. The tables (friends,
 families, blocks) look
 very similar, all with (user_id, friend_id) or (user_id, family_id) as
 keys.

 But when I save a data, like calling:
 $this-data['User']['id'] = 1;
 $this-data['HasAsFriend']['HasAsFriend'] = 2;
 $this-User-save($this-data);

 I'll have not only user1 adding user2 as friend, but also user2 adding
 user1 as friend.
 What's more, they're each other's families and user1 is blocking user2
 too.
 (The data got inserted into families table and blocks table too.)

 I posted my user model relationships athttp://bin.cakephp.org/view/241705085
 I also tried the behavior 
 athttp://bakery.cakephp.org/articles/view/add-delete-habtm-behavior
 ,
 but with the code:

 $this-User-habtmAdd('HasAsFriend', 1, 2);

 Also results the same as inserting into families table and blocks
 table.

 I'm troubled, I'm not sure why this is happening. Any clues is greatly
 appreciated.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cake best practices for mobile browser development

2008-05-08 Thread Marcin Domanski

On Thu, May 8, 2008 at 10:32 AM, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:


  I am actually of the opposite opinion regarding /mobile and
  m.example.com.
  I remember seeing sites use: m.example.com, wap.example.com,
  mob.example.com, mobile.example.com
  The result for me is that I hardly ever bother trying to guess which
  one is used and thuss do not use the mobile verson of the site. IMHO
  the site should automatically adapt to the smaller screen and less
  capable browser. And for most normal websites contain the same content
  (eg news, products, contact info...) formatted for smaller screens.
Oh you misunderstood me :) i would also do the automatic checking - i
just noticed some users do use m.example.com and in this way you
*know* they want the mobile version. So by all means the automatic way
is the way to go - just its good to assume that automatic doesnt work
for everyone and it would be good to give people the alternative  so
they can force the mobile version.

Btw the browser check isn't so resource intensive :) its one regexp.



-- 
Marcin Domanski
http://kabturek.info

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Strange habtm problem - saving in other tables

2008-05-08 Thread largon

I added some logging just to make sure the relationships are unbound:

$this-User-unbindAll(array('hasAndBelongsToMany' =
array('HasAsFriend')));
$this-log(current habtm:  . print_r($this-User-
hasAndBelongsToMany, true));

The error log reads:

2008-05-08 17:03:49 Error: current habtm: Array
(
[HasAsFriend] = Array
(
[className] = User
[joinTable] = friends
[foreignKey] = user_id
[associationForeignKey] = friend_id
[uniq] =
[conditions] =
[with] = Friend
[fields] =
[order] =
[limit] =
[offset] =
[unique] = 1
[finderQuery] =
[deleteQuery] =
[insertQuery] =
)

)

Which indicates that those relationships are unbound successfully.
But the habtmAdd still inserts into other tables:

$this-User-habtmAdd('HasAsFriend', 1, 3);

will result with SQL queries:

28  INSERT INTO `friends` (`user_id`,`friend_id`) VALUES (1,3)
29  SELECT `Friend`.`id` FROM `friends` AS `Friend` WHERE `friend_id` =
1
30  INSERT INTO `friends` (`friend_id`,`user_id`) VALUES (1,3)
31  SELECT `Family`.`id` FROM `families` AS `Family` WHERE `user_id` =
1
32  INSERT INTO `families` (`user_id`,`family_id`) VALUES (1,3)
33  SELECT `Family`.`id` FROM `families` AS `Family` WHERE `family_id`
= 1
34  INSERT INTO `families` (`family_id`,`user_id`) VALUES (1,3)
35  SELECT `Block`.`id` FROM `blocks` AS `Block` WHERE `user_id` = 1
36  INSERT INTO `blocks` (`user_id`,`block_id`) VALUES (1,3)

This is wierd. Is this a bug in cake or is it my misconfiguration in
User model?

On 5月8日, 下午4時41分, largon [EMAIL PROTECTED] wrote:
 If I comment out other habtm relationships, leaving only
 var $hasAndBelongsToMany = array(
 'HasAsFriend' = array(
 'className' = 'User',
 'joinTable' = 'friends',
 'foreignKey' = 'user_id',
 'associationForeignKey' = 'friend_id',
 'uniq' = false,
 'conditions' = '',
 ),
 );
 in my User model, then the save() will go flawlessly.

 However, if I leave those relationships in User model, then the data
 is inserted into
 other tables even if I manually unbindModel() them before calling
 $this-User-save().

 I'm confused. Is there anyone who knows why this is happening? Or
 maybe I should
 just use a $this-User-query() to do the saving job and insert the
 data in the right table? :(

 On 5月8日, 上午6時13分, largon [EMAIL PROTECTED] wrote:

  Hi,

  I'm on a project that users can add other users as friends, families,
  or block them.
  So I've set up some habtm behaviors for that. The tables (friends,
  families, blocks) look
  very similar, all with (user_id, friend_id) or (user_id, family_id) as
  keys.

  But when I save a data, like calling:
  $this-data['User']['id'] = 1;
  $this-data['HasAsFriend']['HasAsFriend'] = 2;
  $this-User-save($this-data);

  I'll have not only user1 adding user2 as friend, but also user2 adding
  user1 as friend.
  What's more, they're each other's families and user1 is blocking user2
  too.
  (The data got inserted into families table and blocks table too.)

  I posted my user model relationships athttp://bin.cakephp.org/view/241705085
  I also tried the behavior 
  athttp://bakery.cakephp.org/articles/view/add-delete-habtm-behavior
  ,
  but with the code:

  $this-User-habtmAdd('HasAsFriend', 1, 2);

  Also results the same as inserting into families table and blocks
  table.

  I'm troubled, I'm not sure why this is happening. Any clues is greatly
  appreciated.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cake best practices for mobile browser development

2008-05-08 Thread David

Martin, would extension parsing be a way to avoid running the resource
intensive browser check with every pageview?

On May 8, 4:32 am, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
 I am actually of the opposite opinion regarding /mobile and
 m.example.com.
 I remember seeing sites use: m.example.com, wap.example.com,
 mob.example.com, mobile.example.com
 The result for me is that I hardly ever bother trying to guess which
 one is used and thuss do not use the mobile verson of the site. IMHO
 the site should automatically adapt to the smaller screen and less
 capable browser. And for most normal websites contain the same content
 (eg news, products, contact info...) formatted for smaller screens.

 David, you should look at viewPath and layoutPath. You can switch
 these in a similar way to what is done for json or xml requests. (no,
 I don't have any working code to paste, sorry) Check out this post for
 how it is setup for json.

 http://groups.google.com/group/cake-php/browse_thread/thread/3c5c74d2...

 You could possibly even use extension parsing once the mobile browser
 has been detectedwww.example.com/products.wapor something similar.
 Look for parseExtension in the manual for a start.

 On May 8, 10:11 am, Marcin Domanski [EMAIL PROTECTED] wrote:

  Hey

    I'm developing an application for both mobile and desktop browsers. On
    the user end, I'd like this to be seamless, so no /mobile etc. Just
    curious as to be best practice for accomplishing this.

  thats always the best option although i see additionally  many ppl
  using m.example.com , setting a cookie etc and not checking every
  request. imo its best to use both ways.

    First, I'm assuming I should use the the Request Handler's isMobile()
    function, and then use beforeRender()  to set the layout to the mobile
    version.
  yes
   But what about the actual view?
   Should I use switches inside
    each view? Is it, perhaps, better practice to use render() to change
    the view altogether to a separate mobile version?

  Why do you want to switch things in the view  ? It depends what mobile
  devices are we talking about - if you want to support the _old_
  160x160 then you would probably have to make a light version of
  everything. But if you're thinking about something more advanced
  (opera mini etc) then i would only use simpler css in the layout, no
  js most of the time etc.

  The problem with mobiles is that there are multiple resolutions,
  browsers are even worst than on the desktop (that's changing
  fortunately).
  I don't know what's you target but generally - lower specs - more work.

  I (most of the time) used only different layouts most of the time
  (different sidebar, navigation etc). Using different views would be a
  pain but sometimes it is a requirement so that's always an option -
  you could automate that (automatically adding _mobile to template
  name, or changing the view class )

    In addition, just how unreliable is the isMobile() function? Is it
    really worthwhile to setup a WURFL-based browser checker as a vendor?

  isMobile checks the user agent you can look what UA it does support in
  the code. WURFL is way more advanced - depends if you need to check
  for specific functions.

  --
  Marcin Domanskihttp://kabturek.info
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Warning message infecting thumbnail images occasionally

2008-05-08 Thread acoustic_overdrive

I've just moved the site to another server and I'm getting the same
problem - one or two of the thumbnails are getting corrupted at random
- but this time the warning message is slightly different:

Warning (2): fopen(/home/sites/xx.com/public_html/app/tmp/
cache/persistent/cake_core_object_map) [function.fopen]: failed to
open stream: No such file or directory [CORE/cake/libs/file.php, line
144]
Notice (8): unserialize() [function.unserialize]: Error at offset 0 of
865 bytes [CORE/cake/libs/cache/file.php, line 179]


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cake best practices for mobile browser development

2008-05-08 Thread [EMAIL PROTECTED]

Absolutely, I agree with you on that note. You should always provide
alternatives to detection. :)

David: Yes it can. But like Marcin wrote, it is not a very expensive
check (and extension parsing also cost execution-time). When checking
each request you would gain the advantage that any deep links to the
site till choose the mobile version automatically. Extension-parsing
can be used as an alternative when the detection is not catching it
correctly. But, looking at the source for isMobile() it looks solid.
It should catch any mobile browser developed by competent developers.
(a mobile browser should probably accept wap content and that is the
fallback in isMobile)

/Martin



On May 8, 11:22 am, Marcin Domanski [EMAIL PROTECTED] wrote:
 On Thu, May 8, 2008 at 10:32 AM, [EMAIL PROTECTED][EMAIL PROTECTED] wrote:

   I am actually of the opposite opinion regarding /mobile and
   m.example.com.
   I remember seeing sites use: m.example.com, wap.example.com,
   mob.example.com, mobile.example.com
   The result for me is that I hardly ever bother trying to guess which
   one is used and thuss do not use the mobile verson of the site. IMHO
   the site should automatically adapt to the smaller screen and less
   capable browser. And for most normal websites contain the same content
   (eg news, products, contact info...) formatted for smaller screens.

 Oh you misunderstood me :) i would also do the automatic checking - i
 just noticed some users do use m.example.com and in this way you
 *know* they want the mobile version. So by all means the automatic way
 is the way to go - just its good to assume that automatic doesnt work
 for everyone and it would be good to give people the alternative  so
 they can force the mobile version.

 Btw the browser check isn't so resource intensive :) its one regexp.

 --
 Marcin Domanskihttp://kabturek.info
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Max number of save()'s in a loop

2008-05-08 Thread Kyle Decot

I'm not sure how to do that. Any suggestions?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



saveAll with three levels

2008-05-08 Thread Jose Selesan
Hi all, does anybody know if I can save a model with a hasMany relation and
each of the related models has a hasMany relation?

Hi have a model called Trivia with a 'hasMany' relation to model Pregunta
and model Pregunta has a 'hasMany' relation to model Opcion. But when I call
$this-Trivia-saveAll($this-data) in my controller, it only saves Trivia
and their related Pregunta, but not Opcion

Please help me!

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Strange habtm problem - saving in other tables

2008-05-08 Thread largon

For anybody who's following this thread, or had the same problem, or
dived in during a google:

This seems like a bug mentioned at https://trac.cakephp.org/ticket/4558
After adding a unset($newValues) as the ticket mentions the problem
goes away.

Thanks all!

On May 8, 5:08 pm, largon [EMAIL PROTECTED] wrote:
 I added some logging just to make sure the relationships are unbound:

 $this-User-unbindAll(array('hasAndBelongsToMany' =
 array('HasAsFriend')));
 $this-log(current habtm:  . print_r($this-User-

 hasAndBelongsToMany, true));

 The error log reads:

 2008-05-08 17:03:49 Error: current habtm: Array
 (
 [HasAsFriend] = Array
 (
 [className] = User
 [joinTable] = friends
 [foreignKey] = user_id
 [associationForeignKey] = friend_id
 [uniq] =
 [conditions] =
 [with] = Friend
 [fields] =
 [order] =
 [limit] =
 [offset] =
 [unique] = 1
 [finderQuery] =
 [deleteQuery] =
 [insertQuery] =
 )

 )

 Which indicates that those relationships are unbound successfully.
 But the habtmAdd still inserts into other tables:

 $this-User-habtmAdd('HasAsFriend', 1, 3);

 will result with SQL queries:

 28  INSERT INTO `friends` (`user_id`,`friend_id`) VALUES (1,3)
 29  SELECT `Friend`.`id` FROM `friends` AS `Friend` WHERE `friend_id` =
 1
 30  INSERT INTO `friends` (`friend_id`,`user_id`) VALUES (1,3)
 31  SELECT `Family`.`id` FROM `families` AS `Family` WHERE `user_id` =
 1
 32  INSERT INTO `families` (`user_id`,`family_id`) VALUES (1,3)
 33  SELECT `Family`.`id` FROM `families` AS `Family` WHERE `family_id`
 = 1
 34  INSERT INTO `families` (`family_id`,`user_id`) VALUES (1,3)
 35  SELECT `Block`.`id` FROM `blocks` AS `Block` WHERE `user_id` = 1
 36  INSERT INTO `blocks` (`user_id`,`block_id`) VALUES (1,3)

 This is wierd. Is this a bug in cake or is it my misconfiguration in
 User model?

 On 5月8日, 下午4時41分, largon [EMAIL PROTECTED] wrote:

  If I comment out other habtm relationships, leaving only
  var $hasAndBelongsToMany = array(
  'HasAsFriend' = array(
  'className' = 'User',
  'joinTable' = 'friends',
  'foreignKey' = 'user_id',
  'associationForeignKey' = 'friend_id',
  'uniq' = false,
  'conditions' = '',
  ),
  );
  in my User model, then the save() will go flawlessly.

  However, if I leave those relationships in User model, then the data
  is inserted into
  other tables even if I manually unbindModel() them before calling
  $this-User-save().

  I'm confused. Is there anyone who knows why this is happening? Or
  maybe I should
  just use a $this-User-query() to do the saving job and insert the
  data in the right table? :(

  On 5月8日, 上午6時13分, largon [EMAIL PROTECTED] wrote:

   Hi,

   I'm on a project that users can add other users as friends, families,
   or block them.
   So I've set up some habtm behaviors for that. The tables (friends,
   families, blocks) look
   very similar, all with (user_id, friend_id) or (user_id, family_id) as
   keys.

   But when I save a data, like calling:
   $this-data['User']['id'] = 1;
   $this-data['HasAsFriend']['HasAsFriend'] = 2;
   $this-User-save($this-data);

   I'll have not only user1 adding user2 as friend, but also user2 adding
   user1 as friend.
   What's more, they're each other's families and user1 is blocking user2
   too.
   (The data got inserted into families table and blocks table too.)

   I posted my user model relationships 
   athttp://bin.cakephp.org/view/241705085
   I also tried the behavior 
   athttp://bakery.cakephp.org/articles/view/add-delete-habtm-behavior
   ,
   but with the code:

   $this-User-habtmAdd('HasAsFriend', 1, 2);

   Also results the same as inserting into families table and blocks
   table.

   I'm troubled, I'm not sure why this is happening. Any clues is greatly
   appreciated.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: saveAll with three levels

2008-05-08 Thread Dr. Tarique Sani
On Thu, May 8, 2008 at 4:50 PM, Jose Selesan [EMAIL PROTECTED] wrote:

 Hi all, does anybody know if I can save a model with a hasMany relation
 and each of the related models has a hasMany relation?

 Hi have a model called Trivia with a 'hasMany' relation to model Pregunta
 and model Pregunta has a 'hasMany' relation to model Opcion. But when I call
 $this-Trivia-saveAll($this-data) in my controller, it only saves Trivia
 and their related Pregunta, but not Opcion


It should work - try with the latest SVN check out

If does not work then take a look at the related test - modify it for one
more level and submit as a bug report

Tarique

-- 
=
Cheesecake-Photoblog: http://cheesecake-photoblog.org
PHP for E-Biz: http://sanisoft.com
=

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Something on the top of CakePHP

2008-05-08 Thread Chris Hartjes

On Thu, May 8, 2008 at 12:01 AM, b logica [EMAIL PROTECTED] wrote:

 I'm not sure if you got that backward, but I'd think it'd always be
 easier if you know the other person has a better idea than yourself.


*Knowing* and *accepting* are two different things.  Computer
programmers tend to be a passive-aggressive lot, so it's no surprise
that there is lots of ranting and raving about how CakePHP doesn't do
things they way they want but very little in the way of actively
seeking to make those changes.  They *know* CakePHP is better than
what they could do but have not come around to *accepting* that there
is the Cake way of doing things, rightly or wrongly.

One person's key critical feature is another person's edge case.
The trick is understanding that, and a lot of people fail at it.

-- 
Chris Hartjes
Internet Loudmouth
Motto for 2008: Moving from herding elephants to handling snakes...
@TheKeyBoard: http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Open Flash Charts in Cake

2008-05-08 Thread dr. Hannibal Lecter

@Marcin: Thanks for sharing that one, very nice!

On May 8, 10:20 am, Marcin Domanski [EMAIL PROTECTED] wrote:
 i always used libchart [1] - quick, easy , nicely written

 [1]http://naku.dohcrew.com/libchart/pages/introduction/

 On Thu, May 8, 2008 at 7:13 AM, Elmo [EMAIL PROTECTED] wrote:

   Also check out this blog entry about App::import():

   http://cakebaker.42dh.com/2008/03/26/loading-vendor-files/

   On Apr 21, 2:23 pm, ScottieBoy4 [EMAIL PROTECTED] wrote:

   I've found a really slick library for generating flash charts and
graphs w/a PHP wrapper.  I can get it to work outside of cake, but not
inside.  Has any one used the Open Flash Charts code in Cake?

 --
 Marcin Domanskihttp://kabturek.info
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cake best practices for mobile browser development

2008-05-08 Thread schneimi

I had the idea to handle this with an extra route to mobile actions in
config/routes.php:

$subdomain = substr(env(HTTP_HOST), 0, strpos(env(HTTP_HOST),
.));

if (strlen($subdomain)  0  ($subdomain == m || $subdomain ==
mobile)) {
  Router::connect(':controller/:action/*', array('prefix' = 'm'));
  Router::connect('/', array('controller' = 'pages', 'action' =
'index', 'prefix' = 'm'));
}

Instead of, or additionally to the subdomain check, you can put the
mobile check in the condition. This way your urls will look the same
like before but internally the mobile actions (and views) with prefix
m are used.

In the mobile action, in case you need the same data as the desktop
action, you can simply call it this way before the mobile view is
rendered:

function m_view() {
  $this-view();
}

I don't know if this is best practice, but for me it's more clearly
arranged and you are more flexible if the mobile version differs alot
from the desktop version.

Regards,

Michael

David schrieb:
 Hey folks,

 I'm very new to Cake and couldn't find this satisfactorily addressed
 elsewhere:

 I'm developing an application for both mobile and desktop browsers. On
 the user end, I'd like this to be seamless, so no /mobile etc. Just
 curious as to be best practice for accomplishing this.

 First, I'm assuming I should use the the Request Handler's isMobile()
 function, and then use beforeRender()  to set the layout to the mobile
 version. But what about the actual view? Should I use switches inside
 each view? Is it, perhaps, better practice to use render() to change
 the view altogether to a separate mobile version?

 In addition, just how unreliable is the isMobile() function? Is it
 really worthwhile to setup a WURFL-based browser checker as a vendor?

 Thanks in advance for your help!

 -David
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to access Cake Session Variables from a Stand Alone PHP script

2008-05-08 Thread bharath kumar
Hi Sliv,

In Login controller i have set the user details using this line.
$this-Session-write('CURRENT_USER', $someone['User']);

and in the php script, which is oustside the cake directory, i am trying to
use the CURRENT_USER in the php script using $_SESSION. which i couldn
access

On Thu, May 8, 2008 at 11:23 AM, Lakshmi [EMAIL PROTECTED] wrote:



 -- Forwarded message --
 From: Sliv [EMAIL PROTECTED]
 Date: May 7, 2008 6:08 PM
 Subject: Re: How to access Cake Session Variables from a Stand Alone
 PHP  script
 To: CakePHP cake-php@googlegroups.com


 What variables are you trying to access that are not available through
 $_SESSION?

 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



hi guys

2008-05-08 Thread ID

I have a Centos5.1 box, loaded with

php-5.1.6
httpd-2.2.3(apache)
mysql-5.0.22

following this video
http://cakephp.org/screencasts/view/3
and this tutor:
http://manual.cakephp.org/view/326/the-cake-blog-tutorial

i have checked out from svn repo
svn co https://svn.cakephp.org/repo/trunk/cake/1.1.x.x/ /var/www/html/
blog

http://localhost/  points to /var/www/html/blog

i have created database, entered test entries, modified database.php
and all as shown in the video step by step,

when i point the browser to,
http://localhost/
it shows a page with:
  CakePHP Rapid Development
  Your database configuration file is present.
  Cake is able to connect to the database.

but when i point the browser to;
http://localhost/posts/

it shows: The requested URL /posts was not found on this server.

any ideas what i could be doing wrong?

thanks

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Session Lost In IE

2008-05-08 Thread bharath kumar
Hi All,

I have got a strange problem in IE-6.0. we have built a browser
plugin(Toolbar) for our application, which changes its contents dynamically
after loggin in to our application. we have used Best toolbar studio to
build a toolbar . what i am experiencing is, when i used the below java
script function to reload the toolbar, my session gets lost and i am kicked
back to the login page. Also we tried using a sample toolbar that uses
session_start(); to start session after login and change its contents
dynamically after logging in without the session being lost. In Mozilla,
everything works fine without session being lost.

?php
echo script
function ToolBarInit(tool)
{
tool.Reload();  // A java script function
}
/script ;
?

it would be very helpful if someone has experienced the same problem, or
have encountered the same problem in IE where session gets lost after reload
function, please share your views on this.
Thanks in Advance

Cheers
Bharath

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Cake integration with other app and session

2008-05-08 Thread Ziad

Hi everyone,

I have an issue that I'd like people's comment(s) on. I am trying to
integrate an existing app with Cake. We are planning to move the
entire app over to Cake eventually but will have to do it in stages.
So we are planning to write new parts of the app in Cake and slowly
move old stuff over.

The problem that I was having was with sessions. It seems that Cake
closes any existing session before doing anything with sessions within
Cake. Session data from my other app is available in Cake. But session
data that I save in Cake is not available in the other app. I've got
around this by commenting out line 167 in cake/libs/session.php:

function start() {
if (function_exists('session_write_close')) {
//  session_write_close();  -- this line
}
$this-__initSession();
return $this-__startSession();
}

This seems to work fine but I was wondering if any of the Cake experts
could point out any negative implications/side effects of doing this.
I would really appreciate any feedback from you guys.

Thanks in advance.

Ziad

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



filling model data in select tag

2008-05-08 Thread sonu

hi all. i m using cakephp 1.1, n firstly i want to know can we use
form helper? if yes then how? secondlyi have a form which
contains a select control,whose items should come from one table and
when user select one item and click submit it should save on another
table.pls solve my problem as even i don't know whether for different
table will there be different model and controller files?

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



blog tutor not working

2008-05-08 Thread ID

hi guys; (sorry revised the title)

I have a Centos5.1 box, loaded with

php-5.1.6
httpd-2.2.3(apache)
mysql-5.0.22

following this video
http://cakephp.org/screencasts/view/3
and this tutor:
http://manual.cakephp.org/view/326/the-cake-blog-tutorial

i have checked out from svn repo
svn co https://svn.cakephp.org/repo/trunk/cake/1.1.x.x/ /var/www/html/
blog

http://localhost/  points to /var/www/html/blog

i have created database, entered test entries, modified database.php
and all as shown in the video step by step,

when i point the browser to,
http://localhost/
it shows a page with:
  CakePHP Rapid Development
  Your database configuration file is present.
  Cake is able to connect to the database.

but when i point the browser to;
http://localhost/posts/

it shows: The requested URL /posts was not found on this server.

any ideas what i could be doing wrong?

thanks

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Storing sessions in mysql memory tables

2008-05-08 Thread JulGaw

Dear developers and users of great CakePHP!

I'm new in this community, I've started to learn Cake about 1 week ago
and very excited by this product :)

I'm trying to make one optimization trick and have questions about it.
I've modified my session table (in mysql 5.0.xx) like this:

CREATE TABLE cake_sessions (
  id varchar(255) NOT NULL default '',
  data varchar(255) default '',
  expires int(11) default NULL,
  PRIMARY KEY  (id)
) ENGINE=MEMORY;

Note ENGINE=MEMORY, and 'data' field now not TEXT but VARCHAR
(because memory tables don't support TEXT or BLOB).

Now the questions:
1) Do you think it's safe for users to store their sessions in memory?
In my opinion it's OK for small or medium number of visits.
Now my sample app works OK with 5 people using it :) and length of
session's 'data' as I see in log never been above 237 bytes.

2) Where I can patch a Cake (or maybe my app) to throw an error if
session's 'data' is bigger than 255 bytes? Because mysql just
truncates the field without a warning :(

3) If you're sure that 255 bytes isn't enough for session storing than
how much bytes (according to your opinion) must take the 'data' field?

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Open Flash Charts in Cake

2008-05-08 Thread BrendonKoz

Since I've found Open Flash Charts I was planning on using the simple
App::import() method, but then I came across a bakery article
specifically about a (somewhat unfinished but still very much working)
Helper for the Open Flash Charts for use with CakePHP v1.2.

http://bakery.cakephp.org/articles/view/open-flash-chart-helper-draw-charts-the-cake-way

On May 8, 9:55 am, S. William Schulz [EMAIL PROTECTED] wrote:
 @Doc,

 I'm using OFC with Cake.  Feel free to ping me if you're still looking
 for a solution down that route.

 S
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Label with checkbox formhelper and CakePHP 1.2

2008-05-08 Thread grigri

The form helper's `input()` and `inputs()` methods generate labels,
the individual control methods (`text()`, `checkbox()`) do not. This
is 100% by design.

 So.. how do i manage to properly label the checkbox?

echo $form-input('dbDBName',array( 'label' = _('DB Database
Name', 'type' = 'checkbox')));

 Btw.. its a tableless model, so no data connection.

You can (and should) create a schema for the model. This will allow
the form helper to automatically choose the correct field type.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Max number of save()'s in a loop

2008-05-08 Thread Samuel DeVore

http://us3.php.net/manual/en/function.set-time-limit.php

reset it every n times through a really long loop if you think that is
your issue, each time you set it it rolls the timer back to 0

Sam D

On Thu, May 8, 2008 at 4:13 AM, Kyle Decot [EMAIL PROTECTED] wrote:

 I'm not sure how to do that. Any suggestions?
 




-- 
-- 
(the old fart) the advice is free, the lack of crankiness will cost you

- its a fine line between a real question and an idiot

http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/
http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/
http://blog.samdevore.com/cakephp-pages/i-cant-bake/

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Label with checkbox formhelper and CakePHP 1.2

2008-05-08 Thread Deckard

Hi!

To keep it short and simple

echo $form-input('dbDBName',array( 'label' = _('DB Database
Name')));

works flawless. It appears an input file with according label.

echo $form-checkbox('dbCreate', array( 'label' =_('Create database
if not exists'))); ?

does not work.

The label is not shown as label but as attribute (???).

So.. how do i manage to properly label the checkbox?

Btw.. its a tableless model, so no data connection.
Thank you for any help!

Carsten

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



using checkbox

2008-05-08 Thread sonu

hi all.
i m using cakephp 1.1 and i have a form which contains 5 checkboxes.
i want that corresponding value of the checkbox which is checked shuld
enter in tha database table.it should be with the help of
htmlhelper ,and at a time user should be able to check only on
checkbox.
pls solve my problem earliest.
thnx.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Something on the top of CakePHP

2008-05-08 Thread Sliv (Tim MacAleese)

An example further to Chris' point is a recent discussion I had with
Nate - I ran into an issue where I passed an IP address through built-
in IP validation then used ip2long to convert it so I could store it
in a MySQL signed INT.  I noticed that an IP written like
255.255.255.011 would pass validation, but if you convert it with
ip2long, store it, retrieve it, convert it with long2ip, you end up
with 255.255.255.9.

Now, I could have posted a rant here saying OH NOES!! CAKE IS FAIL MY
IP VERY BAD! and then talked about what I would change in the core to
fix this.

What did I do instead?  I looked up popular regular expressions for
validating IP addresses and saw that they would also validate
255.255.255.011 as acceptable.  I then put some code in my beforeSave
method to modify the submitted octets to their abs() values before
using ip2long.  Problem solved.

As a final step, I politely contacted Nate, explained what I had
discovered, and asked what his thoughts were on the situation.  He
told me (basically) that validation is not about changing data that's
submitted, it's about ensuring the data is correct (not an exact
quote).

So, I learned something from my own research and sandbox work, I got
input from a developer with far more skill than me, and I don't think
I offended anyone or waste anyone's time.  Above all, I think I walked
away without looking like a moron.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Open Flash Charts in Cake

2008-05-08 Thread S. William Schulz

@Doc,

I'm using OFC with Cake.  Feel free to ping me if you're still looking
for a solution down that route.

S

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Session Lost In IE

2008-05-08 Thread Marcin Domanski

Whats the session security in cake ? did you try to play with it ?

On Thu, May 8, 2008 at 8:21 AM, bharath kumar [EMAIL PROTECTED] wrote:
 Hi All,

  I have got a strange problem in IE-6.0. we have built a browser
 plugin(Toolbar) for our application, which changes its contents dynamically
 after loggin in to our application. we have used Best toolbar studio to
 build a toolbar . what i am experiencing is, when i used the below java
 script function to reload the toolbar, my session gets lost and i am kicked
 back to the login page. Also we tried using a sample toolbar that uses
 session_start(); to start session after login and change its contents
 dynamically after logging in without the session being lost. In Mozilla,
 everything works fine without session being lost.

  ?php
  echo script
  function ToolBarInit(tool)
  {
  tool.Reload();  // A java script function
  }
  /script ;
  ?

  it would be very helpful if someone has experienced the same problem, or
 have encountered the same problem in IE where session gets lost after reload
 function, please share your views on this.
  Thanks in Advance

  Cheers
  Bharath
  




-- 
Marcin Domanski
http://kabturek.info

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Max number of save()'s in a loop

2008-05-08 Thread Kyle Decot

It's now getting anywhere from 2000-2400 loops into it and then I get:

Warning (2): Invalid argument supplied for foreach() [CORE/cake/libs/
model/datasources/dbo_source.php, line 544]
Warning (2): Invalid argument supplied for foreach() [CORE/cake/libs/
model/datasources/dbo_source.php, line 543]
Notice (8): Undefined property:  tablePrefix [CORE/cake/libs/model/
datasources/dbo_source.php, line 456]
Notice (8): Undefined property:  table [CORE/cake/libs/model/
datasources/dbo_source.php, line 456]

Fatal error: Call to a member function on a non-object in /home/
content/a/f/f/affinit3/html/cake/libs/model/datasources/dbo_source.php
on line 568
Warning (0rray  =   array()): Unknown(): Unable to call  () - function
does not exist [Unknown, line ??]

on rare occasions it will get to the 16,000's and then just stop. I'm
really confused by this.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



OT: Shitty Community

2008-05-08 Thread benjam

Seriously, why does everybody in the CakePHP community got their
finger on the trigger to just rip any person that has a question a new
one?

I mean, I have seen some pretty stupid questions in my time, and the
ones here are nowhere near as bad as the ones that I've seen
elsewhere. The thing that makes it different here, is that as soon as
those 'stupid' questions come in, the person asking the question gets
treated like shit for 5-10 posts until their question is answered (if
at all).

So what if you created CakePHP, so what if you've used it for the
entirety of it's life, some people haven't, and those people have
perfectly valid questions for the simple fact that the documentation
for CakePHP is horrendous and any documentation that is out there, is
spread so thin on the internet that looking for an answer is like
trying to find the proverbial needle.

I've seen people get called names (seriously, are we in 4th grade?),
been told to look things up themselves, been harped on to no end, and
all without the courtesy of a decent answer.

I feel that if someone comes to the group with a question, EVEN IF
IT'S BEEN ASKED BEFORE, it deserves an answer, or at least a _polite_
point in the direction of the answer (in the form of a link to the
post, or the page with the answer, NOT a begrudged 'Google It,
dumbass').

If you can't answer the question in a polite and decent manner, don't
answer the question.  Let somebody else who has far better people
skills answer it.  That way, the person asking the question will feel
like they are important to the community.  Because nothing kills a
project faster than a shitty community, no matter what the project is.

So get your head out of your 'Holier than thou' asses and lighten up.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Session Lost In IE

2008-05-08 Thread Esoteric

Try changing your security setting to medium, see if that fixes your
problem.

-Erik

On May 8, 10:29 am, Marcin Domanski [EMAIL PROTECTED] wrote:
 Whats the session security in cake ? did you try to play with it ?



 On Thu, May 8, 2008 at 8:21 AM, bharath kumar [EMAIL PROTECTED] wrote:
  Hi All,

   I have got a strange problem in IE-6.0. we have built a browser
  plugin(Toolbar) for our application, which changes its contents dynamically
  after loggin in to our application. we have used Best toolbar studio to
  build a toolbar . what i am experiencing is, when i used the below java
  script function to reload the toolbar, my session gets lost and i am kicked
  back to the login page. Also we tried using a sample toolbar that uses
  session_start(); to start session after login and change its contents
  dynamically after logging in without the session being lost. In Mozilla,
  everything works fine without session being lost.

   ?php
   echo script
   function ToolBarInit(tool)
   {
   tool.Reload();  // A java script function
   }
   /script ;
   ?

   it would be very helpful if someone has experienced the same problem, or
  have encountered the same problem in IE where session gets lost after reload
  function, please share your views on this.
   Thanks in Advance

   Cheers
   Bharath

 --
 Marcin Domanskihttp://kabturek.info
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to access Cake Session Variables from a Stand Alone PHP script

2008-05-08 Thread Esoteric

Well providing your are starting your session and using the same
session id, then you should be able to access CURRENT_USER.

I am not sure if this will work with database sessions.

-Erik

On May 8, 2:11 am, bharath kumar [EMAIL PROTECTED] wrote:
 Hi Sliv,

 In Login controller i have set the user details using this line.
 $this-Session-write('CURRENT_USER', $someone['User']);

 and in the php script, which is oustside the cake directory, i am trying to
 use the CURRENT_USER in the php script using $_SESSION. which i couldn
 access

 On Thu, May 8, 2008 at 11:23 AM, Lakshmi [EMAIL PROTECTED] wrote:

  -- Forwarded message --
  From: Sliv [EMAIL PROTECTED]
  Date: May 7, 2008 6:08 PM
  Subject: Re: How to access Cake Session Variables from a Stand Alone
  PHP  script
  To: CakePHP cake-php@googlegroups.com

  What variables are you trying to access that are not available through
  $_SESSION?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: OT: Shitty Community

2008-05-08 Thread mariano.iglesias

How is calling the documentation horrendous polite? You have any idea
the amount of hours people take to write that, not to mention that is
a community effort? I tell you, with the likes of you, I don't doubt
anyone would call you names, disrespecting other's people valuable
time like that.

On May 8, 12:07 pm, benjam [EMAIL PROTECTED] wrote:
 perfectly valid questions for the simple fact that the documentation
 for CakePHP is horrendous and any documentation that is out there, is
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: blog tutor not working

2008-05-08 Thread seb

 http://localhost/  points to /var/www/html/blog

 http://localhost/posts/

And what about localhost/blog/posts ?

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: OT: Shitty Community

2008-05-08 Thread Chris Hartjes

On Thu, May 8, 2008 at 11:07 AM, benjam [EMAIL PROTECTED] wrote:
 So get your head out of your 'Holier than thou' asses and lighten up.

So...to sum up

1) there are no stupid questions, only stupid answers
2) every question, no matter how poorly researched or thought out,
deserves a civilized answer
3) people asking questions have no responsibility, only those giving answers

benjam, I agree with you that the go google it, asswipe response is
not a good one.  However, telling people to lighten up is just as
insulting as telling them go google it, asswipe.

People give answers for a variety of reasons.  Most of the time it is
to be helpful, but when you start criticizing parts of the code
written by people who read the list, what do you think is going to
happen?  Not everyone is willing to have a touchy-feely response
style.

I have total respect for those who do their research before asking a
question, and lots of people on the list do that.  Those questions are
worth answering.  Other questions that give the impression that the
poster hasn't thought about it at all before hitting send, well,
again, what do you expect?

-- 
Chris Hartjes
Internet Loudmouth
Motto for 2008: Moving from herding elephants to handling snakes...
@TheKeyBoard: http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: OT: Shitty Community

2008-05-08 Thread John David Anderson

I think you're both right (except the part about horrendous  
documentation - it's actually pretty good at this point).

Imho, the core team *and* the community has a lot to learn about being  
more polite. I think everyone is to the point where we feel justified  
in making each other mad. Some n00b asks a retarded question in a rude  
way? Bite his head off. Some jerk on the core team shut down my idea?  
Complain on the mailing list.

Personally, I've been really ashamed of some of the core team  
responses as much as I have about complaints and requests on the list.

How about we meet in the middle, and every work on being a little more  
polite? I'll try better to understand your frustration if you try  
harder to understand being overworked and underpaid.

-- John

On May 8, 2008, at 9:20 AM, mariano.iglesias wrote:


 How is calling the documentation horrendous polite? You have any idea
 the amount of hours people take to write that, not to mention that is
 a community effort? I tell you, with the likes of you, I don't doubt
 anyone would call you names, disrespecting other's people valuable
 time like that.

 On May 8, 12:07 pm, benjam [EMAIL PROTECTED] wrote:
 perfectly valid questions for the simple fact that the documentation
 for CakePHP is horrendous and any documentation that is out there, is
 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: OT: Shitty Community

2008-05-08 Thread AD7six



On May 8, 5:07 pm, benjam [EMAIL PROTECTED] wrote:
 Seriously, why does everybody in the CakePHP community got their
 finger on the trigger to just rip any person that has a question a new
 one?

 I mean, I have seen some pretty stupid questions in my time, and the
 ones here are nowhere near as bad as the ones that I've seen
 elsewhere. The thing that makes it different here, is that as soon as
 those 'stupid' questions come in, the person asking the question gets
 treated like shit for 5-10 posts until their question is answered (if
 at all).

 So what if you created CakePHP, so what if you've used it for the
 entirety of it's life, some people haven't, and those people have
 perfectly valid questions for the simple fact that the documentation
 for CakePHP is horrendous and any documentation that is out there, is
 spread so thin on the internet that looking for an answer is like
 trying to find the proverbial needle.

 I've seen people get called names (seriously, are we in 4th grade?),
 been told to look things up themselves, been harped on to no end, and
 all without the courtesy of a decent answer.

 I feel that if someone comes to the group with a question, EVEN IF
 IT'S BEEN ASKED BEFORE, it deserves an answer, or at least a _polite_
 point in the direction of the answer (in the form of a link to the
 post, or the page with the answer, NOT a begrudged 'Google It,
 dumbass').

I'd like to build a forum. How can I do that with cake please?

Andy
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: OT: Shitty Community

2008-05-08 Thread seb

 I feel that if someone comes to the group with a question, EVEN IF
 IT'S BEEN ASKED BEFORE, it deserves an answer, or at least a _polite_
 point in the direction of the answer

Well, IMHO, if the guys are not up to browse the list thru Google Groups 
to find the answer, I think they should stop coding anything.

I try to help as much as I can here and elsewhere. And I can see that 
most of the people not just saying 'thanxx' for being helped are very 
oftenly guys or gals not having some *very basic* knowledge in 
programming. It's boring !

This place is intented to work like a community, not as a free helpdesk.



--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: blog tutor not working

2008-05-08 Thread seb

seb wrote:
 http://localhost/  points to /var/www/html/blog
 
 http://localhost/posts/
 
 And what about localhost/blog/posts ?

Ouch. Made a mistake. Forget it.

Do you have a posts_controller.php file in your controllers folder ?

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: ARGHH - why is geneateList deprecated

2008-05-08 Thread NOSLOW

In case you didn't pick up on it, I thinks that's a reference to the
You are not a beautiful and unique snowflake quote that Nate has
used before on this list when appropriate. Unfortunately, it's
appropriate around here all too often.

On May 7, 7:48 pm, MikeK [EMAIL PROTECTED] wrote:
 LOL, thanks fellas -- I only let my closest friends call me
 snowflake ;)

 Just curious -- does the find(list) and set::combine apis work on
 the 5875 code base too?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: OT: Shitty Community

2008-05-08 Thread Gwoo

Benjam,

I am not sure where you derive your hostility. Do you have examples
that will serve to backup your assertion, so we may teach the 4th
graders how to behave? From what I have seen, the tone of the
response often matches the tone of the original message. In general
this is a community list and the developers of Cake are rarely
involved. I generally try to stay out of the group until I see
messages that may work to degrade the community. So, if the community
is shitty then it is through no fault but your (the collective)
own. Everyone must help to make it better, or else they are only being
part of the problem. (In case you were wondering, the previous
statement is not part of the communist manifesto;)
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: saveAll with three levels

2008-05-08 Thread John

On 8 Mag, 13:49, Dr. Tarique Sani [EMAIL PROTECTED] wrote:
 On Thu, May 8, 2008 at 4:50 PM, Jose Selesan [EMAIL PROTECTED] wrote:
  Hi all, does anybody know if I can save a model with a hasMany relation
  and each of the related models has a hasMany relation?

  Hi have a model called Trivia with a 'hasMany' relation to model Pregunta
  and model Pregunta has a 'hasMany' relation to model Opcion. But when I call
  $this-Trivia-saveAll($this-data) in my controller, it only saves Trivia
  and their related Pregunta, but not Opcion

 It should work - try with the latest SVN check out

 If does not work then take a look at the related test - modify it for one
 more level and submit as a bug report

 Tarique


Using saveAll i create a new records in each table related to the one
with the primary key linked as hasmany?
am i right?
But what if i just want to edit a field with a primary key?
For example:
http://blog.matsimitsu.nl/code/166/saveall-with-cakephp-part2

Let's take that models and relations.
If i change the id of a todos record, how can i automatically modify
all the records of task linked to id of todos?

Is there a way?

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: OT: Shitty Community

2008-05-08 Thread John David Anderson


On May 8, 2008, at 9:34 AM, AD7six wrote:

 I'd like to build a forum. How can I do that with cake please?

What needs to be said:
- Don't ask vague questions
- Try to work on a solution a bit before asking

What they need:
- Help getting started with CakePHP
- Learn how to fish (use the API, Bakery, Docs, etc.)

How to better ask:
- I'm building Auth into my forum, and I had a question about this  
function in the API
- Anyone else built a forum in CakePHP? I'd be interested to learn  
about gotchas
- New to CakePHP here - found this list from a buddy... Where do I go  
to get started?
- I googled up a blog post about forum creation using Cake... I had a  
question about this part..

How not to answer it:
- Dude, @*(#$ing google it
- I don't have time for this, etc.
- How many times has this very topic been documented/covered on the  
list/, etc
- Gonna pay me to write your stupid app for you?

How to answer it:
- If you're looking to get started with CakePHP,  [insert link to  
bakery, manual, my blog here]
- In order to help, we'd need more information about what you're  
doing... [insert link to bin here'
- We can't answer a question that vague at this point - go ahead and  
dive in - maybe we can help later on.

fwiw

-- John


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cake integration with other app and session

2008-05-08 Thread Esoteric

I second this, I was about to post something here, when I saw this
one.

I am basically looking to integrate another applications session
system into my CakePHP application. The other application be
vbulletin. I haven't really began to see what the best way to do this
would be but comments from others would be nice at the same time,
since I believe our two questions are related. If not I will start my
own email.

Thanks,
-Erik

On May 8, 6:55 am, Ziad [EMAIL PROTECTED] wrote:
 Hi everyone,

 I have an issue that I'd like people's comment(s) on. I am trying to
 integrate an existing app with Cake. We are planning to move the
 entire app over to Cake eventually but will have to do it in stages.
 So we are planning to write new parts of the app in Cake and slowly
 move old stuff over.

 The problem that I was having was with sessions. It seems that Cake
 closes any existing session before doing anything with sessions within
 Cake. Session data from my other app is available in Cake. But session
 data that I save in Cake is not available in the other app. I've got
 around this by commenting out line 167 in cake/libs/session.php:

 function start() {
 if (function_exists('session_write_close')) {
 //  session_write_close();  -- this line
 }
 $this-__initSession();
 return $this-__startSession();
 }

 This seems to work fine but I was wondering if any of the Cake experts
 could point out any negative implications/side effects of doing this.
 I would really appreciate any feedback from you guys.

 Thanks in advance.

 Ziad
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cake integration with other app and session

2008-05-08 Thread Chris Hartjes

On Thu, May 8, 2008 at 6:55 AM, Ziad [EMAIL PROTECTED] wrote:

 The problem that I was having was with sessions. It seems that Cake
 closes any existing session before doing anything with sessions within
 Cake. Session data from my other app is available in Cake. But session
 data that I save in Cake is not available in the other app. I've got
 around this by commenting out line 167 in cake/libs/session.php:

Sometimes this happens depending on the security level in
config/core.php.  If you have it set to high, it recreates the session
on every page load.

Hope that helps.

-- 
Chris Hartjes
Internet Loudmouth
Motto for 2008: Moving from herding elephants to handling snakes...
@TheKeyBoard: http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: OT: Shitty Community

2008-05-08 Thread Dr. Tarique Sani
On Thu, May 8, 2008 at 9:24 PM, John David Anderson 
[EMAIL PROTECTED] wrote:



 On May 8, 2008, at 9:34 AM, AD7six wrote:
 
  I'd like to build a forum. How can I do that with cake please?

 What needs to be said:
- Don't ask vague questions
- Try to work on a solution a bit before asking


http://catb.org/~esr/faqs/smart-questions.html - Sprinkle this URL in
replies often enough and the rest will be  automagical.

Tarique


P.S. try to include the disclaimer as well ;)

-- 
=
Cheesecake-Photoblog: http://cheesecake-photoblog.org
PHP for E-Biz: http://sanisoft.com
=

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: OT: Shitty Community

2008-05-08 Thread [EMAIL PROTECTED]

Benjam does have a point. People can be needlessly mean sometimes and
that can probably make people think twice about if they are
evaluating. But it is not that bad when compared to other communities.
People are always being ripped on in forums and irc.

The documentations is far from perfect, sure. But compared to (Adobe)
Flash it is glorious. Macromedia (and now Adobe) have had 10 over
years to write something useful, funded paying customers, backed by
one of the larget software companies in the world. That manual does
not tell you a single vital piece of information you need to develop
Flash-applications. CakePHP has been around for only a few years and
had for 1.1 a pretty good manual and API-docs. 1.2 version are still
being worked on (a lot by the looks of it) for obvious reasons.

To continue comparing to Flash... Trying to locate any medium to
advanced tutorial, forum-thread or similar resource is a lot harder
than finding answers for CakePHP.

Plenty of stupid questions come from people that do not have the
Cake-vocabulary to search effectively for answers to their questions.
Not everyone is familiar with HABTM from their everyday life. I
certainly wasn't before I started messing with RoR and CakePHP.

/Martin


On May 8, 5:34 pm, seb [EMAIL PROTECTED] wrote:
  I feel that if someone comes to the group with a question, EVEN IF
  IT'S BEEN ASKED BEFORE, it deserves an answer, or at least a _polite_
  point in the direction of the answer

 Well, IMHO, if the guys are not up to browse the list thru Google Groups
 to find the answer, I think they should stop coding anything.

 I try to help as much as I can here and elsewhere. And I can see that
 most of the people not just saying 'thanxx' for being helped are very
 oftenly guys or gals not having some *very basic* knowledge in
 programming. It's boring !

 This place is intented to work like a community, not as a free helpdesk.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



DB down, don't panic

2008-05-08 Thread sbeam

I have a cake app on a server on which the database (mysql) has been
going down every couple weeks or so. I think I fixed that problem with
mysql, but here is the small problem I have with cake:

with Config.debug=0 cake seems to silently ignore the fact there is no
database. This makes for some strange behavior - pages aren't
populated with content, menus are empty, searches return nothing.

with Config.debug=1 then you get a lot of WARNING this and that and
then a message about table not found

either way, my poor client gets very anxious when they see this and
sends me emails in ALL CAPS

So is there a way, maybe just in my default layout view, to detect if
there is no valid DB connection and then display an message along the
lines of:
http://www.damninteresting.net/content/tech_diff.jpg

thanks guys.
-Sam

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cake integration with other app and session

2008-05-08 Thread Ziad

Hi Chris,

Thanks for your response, that certainly goes some way towards
explaining why it happens. What about my question of do you see any
issue/problem with commenting out this session recreation code?

I guess there is the general issue of sharing session data between two
applications, but if both applications are generally secure then are
there any other issues that people can see? Sorry to be somewhat
pedantic about this, its just that if anyone out there can see an
issue then that would save me getting too deep into this before having
to pull back.

Thanks again.

On May 8, 4:59 pm, Chris Hartjes [EMAIL PROTECTED] wrote:
 On Thu, May 8, 2008 at 6:55 AM, Ziad [EMAIL PROTECTED] wrote:

  The problem that I was having was with sessions. It seems that Cake
  closes any existing session before doing anything with sessions within
  Cake. Session data from my other app is available in Cake. But session
  data that I save in Cake is not available in the other app. I've got
  around this by commenting out line 167 in cake/libs/session.php:

 Sometimes this happens depending on the security level in
 config/core.php.  If you have it set to high, it recreates the session
 on every page load.

 Hope that helps.

 --
 Chris Hartjes
 Internet Loudmouth
 Motto for 2008: Moving from herding elephants to handling snakes...
 @TheKeyBoard:http://www.littlehart.net/atthekeyboard
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: OT: Shitty Community

2008-05-08 Thread benjam

 How is calling the documentation horrendous polite? You have any idea
 the amount of hours people take to write that, not to mention that is
 a community effort? I tell you, with the likes of you, I don't doubt
 anyone would call you names, disrespecting other's people valuable
 time like that.

My apologies, I should have been more clear.  The documentation that
is there is very good, but there are holes in the documentation where
pieces are missing.
So the _lack_ of documentation is bad, not the documentation itself,
and I truly am very grateful to the people who spend their time
helping others out by writing documentation.  If I knew anything about
it, I would write some myself, but I've only been working with Cake
for about a week now.

 So...to sum up

 1) there are no stupid questions, only stupid answers
 2) every question, no matter how poorly researched or thought out,
 deserves a civilized answer
 3) people asking questions have no responsibility, only those giving answers .

I actually do agree with 1 and 2, but I never said anything about 3. I
feel that people should do some research before posting (to at least
know the question they are trying to ask), but I also feel that
posting is part of the research.  But the people asking questions _do_
have responsibility. (If I'm reading your sarcasm correctly)

And a 110% ditto to everything John David Anderson said, although he
put it much better than I did.

And to be clear, I think that CakePHP is an amazing piece of code (I
wouldn't be here if I didn't). And this post has nothing to do with
the actual code.  So if you are a developer, please don't feel like I
am attacking you or your code, because I'm not.

And I admit, I am new to this community, so I may not have a broad
enough picture to make generalized statements like this, but of the
posts I've read, most (if not all) of them turned into bashing
sessions. And there are people in this community who have a reputation
for being quite rude, and that is just not right.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Hierarchical Tree Setup

2008-05-08 Thread benjam

Thanks for the reply, for some reason when I tried the 'empty' option
it didn't work, hence my question here.

And thanks for the beforeSave() hint.

On May 7, 8:44 pm, Adam Royle [EMAIL PROTECTED] wrote:
 I can't help you with the scaffolding - never used it, but it's
 certainly possible to do what you want.

 1) Do this in your view.

 echo $form-input('Product.parent_id', array('options' = $categories,
 'empty' = '-- Top Level --'));

 You might need this in your model...

 function beforeSave(){
 if (isset($this-data[$this-alias]['parent_id'])  
 empty($this-data[$this-alias]['parent_id'])){

 $this-data[$this-alias]['parent_id'] = null;
 }
 return true;
 }

 2) The Tree behaviour has generatetreelist() however it display likes
 this:

 Parent 1
 _Child 1-1
 _Child 1-2
 Parent 2
 _Child 2-1
 _Child 2-2
 __Subchild 2-2-1

 I think you would need to create your own method to generate the data
 in the format you wish.

 Cheers,
 Adam

 On May 8, 4:32 am, benjam [EMAIL PROTECTED] wrote:

  I have a location table with the following fields:
  ---
  id
  name
  location_id -- this is a parent location id
  ---

  I have a couple of questions about getting this to work the way I want
  it to using scaffolding.

  1- How can I set it up so the location_id select box on the form has a
  default value of 0 - 'Top Level' without putting a 'Top Level' entry
  in the table?

  2- How can I get the select box to output in the following format?

  -- Top Level --
  Parent 1
  Parent 1 :: Child 1-1
  Parent 1 :: Child 1-2
  Parent 2
  Parent 2 :: Child 2-1
  Parent 2 :: Child 2-2
  Parent 2 :: Child 2-2 :: Subchild 2-2-1
  etc.

  where the tree is built in the order of the ids of the parents, then
  the order of the idds of the children.

  I can do this manually, but I'd like to know a 'Cake' way of doing it.

  And if I must do this manually, how do I get it to play nice with the
  $form-input method?  If I need to at all?

  Thanks for your help.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



1.2 Documentation has made amazing progress

2008-05-08 Thread keymaster

I think it's time to change the initial knee-jerk reaction when
speaking about cake's documentation.

If I remember correctly, only 3-4 months ago there was something like
190 pages. Most of the new 1.2 features were either totally
undocumented, or sparse at best.

I just had a look today using a pdf created version of the 1.2
cookbook. It currently weighs in at over 330 pages!

We clearly have to recognize that the progress on these 1.2 docs over
the last couple of months, has been nothing short of amazing.

The 1.2 documentation is now, literally, light years better than it
was just a few months ago.

A couple of more months at this pace, with community members
continuing to use the doc, post suggestions, amendments, fleshing out
the stuff not yet documented, etc. and I believe we will have totally
obliterated any lingering perception of the documentation being an
issue.

Much appreciation to John Anderson, AD7-Six et al., for the great
work. Let's all pitch in and submit something to the cookbook to help
them.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Model recursion

2008-05-08 Thread MonkeyGirl

Hi.

Sorry if this is obvious, but is it possible to set recursion to only
go down (to things that belong to the model in question), and not up
(to things that the model belongs to)? I've got a model that I've been
recursing four levels deep, which has been working fine. Now, though,
I've come to realise that I have to set it up to belong to another
model that in turn has a *lot* of things belonging to it. Just putting
in the $belongsTo makes the whole site time out.

Thanks for your help,
Zoe.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Model recursion

2008-05-08 Thread keymaster

http://bakery.cakephp.org/articles/view/bindable-behavior-control-your-model-bindings


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: 1.2 Documentation has made amazing progress

2008-05-08 Thread Aaron Shafovaloff

I might disagree on the way the book is structured, but I'd have to
agree that it has come a long way. I use it a lot now. Good job, guys.

On May 8, 10:33 am, keymaster [EMAIL PROTECTED] wrote:
 I think it's time to change the initial knee-jerk reaction when
 speaking about cake's documentation.

 If I remember correctly, only 3-4 months ago there was something like
 190 pages. Most of the new 1.2 features were either totally
 undocumented, or sparse at best.

 I just had a look today using a pdf created version of the 1.2
 cookbook. It currently weighs in at over 330 pages!

 We clearly have to recognize that the progress on these 1.2 docs over
 the last couple of months, has been nothing short of amazing.

 The 1.2 documentation is now, literally, light years better than it
 was just a few months ago.

 A couple of more months at this pace, with community members
 continuing to use the doc, post suggestions, amendments, fleshing out
 the stuff not yet documented, etc. and I believe we will have totally
 obliterated any lingering perception of the documentation being an
 issue.

 Much appreciation to John Anderson, AD7-Six et al., for the great
 work. Let's all pitch in and submit something to the cookbook to help
 them.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: 1.2 Documentation has made amazing progress

2008-05-08 Thread Sliv (Tim MacAleese)

Yes, indeed, I use it a lot too - maybe at some point there will be a
way to mirror it to contributed servers so it doesn't get too slow due
to the size and number of people using it :P

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: OT: Shitty Community

2008-05-08 Thread the_woodsman

I do find it interesting to compare Cake responses with, say, the
JQuery group- where someone titles their post it's not working and
still get loads of polite and helpful responses!

I think that although the cook book is defnitely filling the gap in
the documentation, the long period where Cake documentation was
lacking is the root of the current situation, as it put a lot of
stress on the developers to contribute to this group.This group was
for a long time the most useful resource for Cake info.

Learning Cake, especially 1.2, was not easy for a long time, and once
you've had to learn everything the hard way, you're less inclined to
help people who want a free ride!

I think that once the cook book becomes more of a known one stop
shop for cake info (especially with some more tutorials as opposed to
just manual style content)  then people wil be less likely to post
dumb questions, and when they do, people will be a lot more inclined
to give friendly, useful  answers!

Plug: I wrote a similar blog post to the one above about the best ways
to reply to these kinds of posts (http://www.acumendevelopment.net/
archives/44).





--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Label with checkbox formhelper and CakePHP 1.2

2008-05-08 Thread BrendonKoz

What field type creates a checkbox?  I was looking for this earlier
and was unable to find it.

On May 8, 10:25 am, grigri [EMAIL PROTECTED] wrote:
 The form helper's `input()` and `inputs()` methods generate labels,
 the individual control methods (`text()`, `checkbox()`) do not. This
 is 100% by design.

  So.. how do i manage to properly label the checkbox?

 echo $form-input('dbDBName',array( 'label' = _('DB Database
 Name', 'type' = 'checkbox')));

  Btw.. its a tableless model, so no data connection.

 You can (and should) create a schema for the model. This will allow
 the form helper to automatically choose the correct field type.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: 1.2 Documentation has made amazing progress

2008-05-08 Thread Aaron Shafovaloff

It's been sporadically unresponsive today. Perhaps they're not
caching?

On May 8, 11:04 am, Sliv (Tim MacAleese) [EMAIL PROTECTED] wrote:
 Yes, indeed, I use it a lot too - maybe at some point there will be a
 way to mirror it to contributed servers so it doesn't get too slow due
 to the size and number of people using it :P
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: OT: Shitty Community

2008-05-08 Thread Sliv (Tim MacAleese)

I have to agree with Gwoo, I haven't seen any replies that weren't
appropriate to the post being replied to.

If you write a post that shows you haven't read the welcome blurb
posted on the group front page that tells you to search first before
asking, and links to the wiki pages with a ton of information, then
you will get an equivalent response (a link to google, a link to the
cookbook, etc.).

If you write a post with an subject that has all the politeness of a
slap in the face like sh**y community or losing faith in cake,
etc. then you will get an equally offensive reply like there's the
door, troll.

If you choose words/topics that can be taken as personally offensive
to the people who work on this project, then you will get a personally
offensive reply.

Actually, I'd be surprised if you could show me even one post that
received a reply that was not appropriate...

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: OT: Shitty Community

2008-05-08 Thread John David Anderson


On May 8, 2008, at 11:22 AM, Sliv (Tim MacAleese) wrote:


 I have to agree with Gwoo, I haven't seen any replies that weren't
 appropriate to the post being replied to.

 If you write a post that shows you haven't read the welcome blurb
 posted on the group front page that tells you to search first before
 asking, and links to the wiki pages with a ton of information, then
 you will get an equivalent response (a link to google, a link to the
 cookbook, etc.).

 If you write a post with an subject that has all the politeness of a
 slap in the face like sh**y community or losing faith in cake,
 etc. then you will get an equally offensive reply like there's the
 door, troll.

 If you choose words/topics that can be taken as personally offensive
 to the people who work on this project, then you will get a personally
 offensive reply.

 Actually, I'd be surprised if you could show me even one post that
 received a reply that was not appropriate...

While I suppose it might be fair, I'm going to argue that it's  
actually not an appropriate response anymore.

An eye for an eye, and soon the whole world is blind
--- Ghandi

How about we try to be polite even if the other person isn't? That  
goes for both sides.

-- John

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



What kind of authentication script?, tutorial? do you use?

2008-05-08 Thread Louie Miranda
I am looking for a authentication script?, tutorial for my new app that will
work on 1.2

I search on the bakery and found this results:
http://bakery.cakephp.org/articles/search -- search string = auth

Any suggestions? I got confused.
-- 
Louie Miranda ([EMAIL PROTECTED])
http://www.axishift.com

Security Is A Series Of Well-Defined Steps
chmod -R 0 / ; and smile :)

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: What kind of authentication script?, tutorial? do you use?

2008-05-08 Thread Mathew Nik Foscarini
I'm switching from the default auth component to the DarthAuth component. Looks 
like it has everything you could need without the overhead of ACLs.


- Original Message 
From: Louie Miranda [EMAIL PROTECTED]
To: cake-php@googlegroups.com
Sent: Thursday, May 8, 2008 1:28:19 PM
Subject: What kind of authentication script?, tutorial? do you use?

I am looking for a authentication script?, tutorial for my new app that will 
work on 1.2

I search on the bakery and found this results:
http://bakery.cakephp.org/articles/search -- search string = auth

Any suggestions? I got confused.
-- 
Louie Miranda ([EMAIL PROTECTED])
http://www.axishift.com

Security Is A Series Of Well-Defined Steps
chmod -R 0 / ; and smile :) 


  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: OT: Shitty Community

2008-05-08 Thread Sliv (Tim MacAleese)

kumbayah.


 How about we try to be polite even if the other person isn't? That
 goes for both sides.

 -- John
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: ARGHH - why is geneateList deprecated

2008-05-08 Thread nate

Trac has decided to be busted right now, so it's harder to figure that
out.  Anyway, seriously, your best bet is just to bite the bullet and
update.  There haven't been *that* many changes, and the deprecated
stuff usually tells you exactly how to fix it.  And a lot of annoying
bugs have been fixed since then.

On May 7, 7:48 pm, MikeK [EMAIL PROTECTED] wrote:
 LOL, thanks fellas -- I only let my closest friends call me
 snowflake ;)

 Just curious -- does the find(list) and set::combine apis work on
 the 5875 code base too?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Getting Cake build version?

2008-05-08 Thread Mathew Nik Foscarini
I hope this isn't a stupid question, but how can I check what version of Cake 
1.2. is installed?

I also need to update my Cake 1.2 install with the latest version. When copying 
files over top my existing install which files should not get modified? are 
there any I should worry about, or is it safe to write overwrite everything.

Also, how does the Cake team handle deleted files from the build updates? Is 
there a list of files that have been removed?

Thanks guys,
Mat.



  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Something on the top of CakePHP

2008-05-08 Thread mbavio

On May 8, 11:03 am, Sliv (Tim MacAleese) [EMAIL PROTECTED] wrote:
 An example further to Chris' point is a recent discussion I had with
 Nate - I ran into an issue where I passed an IP address through built-
 in IP validation then used ip2long to convert it so I could store it
 in a MySQL signed INT.  I noticed that an IP written like
 255.255.255.011 would pass validation, but if you convert it with
 ip2long, store it, retrieve it, convert it with long2ip, you end up
 with 255.255.255.9.

 Now, I could have posted a rant here saying OH NOES!! CAKE IS FAIL MY
 IP VERY BAD! and then talked about what I would change in the core to
 fix this.

 What did I do instead?  I looked up popular regular expressions for
 validating IP addresses and saw that they would also validate
 255.255.255.011 as acceptable.  I then put some code in my beforeSave
 method to modify the submitted octets to their abs() values before
 using ip2long.  Problem solved.

 As a final step, I politely contacted Nate, explained what I had
 discovered, and asked what his thoughts were on the situation.  He
 told me (basically) that validation is not about changing data that's
 submitted, it's about ensuring the data is correct (not an exact
 quote).

 So, I learned something from my own research and sandbox work, I got
 input from a developer with far more skill than me, and I don't think
 I offended anyone or waste anyone's time.  Above all, I think I walked
 away without looking like a moron.

Congratulations, you are a mature programmer. It´s a shame that there
are only a few of them.

Cheers,
mbavio
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: OT: Shitty Community

2008-05-08 Thread benjam

 I do find it interesting to compare Cake responses with, say, the
 JQuery group- where someone titles their post it's not working and
 still get loads of polite and helpful responses!


Maybe I've just been around the jQuery group too long...
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: OT: Shitty Community

2008-05-08 Thread mbavio

I think this guy is just looking for 5 minutes of fame and fortune :P

Cheers,
mbavio
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: What kind of authentication script?, tutorial? do you use?

2008-05-08 Thread mbavio

DarkAuth seems like a simpler solution to simple cases, but if you
need the FULL power, you need to learn how to use Auth / ACL. Two
months ago, I would tell you good luck with that, but nowadays there
are plenty of docs, including the amazing CookBook.

Cheers,
mbavio

On May 8, 2:31 pm, Mathew Nik Foscarini [EMAIL PROTECTED] wrote:
 I'm switching from the default auth component to the DarthAuth component. 
 Looks like it has everything you could need without the overhead of ACLs.

 - Original Message 
 From: Louie Miranda [EMAIL PROTECTED]
 To: cake-php@googlegroups.com
 Sent: Thursday, May 8, 2008 1:28:19 PM
 Subject: What kind of authentication script?, tutorial? do you use?

 I am looking for a authentication script?, tutorial for my new app that will 
 work on 1.2

 I search on the bakery and found this 
 results:http://bakery.cakephp.org/articles/search-- search string = auth

 Any suggestions? I got confused.
 --
 Louie Miranda ([EMAIL PROTECTED])http://www.axishift.com

 Security Is A Series Of Well-Defined Steps
 chmod -R 0 / ; and smile :)

   
 
 Be a better friend, newshound, and
 know-it-all with Yahoo! Mobile.  Try it now.  
 http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



OT: JQuery Group CakePHP Group

2008-05-08 Thread Sliv (Tim MacAleese)

...
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: What kind of authentication script?, tutorial? do you use?

2008-05-08 Thread [EMAIL PROTECTED]

i use and have been happy with othAuth; there's articles about it in
(on?) the bakery; it works w/ 1.2 with a few modifications that can be
found with a quick googling

On May 8, 1:28 pm, Louie Miranda [EMAIL PROTECTED] wrote:
 I am looking for a authentication script?, tutorial for my new app that will
 work on 1.2

 I search on the bakery and found this 
 results:http://bakery.cakephp.org/articles/search-- search string = auth

 Any suggestions? I got confused.
 --
 Louie Miranda ([EMAIL PROTECTED])http://www.axishift.com

 Security Is A Series Of Well-Defined Steps
 chmod -R 0 / ; and smile :)
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: What kind of authentication script?, tutorial? do you use?

2008-05-08 Thread Sliv (Tim MacAleese)

I started off a long time ago trying othAuth, obAuth, (can't remember
all the different names, but I tried several).  The problem I ran into
is that you are then stuck if you upgrade your core and whatever
script you chose happens to break because it used overrides or hacks
or whatever.  Or, the script simply didn't get updated to fix various
bugs because the developer had moved on to other things.

More recently I chose to just search all over the place, mainly
hitting places like Chris Hartjes' blog, this Group, other blogs, etc.
and also just read through the API.  I'm still not what I would
consider confident about working with Auth/ACL, but I am more
comfortable upgrading my core without breaking my app because I'm
trying to stick to the conventions of the framework (plus having more
understanding of how the implementation works in my app).

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Getting Cake build version?

2008-05-08 Thread Sliv (Tim MacAleese)

My personal thought is you should keep your app and your cake core
separate - then you can just delete the core and replace it with a
fresh update without touching your app.  The http://book.cakephp.org
installation section explains how to keep them separate.

I'm not aware of a simple way to check your specific revision from
within your app.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



hasMany relationship simply not working

2008-05-08 Thread rpupkin77

Hey,

I have a hasMany relationship which when I bake the model, php picks
up. I also have a corresponding belongsTo in teh other model. For some
reason when I try to get this data, mysql throws an error saying that
that table can't be found.

To simplify, that hasMany relationship (in this case, School hasMany
SchoolMajor)  is not being added to the sql query which is built by
cake.

There can't be an error in the relationships because they were built
using bake. I have double and triple checked them. if i wasn't sure of
this I would post them. however, I will post the sql error along with
the Joins and the Where clause which I have built:

Thanks in advance to anyone.

FROM `schools` AS `School` LEFT JOIN `campus_types` AS `CampusType` ON
(`School`.`locale` = `CampusType`.`id`) LEFT JOIN `states` AS `State`
ON (`School`.`stabbr` = `State`.`id`) LEFT JOIN `is_types` AS `IsType`
ON (`School`.`sector` = `IsType`.`id`) LEFT JOIN `school_admissions`
AS `SchoolAdmission` ON (`SchoolAdmission`.`school_id` =
`School`.`id`) LEFT JOIN `school_aids` AS `SchoolAid` ON
(`SchoolAid`.`school_id` = `School`.`id`) LEFT JOIN `school_arrests`
AS `SchoolArrest` ON (`SchoolArrest`.`school_id` = `School`.`id`) LEFT
JOIN `school_crimes` AS `SchoolCrime` ON (`SchoolCrime`.`school_id` =
`School`.`id`) LEFT JOIN `school_missions` AS `SchoolMission` ON
(`SchoolMission`.`school_id` = `School`.`id`) LEFT JOIN
`school_tuitions` AS `SchoolTuition` ON (`SchoolTuition`.`school_id` =
`School`.`id`) LEFT JOIN `vocational_tuitions` AS `VocationalTuition`
ON (`VocationalTuition`.`school_id` = `School`.`id`) WHERE
`SchoolMajor`.`awlevel` = 6 AND `School`.`id` =164465 ORDER BY
`SchoolMajor`.`crace24` DESC LIMIT 1


Warning: SQL Error: 1054: Unknown column 'SchoolMajor.awlevel' in
'where clause' in C:\_projects\eclipse\NEW-MF\site\cake\libs\model
\datasources\dbo_source.php on line 440




--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Model filter possible

2008-05-08 Thread jmmg77

My question is simple, but I haven't been able to find the answer.
I'm using Cakephp1.2 which I'm really liking, but I can't seem to
figure this one out.

Is there a way to hard code conditions in the model itself.  I'm not
talking about associations just the model itself.

An example would be if I have a 'people' table.  Can I create a model
called 'members' that filters all people with a valid memberid?

(there would be no good reason to do this, this is simply an example).

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Getting Cake build version?

2008-05-08 Thread seb

Mathew Nik Foscarini wrote:
 I hope this isn't a stupid question, but how can I check what version of 
 Cake 1.2. is installed?

There's a version.txt file located in cake core files folder.

 I also need to update my Cake 1.2 install with the latest version. When 
 copying files over top my existing install which files should not get 
 modified? are there any I should worry about, or is it safe to write 
 overwrite everything.

Well, you can overwrite all cake core files. This is harmless for your app.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How to catch errors / warnings from ConnectionManager::create

2008-05-08 Thread Deckard

Hi!

I am just creating an installer for a cake application.
It uses a tableless model and after the user input his DB connection
details I test the connection to the new database using this code.


  $db = ConnectionManager::create('test',array('driver'
= $postdata['installation']['dbType'],
 
'persistent' = false,
'host' =
$postdata['installation']['dbHost'],
'port' =
$postdata['installation']['dbPort'],
'login' =
$postdata['installation']['dbUsername'],
'password'
= $postdata['installation']['dbPassword'],
'database'
= $postdata['installation']['dbDBName'],
'schema'
= '',
'prefix'
=  $postdata['installation']['dbPrefix'],
'encoding'
= 'UTF-8'));
  if ($db-connected) {


It works fine except that i have no information why the connect
attempt fails. I just know it failed by checking if the DB is
connected or not. What i would like to show to the user is the warning
message the DBis giving back (and which is outputted when debug mode
is activated.

The $db-error property is empty btw, so that is not the solution.

Thank you for any help!

Carsten
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



IE7 Export XLS Problem

2008-05-08 Thread Christopher E. Franklin, Sr.

Hello wonderful group!

I have written some code that in essence, takes a date range and
serves up two different formats depending what button you click.

Firstly, is the View button.  So, for example, I select a date range
and click view, I get a table on the same page with the information I
need.  This works fine in IE7 and Firefox.

Secondly, I have another button called Export.  Basically, it is the
same form with the date ranges except, when I click the button, it
calls a different function in my controller.  The controller gets the
data from the model and packages it via a component as comma separated
values (CSV).  It then just echos out the PHP headers and the CSV
data.

My problem is, it works fine in Firefox.  When I click export, the
date range is submitted, and I get a download window for the xls
file.  But, when I do the same thing in IE7 and IE6, I get an error
stating that:

Internet Explorer cannot download renewals_certificate_export from
subdomain.domain.com

Internet Explorer was not able to open this Internet site. The
requested site is either unavailable or cannot be found. Please try
again later.

So, while this error message is being displayed, I see the download
box in the background, like it is ready to download.  So, that tells
me that the headers for php are correct but, I cannot figure out why
IE7 has a problem downloading variable data on the fly.

I have tried changing the headers to something else to no avail.  I
have tried making the URL different by including the full URL, with an
ending slash (/) and also by including a file name on the end and
accepting it in my controller function (/text.xls).

I am at a loss here.  So, I know it's a problem with IE7, not CakePHP
or with the PHP headers.  Just wondering if anyone has had a similar
problem?  If so, were you able to resolve the issue?

Here is my code:

Controller
-

function renewals_certificate_export($name = null) {
Configure::write('debug', 0);
if(!empty($this-data)) {
$from = date('Y-m-d', strtotime($this-data['Report']
['from_month']./.$this-data['Report']['from_day']./.$this-
data['Report']['from_year'])). 00:00:00;
$to = date('Y-m-d', 
strtotime($this-data['Report']['to_month']./.
$this-data['Report']['to_day']./.$this-data['Report']
['to_year'])). 23:59:59;
$not = '';
if($this-data['Report']['stager'] == 0) {
$not .= AND type != 'Stager' ;
}
if($this-data['Report']['master'] == 0) {
$not .= AND type != 'Master' ;
}
if($this-data['Report']['realtor'] == 0) {
$not .= AND type != 'Realtor' ;
}
if($this-data['Report']['iahsp'] == 0) {
$not .= AND type != 'Iahsp';
}
$results = $this-Report-findAll(date = '$from' AND 
date =
'$to' $not);
foreach($results as $key = $value) {
$user = 
$this-Asp-findByUid($value['Report']['uid']);
$results[$key]['Report']['first_name'] = 
$user['Asp']['fname'];
$results[$key]['Report']['last_name'] = 
$user['Asp']['lname'];
$results[$key]['Report']['email'] = 
$user['Asp']['email'];
$results[$key]['Report']['expiration_date'] = 
$user['Asp']
['anniversary'];
}
$this-Excel-addRow(array(ID, First Name, Last 
Name, Type,
Email, Expiration Date));
foreach($results as $key = $value) {

$this-Excel-addRow(array($value['Report']['uid'],
$value['Report']['first_name'], $value['Report']['last_name'],
$value['Report']['type'], $value['Report']['email'], date('Y-m-d',
strtotime($value['Report']['expiration_date'];
}
$this-Excel-download(date('Y-m-d', 
strtotime($this-data['Report']
['from_month']./.$this-data['Report']['from_day']./.$this-
data['Report']['from_year']))._.date('Y-m-d', strtotime($this-
data['Report']['to_month']./.$this-data['Report']['to_day']./.
$this-data['Report']['to_year']))..xls);
}
}

Excel Component
--

class ExcelComponent extends Object {
var $lines;

function addRow($data) {
if(is_array($data)) {
foreach($data as $key = $value) {
$this-lines .= trim($value).\t;
}
$this-lines = str_replace(\r,,$this-lines);
$this-lines .= \n;
} else {

Re: OT: Shitty Community

2008-05-08 Thread benjam

 I think this guy is just looking for 5 minutes of fame and fortune :P

yes please.

everybody who has posted a response please send me $5.

mbavio gets to send me $10.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: IE7 Export XLS Problem

2008-05-08 Thread Christopher E. Franklin, Sr.

Okay, I got it thanks to some guidance from _psychic_  thank you!

So, the problem here was that the headers were all wrong.

They went from:

header(Content-type: application/vnd.ms-excel);
header(Content-Disposition: attachment; filename=
$file_name);
header(Pragma: no-cache);
header(Expires: 0);

To:

$mm_type=application/octet-stream;

header(Cache-Control: public, must-revalidate);
header(Pragma: hack);
header(Content-Type:  . $mm_type);
//header(Content-Length:  .(string)(filesize($fullpath)) );
//header('Content-Disposition: attachment; filename='.
$filename.'');
header(Content-Transfer-Encoding: binary\n);

//header(Content-type: application/vnd.ms-excel);
header(Content-Disposition: attachment; filename=$file_name);
// header(Pragma: no-cache);
header(Expires: 0);

I think what did it was the application.octet-stream and the
Content-Transfer-Encoding: binary\n

Thanks again _psychic_

Here was where I found these headers:

http://us2.php.net/header

A post by : blinki bill

On May 8, 12:14 pm, Christopher E. Franklin, Sr.
[EMAIL PROTECTED] wrote:
 Hello wonderful group!

 I have written some code that in essence, takes a date range and
 serves up two different formats depending what button you click.

 Firstly, is the View button.  So, for example, I select a date range
 and click view, I get a table on the same page with the information I
 need.  This works fine in IE7 and Firefox.

 Secondly, I have another button called Export.  Basically, it is the
 same form with the date ranges except, when I click the button, it
 calls a different function in my controller.  The controller gets the
 data from the model and packages it via a component as comma separated
 values (CSV).  It then just echos out the PHP headers and the CSV
 data.

 My problem is, it works fine in Firefox.  When I click export, the
 date range is submitted, and I get a download window for the xls
 file.  But, when I do the same thing in IE7 and IE6, I get an error
 stating that:

 Internet Explorer cannot download renewals_certificate_export from
 subdomain.domain.com

 Internet Explorer was not able to open this Internet site. The
 requested site is either unavailable or cannot be found. Please try
 again later.

 So, while this error message is being displayed, I see the download
 box in the background, like it is ready to download.  So, that tells
 me that the headers for php are correct but, I cannot figure out why
 IE7 has a problem downloading variable data on the fly.

 I have tried changing the headers to something else to no avail.  I
 have tried making the URL different by including the full URL, with an
 ending slash (/) and also by including a file name on the end and
 accepting it in my controller function (/text.xls).

 I am at a loss here.  So, I know it's a problem with IE7, not CakePHP
 or with the PHP headers.  Just wondering if anyone has had a similar
 problem?  If so, were you able to resolve the issue?

 Here is my code:

 Controller
 -

         function renewals_certificate_export($name = null) {
                 Configure::write('debug', 0);
                 if(!empty($this-data)) {
                         $from = date('Y-m-d', strtotime($this-data['Report']
 ['from_month']./.$this-data['Report']['from_day']./.$this-data['Report']['from_year'])).
  00:00:00;

                         $to = date('Y-m-d', 
 strtotime($this-data['Report']['to_month']./.
 $this-data['Report']['to_day']./.$this-data['Report']
 ['to_year'])). 23:59:59;
                         $not = '';
                         if($this-data['Report']['stager'] == 0) {
                                 $not .= AND type != 'Stager' ;
                         }
                         if($this-data['Report']['master'] == 0) {
                                 $not .= AND type != 'Master' ;
                         }
                         if($this-data['Report']['realtor'] == 0) {
                                 $not .= AND type != 'Realtor' ;
                         }
                         if($this-data['Report']['iahsp'] == 0) {
                                 $not .= AND type != 'Iahsp';
                         }
                         $results = $this-Report-findAll(date = '$from' 
 AND date =
 '$to' $not);
                         foreach($results as $key = $value) {
                                 $user = 
 $this-Asp-findByUid($value['Report']['uid']);
                                 $results[$key]['Report']['first_name'] = 
 $user['Asp']['fname'];
                                 $results[$key]['Report']['last_name'] = 
 $user['Asp']['lname'];
                                 $results[$key]['Report']['email'] = 
 $user['Asp']['email'];
                                 

Re: OT: Shitty Community

2008-05-08 Thread mbavio

And your post is a bit ironic... Your are asking for polite manners,
and the title of the post is Shitty Community... Lol, I just think
that you are bored and you have nothing better to do than fudd a
little. Calm down, it will be worse if anybody answers any question.

Cheers,
mbavio

On May 8, 4:29 pm, benjam [EMAIL PROTECTED] wrote:
  I think this guy is just looking for 5 minutes of fame and fortune :P

 yes please.

 everybody who has posted a response please send me $5.

 mbavio gets to send me $10.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Model filter possible

2008-05-08 Thread mbavio

When you define the model associations, you can add a conditions key
to the array. Check the CookBook and you will understand what I mean.
Wait, let me give you an example:

var $hasMany = array('Book' = array('conditions' =
array('Book.price' = '!= 0')));

Hope this can help you.

Cheers,
mbavio

On May 8, 3:11 pm, jmmg77 [EMAIL PROTECTED] wrote:
 My question is simple, but I haven't been able to find the answer.
 I'm using Cakephp1.2 which I'm really liking, but I can't seem to
 figure this one out.

 Is there a way to hard code conditions in the model itself.  I'm not
 talking about associations just the model itself.

 An example would be if I have a 'people' table.  Can I create a model
 called 'members' that filters all people with a valid memberid?

 (there would be no good reason to do this, this is simply an example).
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: DB down, don't panic

2008-05-08 Thread Dardo Sordi Bogado

All you need is in the view file for the default home page that cake
creates for you.

On Thu, May 8, 2008 at 1:13 PM, sbeam [EMAIL PROTECTED] wrote:

 I have a cake app on a server on which the database (mysql) has been
 going down every couple weeks or so. I think I fixed that problem with
 mysql, but here is the small problem I have with cake:

 with Config.debug=0 cake seems to silently ignore the fact there is no
 database. This makes for some strange behavior - pages aren't
 populated with content, menus are empty, searches return nothing.

 with Config.debug=1 then you get a lot of WARNING this and that and
 then a message about table not found

 either way, my poor client gets very anxious when they see this and
 sends me emails in ALL CAPS

 So is there a way, maybe just in my default layout view, to detect if
 there is no valid DB connection and then display an message along the
 lines of:
 http://www.damninteresting.net/content/tech_diff.jpg

 thanks guys.
 -Sam

 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Model filter possible

2008-05-08 Thread jmmg77

Thank you for your help.  Is this example model something other than
book?

What I am trying to do is not typical associations between models.

It would be like this, I have a table called books.  I would like to
create two different models that behave as if there are two completely
different tables, but they are both based on the 'books' table.

The first model would be called 'novel' where booktype = 1.
The second would be called 'studyguide' where booktype = 2.

Again, in this example, there are many reasons not to do this, but I
do have a specific need for something like this.

On May 8, 2:44 pm, mbavio [EMAIL PROTECTED] wrote:
 When you define the model associations, you can add a conditions key
 to the array. Check the CookBook and you will understand what I mean.
 Wait, let me give you an example:

 var $hasMany = array('Book' = array('conditions' =
 array('Book.price' = '!= 0')));

 Hope this can help you.

 Cheers,
 mbavio

 On May 8, 3:11 pm, jmmg77 [EMAIL PROTECTED] wrote:

  My question is simple, but I haven't been able to find the answer.
  I'm using Cakephp1.2 which I'm really liking, but I can't seem to
  figure this one out.

  Is there a way to hard code conditions in the model itself.  I'm not
  talking about associations just the model itself.

  An example would be if I have a 'people' table.  Can I create a model
  called 'members' that filters all people with a valid memberid?

  (there would be no good reason to do this, this is simply an example).
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Model filter possible

2008-05-08 Thread mbavio

Model Category on my app:

var $hasMany = array('Article', 'ChildCategory' = array(

   'className' = 'Category',

   'dependent' = false,

   'foreignKey' = 'parent_id',

   'order' = 'ChildCategory.order ASC',

   )
);

So you can see that I can relate a model with itself.

Cheers,
mbavio

On May 8, 5:08 pm, jmmg77 [EMAIL PROTECTED] wrote:
 Thank you for your help.  Is this example model something other than
 book?

 What I am trying to do is not typical associations between models.

 It would be like this, I have a table called books.  I would like to
 create two different models that behave as if there are two completely
 different tables, but they are both based on the 'books' table.

 The first model would be called 'novel' where booktype = 1.
 The second would be called 'studyguide' where booktype = 2.

 Again, in this example, there are many reasons not to do this, but I
 do have a specific need for something like this.

 On May 8, 2:44 pm, mbavio [EMAIL PROTECTED] wrote:

  When you define the model associations, you can add a conditions key
  to the array. Check the CookBook and you will understand what I mean.
  Wait, let me give you an example:

  var $hasMany = array('Book' = array('conditions' =
  array('Book.price' = '!= 0')));

  Hope this can help you.

  Cheers,
  mbavio

  On May 8, 3:11 pm, jmmg77 [EMAIL PROTECTED] wrote:

   My question is simple, but I haven't been able to find the answer.
   I'm using Cakephp1.2 which I'm really liking, but I can't seem to
   figure this one out.

   Is there a way to hard code conditions in the model itself.  I'm not
   talking about associations just the model itself.

   An example would be if I have a 'people' table.  Can I create a model
   called 'members' that filters all people with a valid memberid?

   (there would be no good reason to do this, this is simply an example).
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: hi guys

2008-05-08 Thread MonkeyGirl

Hi!

 but when i point the browser to;http://localhost/posts/

 it shows: The requested URL /posts was not found on this server.

 any ideas what i could be doing wrong?

It sounds like you have debugging set to 0 (off). If you edit app/
config/core.php, you can change it to 1 or 2 in order to get a more
detailed error message.

Most likely, you need to create a file called app/controllers/
posts_controller.php, and give it the right contents to have a
function called index, plus create app/views/posts and put a file
called index.ctp in it.

There should be many guides on getting these things set up, although
last I checked (which was a while ago now), Cake was kinda in between
documentation...

Hope that helps,
Zoe.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



  1   2   >