Re: Hash.php

2013-03-01 Thread CrotchFrog
Looking at the stack trace, there was nothing that seemed to point to the 
cause of the problem. I'm at work now but I'll post a trace over the 
weekend. I use DebugKit from time to time, but it's usually off more often 
than not. I'll run it through DebugKit and see what I can come up with. The 
biggest mystery to me now is why did the error start "all of the sudden" 
and why for some users and not others. 

On Wednesday, February 27, 2013 1:45:29 PM UTC-5, CrotchFrog wrote:

> (Cake 2.2.5) I recently started getting an error that reads:
> Warning (2): Invalid argument supplied for foreach() 
> [CORE]/Cake/Utility/Hash.php, Line 50]
>
> Line 50 in Hash.php is part of get() function for the Hash class. Trying 
> to debug anything in that function results in a memory allocation error. 
> How is Hash being used and what kind of data is being presented to the 
> function that it's running out of memory? 
>
> There are only two users in the database at the moment and the error is 
> only showing for one of them. The method in my Users controller that seems 
> to be triggering the error is: 
>
> public function view($id = null){
> 
>if ($id == null){
>$id = $this->Auth->user('username');
>}
>$user = $this->User->getUser($id); 
>$this->set(compact('user'));
> }
>
> getUser() in the User model is: 
>
> public function getUser($id){
>  
> if (is_numeric($id)){ 
> $user = $this->find('first', array(
> 'conditions' => array(
> 'User.id' => $id),
> 'contain' => array('Avatar', 'Bio', 'Role', 'Group')
> )); 
> } else { 
> $user = $this->find('first', array(
> 'conditions' => array(
> 'username' => $id),
> 'contain' => array('Avatar', 'Bio', 'Role', 'Group')
> )); 
> }
> if ($user){
> return $user;
> } return false; 
> }
>
> Wondering what Hash is looking for and why it's reporting an error with 
> this particular method. The app has been running error free for quite some 
> time and I can't think of anything I changed that would have produced the 
> error. 
>
> Any help is appreciated. 
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How to use TimeHelper to output the data like (Y minutes ago, X hours ago or Z days ago).

2013-03-01 Thread euromark
haha, I just gave the exact same comment-less answer here
http://ask.cakephp.org/questions/view/how_to_use_the_timehelper_to_some_thing_like_it_was_post_5_hours_ago



Am Freitag, 1. März 2013 23:44:37 UTC+1 schrieb Thiago Belem:
>
>
> http://book.cakephp.org/2.0/en/core-utility-libraries/time.html#CakeTime::timeAgoInWords
> 
>
>
> --
> ***Thiago Belem*
> Desenvolvedor
> Rio de Janeiro - RJ - Brasil
>
> *Assando Sites* - Curso online de *CakePHP*
> assando-sites.com.br 
>
> thiagobelem.net
> con...@thiagobelem.net 
>
> *Skype / gTalk **»* thiago.belem.web
> *LinkedIn* *»* br.linkedin.com/in/thiagobelem/pt
>  
>
> On Fri, Mar 1, 2013 at 7:41 PM, Cesar Felipe 
> > wrote:
>
>> Hi guys,
>>
>> I would like to display the data of post like this: 
>>
>> Y minutes ago
>> X hours ago
>> Z days ago 
>>
>> the letter would be the actually number.
>>
>> Can I use the TimeHelper for that? My current code is like this:
>>
>> {{{
>> 
>> }}}
>>
>> How should I change  so I will be able to display the information in the 
>> way I need?
>>
>> Thank you
>> Felipe
>>
>> -- 
>> 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+u...@googlegroups.com .
>> To post to this group, send email to cake...@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: beforeValidate can't modify my data

2013-03-01 Thread kicaj
The results of pr($this->News->validationErrors) is:

Array
(
[Photo] => Array
(
[1] => Array
(
)

)

)


