Friday, August 31, 2012

Re: Cakephp 1.3 - Detect if Ajax if session expired

hi 

true 1.3 

class AppController extends Controller {
public function beforeFilter(){
if ($this->Auth->User()){
}else{
if($this->params['isAjax']){
$allowed = false;
foreach($this->Auth->allowedActions as $action){
if($action == $this->params['action']){
$allowed = true;
}
}
if(!$allowed){
$return['login'] = true;
echo json_encode($return);
}
}
}
}

}




class TestsController extends AppController{
    
    public function beforeFilter() {
$this->Auth->allow('add');  // responseText: "{"login":"is allowed"}"    
// $this->Auth->allow('add'); // responseText: "{"login":true}" 
parent::beforeFilter();
    }
    
    public function add(){
if(!isset($return)){
$return['login'] = 'is allowed';
}
$this->set('return',$return);
$this->render('ajax_view','ajax');
}    

}   


Best regards!


2012/8/31 romel javier gomez herrera <bmxquiksilver7185@gmail.com>
hi, chris.

2.0
class AppController extends Controller {
public function beforeFilter(){
if ($this->Auth->User()){
}else{
if($this->request->isAjax()){
$allowed = false;
foreach($this->Auth->allowedActions as $action){
if($action == $this->request->params['action']){
$allowed = true;
}
}
if(!$allowed){
$return['login'] = true;
echo json_encode($return);
}
}
}
}

}




class TestsController extends AppController{
    
    public function beforeFilter() {
$this->Auth->allow('add'); // responseText: "{"login":"is allowed"}"    
// $this->Auth->allow('add'); // responseText: "{"login":true}" 
parent::beforeFilter();
    }
    
    public function add(){
if(!isset($return)){
$return['login'] = 'is allowed';
}
$this->set('return',$return);
$this->render('ajax_view','ajax');
}    

}   


1.3

class AppController extends Controller {
public function beforeFilter(){
if ($this->Auth->User()){
}else{
if($this->request->isAjax()){
$allowed = false;
foreach($this->Auth->allowedActions as $action){
if($action == $this->params['action']){
$allowed = true;
}
}
if(!$allowed){
$return['login'] = true;
echo json_encode($return);
}
}
}
}

}




class TestsController extends AppController{
    
    public function beforeFilter() {
$this->Auth->allow('add'); // responseText: "{"login":"is allowed"}"    
// $this->Auth->allow('add'); // responseText: "{"login":true}" 
parent::beforeFilter();
    }
    
    public function add(){
if(!isset($return)){
$return['login'] = 'is allowed';
}
$this->set('return',$return);
$this->render('ajax_view','ajax');
}    

}   

Best regards!

2012/8/31 Chris Cinelli <chris.cinelli@formativelearning.com>
We have this is a problem, too. Last Romel's solution sounds pretty good.
I would like though that this can be the default behavior (ex: putting it in AppController::beforeFilter). But I want that all the actions specified by $this->Auth->allow(...) do not to emit the {"login":true}

One option is to call $this->Auth->allow(...) before
parent::beforeFilter() in the derived controllers and having something (?) that tells if the current action is in the allow list.
However an optional solution should be able to work even if parent::beforeFilter() is called before  Auth->allow.

Should not this be a feature of the AuthComponent?

Best,
   Chris


On Fri, Aug 31, 2012 at 6:02 AM, romel javier gomez herrera <bmxquiksilver7185@gmail.com> wrote:
hi 


<?php class AppController extends Controller {

public function beforeFilter(){
if ($this->Auth->User()){
}else{
if($this->params['isAjax']){
// if the session expired
$return['login'] = true;
echo json_encode($return); // responseText: "{"login":true}"
}
}
}
} ?>

Best regards!


2012/8/31 Florin Trifu <florin.catalin.trifu@gmail.com>
Thank you!

This is how I have tried in the first place but it is not working. $this->RequestHandler->isAjax() is null or false, so it will never execute the conditional code.

Best regards!

--
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+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
 
 

--
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+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
 
 



--
--Everything should be made as simple as possible, but not simpler (Albert Einstein)

--
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+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
 
 


--
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+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
 
 

Re: Cakephp 1.3 - Detect if Ajax if session expired

hi, chris.

