RE: Directory Protection

2013-05-23 Thread Advantage+
The point is for example (not comparing to Facebook / or any site that has
images / files) but you cannot go to facebook.com/profiles/uploads/images
and view all images its protected, server gets image location  and sends it
out to the "view" when needed.

 

I do not want the folder "files" are uploaded to be accessed. 

If I put the"upload"  folder outside webroot CakeRequest::file just spits
out the image / file to the browser….. I do not want that.

 

I need to pull from the folder and display it as if it was coming from img
folder as normal.

 

You do not want anyone to go to site.com/img/uploads/ and have full access
to browse thru all your files / images / uploads

 

 

 

From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of André Luis
Sent: Thursday, May 23, 2013 9:27 AM
To: cake-php@googlegroups.com
Subject: Re: Directory Protection

 

Just a suggestion, but why dont you create a images folder on the root of
the server, them create a controller wich read the image and outputs to
browser? It would be protected...

 

It would be like you create /app/images and upload the files to this folder,
them only cake would have access, but for a better security, the root folder
is advised. 


Em quarta-feira, 22 de maio de 2013 23h08min56s UTC-3, advantage+ escreveu:

I have an" img/uploads" folder which has users profile images and such.

 

How do you go about protecting the folder so there is no access except when
Cake gets the images? 

So anyone can't just browse thru the directory?

 

Google search turned up MediaView so put the uploads outside of webroot, but

" As of 2.3 MediaView is deprecated and you can use CakeResponse::file() to
send a file as response:"

 

Should it be set to use CakeResponse::file($path, $options = array())

Allows you to set a file for display or download

 

If so is there a simple example out there showing exactly how this would get
the files and server it up?

 