W dniu piątek, 1 marca 2013 18:13:04 UTC+1 użytkownik André Luis napisał:
>
> give a pr() function, and paste the output here please, them i think we 
> can help u
>
> Em quarta-feira, 27 de fevereiro de 2013 20h58min12s UTC-3, kicaj escreveu:
>>
>> I create form with many fields and fields for upload files (Photo.0.image, 
>> Photo.1.image).
>>
>> How do I choose from my computer two files to upload and send form, then 
>> works perfectly. But sometimes I would like upload only one file (
>> Photo.0.image) and the secend input file (Photo.1.image) leave empty. I 
>> prepare Photo::beforeValidate for this:
>>
>> public function beforeValidate($options = array()) {
>> if(empty($this->data['Photo']['image']['tmp_name'])) {
>> unset($this->data['Photo']);
>> }
>>  return true;
>> }
>>
>> But my SaveAll() return false and results for 
>> pr($this->News->validationErrors) is:
>>
>> Array (
>>  [Photo] => Array (
>>  [1] => Array ()
>>  )
>> )
>>
>> What going on?
>> Any idea?
>>
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How to use TimeHelper to output the data like (Y minutes ago, X hours ago or Z days ago).

2013-03-01 Thread Thiago Belem
http://book.cakephp.org/2.0/en/core-utility-libraries/time.html#CakeTime::timeAgoInWords



--
***Thiago Belem*
Desenvolvedor
Rio de Janeiro - RJ - Brasil

*Assando Sites* - Curso online de *CakePHP*
assando-sites.com.br 

thiagobelem.net
cont...@thiagobelem.net

*Skype / gTalk **»* thiago.belem.web
*LinkedIn* *»* br.linkedin.com/in/thiagobelem/pt


On Fri, Mar 1, 2013 at 7:41 PM, Cesar Felipe  wrote:

> Hi guys,
>
> I would like to display the data of post like this:
>
> Y minutes ago
> X hours ago
> Z days ago
>
> the letter would be the actually number.
>
> Can I use the TimeHelper for that? My current code is like this:
>
> {{{
> 
> }}}
>
> How should I change  so I will be able to display the information in the
> way I need?
>
> Thank you
> Felipe
>
> --
> 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?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




How to use TimeHelper to output the data like (Y minutes ago, X hours ago or Z days ago).

2013-03-01 Thread Cesar Felipe
Hi guys,

I would like to display the data of post like this: 

Y minutes ago
X hours ago
Z days ago 

the letter would be the actually number.

Can I use the TimeHelper for that? My current code is like this:

{{{

}}}

How should I change  so I will be able to display the information in the 
way I need?

Thank you
Felipe

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Safari losing session...

2013-03-01 Thread John Hardy
This is most likely caused by error or warning being output in the 
'output_buffer' before the page/fragment is finished rendering.

Turn on debugging and make sure there are no warnings and/or errors occurring.



On Dec 3, 2012, at 5:49 PM, Benjamin Allison  wrote:

> So I've set Configure::write('Session.checkAgent', false) and Security.level 
> to medium in my app, but Safari still seems to be losing the session between 
> certain actions, in particular when coming from a page that has quite a bit 
> of AJAX on it.
> 
> The weird thing is that the app still works. Data gets saved, things procede 
> as normal, I just keep getting the standard authError.
> 
> Again, this doesn't happen in other browsers. 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 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.
>  
>  

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Safari losing session...

2013-03-01 Thread vanessa v

I have the same issue as you. This also happens in IE... 



On Monday, December 3, 2012 8:49:23 PM UTC-5, Benjamin Allison wrote:
>
> So I've set Configure::write('Session.checkAgent', false) and Security.level 
> to medium in my app, but Safari still seems to be losing the session 
> between certain actions, in particular when coming from a page that has 
> quite a bit of AJAX on it.
>
> The weird thing is that the app still works. Data gets saved, things 
> procede as normal, I just keep getting the standard authError.
>
> Again, this doesn't happen in other browsers. 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: beforeValidate can't modify my data

2013-03-01 Thread André Luis
give a pr() function, and paste the output here please, them i think we can 
help u

