Re: hasOne load time x4

2013-11-03 Thread datgs
Please export here your db schema. 

On Friday, November 1, 2013 11:12:55 PM UTC+7, Aurelian Apostol wrote:

 I am using two tables items and products, item hasOne product.
 When making a containable pagination on Item it loads 1200 rows in 13s, 
 when moving Product in hasMany it loads in 3,2s. With no other changes on 
 the models or any other place as that matters.

 Any ideas? 


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: How to call a function from another controlle?

2012-09-07 Thread datgs
Can this work for Cake 1.3?

On Thursday, September 6, 2012 12:23:39 PM UTC+7, andrewperk wrote:

 I do this:

 ?php
 // Loads in the TestController from the Test plugin Controller package
 App::uses('TestController', 'Test.Controller');

 class AppController extends Controller {

 public function beforeFilter() {
 // Instantiate the TestController
 // Call your method
 $Test = ClassRegistry::init('TestController');
 $Test-ping();
 }
 }

 On Wednesday, September 5, 2012 4:06:39 PM UTC-7, Salines wrote:

 eg I have a plugin called Test, and the class named TestController, where 
 I have a ping function  , public function ping() {...}

 how can I call the ping function from app controller beforeFilter 
 function?

 public function beforeFilter(){
  // call Plugin/Test/TestController/ping() ???
 }

 Thanx




-- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




CakePHP should support better validation rules definition

2012-01-10 Thread datgs
Hi all,

I think CakePHP should support for better way to define validation
rules. Like Yii::Model::rules() definition. There are many benefits
from it:

1/ Shorter rule definition ( we can group the same rule the same
definition)
2/ The rules' parameters are easier to be changed. (Sometime my rules
parameters are read from my database)

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Lazy load for Model and PHP4 problem

2011-07-07 Thread datgs
Hi Team,

As I can see. There was so many discussions about the lazy load
mechanism of CakePHP model is not good defined. How it is resolved in
CakePHP 2.0?

Another problem is PHP4, is it eliminated (sorry because I haven't
tried 2.0 version of Cake yet)?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Using cache as session handler

2011-05-13 Thread datgs
I've found that if I would like to use some kind of cache as session
handler. I'm forced to use default cache (CakePHP 1.3.7). Because of
the session handler customization for cache is not good:

session_set_save_handler(
array('CakeSession','__open'),
array('CakeSession', '__close'),
array('Cache', 'read'),
array('Cache', 'write'),
array('Cache', 'delete'),
array('Cache', 'gc')
);

Have no information about the cache config will be used. That mean
only default config accepted.
It impacts other caches. If I want to use memcache for session handler
but I don't want to save the schema to memcache for instant.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Is this possible a big issue

2011-05-07 Thread datgs
strtotime('now') is from the CakePHP core, I have no comment :)

Someone told me about NPC to sync the time among multiple servers.
Anyway, it should be the job of administrator :)

On May 7, 4:36 pm, Elte Hupkes ell...@gmail.com wrote:
 Also make sure you use the same timezone on all servers.. I usually
 use date_default_timezone_set('UTC') and the UTC_ MySQL functions to
 that end.

 On a different note, why use strtotime('now') instead of time()?

 On May 6, 8:09 pm, datgs giangson...@gmail.com wrote:







  Thanks, I think NTP is a good choice.

  On May 6, 4:05 pm, Ryan Schmidt google-2...@ryandesign.com wrote:

   On May 6, 2011, at 03:59, datgs wrote:

I've worked with CakePHP magical created, modified and updated. And I
found that automation of getting current time based on php at

$time = strtotime('now');

I think it is not good for some case, for example if my MySQL server
time is different from HTTP server time and someone want to mine data
just at MySQL side, the result of query might be wrong.

I think CakePHP team should make a time synchronic between HTTP Server
 Database Server before saving the data.

   A what? I didn't understand this sentence.

   If you're concerned that the clocks on various servers would be 
   different, then fix that problem by using NTP on every server.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Is this possible a big issue