$image = CakeResponse::file('where/file/is/here.jpg, $options = array())

$this->Controller->set('image', $image);

 

Thanks,

Dave

 

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




RE: CakePHP 2.x Moving Find into Model

2013-05-23 Thread Advantage+
Yeah just to keep it simple but allow to pass vars if needed. 

Just an example what I sent but you can pop wars in everything condition you
want based on the controller action.

 

I have some if logged in page based on viewed / like / hate.. Its limitless.
So define the core structure and just simply swap out as needed

 

From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of Jeremy Burns : Class Outfit
Sent: Friday, May 24, 2013 2:01 AM
To: cake-php@googlegroups.com
Subject: Re: CakePHP 2.x Moving Find into Model

 

Got it - thanks. So you're really just setting up the paginate variable in
the model rather than the controller then calling it from the controller to
set up pagination before doing a paginate find?

 

On 24 May 2013, at 05:25, "Advantage+"  wrote:





Not sure if this is any help. But I hate all the $params in the controller
especially if you have to do it on the fly so I set all the params in the
model like such: (Just swap out 'model' for your own )

Model:

public function _Pagination($limit = 15){

   

$params = array(

'conditions' => array(

 
'fields' => array(

 
'Model.id',

 
'Model.featured',

 
'Model.title',

 
'Model.description),

 
'limit' => $limit,

 
'order' => array(

 
'Model.created DESC'),

 
'contain' => array(

 
'State' => array(

 
'fields' => array(

 
'State.abrev')),

'Country' =>
array(

 
'fields' => array(

 
'Country.name',

 
'Country.iso')));

   

return $params;

}

 

Controller:

$this->paginate = $this->Model->_Pagination ($anything you want to pass
$limit, $conditions...);

And just pop it into the find into the $params like

 

$this->paginate = $this->Model->_Pagination($limit = 10); or anything you
might want to edit on the fly.

 

Swap out all the vars you want and make it work for you.

Then do standard:

 

$this->set('whatever', $this->paginate('Model'));

 

All it is basically is the same as you normally would do in the controller
but rather than having all that crap I find it easier to say paginateThis(),
pagginateThat() rather than all that in the controller and just pull the
params from the model.

 

Dave

 

From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of Jeremy Burns : Class Outfit
Sent: Friday, May 24, 2013 1:00 AM
To: cake-php@googlegroups.com
Subject: Re: CakePHP 2.x Moving Find into Model

 

Have you got an example of that?

 

On 24 May 2013, at 01:09, lowpass < 
zijn.digi...@gmail.com> wrote:






Apply the array to the $paginate class var, not the method. Basically, you
can declare the $paginate array as a class var, then add to or override any
part of it from within an action.

 

On Thu, May 23, 2013 at 7:12 PM, Larry Lutz < 
lut...@swbell.net> wrote:

I'm trying to achieve the fat model/skinny controller mantra in CakePHP 2.7.
In that scenario, the model should control the data, and that means moving
the finds out of the controllers and into the models. However, at least with
the view and admin_view actions, one needs the data paginated.

The problem starts there. It's easy enough to do a $this->find('all') in the
model to get the data, along with any conditions, contains, etc. However
that produces an array. Paginator->paginate(), as far as I can tell won't
work in the model; it's a component that only works in a controller. Yet, if
I take the array produced in the model into the controller and try to pass
it on toPaginator->paginate(), it fails because paginate won't accept an
array.

In terms of trying to achieve the fat model/skinny controller goal, what am
I missing here. How can I achieve a paginated result while still having the
model (properly) do the work of managing and finding the data?

 

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

Re: CakePHP 2.x Moving Find into Model

2013-05-23 Thread Jeremy Burns : Class Outfit
Got it - thanks. So you're really just setting up the paginate variable in the 
model rather than the controller then calling it from the controller to set up 
pagination before doing a paginate find?

On 24 May 2013, at 05:25, "Advantage+"  wrote:

> Not sure if this is any help. But I hate all the $params in the controller 
> especially if you have to do it on the fly so I set all the params in the 
> model like such: (Just swap out 'model' for your own )
> Model:
> public function _Pagination($limit = 15){
>
> $params = array(
> 'conditions' => array(
>   
>   'fields' => array(
>   
>   'Model.id',
>   
>   'Model.featured',
>   
>   'Model.title',
>   
>   'Model.description),
>   
>   'limit' => $limit,
>   
>   'order' => array(
>   
>   'Model.created DESC'),
>   
>   'contain' => array(
>   
>   'State' => array(
>   
>   'fields' => array(
>   
>   'State.abrev')),
> 'Country' => 
> array(
>   
>   'fields' => array(
>   
>   'Country.name',
>   
>   'Country.iso')));
>
> return $params;
> }
>  
> Controller:
> $this->paginate = $this->Model->_Pagination ($anything you want to pass 
> $limit, $conditions…….);
> And just pop it into the find into the $params like
>  
> $this->paginate = $this->Model->_Pagination($limit = 10); or anything you 
> might want to edit on the fly.
>  
> Swap out all the vars you want and make it work for you.
> Then do standard:
>  
> $this->set('whatever', $this->paginate('Model'));
>  
> All it is basically is the same as you normally would do in the controller 
> but rather than having all that crap I find it easier to say paginateThis(), 
> pagginateThat() rather than all that in the controller and just pull the 
> params from the model.
>  
> Dave
>  
> From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf 
> Of Jeremy Burns : Class Outfit
> Sent: Friday, May 24, 2013 1:00 AM
> To: cake-php@googlegroups.com
> Subject: Re: CakePHP 2.x Moving Find into Model
>  
> Have you got an example of that?
>  
> On 24 May 2013, at 01:09, lowpass  wrote:
> 
> 
> Apply the array to the $paginate class var, not the method. Basically, you 
> can declare the $paginate array as a class var, then add to or override any 
> part of it from within an action.
>  
> 
> On Thu, May 23, 2013 at 7:12 PM, Larry Lutz  wrote:
> I'm trying to achieve the fat model/skinny controller mantra in CakePHP 2.7. 
> In that scenario, the model should control the data, and that means moving 
> the finds out of the controllers and into the models. However, at least with 
> the view and admin_view actions, one needs the data paginated.
> 
> The problem starts there. It's easy enough to do a $this->find('all') in the 
> model to get the data, along with any conditions, contains, etc. However that 
> produces an array. Paginator->paginate(), as far as I can tell won't work in 
> the model; it's a component that only works in a controller. Yet, if I take 
> the array produced in the model into the controller and try to pass it on 
> toPaginator->paginate(), it fails because paginate won't accept an array.
> 
> In terms of trying to achieve the fat model/skinny controller goal, what am I 
> missing here. How can I achieve a paginated result while still having the 
> model (properly) do the work of managing and finding the data?
>  
> -- 
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>  
> --- 
> You received this message b

RE: CakePHP 2.x Moving Find into Model

2013-05-23 Thread Advantage+
Not sure if this is any help. But I hate all the $params in the controller
especially if you have to do it on the fly so I set all the params in the
model like such: (Just swap out 'model' for your own )

Model:

public function _Pagination($limit = 15){



$params = array(

'conditions' => array(

 
'fields' => array(

 
'Model.id',

 
'Model.featured',

 
'Model.title',

 
'Model.description),

 
'limit' => $limit,

 
'order' => array(

 
'Model.created DESC'),

 
'contain' => array(

 
'State' => array(

 
'fields' => array(

 
'State.abrev')),

'Country' =>
array(

 
'fields' => array(

 
'Country.name',

 
'Country.iso')));



return $params;

}

 

Controller:

$this->paginate = $this->Model->_Pagination ($anything you want to pass
$limit, $conditions...);

And just pop it into the find into the $params like 

 

$this->paginate = $this->Model->_Pagination($limit = 10); or anything you
might want to edit on the fly.

 

Swap out all the vars you want and make it work for you.

Then do standard:

 

$this->set('whatever', $this->paginate('Model'));

 

All it is basically is the same as you normally would do in the controller
but rather than having all that crap I find it easier to say paginateThis(),
pagginateThat() rather than all that in the controller and just pull the
params from the model. 

 

Dave

 

From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of Jeremy Burns : Class Outfit
Sent: Friday, May 24, 2013 1:00 AM
To: cake-php@googlegroups.com
Subject: Re: CakePHP 2.x Moving Find into Model

 

Have you got an example of that?

 

On 24 May 2013, at 01:09, lowpass  wrote:





Apply the array to the $paginate class var, not the method. Basically, you
can declare the $paginate array as a class var, then add to or override any
part of it from within an action.

 

On Thu, May 23, 2013 at 7:12 PM, Larry Lutz  wrote:

I'm trying to achieve the fat model/skinny controller mantra in CakePHP 2.7.
In that scenario, the model should control the data, and that means moving
the finds out of the controllers and into the models. However, at least with
the view and admin_view actions, one needs the data paginated.

The problem starts there. It's easy enough to do a $this->find('all') in the
model to get the data, along with any conditions, contains, etc. However
that produces an array. Paginator->paginate(), as far as I can tell won't
work in the model; it's a component that only works in a controller. Yet, if
I take the array produced in the model into the controller and try to pass
it on to Paginator->paginate(), it fails because paginate won't accept an
array.

In terms of trying to achieve the fat model/skinny controller goal, what am
I missing here. How can I achieve a paginated result while still having the
model (properly) do the work of managing and finding the data?

 

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

 

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

Re: CakePHP 2.x Moving Find into Model

2013-05-23 Thread Jeremy Burns : Class Outfit
Have you got an example of that?

On 24 May 2013, at 01:09, lowpass  wrote:

> Apply the array to the $paginate class var, not the method. Basically, you 
> can declare the $paginate array as a class var, then add to or override any 
> part of it from within an action.
> 
> 
> On Thu, May 23, 2013 at 7:12 PM, Larry Lutz  wrote:
> I'm trying to achieve the fat model/skinny controller mantra in CakePHP 2.7. 
> In that scenario, the model should control the data, and that means moving 
> the finds out of the controllers and into the models. However, at least with 
> the view and admin_view actions, one needs the data paginated.
> 
> The problem starts there. It's easy enough to do a $this->find('all') in the 
> model to get the data, along with any conditions, contains, etc. However that 
> produces an array. Paginator->paginate(), as far as I can tell won't work in 
> the model; it's a component that only works in a controller. Yet, if I take 
> the array produced in the model into the controller and try to pass it on to 
> Paginator->paginate(), it fails because paginate won't accept an array.
> 
> In terms of trying to achieve the fat model/skinny controller goal, what am I 
> missing here. How can I achieve a paginated result while still having the 
> model (properly) do the work of managing and finding the data?
> 
> -- 
> 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.
>  
>  

-- 
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: Broken Sessions When Using Firebug in CakePHP 2.3

2013-05-23 Thread OJ Tibi - @ojtibi
It's worth noting that the FirePHP add-on on Firefox was modifying my 
user-agent string. To turn it off, click on the FirePHP icon on your 
Firebug panel -> Options -> Modify User-Agent String.

On Thursday, May 23, 2013 5:23:09 PM UTC+8, OJ Tibi - @ojtibi wrote:
>
> Works for me, thanks!
>
> On Thursday, May 23, 2013 9:23:27 AM UTC+8, SpazzyV wrote:
>>
>> You may want to set checkAgent = false, as Firefox will present as one 
>> User Agent but then FireBug could show up as a different User Agent. The 
>> default is true, and if the user agent changes with the same session key 
>> will break the session - I believe.
>>
>> Thanks,
>> Vinnie
>>
>

-- 
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: Cache Implement on ACL

2013-05-23 Thread rchavik


On Thursday, 23 May 2013 22:10:32 UTC+7, Yasir Arafat wrote:
>
> Hello,
> I have used ACL in an application. It was fine when there were very few 
> functionality but day by day as the functionalities are increased the load 
> time is also increasing. I make sure about 
>
>
>
>- *D**atabase is normalized properly*
>- *I**ndex field properly*
>- *T**able engine is innoDB*. 
>
>
> I get little improvement but that's not sufficient. So i think if i can 
> implement cache on ACL that will help me
>
> So i need help on implementing ACL or if you have any other suggesions.
>
>
Maybe 
https://github.com/croogo/croogo/blob/1.5/Plugin/Acl/Controller/Component/Auth/AclCachedAuthorize.php
 
could be used/modified as a starting point.

 

-- 
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.x Moving Find into Model

2013-05-23 Thread lowpass
Apply the array to the $paginate class var, not the method. Basically, you
can declare the $paginate array as a class var, then add to or override any
part of it from within an action.


On Thu, May 23, 2013 at 7:12 PM, Larry Lutz  wrote:

> I'm trying to achieve the fat model/skinny controller mantra in CakePHP
> 2.7. In that scenario, the model should control the data, and that means
> moving the finds out of the controllers and into the models. However, at
> least with the view and admin_view actions, one needs the data paginated.
>
> The problem starts there. It's easy enough to do a $this->find('all') in
> the model to get the data, along with any conditions, contains, etc.
> However that produces an array. Paginator->paginate(), as far as I can
> tell won't work in the model; it's a component that only works in a
> controller. Yet, if I take the array produced in the model into the
> controller and try to pass it on to Paginator->paginate(), it fails
> because paginate won't accept an array.
>
> In terms of trying to achieve the fat model/skinny controller goal, what
> am I missing here. How can I achieve a paginated result while still having
> the model (properly) do the work of managing and finding the data?
>
> --
> 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.




CakePHP 2.x Moving Find into Model

2013-05-23 Thread Larry Lutz
I'm trying to achieve the fat model/skinny controller mantra in CakePHP 
2.7. In that scenario, the model should control the data, and that means 
moving the finds out of the controllers and into the models. However, at 
least with the view and admin_view actions, one needs the data paginated.

The problem starts there. It's easy enough to do a $this->find('all') in 
the model to get the data, along with any conditions, contains, etc. 
However that produces an array. Paginator->paginate(), as far as I can tell 
won't work in the model; it's a component that only works in a controller. 
Yet, if I take the array produced in the model into the controller and try 
to pass it on to Paginator->paginate(), it fails because paginate won't 
accept an array.

In terms of trying to achieve the fat model/skinny controller goal, what am 
I missing here. How can I achieve a paginated result while still having the 
model (properly) do the work of managing and finding the data?

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




cakePHP 2.3 and Sybase

2013-05-23 Thread PlanoCoder
I have been asked to develop a application using the companies existing 
data base.  The current database is on a microsoft 2008r2 server.  I am 
developing the application on a LAMP server. I need to connect to the 
sybase database on the microsoft server.  I have configured my lamp server 
to connect to and pull information from the remote sybase data base.  Is 
there a way to get cake 2.3 to use this sybase server?


-- 
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: Performance

2013-05-23 Thread André Luis
Very nice, I already use most of those techniques, thanks!!

But it seems the more internet get faster, more people care about website 
sizing and requests count

Em quinta-feira, 23 de maio de 2013 11h04min06s UTC-3, Eduardo Barbosa 
Moreira escreveu:
>
> Hello friends, there is a guide about performance, it is very usefull: 
> http://browserdiet.com/
>
> Do you know it?
>
>
>

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




Performance

2013-05-23 Thread Eduardo Moreira
Hello friends, there is a guide about performance, it is very usefull:
http://browserdiet.com/

Do you know it?

-- 
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 many Plug-ins Is Too many

2013-05-23 Thread André Luis
When you load plugins, only bootstrap and routes are automatically loaded 
everytime, so if you are loading some plugin´s bootstrap or routes be shure 
there is nothing heavy on those files.

Em quarta-feira, 22 de maio de 2013 03h57min50s UTC-3, advantage+ escreveu:
>
> I guess the question already will depend on the size / scale of the site. 
>
> But with everything moving towards packaging components / helper and such 
> as plugins is there a better way or does it really matter?
>
>  
>
> Bootstrap / facebook / twitter / js compressor / css compressor / 
> UserManger / ContentManger / SeoManager / ContactManager / GalleryManager / 
> BritaPurifirer / LESS / Sluggable / Cacheable
>
>  
>
> Just seems like a lot to load. Then on demand ones like Upload / Cropper / 
> Publisher………I can go on all night.
>
>  
>
> Is there a best practice? Most of these run universally and required 
> everywhere so it's not so much a pick and choose when to load them.
>
>  
>
> But if you created a site with no plugins for example and have say the 
> mentioned above ones as straight controllers / models in the respective 
> directories would it be the same thing?(would not do that obviously)
>
> Is there an overhead to deal with or does Cake treat it as if was a 
> regular model / controller as if it was sitting in the model / controller 
> folders? 
>

-- 
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: Directory Protection

2013-05-23 Thread André Luis
Just a suggestion, but why dont you create a images folder on the root of 
the server, them create a controller wich read the image and outputs to 
browser? It would be protected...

It would be like you create /app/images and upload the files to this 
folder, them only cake would have access, but for a better security, the 
root folder is advised. 

Em quarta-feira, 22 de maio de 2013 23h08min56s UTC-3, advantage+ escreveu:
>
> I have an" img/uploads" folder which has users profile images and such.
>
>  
>
> How do you go about protecting the folder so there is no access except 
> when Cake gets the images? 
>
> So anyone can't just browse thru the directory?
>
>  
>
> Google search turned up MediaView so put the uploads outside of webroot, 
> but 
> " As of 2.3 MediaView is deprecated and you can use *CakeResponse::file()*to 
> send a file as response:"
>
>  
>
> Should it be set to use CakeResponse::file(*$path*, *$options = array()*)
>
> Allows you to set a file for display or download
>
>  
>
> If so is there a simple example out there showing exactly how this would 
> get the files and server it up?
>
>  
>
> $image = CakeResponse::file(*'where/file/is/here.jpg*, *$options = array()
> *)
>
> $this->Controller->set('image', $image);
>
>  
>
> Thanks,
>
> Dave
>
>  
>

-- 
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: Directory Protection

2013-05-23 Thread mulianto
Hi

You can protect the image view via the web server hot link protection by make  
sure the request is come from your own application, which simply checking the 
http referrer of the requet.

Let the web server do the static image serving, and cake for serving the app 
logic. 

Hope helps

Mulianto
Sent from my iPhone

On 23 Mei 2013, at 10:08, "Advantage+"  wrote:

> I have an" img/uploads" folder which has users profile images and such.
>  
> How do you go about protecting the folder so there is no access except when 
> Cake gets the images?
> So anyone can't just browse thru the directory?
>  
> Google search turned up MediaView so put the uploads outside of webroot, but 
> " As of 2.3 MediaView is deprecated and you can use CakeResponse::file() to 
> send a file as response:"
>  
> Should it be set to use CakeResponse::file($path, $options = array())
> Allows you to set a file for display or download
>  
> If so is there a simple example out there showing exactly how this would get 
> the files and server it up?
>  
> $image = CakeResponse::file('where/file/is/here.jpg, $options = array())
> $this->Controller->set('image', $image);
>  
> Thanks,
> Dave
>  
> -- 
> 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.




Re: Broken Sessions When Using Firebug in CakePHP 2.3

2013-05-23 Thread OJ Tibi - @ojtibi
Works for me, thanks!

On Thursday, May 23, 2013 9:23:27 AM UTC+8, SpazzyV wrote:
>
> You may want to set checkAgent = false, as Firefox will present as one 
> User Agent but then FireBug could show up as a different User Agent. The 
> default is true, and if the user agent changes with the same session key 
> will break the session - I believe.
>
> Thanks,
> Vinnie
>

-- 
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 many Plug-ins Is Too many

2013-05-23 Thread AD7six
> Just seems like a lot to load

Nothing is loaded until you use it - and it won't make any difference if 
you _are_ using a file, whether they are all located in one app/plugin, or 
organized in plugins.

AD

On Wednesday, 22 May 2013 08:57:50 UTC+2, advantage+ wrote:
>
> I guess the question already will depend on the size / scale of the site. 
>
> But with everything moving towards packaging components / helper and such 
> as plugins is there a better way or does it really matter?
>
>  
>
> Bootstrap / facebook / twitter / js compressor / css compressor / 
> UserManger / ContentManger / SeoManager / ContactManager / GalleryManager / 
> BritaPurifirer / LESS / Sluggable / Cacheable
>
>  
>
> Just seems like a lot to load. Then on demand ones like Upload / Cropper / 
> Publisher………I can go on all night.
>
>  
>
> Is there a best practice? Most of these run universally and required 
> everywhere so it's not so much a pick and choose when to load them.
>
>  
>
> But if you created a site with no plugins for example and have say the 
> mentioned above ones as straight controllers / models in the respective 
> directories would it be the same thing?(would not do that obviously)
>
> Is there an overhead to deal with or does Cake treat it as if was a 
> regular model / controller as if it was sitting in the model / controller 
> folders? 
>

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