Em quarta-feira, 27 de fevereiro de 2013 20h58min12s UTC-3, kicaj escreveu:
>
> I create form with many fields and fields for upload files (Photo.0.image, 
> Photo.1.image).
>
> How do I choose from my computer two files to upload and send form, then 
> works perfectly. But sometimes I would like upload only one file (
> Photo.0.image) and the secend input file (Photo.1.image) leave empty. I 
> prepare Photo::beforeValidate for this:
>
> public function beforeValidate($options = array()) {
> if(empty($this->data['Photo']['image']['tmp_name'])) {
> unset($this->data['Photo']);
> }
>  return true;
> }
>
> But my SaveAll() return false and results for 
> pr($this->News->validationErrors) is:
>
> Array (
>  [Photo] => Array (
>  [1] => Array ()
>  )
> )
>
> What going on?
> Any idea?
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Image Upload

2013-03-01 Thread Tony Messias
See this:

http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::file

Att,


--

Luiz Antonio S Messias
Desenvolvedor Web


@tonyzrp 
*LinkedIn* 


On 1 March 2013 13:56, Steven Scaffidi  wrote:

> Hi I'm trying to create an image upload form in CakePHP. How do I do this
> without a plugin? Is there a simple way? I don't need any validation or
> advanced functionality - just looking for the simplest method. Any
> suggestions?
>
> I have a table with 7 fields. 1 of them is the photo field.
>
> Thanks,
>
> Steven
>
> --
> 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?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Image Upload

2013-03-01 Thread Steven Scaffidi
Hi I'm trying to create an image upload form in CakePHP. How do I do this 
without a plugin? Is there a simple way? I don't need any validation or 
advanced functionality - just looking for the simplest method. Any 
suggestions?

I have a table with 7 fields. 1 of them is the photo field.

Thanks,

Steven

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How to install without pear

2013-03-01 Thread AD7six
The installation instructions for CakePHP are 
here http://book.cakephp.org/2.0/en/installation.html

Cheers,

AD


On Thursday, 28 February 2013 23:39:47 UTC+1, John wrote:
>
> I have a version of pear that is too old to install Cake 2.3.0 and I'm not 
> in a position to upgrade it.  The readme.md is pretty slim on how to 
> install it.  Is there a good current guide somewhere?
>
> thanks
>
>
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Issue with test suite

2013-03-01 Thread Rémi Dewitte
Hello,

I am trying to run tests and have an error.
1/ it fails on SchemaShellTest::testName() line 527
2/ because 
lib/Cake/Test/test_app/Plugin/TestPlugin/Config/Schema/custom_name.php does 
not exist
3/ find -name custom_name.php gives nothing :/

The test comes from this PR :https://github.com/cakephp/cakephp/pull/759
Maybe this file was just forgotten.

Thanks for your help,
Rémi

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




How to install without pear

2013-03-01 Thread John
I have a version of pear that is too old to install Cake 2.3.0 and I'm not 
in a position to upgrade it.  The readme.md is pretty slim on how to 
install it.  Is there a good current guide somewhere?

thanks


-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: CakePHP 2.3.0: Bug in CacheEngine?

2013-03-01 Thread majna
You are using APC *and* File cache?
https://github.com/cakephp/cakephp/blob/2.3.0/app/Config/bootstrap.php#L99

also note that APC memory is not shared between PHP CLI and Apache mod_php 
(it is shared when php-fpm is used).
i.e. you cannot clear APC cache created by Apache from Cake console or vice 
versa.

On Wednesday, February 27, 2013 9:42:59 AM UTC+1, LDSign wrote:
>
> Hi
>
> Related to my post below I have switched from File to APC Cache. Read and 
> write commands to the APC-Cache work like expected. But when I use clear() 
> and clearGroup() nothing happens.
>
> I have digged a little deeper and put some debug info in the related 
> FileEngine.php and ApcEngine.php. Result: The functions (clear & 
> clearGroup) in ApcEngine.php are never used - instead the ones of the 
> FileEngine.php are used. Its clear, that this does not work.
>
> Is this a bug?
>
> Ive debugged the $engine-variable in core.php. It is "Apc" like it should 
> - "File" isn't used at all anymore in my app.
>
> Thanks,
> Frank
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.