Discussion on optimizing-cakes-performance

2008-06-10 Thread SeanW

"If users commonly search 'product names' you may want to make that
field a FULLTEXT index. This will make searches much faster."

Have you verified this?  Using a fulltext index requires the "MATCHES"
function in the SQL, it doesn't get used if you do a "WHERE foo=" type
query.  I don't see any code in CakePHP that uses the MATCHES function.
--~--~-~--~~~---~--~~
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: CakePHP with PBX System.. Is it doable?

2008-06-05 Thread SeanW

Hi Reza,

Most PBX systems log with a feature called Call Detail Recording (or
Records), CDR for short.  How to get at them depends on the system,
but generally there is a card in the PBX with a serial output that
spits out the CDR records. Attached to this is often a buffer box that
a PC dials into periodically to fetch records, or it could be tied
into the hotel management system directly for real time reporting.  It
might also be done on the management interface by issuing a command to
dump the CDR records and flush the logs.

If this is the case, you'll probably attach the CDR port to the PC
directly, and write a daemon that logs the CDR records (flat file,
probably .CSV) into your database.  Cake, or whatever other apps you
use, will read the data from your SQL database.

Sean

On Jun 5, 12:37 pm, Reza Muhammad <[EMAIL PROTECTED]> wrote:
> Hi guys,
>
> I was just assigned to a project building a hotel management system,  
> and I would like to use CakePHP. Most of the requirements are pretty  
> standards, but there is one thing I'm not familiar with.
>
> I am supposed to be able to track calls from each rooms that is using  
> PSTN through PBX. There will be no VoIP calls.  I have got no clue  
> whether it is doable or not.
>
> My questions are:
> 1. Can data packets from calls be captured using PHP?
> 2. Or do I have to use another software for the PBX to save data to  
> the database (hopefully to MySQL, or other open source RDBMS  
> software), then collect the data from that server's database?
>
> Does anyone have some experience on this problem? Do you mind to share  
> your thoughts on this?  Is there such software to do #2?
>
> Your thoughts and comments are much appreciated.
>
> Thank you,
> Reza Muhammad
--~--~-~--~~~---~--~~
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: looking for a hosting company

2008-03-28 Thread SeanW

I once had a Godaddy VPS, it started off pretty well but eventually
the disk latency became absurd.  I presented some tests showing 2
*seconds* for a single disk access in a ticket and was told that's
within their tolerances.  I canceled the VPS after that.

Sean

On Mar 28, 6:51 am, phpjoy <[EMAIL PROTECTED]> wrote:
> any experience with godaddy anyone?
> i had some, wonder what was yours.
>
> On Mar 26, 3:53 pm, Zoltan <[EMAIL PROTECTED]> wrote:
>
> > Just wondering if anyone has a hosting company they'd recommend.
> > I've personally hosted a few sites on DreamHost, speed is ok, but
> > getting Cake sites up and running is problem-free. On the other hand,
> > I've used Rackspace, which is faster, but keep on running into
> > problems.
>
> > If anybody has a hosting company they'd recommend, I'd appreciate it.
>
> > Thanks,
> > Zoltanwww.yyztech.ca
--~--~-~--~~~---~--~~
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: looking for a hosting company

2008-03-27 Thread SeanW

On Mar 26, 12:59 pm, Rob  Russell <[EMAIL PROTECTED]> wrote:
> Anybody hosted Cake on 1and1? I've really liked them so far but I
> haven't pushed any Cake apps on to that server yet. I had a VPS
> (somewhere else) and ran in to trouble locking it down so I've been
> relegated to managed virtual hosting for now (though 1and1 has met my
> needs completely so far).

I've run some pretty simple cake stuff on 1&1 and have been pretty
happy. I wrote up about it:

http://ertw.com/blog/2007/11/05/pushing-a-cakephp-app-from-dev-to-prod/

some people have also commented on the article with improvements to my
scripts.

Sean
--~--~-~--~~~---~--~~
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: Logic on Site Index

2008-02-18 Thread SeanW

Look at app/config/routes.php

/**
 * Here, we are connecting '/' (base path) to controller called
'Pages',
 * its action called 'display', and we pass a param to select the view
file
 * to use (in this case, /app/views/pages/home.thtml)...
 */
Router::connect('/', array('controller' => 'pages', 'action' =>
'display', 'home'));

Just connect it to a different controller and action.

Sean

On Feb 17, 9:30 am, UberK <[EMAIL PROTECTED]> wrote:
> Hi, CakePHP noob here. What is the best way to put logic into the site
> index, ie.http://www.website.com/, without redirecting? Is there an
> index controller or something? The default 1.2.0.6311 splash screen
> says I can change the view and layout of the page but gives no
> explanation as to how to tie it to a controller, and I need controller-
> level functionality (check for auto-login cookies etc). Thanks,
> Ken M
--~--~-~--~~~---~--~~
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: Model/controller naming question - object name ends in 's' :