2.0
class AppController extends Controller {
public function beforeFilter(){
if ($this->Auth->User()){
}else{
if($this->request->isAjax()){
$allowed = false;
foreach($this->Auth->allowedActions as $action){
if($action == $this->request->params['action']){
$allowed = true;
}
}
if(!$allowed){
$return['login'] = true;
echo json_encode($return);
}
}
}
}

}




class TestsController extends AppController{
    
    public function beforeFilter() {
$this->Auth->allow('add'); // responseText: "{"login":"is allowed"}"    
// $this->Auth->allow('add'); // responseText: "{"login":true}" 
parent::beforeFilter();
    }
    
    public function add(){
if(!isset($return)){
$return['login'] = 'is allowed';
}
$this->set('return',$return);
$this->render('ajax_view','ajax');
}    

}   


1.3

class AppController extends Controller {
public function beforeFilter(){
if ($this->Auth->User()){
}else{
if($this->request->isAjax()){
$allowed = false;
foreach($this->Auth->allowedActions as $action){
if($action == $this->params['action']){
$allowed = true;
}
}
if(!$allowed){
$return['login'] = true;
echo json_encode($return);
}
}
}
}

}




class TestsController extends AppController{
    
    public function beforeFilter() {
$this->Auth->allow('add'); // responseText: "{"login":"is allowed"}"    
// $this->Auth->allow('add'); // responseText: "{"login":true}" 
parent::beforeFilter();
    }
    
    public function add(){
if(!isset($return)){
$return['login'] = 'is allowed';
}
$this->set('return',$return);
$this->render('ajax_view','ajax');
}    

}   

Best regards!

2012/8/31 Chris Cinelli <chris.cinelli@formativelearning.com>
We have this is a problem, too. Last Romel's solution sounds pretty good.
I would like though that this can be the default behavior (ex: putting it in AppController::beforeFilter). But I want that all the actions specified by $this->Auth->allow(...) do not to emit the {"login":true}

One option is to call $this->Auth->allow(...) before
parent::beforeFilter() in the derived controllers and having something (?) that tells if the current action is in the allow list.
However an optional solution should be able to work even if parent::beforeFilter() is called before  Auth->allow.

Should not this be a feature of the AuthComponent?

Best,
   Chris


On Fri, Aug 31, 2012 at 6:02 AM, romel javier gomez herrera <bmxquiksilver7185@gmail.com> wrote:
hi 


<?php class AppController extends Controller {

public function beforeFilter(){
if ($this->Auth->User()){
}else{
if($this->params['isAjax']){
// if the session expired
$return['login'] = true;
echo json_encode($return); // responseText: "{"login":true}"
}
}
}
} ?>

Best regards!


2012/8/31 Florin Trifu <florin.catalin.trifu@gmail.com>
Thank you!

This is how I have tried in the first place but it is not working. $this->RequestHandler->isAjax() is null or false, so it will never execute the conditional code.

Best regards!

--
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+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
 
 

--
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+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
 
 



--
--Everything should be made as simple as possible, but not simpler (Albert Einstein)

--
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+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
 
 

--
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+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
 
 

Re: How to do a DISTINCT find but also return more than 1 field

I thought I'd post back with my solution.  I seem to magically figure it out 2 minutes after posting, but never before hand haha. 

I just used the 'group' key instead and that seemed to do the trick returning only distinct IP rows while bringing back data for all fields that I needed:

$DistinctIp = $this->Log->find('all', array(
'conditions'=>array(
'last_usage_human >'=>date('Y-m-d H:i:s', strtotime('-15 minutes'))
),
'fields'=>array('Log.ip', 'Log.user_agent', 'Log.ip_name', 'Log.last_usage_human'),
'limit'=>333,
                        'group'=>'Log.ip'
));

On Friday, August 31, 2012 6:32:20 PM UTC-7, andrewperk wrote:
Hello,

When trying to do a DISTINCT find with only 1 field being returned everything works fine. But if I want more than just that 1 field of data returned it's no longer distinct. How can I do this?

$DistinctIp = $this->Log->find('all', array(
'conditions'=>array(
'last_usage_human >'=>date('Y-m-d H:i:s', strtotime('-15 minutes'))
),
'fields'=>array('DISTINCT Log.ip', 'Log.user_agent', 'Log.ip_name', 'Log.last_usage_human'),
'limit'=>333
));

This does not work, it's returning everything, it's no longer DISTINCT. 

Here you can see I want only rows with the DISTINCT ip field to be returned. But I want the data that's returned from more than just that field such as the: ip_name, last_usage_human fields as well. But when I do this it returns everything and doesn't constrain it to the DISTINCT.