2011-05-06 Thread datgs
I've worked with CakePHP magical created, modified and updated. And I
found that automation of getting current time based on php at

$time = strtotime('now');

I think it is not good for some case, for example if my MySQL server
time is different from HTTP server time and someone want to mine data
just at MySQL side, the result of query might be wrong.

I think CakePHP team should make a time synchronic between HTTP Server
 Database Server before saving the data.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Is this possible a big issue

2011-05-06 Thread datgs
Thanks, I think NTP is a good choice.

On May 6, 4:05 pm, Ryan Schmidt google-2...@ryandesign.com wrote:
 On May 6, 2011, at 03:59, datgs wrote:

  I've worked with CakePHP magical created, modified and updated. And I
  found that automation of getting current time based on php at

  $time = strtotime('now');

  I think it is not good for some case, for example if my MySQL server
  time is different from HTTP server time and someone want to mine data
  just at MySQL side, the result of query might be wrong.

  I think CakePHP team should make a time synchronic between HTTP Server
   Database Server before saving the data.

 A what? I didn't understand this sentence.

 If you're concerned that the clocks on various servers would be different, 
 then fix that problem by using NTP on every server.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Is this URL secure enough

2011-05-06 Thread datgs
I have an URL under HTTPS.

https://domain.com/privatekey/550e8400-e29b-41d4-a716-44665544

Is the request path (privatekey/550e8400-e29b-41d4-a716-44665544)
encrypted like POST or GET params?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Is this URL secure enough

2011-05-06 Thread datgs
Thanks for your comment. I would like to eplain more my situation.

Assump that you have 2 users Officer and Approver. The Officer create
a report and send it to Approver to be accepted or denied.

The Approver receives an URL which meantioned within the email. He
click the link:

1/ He can login the system without username  password
2/ Redirect to the report detail

I know that the apperance of this link is high risk and have warned
the Approver about .. please keep the link in secure... Moreover, I
have added a lifetime to reduce the risk (because when the report is
approved, the link is invalid, it looks like the URL used to activate
the user after registration).

Please tell me what is the best solution for this?

On May 7, 4:14 am, Elte Hupkes ell...@gmail.com wrote:
 Yes, URLs are encrypted over SSL (incidentally the reason you used to
 be unable to host multiple domains under the same certificate - the
 server couldn't make out which domain to serve). However, I would
 consider sending private data in a URL a bad idea regardless of
 whether it's encrypted or not; it shows up in browser history for
 example, and you really want to avoid that.

 On May 6, 8:15 pm, datgs giangson...@gmail.com wrote:







  I have an URL under HTTPS.

 https://domain.com/privatekey/550e8400-e29b-41d4-a716-44665544

  Is the request path (privatekey/550e8400-e29b-41d4-a716-44665544)
  encrypted like POST or GET params?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Something wrong with authentication with multiple roles

2009-02-09 Thread datgs

I'm new in cakePHP. And I don't know how to question directly to
cakePHP development team.

I think Acl in cakePHP is good. But I've found some thing wrong with
authentication check, with multiple roles.

Details:

File: cake/libs/controller/components/acl.php
Class: DbAcl
Method: Check
Line: 282. Code: return false;
Line: 299. Code: return false;

I've had some tests with this method. I've seen that,

DbAcl::check($aro, $aco, $action = '*')

accept multiple request object (mean that $aro may have 1, 2, 3 or
more request object).

But in the code, return false is used at above line (282 and 299),
there is only one $aro in list to be checked.

In my case, I've change all these line to continue.

What is your opinion ?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How to login with username only ?

2009-02-05 Thread datgs

Hi everybody,

I've had to rewrite code in AuthComponent class to login with username
only.

Was it the best way for my purpose. Is there any way without changing
the code in AuthComponent.

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