2008-01-13 Thread SeanW

I think you want to look at custom inflection:  
http://tempdocs.cakephp.org/#TOC41977

And yes, the plural of "lens" is "lenses".

Sean

On Jan 12, 4:08 pm, Tim <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I'm a newbie to CakePHP, and a relative newbie to php. CakePHP looks
> like just what I was looking for :)
>
> The issue is with business objects that end with the character 's'. I
> have a model that i'd like to call "lens". That would make the
> controller called "lenss_controller", which is only a problem because
> it appears in the URL. It would also mean a database table called
> "lenss". Is there a way to give everything sensible names?
>
> Right now my solution is to call the model "len", the controller
> "lens_controller", and the database table "lens".
>
> Thanks
>
> Tim
--~--~-~--~~~---~--~~
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: Accelerating cakePHP

2007-12-16 Thread SeanW

Also look at

http://www.ibm.com/developerworks/linux/library/l-tune-lamp-1/
(tuning Linux)
http://www.ibm.com/developerworks/linux/library/l-tune-lamp-2.html
(tuning Apache and PHP)
http://www.ibm.com/developerworks/linux/library/l-tune-lamp-3.html
(tuning MySQL)

Sean

On Dec 16, 3:29 am, majna <[EMAIL PROTECTED]> wrote:
> before John David Anderson tips,
> try to configure apache to fit your site needs.
> tweak mysql conf. if your queries took more then few ms.
> use nix ramdisk on  php files for disk IO
>
> On Dec 15, 9:21 pm, "John David Anderson (_psychic_)"
>
> <[EMAIL PROTECTED]> wrote:
> > On Dec 15, 2007, at 1:12 PM, Chris Hartjes wrote:
>
> > > On Dec 15, 2007 3:00 PM, Pillow <[EMAIL PROTECTED]> wrote:
>
> > >> Hi,
> > >> I've website which has about 3 uniq visits per day (up to 1500
> > >> online). The problem is that CMS written on CakePHP consumes too much
> > >> of CPUs power.
>
> > >> Almost everything is beeing cached (whole views, sometimes db
> > >> results).
>
> > >> In addition the same site was earlier driven by some poor free system
> > >> which hadn't even had cache, and the CPU usage was about 6 times
> > >> less.
>
> > >> Do you have any tricks and tips to speed up system based on cake?
>
> > > Sounds like it was poorly designed, as 3 hits a day isn't what I
> > > would consider high traffic.  However, I would suggest the following:
>
> > (agreed)
>
> > > 1) install a PHP opcode cache like APC
> > > 2) make sure you have appropriate database indexes in place
> > > 3) spend some time profiling your code using tools like Xdebug and
> > > Cachegrind to find out where the slow spots really are.
>
> > I might also add
>
> > 4) Move rewrite instructions to apache conf rather than .htaccess
> > 5) Use unbind model (or something similar) more extensively.
>
> > -- John
--~--~-~--~~~---~--~~
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: Is cake generating inefficient SQL? (uses IN clause)

2007-12-14 Thread SeanW

A covering index might also help, depending on what type of field
b.field_2 is.

CREATE INDEX cover_field2 ON b (id,field_2);

If field_2 is a short varchar then there is a greater chance that
mysql will just read the index and grab the data from there, and never
touch the table.

If you need a bunch more fields then the covering technique loses its
effectiveness.

Sean

