Re: is this a threadsafe code?

2014-03-19 Thread Eugenio
Why not;
$myBoolean=(boolean) something;


2014-03-18 9:29 GMT-03:00 Kamal Deol :

> YES It is Thread Safe : 100% Sure
>
>
> On Tue, Mar 18, 2014 at 6:33 AM, Gary Kremmer wrote:
>
>> class SomeController extends AppController {
>>
>> public function index() {
>>  if(something) {
>>$myBoolean=true;
>>   } else {
>> $myBoolean=false;
>> } //end of if
>>  } //end of method
>> } //end of class
>>
>>
>> I am using nginx+php FPM.
>>
>> My question is if there are multiple users hitting the SomeController at
>> the same time, is myBoolean threadsafe?
>>
>> Thanks,
>> Gary.
>>
>> --
>> 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/d/optout.
>>
>
>  --
> 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/d/optout.
>



-- 
*May the source be with you.*

-- 
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/d/optout.


Re: Jquery and Internet Explorer compatibility in cake1.3

2013-04-13 Thread Eugenio
Can you try this code?



$(document).ready(function() {
  $('a.report').click(function(e) {
e.preventDefault();
var t = $(this);
var dialog = $('
').load(t.attr('href')).dialog({ autoOpen: false, width: 500, modal: true, title: 'Report Photo', }); }); }); and the link: 2013/4/12 Chris > thanks rchavik,... > that solve the problem with dialog box with IE7,... > > but still having problem with IE10 ,... I have other functions like jquery > autocomplete, etc,... not works until I reload the page "F5" > I even have this in header: > > > but loosing jquery on browse,... have to reload the page to trigger jquery > > how can I solve this,...? > > thanks a lot,... > chris > > > > On Thursday, April 11, 2013 5:44:24 PM UTC-7, rchavik wrote: >> >> >> >> On Friday, 12 April 2013 03:31:24 UTC+7, Chris wrote: >>> >>> hi guys,... can anyone help please,... I know its not cake related >>> (maybe it does),... I apologize,... but may someone know the answer. >>> >>> title: 'Report Photo', >>> >>> >> Remove the trailing comma there >> > -- > 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. > > > -- *May the source be with you.* -- 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.

Using $this->requestAction from shell is breaking the links

2012-03-21 Thread Eugenio
Hi, i am using the requestAction feacture to generate the cache of heavy
traffic pages, the only problem is that the base param of the urls is
/usr/share/php/cake/console/ instead of /, is there any way of solve this?
now i am usign a str_replace to change de links but i want a better way to
solve this.

Any clue

Code Example;

'posts','action'=>'index'));
$_url = implode(DS, array_filter(explode('/', $url)));
$path = WWW_ROOT. 'cache'.DS..DS.$_url.DS.'index.html';
Configure::write('debug',0);


$html=$this->requestAction($this->params['url'],array('return','bare'=>0,'webroot'=>'/','base'=>'/'));
 $html=str_replace('/usr/share/php/cake/console/','/',$html);

$file = new File($path, true,0777);
$file->write($html);
}
}

?>

Cheers!!

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


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


Re: Nginx cache in cakephp app

2011-09-08 Thread Eugenio
Yes... but remember that linux has a directory file limit, so when you have
long term cache files an a really large site, you have to md5 the fali
before save it and put it in subdirectorys.

2011/9/7 WyriHaximus 

> Have you looked into html_cache by Matt Curry?
> https://github.com/mcurry/html_cache
>
> On Sep 7, 4:42 pm, Eugenio  wrote:
> > Hi to everyone, i have a nginx question... the app is written in cakephp,
> > maybe you could help me.
> >
> > Right now im working on a heavy app written in php.
> >
> > The app knows what pages to cache a cron job delete the old cache pages,
> the
> > cache is saved doing a md5 to the url to get a hash, then puts a / every
> 2
> > chars, example;
> >
> > /posts/index
> > hash: d1546d731a9f30cc80127d57142a482b
> > cache file: /d1/54/6d/73/1a/9f/30/cc/80/12/7d/57/14/2a/48/2b/index.html
> >
> > The php script check if exist a cache file, if cache file exist render.
> >
> > The question is, is anyway to do this with nginx??
> >
> > Thanks for your time
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

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


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


Nginx cache in cakephp app

2011-09-07 Thread Eugenio
Hi to everyone, i have a nginx question... the app is written in cakephp,
maybe you could help me.

Right now im working on a heavy app written in php.

The app knows what pages to cache a cron job delete the old cache pages, the
cache is saved doing a md5 to the url to get a hash, then puts a / every 2
chars, example;

/posts/index
hash: d1546d731a9f30cc80127d57142a482b
cache file: /d1/54/6d/73/1a/9f/30/cc/80/12/7d/57/14/2a/48/2b/index.html

The php script check if exist a cache file, if cache file exist render.

The question is, is anyway to do this with nginx??

Thanks for your time

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


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


Re: cakephp 1.3 loading page is slow

2011-07-27 Thread Eugenio
Try with the html cache plugin;
http://bakery.cakephp.org/articles/mattc/2009/03/20/html-cache-helper

It will really speed it up, just be careful and remember to clean cache
after updates.

2011/7/27 leafchild 

> I notice loading page is extremely slow.
>
> Those pages are not connected to DB. Just simple static page.
> How can I make it faster to load these pages?
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

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


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


Re: Contain and SQL Statement Question

2011-03-31 Thread Eugenio
If you have that kind of need you are having database architecture
issues... its not a cakephp issue.

Ask yourself how you do that query in plain SQL.

Cheers

2011/3/31 heohni :
> Hi,
>
> I have the following models:
>
> Member hasMany Payments
> Payment belongs to a member
>
> To get now all members and their payments I do the following
> statement:
>
> $this->paginate = array(
>            'fields' => array(.),
>            'conditions' => array(...),
>            'contain' => array(
>                'Payment' => array(
>                    'fields' => array(...),
>                    'conditions' => array(...)
>                )
>             )
>        );
>
> So far, the result is correct.
>
> BUT!
> The second statement, where all payment are getting selected, that
> statement looks like:
> WHERE `Payment`.`member_id` IN (5, 10, 11)
>
> This is for 3 members fine, but what will happen, if I have 10k
> members?
>
> Do I have the chance to get this whole statement done in 1 single
> statement? To make sure I will not fail in perfomance in the future?
>
> Please advice!
> Thanks!!
>
> --
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php
>

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


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


Re: Does the CakePHP ready for 'Large Scale' web applications?

2011-02-10 Thread Eugenio
Hi Okto, have you try using the view cache helper = its really great,
or perhaps you could use the plain html cache plugin, that really will
speed up, of course it have some cons...

http://bakery.cakephp.org/articles/mattc/2009/03/20/html-cache-helper

http://book.cakephp.org/view/348/Clearing-the-Cache#!/view/346/Caching-in-the-Controller

Good luck!

2011/2/10 Okto Silaban :
> Thanks.. :D
>
> I'll try this.
>
> On Fri, Feb 11, 2011 at 12:14 AM, ibejohn818  wrote:
>>
>> This what I am using.
>> ===
>> class AppModel extends Model {
>>
>>
>>
>>        public function save($data = null, $validate = true, $fieldList =
>> array()) {
>>
>>                $this->useDbConfig = 'master';
>>
>>                $success = parent::save($data,$validate,$fieldList);
>>
>>                $this->useDbConfig = 'default';
>>
>>                return $success;
>>
>>        }
>>
>>        public function saveAll($data = null, $options = array()) {
>>
>>                $this->useDbConfig = 'master';
>>
>>                $status = parent::saveAll($data,$options);
>>
>>                $this->useDbConfig = 'default';
>>
>>                return $status;
>>
>>        }
>>
>>        public function updateAll($fields, $conditions = true) {
>>
>>                $this->useDbConfig = 'master';
>>
>>                $status = parent::updateAll($fields,$conditions);
>>
>>                $this->useDbConfig = 'default';
>>
>>                return $status;
>>
>>        }
>>
>>        public function delete($id = null, $cascade = true) {
>>
>>                $this->useDbConfig = "master";
>>
>>                $status = parent::delete($id,$cascade);
>>
>>                $this->useDbConfig = 'default';
>>
>>                return $status;
>>
>>        }
>>
>>
>> }
>>
>> 
>>
>> For multiple Slaves you should use a load balancer to RoundRobin
>> Balance the requests to your slaves.
>>
>>
>> On Feb 10, 9:05 am, Okto Silaban  wrote:
>> > That's what I'm trying to do.
>> > I've setup 1 master and 2 slaves. But CakePHP doesn't support read &
>> > write
>> > query separation.
>> > So, do you have any information how can I split the read & write query?
>> > *other than rewrite all my models
>> >
>> > thanks.
>> >
>> > On Wed, Feb 9, 2011 at 10:03 AM, Dr. Tarique Sani
>> > wrote:
>> >
>> >
>> >
>> > > Have you split the reads and the writes?
>> >
>> > > All the writes go to the master which is on a server of its own and
>> > > the reads are from the slaves which are typically on the same machine
>> > > as the webserver and of course use very aggressive caching
>> >
>> > > Cheers
>> > > Tarique
>>
>> --
>> Our newest site for the community: CakePHP Video Tutorials
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help
>> others with their CakePHP related questions.
>>
>>
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group
>> at http://groups.google.com/group/cake-php
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at
> http://groups.google.com/group/cake-php
>

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


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