Thanks,


Andrew

--
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+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
 
 

Re: Building a CakePHP app with Parse.com - anyone done it?

I too am interested in Parse.com and CakePHP. For my purposes (creating a search site that looks up stored lat/long locations), I need a simple website with user login/profile, database posting/getting using REST, and native iPhone and Android apps. I would also like to extend the webapp/mobile app to incorporate twitter, facebook, and pinterest.

WhyNotSmile, have you made the merge from CakePHP to Parse.com? I think I want to store all my data on Parse and send requests from the mobile apps or the webapp. Does this design sound reasonable?

One more catch: I would like for each user to be able to setup a custom page available to the public. I will need images for each user and the problem is Parse's free service only allows for 1GB. I am thinking that I would have to store all images on the CakePHP server, but save the URL link for them in the Parse database. I am not sure if this would be a good solution.

Any advice would be great. Thanks in advance,
-Scott

--
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+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
 
 

Re: Cakephp 1.3 - Detect if Ajax if session expired

We have this is a problem, too. Last Romel's solution sounds pretty good.
I would like though that this can be the default behavior (ex: putting it in AppController::beforeFilter). But I want that all the actions specified by $this->Auth->allow(...) do not to emit the {"login":true}

One option is to call $this->Auth->allow(...) before
parent::beforeFilter() in the derived controllers and having something (?) that tells if the current action is in the allow list.
However an optional solution should be able to work even if parent::beforeFilter() is called before  Auth->allow.

Should not this be a feature of the AuthComponent?

Best,
   Chris


On Fri, Aug 31, 2012 at 6:02 AM, romel javier gomez herrera <bmxquiksilver7185@gmail.com> wrote:
hi 


<?php class AppController extends Controller {

public function beforeFilter(){
if ($this->Auth->User()){
}else{
if($this->params['isAjax']){
// if the session expired
$return['login'] = true;
echo json_encode($return); // responseText: "{"login":true}"
}
}
}
} ?>

Best regards!


2012/8/31 Florin Trifu <florin.catalin.trifu@gmail.com>
Thank you!

This is how I have tried in the first place but it is not working. $this->RequestHandler->isAjax() is null or false, so it will never execute the conditional code.

Best regards!

--
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+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
 
 

--
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+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
 
 



--
--Everything should be made as simple as possible, but not simpler (Albert Einstein)

--
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+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
 
 

How to do a DISTINCT find but also return more than 1 field

Hello,

When trying to do a DISTINCT find with only 1 field being returned everything works fine. But if I want more than just that 1 field of data returned it's no longer distinct. How can I do this?

$DistinctIp = $this->Log->find('all', array(
'conditions'=>array(
'last_usage_human >'=>date('Y-m-d H:i:s', strtotime('-15 minutes'))
),
'fields'=>array('DISTINCT Log.ip', 'Log.user_agent', 'Log.ip_name', 'Log.last_usage_human'),
'limit'=>333
));

This does not work, it's returning everything, it's no longer DISTINCT. 

Here you can see I want only rows with the DISTINCT ip field to be returned. But I want the data that's returned from more than just that field such as the: ip_name, last_usage_human fields as well. But when I do this it returns everything and doesn't constrain it to the DISTINCT.

Thanks,


Andrew

--
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+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
 
 

Re: SQL query rather than CakePHP style query

We use something like this in the models:

$query = "SELECT * FROM user WHERE id=:user_id"
$data = $this->getDataSource()->fetchAll($query, array("usery_id" => $user_id), array("cache" => false));



On Fri, Aug 31, 2012 at 2:13 AM, Phang Mulianto <braveh4rt@gmail.com> wrote:
hi,

the bottom line is you should not trust any parameter generated from outside your app by user.

You should do input validation, which is sanitize class.

so let say the $id will not contain '; delete * from user' , if your id expected is int, make sure it only contains int

hope helps


On Fri, Aug 31, 2012 at 4:36 PM, Mariano C. <mariano.calandra@gmail.com> wrote:
My method is something like

public function getSomething($id)
   $sql = "SELECT ... WHERE id =".$id;
   return $this->Model->query($sql);
}

How should I use your tips?

Il giorno venerdì 31 agosto 2012 05:11:34 UTC+2, Dr. Tarique Sani ha scritto:
Using prepared statements via the fetchAll method with Sanitize::clean
is the way to go

--
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+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
 
 