On Dec 14, 7:09 am, grigri <[EMAIL PROTECTED]> wrote:
> Sorry, I think you're interepreting the results wrong.
>
> The MySQL optimizer is a complicated piece of code, but it generally
> works well.
>
> Basically, if your range query affects a large portion of the table
> entries then it is MORE efficient to do a table scan than an index-
> based range check, so it does. In fact, in older versions of MySQL
> based this decision solely on the approximate percentage:
>
> ---
> quote fromhttp://dev.mysql.com/doc/refman/5.0/en/where-optimizations.html
> :
>
> "Each table index is queried, and the best index is used unless the
> optimizer believes that it is more efficient to use a table scan. At
> one time, a scan was used based on whether the best index spanned more
> than 30% of the table, but a fixed percentage no longer determines the
> choice between using an index or a scan. The optimizer now is more
> complex and bases its estimate on additional factors such as table
> size, number of rows, and I/O block size."
> 
>
> Try running the same query on a table with a larger row count. I ran a
> indexed/ranged query against a table with over 4 million rows (there
> were 100 entries in the IN() statement), and EXPLAIN SELECT confirmed
> that the index was being used, and no full table scan was involved.
>
> On Dec 14, 11:46 am, keymaster <[EMAIL PROTECTED]> wrote:
>
> > If you have two tables A hasMany B, and B belongsTo A:
>
> > $data = $this->A->findAll($where, null,  null, null, null, 1);
>
> > Cake will generate one query for the A records, and then a second
> > query for the B records.
>
> > That's fine.
>
> > Now, the second query is of the form:
>
> > SELECT `B`.`id`, `B`.`field_2` FROM `B` AS `B` WHERE `B`.`a_id` IN
> > (16, 17, 18, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142,
> > 143, 144, 145, 146, 147, 154, 168, 170, 171, 172, 173, 174, 175, 176,
> > 177, 178, 179, 180, 181, 182, 183, 184, 187, 188, 189, 190, 238, 281,
> > 282, 311, 312, 313, 314, 338, 348)
>
> > The IN clause is a list of the A record id's from the first query.
>
> > Again, fine.
>
> > The problem is, for a large IN clause, even if one creates an index on
> > the B.a_id field, mySQL will not use the index, and will do a full
> > table scan comparing each record in B to the list of record id's in
> > the IN clause.
>
> > Very inefficient.
>
> > For small numbers of A records in the IN clause, B's index on B.a_id
> > will be used. But once you pass a certain nuber of id's in the IN
> > clause, (I had around 60) the index on B.a_id is no longer used, and a
> > full table scan is performed instead.
>
> > Here is a sample EXPLAIN performed on the cake query above:
>
> > id  select_type table   typepossible_keys   key key_len 
> > ref rows
> > Extra
> > 1   SIMPLE BALL a_id   NULL  NULL   NULL
> > 1
> > Using where
>
> > An index exists on B.a_id, yet is not used.
>
> > For small numbers of id's in the IN clause, the index is used.
>
> > The IN clause is very inefficient and can scarily result in full table
> > scans.
--~--~-~--~~~---~--~~
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: newbie question - multiple functions in a page

2007-12-03 Thread SeanW

On Dec 2, 7:56 pm, Adam Royle <[EMAIL PROTECTED]> wrote:
> Using elements is what you want. Inside the elements you can use
> requestAction to get at any data you wish to use. You can return an
> array of data directly, or render a view. See tutorial here for an
> example (and also how to cache the result)

That tutorial certainly explains requestAction and how cool it is, but
I'm left thinking "what happened to the skinny controller, fat model"
concept?  Why am I going to wind my way (again) through the Cake
framework only to get at a piece of data that the model should know
about anyway?

For example, tag cloud.  We have a tag model, presumably linked to
posts or something.  Within the tag model I'd have a function,
tagCloud, that would return the tag cloud in an array, something like

$ret[0]["tag"] = "cake";
$ret[0]["count"] = "5";
$ret[1]["tag"] = "php";
$ret[1]["count"] = "6";

In the controller generating the post, we'd add "Tags" to the $uses
array, and in the action do a

$this->set("tagcloud", $this->Tag->tagCloud());

The tag cloud HTML would be encapsulated in an element so that anyone
could use it from the view, $this->renderElement("tagcloud",
array("data" => $tagcloud))

None of this precludes using requestAction...  In fact the reason I
arrived at this conclusion is by starting off there, realizing the job
of collecting the tag cloud data belongs in the model, realized we
need an element anyway, so why bother using requestAction when I can
just set() it in the controller and still be blissfully unaware about
how the data is constructed?

BTW this extends to the other cases the OP mentioned, ie $this->Books-
>getReadingList(5), etc.

The post that opened my eyes to the fat model concept:

http://weblog.jamisbuck.org/2006/10/18/skinny-controller-fat-model

It's written for Ruby on Rails, but it's easy enough to translate to
PHP.

Sean
--~--~-~--~~~---~--~~
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: Load balanced web servers with CakePHP

2007-11-27 Thread SeanW

Cake seems to use the PECL memcache extensions, which I've used
elsewhere, and they're solid.  I'd look at caching in memcache before
NFS mounted disk.

Sean

On Nov 27, 7:19 am, dericknwq <[EMAIL PROTECTED]> wrote:
> I have read about it but nope, never consider it yet. Seems like a
> pretty good replacement though since it's meant to be a global cache.
> How is Cake's support for memcache? You tried it personally?
>
> On Nov 27, 7:05 pm, bgmill <[EMAIL PROTECTED]> wrote:
>
> > Have you considered using memcached?
--~--~-~--~~~---~--~~
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

Re: Multiple Slave Servers?

2007-11-21 Thread SeanW

Yup

Sean

