Re: create subdomain.

2007-09-28 Thread guitarclap

If you are using Windows as your local dev environment this I am
pretty sure this is impossible.
Windows can't handle local wildcards in hosts (windows\system32\drivers
\etc\hosts)

(Won't work)
127.0.0.1  *.site.local

(Will work)
127.0.0.1 sub1.site.local
127.0.0.1 sub2.site.local

You will also have to edit your httpd.conf to include the wildcard for
ServerAlias

ServerAlias *.site.local


On Sep 28, 11:17 am, Adwin  Wijaya [EMAIL PROTECTED] wrote:
 Grant Cox wrote:
  What you want is a wildcard subdomain.  Register in DNS
  *.yourdomain.com, and handle the same in your webserver, pointing to
  your cake app.

  Then the first step in your app (in beforeFilter) should be to look at
  the env('HTTP_HOST') to determine if the subdomain requested is valid
  (matching a user account or whatever).  If not, then 404, or show a
  account not found page, whatever you like.

 Can you tell me how to register dns ? I am still using my localhost
 for testing at the moment (with host modification so that it looks
 like in the real server.)

 shall i modify the .htaccess as well ?

 thank u


--~--~-~--~~~---~--~~
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: Easy way to deal with enum's?

2007-09-28 Thread guitarclap

For boolean fields tinyint(1) works great!
A while back, I ran into situations where ENUM was the best way to go
so I created the Enumerable behavior.

http://bin.cakephp.org/view/513331644

Not sure if it still works or not (haven't tested it in a while).  It
stores the integer representation of the array (first index = 1).
Maybe this can help someone :)



--~--~-~--~~~---~--~~
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: Cake 1.2 Cache Problem - Submitting a Form doesn't Reset Cache

2007-09-28 Thread guitarclap

I ran into a similar situation when I tried to cache a login page;
when the form was submitted it would just simply show the same view
again.  I am pretty sure that this is by design - or fixed in the svn
(somewhere).  If you check out the file in /tmp/cache/views/ you will
see why - cake caches the entire view and doesn't call the
Controller::action().

IMO, cake should disregard cached views when POST is detected because
POST obviously contains data that is unpredictable (ie, a user logging
in).

On Sep 28, 10:28 am, Baz [EMAIL PROTECTED] wrote:
 I'm having a sort of stupid problem. I've searched for a resolution, but I
 don't see anyone reporting the same issues.

 Maybe I'm doing something wrong.

 I'm using Cake's cache and I'm trying to Cache the whole controller.

 var $cacheAction = '+1 hour';

 However, Cake now refuses to accept any form submissions. I'm assuming
 because on a post, it just calls back the same cached page. Any ideas from
 anyone?

 From what I've read, Cake is smart enough to clear the cache if there has
 been an update to the model, but it's not letting me update because it won't
 accept posts. Am I missing something? Or do I simply have to cache every
 controller except those with forms?

 ThanX in advance guys.


--~--~-~--~~~---~--~~
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: money_format?

2007-05-19 Thread guitarclap

NumberHelper has a currency() method.

On May 17, 11:36 am, Enchy [EMAIL PROTECTED] wrote:
 Hi

 money_format doesnt work when I run it in CakePHP
 Is there any alternative I can use?

 L


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



Admin as a plugin

2007-05-18 Thread guitarclap

I was wondering what the cons were to making 'admin' an actual
plugin.  It seems to me that this might make the app much more
organized since regular and admin_* functions aren't mixed in the same
file.

What are your thoughts?  Is there more overhead doing it this way?


--~--~-~--~~~---~--~~
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: Admin as a plugin

2007-05-18 Thread guitarclap

Thanks for your reply!
I agree with everything that you say.  To me, it's kinda non
conventional to mix the admin_* methods within non .. mostly because
you can't look at the controllers and discern which ones have those
methods until you open up the file.  This way through a plugin you
know what each controllers specifically does.  Also, with plugins
having their own AppController, you can easily set menus, etc ..

Also, this is a breeze for ACL because you can wildcard controllers
with Admin*:* (using felix g's SimpleAcl)



On May 18, 11:27 am, Greg [EMAIL PROTECTED] wrote:
 It also depends on how many people are working on your application.
 If, say, you have an admin programmer who only works on the admin
 section of your app, and a public side programmer who sticks to the
 non-admin areas, the project would be rather difficult to manage if
 you
 were to go about the admin_* route.  You would constantly have more
 than one person modifying a file at a time, which becomes a complete
 hassle when using svn or some other versioning system.

 So, as far as I know, your other options are to go with a plugin, or a
 completely separate app.  I am not sure about the overhead with
 plugins,
 I am really new to Cake still, so I need to do some more research on
 that.
 I am about to jump into the same situation you are, and I would like
 to
 use plugins, it just seems more logical from first look.

 ...and there's my 2 cents.


--~--~-~--~~~---~--~~
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: high load and benchmarking

2006-11-16 Thread guitarclap

Not sure actual benchmarking tools but hopefully this is helpful:

www.pokerinside.com
- 22.44 queries per second (77,190 per hour)
- 69,265 members, with 9,959 active members
- 3,100 unique visitors daily with 38,000 unique page views
- 8 cron jobs run every 5, 30, 60 minutes
- Server: Dual P4 2.8 1G Ram
- Avg page creation time: 157ms (with static pages less than 50ms)


--~--~-~--~~~---~--~~
 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: unnecessary left joins in findCount()?

2006-11-16 Thread guitarclap

$this-{model}-findCount(null, -1); // 2nd param is the recursive

On Nov 16, 3:56 pm, sbarre [EMAIL PROTECTED] wrote:
 I'm running into peformance issues with the findCount() method in the
 model class..

 I am doing a listing of records in a given table, and the record has a
 few associations for it, however the table that I am querying has 1.8
 million records in it, and while I turn off the recursive  option in
 findAll() (which keeps my query time down to 17ms), the findCount()
 method still LEFT JOINs the 3 other association tables when simply
 doing a count(*) operation, and this gives me a 16000ms execution time
 on the findCount() method.

 Is there a way to tell findCount() that I don't care about the
 associations, much like I can with findAll()?

 I suppose I can override it, but this seems like something that should
 be in the model class, no?


--~--~-~--~~~---~--~~
 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: Future of the Internet

2006-09-19 Thread guitarclap

I guess I went off on sort of a tangent with some of my post but the
basics of my post, IMO, are quite applicable to this group since our
existance as a community is based on the net and our main tool (Cake)
is web-based development.  Any small change in the net can affect us
all ... with some changes drastically changing our ways of life.

I agree with what you said about net neutrality that the telecomm's
must recompensate for their costs but I believe the costs needs to be
claimed on the end-user not necessarily the destination or route of
information.  My cable intenet is nearing $50 per month, which in the
larger picture, is very very very reasonable and affordable.

But as technology increases costs actually go down -- for both the
end-user and the telecomm's.  The problem is capitalism ... the
telecomm's main goal isn't to provide a service they are here to make
the most money possible.  When another company lowers rates to be more
competative its a ripple effect with the whole industry.

Look at cell phone companies .. there always is this struggle of we
give you more than the other companies.  Recently these phone
companies have had to install superlative (and often unused) components
to attract more buyers (music, mp3, video, etc).  Cell phones are no
more about the actual service, but the methods (ie phones) that carry
the service.

What happens when cellphone companies keep lower prices and increasing
costs?  Are we going to start charging land lines more? Start charging
more for incoming calls?  This, in a way, sort of parallels whats
happening with the telecomm companies.

I also believe in your statment that the future of the net lies in
going back to its roots.  It will be very interesting in what happens
with 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
-~--~~~~--~~--~--~---



Future of the Internet

2006-09-18 Thread guitarclap

I am curious to see what other's think about this ...

Where is the internet headed in the near future?

It seems that recently there is a huge onslaught of community-based
sites and digital music but it is definitely starting to fade ... why?
You can thank News Corp, Time Warner and the other ad agencies that are
monopolizing the internet by flooding it with their products by buying
out as much as they can and then shoving it down your throat only to
shove it back further after you already puked all over the keyboard.

Remember back to the day when MP3.com was just independent musicians
looking for a way to get their music heard? It was incredible to hear
the talent out there ... where has it gone?  I don't care about
Ludacris or any other degenerate, uneducated imbecile turned
millionaire overnight with a song that we are told to listen to by
radio, TV and news (cough .. surprisingly all owned by the same
people.. cough).

With the latest debates and possible threats of removing net neutrality
could possible mean that this problem isn't going away anytime soon!

Where does the internet stand now? Is the only way to make a decent
income on a site is holding out to sell-out to larger corporations? As
a web developer this issue is a hot one because it essentially is my
future.

Ideas? Comments?


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



Re: Cake and Traffic

2006-08-12 Thread guitarclap

www.pokerinside.com ... 100% 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
-~--~~~~--~~--~--~---



HUGE inefficiencies

2006-08-11 Thread guitarclap

I have recently come to terms on how cake deletes associated models
with the 'dependent' variable.  This is a powerful but I feel that it
is hugely inefficient when it comes to deleting (especially a hasMany
relationship).

I have a few models whos afterSave and afterDelete callbacks
decriment/incriment a counter (much like how counterCache is 'supposed'
to be implemented).  This is a huge concern because now I am updating a
parent model everytime a model is deleted.

Example Implementation (rough example):  ForumPost (includes field
`view_count`) hasMany ForumPostView (belongsTo ForumPost-dependent =
true).

ForumPostView::afterSave() and ForumPostView::afterDelete() both call a
{model}-counterCache() that incriments/decriments the 'view_count'
based on their associated foreign key.

Now you can imagine what happens when I call ForumPost-del (1);  and a
ForumPost has about 500 ForumPostViews. It will go through and delete a
ForumPost, then the callbacks will count(*) and save
ForumPost.view_count ...

See where I am coming from?

IMO, the best way to handle this is to hack in a afterMultiDelete()
callback thta I can control the functionality on a multiDelete..

Thoughts? Opinions?


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