Re: using cake to make a light database administration app

2007-11-22 Thread alex.tomes

Maybe I wasn't clear enough: this is a database admin application,
what do I do, I choose a random table from the the random databases
and make a dynamic model? this isn't very good programming practice...
even so, I can't dynamically switch databases that are not defined in
the database config... I think this cakephp isn't what I as looking
for in this case, I think I am going to switch to code igniter and see
what it can offer for this...

On Nov 23, 1:58 am, AD7six <[EMAIL PROTECTED]> wrote:
> On Nov 22, 11:54 pm, "alex.tomes" <[EMAIL PROTECTED]> wrote:
>
> > Yeah really cool approach, but to what model I assign queries like
> > "show databases" or "show tables"
>
> Any one of them.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



Question son "Blog Tutorial" on CakePHP.org ?

2007-11-22 Thread Mr.Blue

When i trying to practice the blog tutorial, I got an issue that.

I need  to name post_controller.php instead of posts_controller.php
like the tutorial showed.

and the content is wrong also:



My first cakephp only run when I correct this.

I 'm using PHP 5.2.3 and Apache 2 on an Ubuntu machine, is there any
thing wrong ?

Thanks so much for your any help
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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: Thoughts for a cake "application boilerplate"

2007-11-22 Thread Dr. Tarique Sani

On Nov 23, 2007 12:20 PM, keymaster <[EMAIL PROTECTED]> wrote:
> What would you put in your boilerplate, and how would you structure
> it ?

CakePHP Framework is my boilerplate - however if I was into making
cookie-cutters I would add a forum and then a sink? 


T

-- 
=
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 "Cake 
PHP" 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
-~--~~~~--~~--~--~---



Thoughts for a cake "application boilerplate"

2007-11-22 Thread keymaster

Well, finally starting to plan what I really should have done some
time ago organize an application boilerplate which can be reused
from client to client.

Just an attempt to be a little more efficient in development, DRY
style. I'm sure many of you have thought the same thing at some time.

So, in thinking of all the things most clients would need, I came up
with the following list which would go into this boilerplate:

user management,
ajax support - turning off debug info being displayed during ajax
request,
site offlining,
cron dispatcher,
session expiry management,
access control,
input/url sanitization,
admin panel generation,
cms plugin,
catalog plugin (ie. search, list, detail),
cart plugin,
all the useful omponents/helpers/behaviors and tricks that I can find
on the bakery or wherever,
etc.

Then as each new client comes along, I pop in the boilerplate app
folder, and in a plug-in I would put the client specific code. That
way, if I ever update the boilerplate, it is easier to migrate over.
Just put in the new boilerplate app folder, and copy in the client
plugin.

With this lofty goal in mind, I thought I would open up to the
community and see what other people's thinking is.

What would you put in your boilerplate, and how would you structure
it ?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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: Reserved names within fieldnames

2007-11-22 Thread Gwoo

This seems like more of a bug to me. It is most likely a by product of
some pragmatic programming, and maybe could be refactored to allow for
more use cases. I am curious what caused the problem with
"followupdate". I can certianly see why Adrian had trouble, but even
in his case it should not matter unless he is passing
personalIdentifiers to the view, in which case Cake would try to
populate a select.

I hope that Adrian will expand on his experience a little more than to
just saying there are a few hiccups.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



Reserved names within fieldnames

2007-11-22 Thread villas

Further to Adrian Gould's post below which was posted on the wrong
thread...

I had a similar problem with my fieldname 'followupdate'.  It might be
a good idea to have a list of reserved names which shouldn't be
included in fieldnames.  However,  once you are aware of the problem,
you are probably more careful in considering your choice of
fieldname.  Having had my previous experience,  'personal_identifier'
would certainly get my alarm bell ringing,  but I'm sure this would
catch out quite a few people.

On Nov 22, 6:08 am, "Gould, Adrian" <[EMAIL PROTECTED]>
wrote:
> I noted a problem with _id when you want to use the name of a field such as 
> personal_identifier - cake believes it is personal_id and causes a few 
> hiccups.
>
> This is v1.1.x btw
>
> Any other got a similar problem?
>
> Ady
>
> ---
> Adrian Gould
> Lecturer in IT / Network Engineering / Multimedia
> Business Finance & Computing [Midland Campus]
> Swan TAFE
> PO BOX 1336, Midland WA 6936
>
> Phone: (08) 9267 
> eMail: [EMAIL PROTECTED]
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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: Problems modeling User - Friend HABTM associations