--
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+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
 
 



--
--Everything should be made as simple as possible, but not simpler (Albert Einstein)

--
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+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
 
 

Re: [Render problem] 5s to render any view

other test,

this time without data in view (white page)

Memory

Peak Memory Use 10.65 MB

MessageMemory use
Component initialization4.48 MB
Controller action start5.26 MB
Controller render start5.33 MB
View render complete10.31 MB

Timers

Total Request Time: 148 (ms)

MessageTime in msGraph
Core Processing (Derived from $_SERVER["REQUEST_TIME"]) 28.28
Event: Controller.initialize0.10
Event: Controller.startup 0.38
Controller action0.12
Event: Controller.beforeRender 4.62
» Processing toolbar data4.53
Rendering View 98.53
» Event: View.beforeRender0.06
» Rendering APP/View/Inicio/index.ctp 95.86
» Event: View.afterRender0.06
» Event: View.beforeLayout 0.05
» Rendering APP/View/Layouts/deslogado.ctp0.36
Event: View.afterLayout 0.00

and the same problem happened (previous post) 

:(

I really have no idea


On Fri, Aug 31, 2012 at 9:46 PM, Alexandre Vasconcelos <ops.rio@gmail.com> wrote:
guys, 

I installed the debugkit and did some tests

Index, without user session (not logged)

Memory

Peak Memory Use 10.65 MB

MessageMemory use
Component initialization 4.49 MB
Controller action start5.27 MB
Controller render start5.33 MB
View render complete10.31 MB

Timers

Total Request Time: 81 (ms)

MessageTime in msGraph
Core Processing (Derived from $_SERVER["REQUEST_TIME"]) 24.14
Event: Controller.initialize 0.11
Event: Controller.startup0.36
Controller action 0.13
Event: Controller.beforeRender4.66
» Processing toolbar data 4.57
Rendering View35.04
» Event: View.beforeRender 0.07
» Rendering APP/View/Inicio/index.ctp31.76
» Event: View.afterRender 0.12
» Event: View.beforeLayout0.11
» Rendering APP/View/Layouts/deslogado.ctp 0.64
Event: View.afterLayout0.00
but, here the problem happened, all data was sent and showed on browser, but, the browser kept loading something during 5s, and no javascript was working during this time.

this behavior is the same for the other views

some idea?

tks


Em sexta-feira, 31 de agosto de 2012 12h51min17s UTC-3, Alexandre Vasconcelos escreveu:
Hi Ad7six, I will install debug kit and make some tests and put here the results




On Fri, Aug 31, 2012 at 12:47 PM, Jeremy Burns | Class Outfit <jeremyburns@classoutfit.com> wrote:
Then see what AD7Six said...


Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 31 Aug 2012, at 16:45:44, Alexandre <ops.rio@gmail.com> wrote:

Hi Jeremy

this problems is in whole app. every render.

On Fri, Aug 31, 2012 at 12:37 PM, Jeremy Burns | Class Outfit <jeremyburns@classoutfit.com> wrote:
So is this problem isolated to one function/view in your app or is it the whole app? If it's just one function/app, does it eventually return data (die(debug())?) or does it fail?


Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 31 Aug 2012, at 16:35:09, Alexandre <ops.rio@gmail.com> wrote:

yes, I can connect in database and I have many models that work correctly, and I connect in phpmyAdmin with the same credentilas



On Fri, Aug 31, 2012 at 12:22 PM, Jeremy Burns | Class Outfit <jeremyburns@classoutfit.com> wrote:
So is the database returning any results? Can you connect to it outside of the app using the credentials you entered in database.php?


Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 31 Aug 2012, at 16:19:38, Alexandre Vasconcelos <ops.rio@gmail.com> wrote:

hi Jeremy,

'datasource' => 'Database/Mysql',



Em sexta-feira, 31 de agosto de 2012 11h53min56s UTC-3, Jeremy Burns escreveu:
What's the datasource?

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 31 Aug 2012, at 15:44:33, Alexandre Vasconcelos <ops...@gmail.com> wrote:

Hi,

I'm using cakephp in my project, this is my second project with cakephp, but now I've a problem and I've no idea what's happening and I've no idea how to investigate it

The problem

may views, any view, is rendering in 5s, and I did some tests:

- I commented <?php echo $this->fetch('content'); ?> in my default layout - the problem stopped

- I commented all codes inside my controller, leaving only the view to rendering, my view was an html without any php code(is a short html) - the problem happened

- I disabled all plugins in bootstrap - the problem happened

- I disabled all routs - the problem happened

so, this is my problem, i need solve it, if someone need more information about, or want to suggest some other test, tell me, I'll do and put the result here.

OBS.: 
I don't know if this helps to identify the problem, after rendering (after 5s) this message apears in chorme console:
"Port error: Could not establish connection. Receiving end does not exist.


tks

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


--
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+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
 
 


--
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+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
 
 


--
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+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
 
 


--
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+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
 
 


--
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+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
 
 

--
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+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
 
 

--
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+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
 
 

--
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+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
 
 

Re: [Render problem] 5s to render any view

guys, 

I installed the debugkit and did some tests

Index, without user session (not logged)

Memory

Peak Memory Use 10.65 MB

MessageMemory use
Component initialization4.49 MB
Controller action start5.27 MB
Controller render start5.33 MB
View render complete10.31 MB

Timers

Total Request Time: 81 (ms)

MessageTime in msGraph
Core Processing (Derived from $_SERVER["REQUEST_TIME"])24.14
Event: Controller.initialize0.11
Event: Controller.startup0.36
Controller action0.13
Event: Controller.beforeRender4.66
» Processing toolbar data4.57
Rendering View35.04
» Event: View.beforeRender0.07
» Rendering APP/View/Inicio/index.ctp31.76
» Event: View.afterRender0.12
» Event: View.beforeLayout0.11
» Rendering APP/View/Layouts/deslogado.ctp0.64
Event: View.afterLayout0.00
but, here the problem happened, all data was sent and showed on browser, but, the browser kept loading something during 5s, and no javascript was working during this time.

this behavior is the same for the other views

some idea?

tks


Em sexta-feira, 31 de agosto de 2012 12h51min17s UTC-3, Alexandre Vasconcelos escreveu:
Hi Ad7six, I will install debug kit and make some tests and put here the results




On Fri, Aug 31, 2012 at 12:47 PM, Jeremy Burns | Class Outfit <jeremyburns@classoutfit.com> wrote:
Then see what AD7Six said...


Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 31 Aug 2012, at 16:45:44, Alexandre <ops.rio@gmail.com> wrote:

Hi Jeremy

this problems is in whole app. every render.

On Fri, Aug 31, 2012 at 12:37 PM, Jeremy Burns | Class Outfit <jeremyburns@classoutfit.com> wrote:
So is this problem isolated to one function/view in your app or is it the whole app? If it's just one function/app, does it eventually return data (die(debug())?) or does it fail?


Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 31 Aug 2012, at 16:35:09, Alexandre <ops.rio@gmail.com> wrote:

yes, I can connect in database and I have many models that work correctly, and I connect in phpmyAdmin with the same credentilas



On Fri, Aug 31, 2012 at 12:22 PM, Jeremy Burns | Class Outfit <jeremyburns@classoutfit.com> wrote:
So is the database returning any results? Can you connect to it outside of the app using the credentials you entered in database.php?


Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 31 Aug 2012, at 16:19:38, Alexandre Vasconcelos <ops.rio@gmail.com> wrote:

hi Jeremy,

'datasource' => 'Database/Mysql',



Em sexta-feira, 31 de agosto de 2012 11h53min56s UTC-3, Jeremy Burns escreveu:
What's the datasource?

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 31 Aug 2012, at 15:44:33, Alexandre Vasconcelos <ops...@gmail.com> wrote:

Hi,

I'm using cakephp in my project, this is my second project with cakephp, but now I've a problem and I've no idea what's happening and I've no idea how to investigate it

The problem

may views, any view, is rendering in 5s, and I did some tests:

- I commented <?php echo $this->fetch('content'); ?> in my default layout - the problem stopped

- I commented all codes inside my controller, leaving only the view to rendering, my view was an html without any php code(is a short html) - the problem happened

- I disabled all plugins in bootstrap - the problem happened

- I disabled all routs - the problem happened

so, this is my problem, i need solve it, if someone need more information about, or want to suggest some other test, tell me, I'll do and put the result here.

OBS.: 
I don't know if this helps to identify the problem, after rendering (after 5s) this message apears in chorme console:
"Port error: Could not establish connection. Receiving end does not exist.


tks

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


--
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+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
 
 


--
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+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
 
 


--
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+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
 
 


--
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+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
 
 


--
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+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
 
 

--
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+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
 
 

--
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+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.