On Nov 21, 6:40 pm, 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?
--~--~-~--~~~---~--~~
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-21 Thread SeanW

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?
--~--~-~--~~~---~--~~
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-21 Thread SeanW

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?
--~--~-~--~~~---~--~~
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: Auth->allow not working at all?

2007-11-10 Thread SeanW

Arne,

Good to see you got the other stuff going, I just replied so I guess
you can ignore that :)

Use $this->Auth->allow("*") to allow access to all actions, or $this-
>Auth->allow("foo", "bar") to allow access to the foo and bar actions
of the current controller.

Your login handler is allowed access no matter what.

Sean

On Nov 9, 11:34 pm, Arne-Kolja Bachstein <[EMAIL PROTECTED]> wrote:
> Hi,
>
> regarding to my auth problem again (got it working now) just a quick
> question: Is the allow() method not working at all or do i
> misunderstand something? When using $this->Auth->allow() it seems to
> disallow something within my login handler even when allowing login,
> logout and such explicitely. So if I allow() login, login can get
> viewed, but doesnt query the database. When not using allow() at all,
> login and logout do work (think its standard behaviour to allow those
> two functions).
>
> But how can only a part of the login function be disallowed? Is it a
> bug, is it a feature, is it just weird?
>
> Best regards
>
> Arne


--~--~-~--~~~---~--~~
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: Simplest usage of the new Auth component?

2007-11-10 Thread SeanW

Arne,

You don't have to use the Acl component, I was just playing around
with various things and forgot to take it out :)  (I'm just picking up
CakePHP myself)

If you don't have $this->Auth available, make sure you're using Auth
in app_controller.php

Sean

On Nov 9, 8:12 pm, Arne-Kolja Bachstein <[EMAIL PROTECTED]> wrote:
> Hi Sean,
>
> thanks for pasting it, but there's only one single issue that doesn't
> match your config at all: You're using the Acl component... do I
> _have_ to use Acl too? I though I could use it without Acl only using
> the table data and such, so I did not work with Acl at all.
>
> I did a bit debugging though and found that my users_controller->login
> function doesnt have $this->Auth->user() available.
>
> if ($this->Auth->user()) { ... } else { debug("no auth->user :-(") }
>
> gives me the debug message, so for some reason I don't have access to
> this what seems to be the point. Did I forget something?
>
> Best regards
>
> Arne
>
> On Nov 9, 4:25 pm, SeanW <[EMAIL PROTECTED]> wrote:
>
> > On Nov 8, 6:33 pm, Arne-Kolja Bachstein <[EMAIL PROTECTED]> wrote:
>
> > > But when submitting the form, it redirects me back to the login, pre-
> > > filling the password field with 32 chars (assume it's the md5 hash,
> > > but why?).
>
> > That's probably because the authentication is failing, or not being
> > checked.
>
> > Remember I don't use username and password, I use email and password.
> > So make sure that in app_controller.php where I have
>
> > $this->Auth->fields = array('username' => 'email', 'password' =>
> > 'password');
>
> > you have
>
> > $this->Auth->fields = array('username' => 'username', 'password' =>
> > 'password');
>
> > Did you also null out your salt in config.php?
>
> > I posted my code (login.ctp and users_controller.php) 
> > tohttp://pastebin.ca/767192
>
> > Sean


--~--~-~--~~~---~--~~
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: Simplest usage of the new Auth component?

2007-11-09 Thread SeanW

On Nov 8, 6:33 pm, Arne-Kolja Bachstein <[EMAIL PROTECTED]> wrote:
> But when submitting the form, it redirects me back to the login, pre-
> filling the password field with 32 chars (assume it's the md5 hash,
> but why?).

That's probably because the authentication is failing, or not being
checked.

Remember I don't use username and password, I use email and password.
So make sure that in app_controller.php where I have

$this->Auth->fields = array('username' => 'email', 'password' =>
'password');

you have

$this->Auth->fields = array('username' => 'username', 'password' =>
'password');

Did you also null out your salt in config.php?

I posted my code (login.ctp and users_controller.php) to 
http://pastebin.ca/767192

Sean


--~--~-~--~~~---~--~~
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: Simplest usage of the new Auth component?

2007-11-08 Thread SeanW

On Nov 7, 9:07 pm, Arne-Kolja Bachstein <[EMAIL PROTECTED]> wrote:
>
> My goal is to implement the authentication basics directly into /app/
> app_controller.php rather than the users controller, as I think it

I posted something about this recently, where authentication is done
in the main app_controller with default behaviours, and controllers
can fine tune it.

http://ertw.com/blog/2007/11/04/a-simple-authentication-system-with-cakephp-12-and-auth-component/

It uses controller based authorization (which again can have a global
policy at the app_controller level, and be overridden at the
controller level)

Sean


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---