2007-11-22 Thread Nasko

Sorry, I forgot to specify:

I'm using CakePHP 1.2 rev. 5693 from the branches.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



Problems modeling User - Friend HABTM associations

2007-11-22 Thread Nasko

Hi all,

I really tried to pull this thing by myself, but there's always
something that's not working as expected.

I have a user-and-friend situation.
I need to have both the friend requests and the accepted friendships
in the same table. Hence, the extra fields in the HABTM join table.
I also need to be able to retrieve the pending incoming and outgoing
requests for the current user, together with any additionally
associated models (User hasMany Photo, etc.).
I need to be able to paginate and sort those pending requests.
I need to retrieve the currently established friendships for the
current user (logged user id is either user_id or friend_id in the
join table)

Reading through quite some articles, I based my setup on two of them:
http://groups.google.com/group/cake-php/msg/fae9ec58501534e6? by
AD7six
http://www.cricava.com/blogs/index.php?blog=6&title=modelizing_habtm_join_tables_in_cakephp_&more=1&c=1&tb=1&pb=1
by Mariano Iglesias

Mariano Iglesias describes two alternative approaches (using auto-with
models vs. manually modeling the habtm association). I decided to go
for modeling the join table, because I intended to use AD7six's
Pagination component and I have prior experience with that component
where I had to manually model the habtm join tables.

So, here's my setup:

[models/user.php]:

var $hasMany = array(
'Photo' => array(
'className' => 'Photo',
'foreignKey'=> 'user_id',
'order' => 'Photo.primary DESC, Photo.id ASC',
'dependent' => true,
),

);

var $hasAndBelongsToMany = array(
'Friend' => array(
'className'=> 'User',
'joinTable'=> 'users_friends',
'foreignKey'   => 'friend_id',
'associationForeignKey'=> 'user_id',
'unique'   => true,
'with'   => 'UserFriend',
),
);

[models/user_friend.php]:

class UserFriend extends AppModel {
var $name = 'UserFriend';
var $useTable = 'users_friends';

var $belongsTo = array(
'User' => array(
'className'=> 'User',
'joinTable'=> 'users_friends',
'foreignKey'   => 'user_id',
'associationForeignKey'=> 'friend_id',
'unique'   => true,
),
'Friend' => array(
'className'=> 'User',
'joinTable'=> 'users_friends',
'foreignKey'   => 'friend_id',
'associationForeignKey'=> 'user_id',
'unique'   => true,
),
);
}

