Check Cache view

2013-09-17 Thread localhost
Hello

First let me thank you Cakephp team for this amazing Caching system, very 
easy to use and saved us a lot of time.


Just one question .

Currently I'm using cache view for a page that require a lot of time to 
generate, (i'm using the data generation in the controller and then the 
view generation in the view), is they are way in the controller to check if 
the view is cached or not?

basicly I want to check in the controller if the view still valid so I 
don't need to generate the data again in the controller.


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


Re: How to order a find result by a specific value

2013-09-17 Thread starchild.no1
Thanks Ruben,

This is what worked:
cake way-
'order' => array("Tbl.field_name = '{$string}' DESC")

Sql that was called-
ORDER BY `Tbl`.`field_name` = 'my-value-string' DESC 


On Monday, September 16, 2013 9:09:06 PM UTC-4, Reuben wrote:
>
> I don't think CakePHP handles case clauses or specific values in order by 
> clauses.
>
> You could just try sending in a literal value to the order by clause.
>
> i.e. 'order' => 'id=5 desc, id asc'
>
> Although I might recommend fully qualifying the table name i.e. 'order' => 
> 'friends.id=5 desc, friends.id asc'. You may have to investigate the 
> anticipated alias for the table name, used in the query.
>
> I've never done ordering like this, so I don't know if it is vendor 
> specific or not.  CakePHP doesn't tend to cater for vendor specific 
> options, unless it's mission critical. i.e. TOP vs LIMIT.
>
> On Tuesday, 17 September 2013 06:43:19 UTC+10, starchild.no1 wrote:
>>
>> Hi  all,
>>>
>>> I'm trying to return a find result in an order specified by a given 
>>> value..
>>>
>>> function getAllResults($A=1, $B='red'){
>>>$results = $this->Tbl->find(all, array(
>>> 'conditions' => array('Tbl.foreign_key' => $A),
>>> 'order' => array('Tbl.color' => $B)
>>>));
>>> }
>>>
>>> I've seen:  'order' => array("FIELD(Tbl.color, value_1, value_2, 
>>> value_3)")
>>> But FIELD takes an array and I would like to use just one value=red.
>>> Besides how would I even know where my required value is located in the 
>>> array( value_1, value_2, value_3) using FIELD unless it's hard coded.
>>>
>>> I've also seen: 
>>>
>>> select * from your_tableorder by case when name = 'core' then 1 else 2 end, 
>>> priority 
>>>
>>> And:
>>> select id, name from friends order by id=5 desc, id asc
>>> select id,name from friends order by id=5 desc, id asc
>>>
>>> Which is what I really want to do but can't figure out how to write it the 
>>> cakephp way.
>>>
>>>
>>> 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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Please help Safe Mode PHP server problems

2013-09-17 Thread Breno Ribeiro
Can't you disable safe_mode?

It has been deprecated on php  5.3 and is removed from php 5.4 since it was
not "correct" and generated more pain than security.
http://www.php.net/manual/en/features.safe-mode.php

A well chosen open_basedir is a good alternative to safe mode.


--
[]'s

Breno Damas M. Ribeiro
+[Web] Developer
+http://ribeirobreno.com.br/

"E eu com essa dor terrível nos diodos esquerdos." - Marvin


On Tue, Sep 17, 2013 at 9:55 AM, Miloš Vučinić wrote:

> Oh and one more thing. When I delete the line set_time_limit(0);, the
> error stays the same
>
>
> On Tuesday, September 17, 2013 2:33:59 PM UTC+2, Miloš Vučinić wrote:
>>
>> Hey guys,
>>
>> I am not usually asking for help, but this time I am desperate. I am
>> running a Cake PHP app on a* safe mode php server*. And when I try to
>> download a file using media view i get error Cannot set time limit in safe
>> mode [CORE/Cake/Network/**CakeResponse.php, line 1303 .
>> So I delete that line just to see what will happen (maybe it can work
>> without it or smth) upload the code and I get the same error, as if I
>> haven't changed the code in /Cake/Network/CakeResponse.php . Then I thought
>> I am editing the wrong files so I add a few echos and it works .. I am so
>> confused...
>>
>> *The full error is here : *
>> Warning (2): set_time_limit(): Cannot set time limit in safe mode
>> [CORE/Cake/Network/**CakeResponse.php, line 1303]Code Context
>>
>> set_time_limit - [internal], line ??
>> CakeResponse::_sendFile() - CORE/Cake/Network/**CakeResponse.php, line
>> 1303
>> CakeResponse::send() - CORE/Cake/Network/**CakeResponse.php, line 415
>> MediaView::render() - CORE/Cake/View/MediaView.php, line 98
>> Controller::render() - CORE/Cake/Controller/**Controller.php, line 948
>> Dispatcher::_invoke() - CORE/Cake/Routing/Dispatcher.**php, line 194
>> Dispatcher::dispatch() - CORE/Cake/Routing/Dispatcher.**php, line 162
>>
>> even tho the new function looks like this:
>> /**
>>  * Reads out a file, and echos the content to the client.
>>  *
>>  * @param File $file File object
>>  * @return boolean True is whole file is echoed successfully or false if
>> client connection is lost in between
>>  */
>> protected function _sendFile($file) {
>> $compress = $this->outputCompressed();
>> $file->open('rb');
>> while (!feof($file->handle)) {
>> if (!$this->_isActive()) {
>> $file->close();
>> return false;
>> }
>> set_time_limit(0);
>> echo fread($file->handle, 8192);
>> if (!$compress) {
>> $this->_flushBuffer();
>> }
>> }
>> $file->close();
>> return true;
>> }
>>
>>
>> *Is it possible that CakePHP cant be run under safe mode servers ? *
>>
>>  --
> 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.
>

-- 
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: Please help Safe Mode PHP server problems

2013-09-17 Thread Miloš Vučinić
Oh and one more thing. When I delete the line set_time_limit(0);, the error 
stays the same

On Tuesday, September 17, 2013 2:33:59 PM UTC+2, Miloš Vučinić wrote:
>
> Hey guys, 
>
> I am not usually asking for help, but this time I am desperate. I am 
> running a Cake PHP app on a* safe mode php server*. And when I try to 
> download a file using media view i get error Cannot set time limit in safe 
> mode [CORE/Cake/Network/CakeResponse.php, line 1303 . 
> So I delete that line just to see what will happen (maybe it can work 
> without it or smth) upload the code and I get the same error, as if I 
> haven't changed the code in /Cake/Network/CakeResponse.php . Then I thought 
> I am editing the wrong files so I add a few echos and it works .. I am so 
> confused...
>
> *The full error is here : *
> Warning (2): set_time_limit(): Cannot set time limit in safe mode 
> [CORE/Cake/Network/CakeResponse.php, line 1303]Code Context
>
> set_time_limit - [internal], line ??
> CakeResponse::_sendFile() - CORE/Cake/Network/CakeResponse.php, line 1303
> CakeResponse::send() - CORE/Cake/Network/CakeResponse.php, line 415
> MediaView::render() - CORE/Cake/View/MediaView.php, line 98
> Controller::render() - CORE/Cake/Controller/Controller.php, line 948
> Dispatcher::_invoke() - CORE/Cake/Routing/Dispatcher.php, line 194
> Dispatcher::dispatch() - CORE/Cake/Routing/Dispatcher.php, line 162
>
> even tho the new function looks like this: 
> /**
>  * Reads out a file, and echos the content to the client.
>  *
>  * @param File $file File object
>  * @return boolean True is whole file is echoed successfully or false if 
> client connection is lost in between
>  */
> protected function _sendFile($file) {
> $compress = $this->outputCompressed();
> $file->open('rb');
> while (!feof($file->handle)) {
> if (!$this->_isActive()) {
> $file->close();
> return false;
> }
> set_time_limit(0);
> echo fread($file->handle, 8192);
> if (!$compress) {
> $this->_flushBuffer();
> }
> }
> $file->close();
> return true;
> }
>
>
> *Is it possible that CakePHP cant be run under safe mode servers ? *
>
>

-- 
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: Display dynamic checkbox in cakephp using Jquery

2013-09-17 Thread kdubya
You have multiple problems. First, the fact that you are getting the 
"method in controller could not be found" message means your routing is not 
correct. Try looking at 
http://book.cakephp.org/2.0/en/core-libraries/components/request-handling.html#RequestHandlerComponent

Second, at the end of your method() function your 2 set() calls make no 
sense. In particular, the second one serializes the string *values*. I'm 
pretty sure that is not what you meant to do. The second argument to that 
set call should be an array of values.

You have not really given enough information here. Show the rest of your 
view code where the js file is being called. 

Ken

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


Please help Safe Mode PHP server problems

2013-09-17 Thread Miloš Vučinić
Hey guys, 

I am not usually asking for help, but this time I am desperate. I am 
running a Cake PHP app on a* safe mode php server*. And when I try to 
download a file using media view i get error Cannot set time limit in safe 
mode [CORE/Cake/Network/CakeResponse.php, line 1303 . 
So I delete that line just to see what will happen (maybe it can work 
without it or smth) upload the code and I get the same error, as if I 
haven't changed the code in /Cake/Network/CakeResponse.php . Then I thought 
I am editing the wrong files so I add a few echos and it works .. I am so 
confused...

*The full error is here : *
Warning (2): set_time_limit(): Cannot set time limit in safe mode 
[CORE/Cake/Network/CakeResponse.php, line 1303]Code Context

set_time_limit - [internal], line ??
CakeResponse::_sendFile() - CORE/Cake/Network/CakeResponse.php, line 1303
CakeResponse::send() - CORE/Cake/Network/CakeResponse.php, line 415
MediaView::render() - CORE/Cake/View/MediaView.php, line 98
Controller::render() - CORE/Cake/Controller/Controller.php, line 948
Dispatcher::_invoke() - CORE/Cake/Routing/Dispatcher.php, line 194
Dispatcher::dispatch() - CORE/Cake/Routing/Dispatcher.php, line 162

even tho the new function looks like this: 
/**
 * Reads out a file, and echos the content to the client.
 *
 * @param File $file File object
 * @return boolean True is whole file is echoed successfully or false if 
client connection is lost in between
 */
protected function _sendFile($file) {
$compress = $this->outputCompressed();
$file->open('rb');
while (!feof($file->handle)) {
if (!$this->_isActive()) {
$file->close();
return false;
}
set_time_limit(0);
echo fread($file->handle, 8192);
if (!$compress) {
$this->_flushBuffer();
}
}
$file->close();
return true;
}


*Is it possible that CakePHP cant be run under safe mode servers ? *

-- 
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: CakePhp doesn't read the script

2013-09-17 Thread Mike Karthauser
i suspect you are using short tags  wrote:

> I updated my apache  and php on local server and my project on cake stoped 
> working. Now it looks like on the picture
> 
> 
> 
> Please HELP is extremely needed!
> 
> 
> -- 
> 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.


Mike Karthäuser
Director, Brightstorm Ltd.

1, Brewery Court
North Street
Bristol
BS3 1JS

mi...@brightstorm.co.uk
www.brightstorm.co.uk
+44(0) 7939252144


-- 
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: CakePhp doesn't read the script

2013-09-17 Thread Ivan Rimac
you dont have php tags open somewhere in the beginning


On Mon, Sep 16, 2013 at 10:23 PM, George Manvelishvili  wrote:

> I updated my apache  and php on local server and my project on cake stoped
> working. Now it looks like on the picture
>
>
> 
>
> Please HELP is extremely needed!
>
> --
> 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.
>



-- 
*Ivan Rimac***
mail: i...@rimac.hr
*tel: +385 95 555 99 66*
*http://ivanrimac.com*
*http://rimac.hr*

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


CakePhp doesn't read the script

2013-09-17 Thread George Manvelishvili


I updated my apache  and php on local server and my project on cake stoped 
working. Now it looks like on the picture



Please HELP is extremely needed!

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


i18n shell validation msgs not being extracted

2013-09-17 Thread aka
I'm trying to generate the pot files from my site with cake's i18n shell 
useing cake 2.3. As mentioned in the cake docs the shell should 
automatically extract the validation msgs. However, none of the validation 
strings are added to my pot files. 

My validation array simply looks like: 
public $validate = array( 
'currency' => array(
'notempty' => array(
'rule' => array('notempty'),
'message' => 'Select a currency'
),
),
'title' => array(
'notempty' => array(
'rule' => array('notempty'),
'message' => 'Fill out a title'
),
)

... etc
)


What am i not seeing here?!

Thanks allot!

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