[DB tables]:
CREATE TABLE `users` (
  `id` mediumint(8) unsigned NOT NULL auto_increment,
  `group_id` smallint(6) NOT NULL,
  `email` varchar(100) default NULL,
  `username` varchar(50) NOT NULL,
  `password` varchar(50) default NULL,
  `active` tinyint(1) default '0',
  `created` datetime default NULL,
  `modified` datetime default NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `username` (`username`),
  UNIQUE KEY `email` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8

CREATE TABLE `users_friends` (
 `id` int(11) NOT NULL auto_increment,
 `user_id` int(10) unsigned NOT NULL default '0',
 `friend_id` int(10) unsigned NOT NULL default '0',
 `requested` datetime default NULL,
 `accepted` datetime default NULL,
 `active` tinyint(1) default '0',
 PRIMARY KEY  (`id`),
 KEY `key_fan_friend` (`user_id`,`friend_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8

CREATE TABLE `photos` (
  `id` int(11) NOT NULL auto_increment,
  `type` varchar(255) NOT NULL default '',
  `ext` varchar(255) NOT NULL default '',
  `size` int(11) NOT NULL default '0',
  `primary` tinyint(1) default '0',
  `user_id` int(11) NOT NULL,
  `created` datetime default NULL,
  `updated` datetime default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8

Here are my results with this setup:

[controllers/users_controller.php]:

function requests() {
$user_id = $this->othAuth->user('id');
$this->User->unbindAll(
array(
'hasMany' => array('Photo'),
'hasAndBelongsToMany' => array('Friend'),
)
);
$outgoingConditions = array(
'UserFriend.user_id' => $user_id,
'UserFriend.active' => 0,
);
$incomingConditions = array(
'UserFriend.friend_id' => $user_id,
'UserFriend.active' => 0,
);
$outgoing_requests = $this->User->UserFriend-
>findAll($outgoingConditions);
$incoming_requests = $this->User->UserFriend-
>findAll($incomingConditions);

$this->log($outgoing_requests, 'outgoing');
$this->log($incoming_requests, 'incoming');
}

[app/tmp/logs/incoming.log]
Array
(
[0] => Array
(
[UserFriend] => Array
(
[id] => 3
[user_id] => 3
[friend_id] => 1
[requested] => 2007-11-21 17:43:14
[accepted]

Re: using cake to make a light database administration app

2007-11-22 Thread AD7six



On Nov 22, 11:54 pm, "alex.tomes" <[EMAIL PROTECTED]> wrote:
> Yeah really cool approach, but to what model I assign queries like
> "show databases" or "show tables"

Any one of them.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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: using cake to make a light database administration app

2007-11-22 Thread alex.tomes


Yeah really cool approach, but to what model I assign queries like
"show databases" or "show tables" ? these are a must in the type of
app I am developing.

Thanks for your quick response!

On Nov 22, 8:18 pm, Gwoo <[EMAIL PROTECTED]> wrote:
> $DynamicModel = new Model(array('name'=> 'whatever', 'table'=>
> 'whatever'));
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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: Behaviours - Session data

2007-11-22 Thread rtconner

> What happens when you want a process to be accessible from command line, or a 
> cron job?
Curious. I've never really given thought to this. I'm sure if it ever
came to it though, I'd modify the behavior in some manner to let me
tell it there is no session.

Ya 99% of my cart code is in components. In one case though I had a
user upload a custom image to attach to the item, so I had to put some
session code in the model so the image could keep track of it's id.
Best practice, worst practice... who knows, and who cares? It got the
job done, it works and that is that. Sexy code doesn't pay the bills.

-Rob

On Nov 21, 11:07 pm, Grant Cox <[EMAIL PROTECTED]> wrote:
> Perhaps I worded my first response too harshly - as there are
> certainly cases where it is far easier to access the session directly
> than to have a more elegant solution.  I too have a similar model
> behaviour ("created_by", "modified_by"), however this is a single
> $_SESSION access - literally one line, out of the entire application.
>
> I'd be interested to hear what shopping cart functionality you used in
> a model - I've always implemented with a component only.
>
> So yes, it can be easier.  But still, models should not be tied to the
> session, and *I think* doing so is a hack.  What happens when you want
> a process to be accessible from command line, or a cron job?
>
> On Nov 22, 3:01 pm, rtconner <[EMAIL PROTECTED]> wrote:
>
> > Ya Grant not to argue with you, but if you are going to make a
> > statement like that, you make me think you have not done much cake
> > programming. (Though for how long you've been around I'll assume
> > otherwise)
>
> > I need data from the session in the models all the time. It's usually
> > a modified_by or created_by type of thing. Sometimes its other things,
> > like enclosing  shopping cart abilities into a model and component.
> > Cake is meant to make tasks simple  and isolated so you don't have to
> > repeat yourself. If you can't enclose this type of thing into a
> > behavior, then what good is cake? Not accessing this data from within
> > a model really defeats the DRY principal.
>
> > On Nov 21, 3:54 pm, Grant Cox <[EMAIL PROTECTED]> wrote:
>
> > > Cake does not provide a method, as you should not be accessing the
> > > session from any model / behaviour.
>
> > > Sometimes it is just much easier to do so though, so you can still
> > > access $_SESSION directly.  But you really should reconsider whether
> > > you have to access the session in your model / behaviour - it may
> > > indicate an overall problem with your application structure.
>
> > > On Nov 21, 11:46 pm, villas <[EMAIL PROTECTED]> wrote:
>
> > > > Cake 1.2  -- How can I access session data from inside a 'behaviour'
> > > > file?  TIA
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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: bake : feature request

2007-11-22 Thread FoxMaSk

ok, I understood


On Nov 22, 7:15 pm, Gwoo <[EMAIL PROTECTED]> wrote:
> yes, you are missing something. Bake is not meant to satisfy special
> cases. As a good friend would say, "Edge case, move on".
> Bake works based on the conventions in Cake. If you do not follow
> these conventions because you do not "like" them, then you will end up
i did not say i dont like the conventions on the contrary i jsut
search the better way to use cake.
if you say it a special case
i will search a way to simply the issue.

> writing a lot more code.

regards
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



Save multipel posts at once

2007-11-22 Thread laeffe

I'm trying to create a page that will submit multipel posts for an
model. But i cant figure out how to do it the cake way.. any ideas
anyone?

//Laeffe
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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: using cake to make a light database administration app

2007-11-22 Thread Gwoo

$DynamicModel = new Model(array('name'=> 'whatever', 'table'=>
'whatever'));
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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: bake : feature request

2007-11-22 Thread Gwoo

yes, you are missing something. Bake is not meant to satisfy special
cases. As a good friend would say, "Edge case, move on".
Bake works based on the conventions in Cake. If you do not follow
these conventions because you do not "like" them, then you will end up
writing a lot more code.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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: Checkboxes instead of multiple select

2007-11-22 Thread Gwoo

This thread was highjacked by Mr. Gould. Please do not reply to a
message and change the subject.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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 cake to make a light database administration app

2007-11-22 Thread alex.tomes

Hi all bakers,

I am planning to use cake to make some simple database administration
application and I was wondering, how do I make queries that are not
related to a certain model, am I bound to using a model that is
related to a table? Does this mean cake is not suited for something
like this? Or I just choose a model related to a local table and do
all kinds of queries with in it?(that would be a dirty solution).

Thanks in advance for you advice,

Alex Tomes
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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 set a certain language instead of auto-detected by l10n?

2007-11-22 Thread snowdog

The problem is caused by build-in Auth component... If you remove the
component everything works fine with "standard" way. It looks this is
a bug...

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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: recommendations for credit card processing

2007-11-22 Thread inVINCable

I would also like some suggestions for this as well.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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 problem

2007-11-22 Thread MaMe

Hi,

I've got 2 tables, entries and connectors.

entries
=
id
type
name
description
value
...

connectors

id
parent_entry   (entry id)
child_entry   (entry id)
child_position   (int)

Entries can have several parent and child entries.
I need help with the 2 models, at least with the specification of the
$hasAndBelongsToMany, $belongsTo, ... variables.

Servus, Mame

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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: enforcing a parent

2007-11-22 Thread julian

AD thanks for the input,  I believe I was misleading in my
terminology,  I see I used the proase scafolding.  what i meand was
the "standard views " you geat when you bake a view and specify no
scafolding

once again sorry for mixing up my terms

Julian

On Nov 22, 12:41 pm, AD7six <[EMAIL PROTECTED]> wrote:

> You don't, you write an application. Have a look at baking none-
> scaffolding controllers/views, and edit what you get out.
>
> hth,
>
> AD
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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: Multiple Slave Servers?

2007-11-22 Thread SeanW

Mike, they'll both work.  The advantages of load balancing are that
you can add and remove servers at will, without changing the app.  If
a slave goes down, your load balancer takes care of it.  You can apply
different load balancing algorithms, such as least connections, to
distribute the load.  The advantages of the code based approach is
simplicity. If you ever partition/shard your databases you're going to
need some application logic to pick the right database, too.

My day job is as a network guy so I use load balancers frequently and
am comfortable with them, which is why it's one of the first things
that come to mind (I've also been involved in projects where we had
code across a dozen servers in multiple places for the list of
memcached servers, updating the list of servers was not a fun task).

Sean


On Nov 21, 10:25 pm, Mike Lewis <[EMAIL PROTECTED]> wrote:
> So now that I have heard from both sides, what would be the "better"
> thing to do here.
>
> Load Balancer With multiple slaves
>
> OR KyleKai way of randomizing what slave host to choose by the
> application
>
> -
> Mike
>
> On Nov 21, 9:58 pm, "Samuel DeVore" <[EMAIL PROTECTED]> wrote:
>
> > make sure you set the 'persistent' to false and don't use mysql_pconnect
>
> > On Nov 21, 2007 7:07 PM, KyleKai <[EMAIL PROTECTED]> wrote:
>
> > > sorry forget say...
> > >if you have many slave_database , you can try this.
>
> > > On 11月22日, 上午10時05分, KyleKai <[EMAIL PROTECTED]> wrote:
> > > > Try
> > > >  > > > $slave_db_list = array('1','2','3');
> > > > $slave_db_host = $slave_db_list[rand(0,count($slave_db_list))-1];
> > > > class DATABASE_CONFIG {
> > > >var $default = array(
> > > >  'driver'=> 'mysql',
> > > >  'host'  => $slave_db_host,
> > > >  'login' => '',
> > > >  'password'  => '.',
> > > >  'database'  => 'my_db'
> > > >  );}
>
> > > > ?>
> > > > On 11月22日, 上午8時40分, Mike Lewis <[EMAIL PROTECTED]> wrote:
>
> > > > > So what your saying is put the load balancer IP Address for the
> > > > > slave.host.ip ?
>
> > > > > var $default = array(
> > > > > 'driver'=> 'mysql',
> > > > > 'host'  => 'slave.host.ip',
> > > > > 'login' => '',
> > > > > 'password'  => '.',
> > > > > 'database'  => 'my_db'
> > > > > );
>
> > > > > -
> > > > > Mike
>
> > > > > On Nov 21, 3:39 pm, SeanW <[EMAIL PROTECTED]> wrote:> Most of those 
> > > > > protocols are balanced at layer 4 (IP and port), the
> > > > > > load balancer has no knowledge of the underlying protocol.  Just
> > > > > > balance port 3306 across your slaves, it'll work just fine.
>
> > > > > > Sean
>
> > > > > > On Nov 21, 12:18 pm, Mike Lewis <[EMAIL PROTECTED]> wrote:
>
> > > > > > > I realize that but as far as I know Load Balancers only these
> > > > > > > protocols:
>
> > > > > > > HTTP
> > > > > > > HTTPS
> > > > > > > FTP
> > > > > > > POP3
> > > > > > > SMTP
> > > > > > > IMAPv4
> > > > > > > DNS
> > > > > > > Telnet
> > > > > > > LDAP
>
> > > > > > > I'm not to sure if connecting to a DB is anywhere in there.
>
> > > > > > > So from a application standpoint is there anyway to do some 
> > > > > > > rotation
> > > > > > > and/or random act to using multiple slave servers.
>
> > > > > > > -
> > > > > > > Mike
>
> > > > > > > On Nov 21, 9:08 am, SeanW <[EMAIL PROTECTED]> wrote:
>
> > > > > > > > For multiple slave servers I'd look at a load balancer, either
> > > > > > > > hardware or ipvs + heartbeat.  There's more than just "which 
> > > > > > > > server do
> > > > > > > > I send it to?", there's also making sure the server is alive 
> > > > > > > > and not
> > > > > > > > too lagged.
>
> > > > > > > > Sean
>
> > > > > > > > On Nov 20, 8:24 pm, Mike Lewis <[EMAIL PROTECTED]> wrote:
>
> > > > > > > > > I saw a post about setting up one slave server (http://
> > > > > > > > > groups.google.com/group/cake-php/browse_thread/thread/58ea010f930fab6c/
> > > > > > > > > df64d493b24d5a67?lnk=gst&q=master+slave+mysql&rnum=1), but I'm
> > > > > > > > > assuming thats not how you set up multiple slave servers. 
> > > > > > > > > Quoting fromhttp://www.alertra.com/article446.php:
>
> > > > > > > > > "If necessary, set up multiple slave servers all replicating 
> > > > > > > > > from the
> > > > > > > > > same master. Design your application to distribute SELECT 
> > > > > > > > > queries
> > > > > > > > > across all available slaves in some type of rotating or random
> > > > > > > > > fashion. Once this basic infrastructure is in place, you can 
> > > > > > > > > simply
> > > > > > > > > add more slaves as query volume increases."
>
> > > > > > > > > Is there a simple way of doing this in CakePHP?
>
> > --
> > (the old fart) the advice is f

Re: Sad Question

2007-11-22 Thread Sliv

A colleague of mine a couple of years ago ran into problems with 2003
web edition, found that it really tried to lock everything down in an
attempt to be a secure internet server.  Since the server was slotted
for intranet only (behind firewall), he switched to 2003 standard and
found things worked better; he claimed that doing the post-config from
the service pack was still a bit tricky, though, as again, the SP was
attempting to lock things down.

Sorry I can't be more specific, I wasn't involved at the time, was
just something I remember him talking about.

On another note, I feel your pain as I know what it's like to have
Management make retarded decisions after they play golf with a
Microsoft Sales Rep or whatever...

On Nov 19, 2:53 pm, "Christopher E. Franklin, Sr."
<[EMAIL PROTECTED]> wrote:
> Here's another thought, has anyone run into any trobule with Windows
> 2003 Web Edition (not the full windows server 2003 that includes file
> server stuff, domain controller stuff)?
>
> On Nov 19, 10:46 am, "Christopher E. Franklin, Sr."
>
> <[EMAIL PROTECTED]> wrote:
> > Well, I tried this weekend to get cake running on Windows IIS7, MySQL
> > and PHP.  It works fine with a fresh install and making a new
> > controller, model and view.  Works fine with Apache on Windows too
> > but, I am seeing a recurring pattern here.
>
> > If I extend the AppController by placing another app_controller.php
> > file into the app directory and put var $components =
> > array('Session');  then in function beforeRender(){ 
> > $this->Session->check('some_key'); } I get this error:
>
> > [Mon Nov 19 10:36:34 2007] [error] [client 192.168.1.100] PHP Fatal
> > error:  Call to a member function check() on a non-object in C:\\apache
> > \\htdocs\\app\\app_controller.php on line 82
>
> > Doesn't matter if it's apache or iis, that's the error that persists.
> > Apache on Windows, I have mod_rewrite enabled in httpd.conf and I have
> > the AllowOverride settings to All.
>
> > Now, I also set up another Linux box with apache mysql and php, just
> > copied over the site and voila. Works fine!
>
> > The only difference is that one is on Windows and the other is on
> > Linux.
>
> > I am going to paste what's in my app controller.php here so, this post
> > may get a little long.
>
> >  > class AppController extends Controller
> > {
> > /**
> >  * Adding Ajax and Javascript helpers to the default helpers.
> >  * This will load them on the home page.
> >  *
> >  * @var Array Holds the names of the helpers to be loaded by
> > default
> >  */
> > public $helpers = array('Html',
> > 'Ajax',
> > 'Javascript',
> > 'MenuDisplay',
> > 'Banners',
> > 'DraggableBox',
> > 'FormatCategories',
> > 'Session',
> > 'HeaderSearch',
> > 'TextImage',
> > 'TodaysHotProp',
> > 'classifiedGlance',
> > 'AdminHelper',
> > 'Number',
> > 'Form',
> > 'Pdf');
>
> > public $uses = array('Menu', 'Category', 'HotProp', 'Classified',
> > 'WvdBanner', 'Edition','Banner');
>
> > public $components = array('Cookie', 'Session', 'Apphtml',
> > 'MyAuth');
>
> > /**
> >  * Changing the default extension of templates to php.
> >  *
> >  * @var String Holds the default extension of template files.
> >  */
> > public $ext = '.php';
>
> > /**
> >  * Setting the default pagination properties.  Mainly for
> > classifieds.
> >  *
> >  * @var Array Holds the default pagination limits
> >  */
> > public $paginate = array('limit' => 20, 'page' => 1);
>
> > /**
> >  * Setting the default theme
> >  *
> >  * @var String The default theme
> >  */
>
> > private $current_theme = 'blue';
>
> > /**
> >  * This method overrides the basic method from
> > Controller::beforeRender()
> >  * There are certain things that every view needs in order to
> > display
> >  * correctly so, we set those values here, right before the page
> > renders.
> >  *
> >  * @internal We can also set a beforeFilter if we need to shut the
> > site down
> >  */
> > public function beforeRender()
> > {
> > // I get the error here for $this->Session->check();
> > /**
> >  * Get rid of the callback when not on the users controller
> >  *
> >  * @todo Add more controllers later on if needed
> >  

Re: Help with database structure

2007-11-22 Thread eid

Thanks a lot, I'll look it over. I promised a friend to do this for
him so I kind of have to do it now :P I know it's a large project to
start out with, but hopefully it will work out.

Again, thank you :-)

On 21 Nov., 23:45, Grant Cox <[EMAIL PROTECTED]> wrote:
> http://manual.cakephp.org/chapter/models
>
> Read up on associations, and how they are meant to work.  And perhaps
> make something a bit smaller until you understand what the difference
> between associations are.
>
> Anyway, this is the kind of structure I would start with for what you
> outlined.  I've used the tennis analogy of game, set, match.
>
> DB Structure
> --
> User
>  - id
>  - team_id
>
> Team
>  - id
>  - team_leader_id
>
> Match
>  - id
>  - winning_team_id (set when a match is completed)
>
> Set
>  - id
>  - match_id
>  - winning_team_id (set when a set is completed)
>
> Game
>  - id
>  - set_id
>  - home_team_id
>  - away_team_id
>  - home_team_score
>  - away_team_score
>
> Associations
> --
> User belongsTo Team
> User hasOne LeadTeam (class => Team, foreignKey => team_leader_id)
>
> Team hasMany Member (class => User)
> Team belongsTo Leader (class => User, foreignKey => team_leader_id)
>
> Match hasMany Set
> Match belongsTo WinningTeam (class => Team, foreignKey =>
> winning_team_id)
>
> Set hasMany Game
> Set belongsTo WinningTeam (class => Team, foreignKey =>
> winning_team_id)
>
> Game belongsTo HomeTeam (class => Team, foreignKey => home_team_id)
> Game belongsTo AwayTeam (class => Team, foreignKey => away_team_id)
> Game belongsTo Set

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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: bake : feature request

2007-11-22 Thread Christian Winther

Please use trac for enhancements :)

-Original Message-
From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of FoxMaSk
Sent: 22. november 2007 13:20
To: Cake PHP
Subject: bake : feature request


hello

when we do cake bake controller and choose one of the list,
i'd like to be able to rename the controller class name (by giving the
$useTable)

currently i dont like the way the database tables are named,
so when i do cake bake model that's create a model that i modify by
renaming the model filename,  changed the class name and add
$useTable.

But after that, when i do cake bake controller ; and make my choice i
have
"You must have a model for this class to build scaffold methods.
Please try again."
because effectively the model has changed and bake cant find it.

So it will be nice to be able to specify the $useTable and class name
we we want.

Or may be i miss something that permits to do that ?

Kind regards





--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



bake : feature request

2007-11-22 Thread FoxMaSk

hello

when we do cake bake controller and choose one of the list,
i'd like to be able to rename the controller class name (by giving the
$useTable)

currently i dont like the way the database tables are named,
so when i do cake bake model that's create a model that i modify by
renaming the model filename,  changed the class name and add
$useTable.

But after that, when i do cake bake controller ; and make my choice i
have
"You must have a model for this class to build scaffold methods.
Please try again."
because effectively the model has changed and bake cant find it.

So it will be nice to be able to specify the $useTable and class name
we we want.

Or may be i miss something that permits to do that ?

Kind regards



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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: enforcing a parent

2007-11-22 Thread AD7six



On Nov 22, 11:47 am, julian <[EMAIL PROTECTED]> wrote:
> Dear all
>
> I am sure I have missed something, but I cant spot the answer.
>
> I have a one to many,  I have baked some scaffolding, but when I add a
> child class to the parent I get a drop down for the foreign key.  I
> would like this field to be hidden and to have referential integrity
> enforced.
>
> secondly is there a tutorial/blog on moving scaffolding to
> "production"

You don't, you write an application. Have a look at baking none-
scaffolding controllers/views, and edit what you get out.

hth,

AD
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



enforcing a parent

2007-11-22 Thread julian

Dear all

I am sure I have missed something, but I cant spot the answer.

I have a one to many,  I have baked some scaffolding, but when I add a
child class to the parent I get a drop down for the foreign key.  I
would like this field to be hidden and to have referential integrity
enforced.

secondly is there a tutorial/blog on moving scaffolding to
"production"

many thanks

julian

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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: Validate Models aginst DB

2007-11-22 Thread AD7six



On Nov 22, 11:42 am, Comida411 <[EMAIL PROTECTED]> wrote:
> Hello Bakers
> A few weeks ago I found a very very simple controller and view that
> when installed and run along with my db and models when run in such a
> way that it would have cake look at the models and look at the db and
> look for inconsistencies.. actually cake did the work but the
> controller started cake running validating the models against the
> db...
>
> I lost the controller an view that did this..
>
> I am good with building dbs and with models but have little to no
> skill with views and contollers...
> I am now building a new site for my 7 year old son to manage his
> collection of books online.. I have built the db  I havew built the
> models but now I need to have cake vvalidate the models aginst the
> db.. before I move forward writing the controllers ...
>
> Could any baker out there create a simple simple controller and view
> that when cake runs.. has cake validate the models and db.. in this
> fashion I will be able to make sure all the mispelings and expected
> tables are present before I move to the next stage..
>
> thank you for your consideration of my request..
> Sincerely
> Comida411

It's not clear what you mean, given that if you spell something wrong
cake tells you.

ty using scaffolding/bake.

AD
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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: Confusing problem with insert/update via AJAX (have exhausted solutions find via search)

2007-11-22 Thread designvoid

Yup, that was it! I'd got totally muddled up.

I have now switched that PK definition to the correct one, and changed
the releationship in the model to 'belongsTo' and everything is hunky
dory!

It was definately one of those 'I've been staring at this for far too
long and can't see the problem...'

Cheers!

d.

On Nov 21, 6:06 pm, mehodgson <[EMAIL PROTECTED]> wrote:
> This may be the problem, in your controller your set:
>
> $this->params['marked_jobs']['Mark']['jm_j_id'] = $j_id;
>
> and in your model your set:
>
> var $primaryKey = 'jm_j_id';
>
> ...so in your controller you are setting the passed value to 'jm_j_id'
> which is the PK.
>
> On Nov 21, 8:34 am, designvoid <[EMAIL PROTECTED]> wrote:
>
> > Hi there!
>
> > I'm trying to perform an insert query via an ajax call, having
> > searched throughout the group, I have come to the conclusion that it
> > is something to do with Cake taking the only parameter passed as the
> > PK and performing an update rather than an insert. I have found posts
> > regarding this suggesting setting the id to null at start of function,
> > using the model->create command etc, but none of these seem to work...
>
> > I'll paste some snippets, this is my view file with the AJAX call:
>
> >  > onClick="new Ajax.Updater('jobs_marked','markit/ > $item['j_id']; ?>', {asynchronous:true, evalScripts:true});" />
>
> > This is my controller function:
>
> > function markit($j_id)
> > {
> > $this->Mark->id = null;
> > $this->params['marked_jobs']['Mark']['jm_j_id'] = $j_id;
>
> > if ($this->Mark->save($this->params['marked_jobs']))
> > {
> > $this->set('jobs', $this->Job->findAll());
> > $this->set('marked_jobs', $this->Mark->findAll());
> > $this->render('marked', 'ajax');
> > }
> > }
>
> > And this is my 'mark' model:
>
> > class Mark extends AppModel {
> > var $name = 'Mark';
> > var $primaryKey = 'jm_j_id';
> > var $useTable = 'jobs_marked';
>
> > var $hasOne = array('Job' =>
> > array('className'=> 'Job',
> > 'conditions'   => '',
> > 'order'=> '',
> > 'dependent'=>  true,
> > 'foreignKey'   => 'j_id'
> > )
> > );
>
> > }
>
> > I hope that this is something simple that I have overlooked and one of
> > you fine people can shed some light on it...
> > TIA,
> > d.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



Validate Models aginst DB

2007-11-22 Thread Comida411

Hello Bakers
A few weeks ago I found a very very simple controller and view that
when installed and run along with my db and models when run in such a
way that it would have cake look at the models and look at the db and
look for inconsistencies.. actually cake did the work but the
controller started cake running validating the models against the
db...

I lost the controller an view that did this..

I am good with building dbs and with models but have little to no
skill with views and contollers...
I am now building a new site for my 7 year old son to manage his
collection of books online.. I have built the db  I havew built the
models but now I need to have cake vvalidate the models aginst the
db.. before I move forward writing the controllers ...

Could any baker out there create a simple simple controller and view
that when cake runs.. has cake validate the models and db.. in this
fashion I will be able to make sure all the mispelings and expected
tables are present before I move to the next stage..

thank you for your consideration of my request..
Sincerely
Comida411
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---