Re: Database sessions garbage collection issue

2012-08-01 Thread Crazy
It's the same code in the 2.x branch, I'll log a ticket, just wanted to be 100% sure before I did. In the close method it only gets called when using cache, not when using database sessions. I'll patch the function, thanks for the help. -- Our newest site for the community: CakePHP Video Tuto

Re: Database sessions garbage collection issue

2012-08-01 Thread Crazy
n.gc-probability > Then watch SQL log for that query. > > Anyway, expires should be current timestamp + Session.timeout config > I know, PHP and sessions - nothing but sorcery :D > > On Wednesday, August 1, 2012 9:12:13 AM UTC+2, Crazy wrote: >> >> I'm having some

Re: Database sessions garbage collection issue

2012-08-01 Thread Crazy
lue is passed to it? > > On Wed, Aug 1, 2012 at 3:12 AM, Crazy wrote: > > I'm having some issues with my sessions. > > > > It's probably configuration somewhere, but don't know what to > change/where > > to look. > > > > I'm usi

Re: hide model fields from controller

2012-08-01 Thread Crazy
You can use the model callbacks for that, the beforesave one, see: http://book.cakephp.org/2.0/en/models/callback-methods.html#beforesave On Wednesday, August 1, 2012 10:37:29 AM UTC+2, Mahmoud Adel Farid wrote: > > well i am worried about controller so no other team member can directly > chang

Re: Is CakePHP more suitable for web services or Zend Framework?

2012-08-01 Thread Crazy
CakePHP can do what you want just fine, I've created several api's in it already. My reason for using cake is like what you say, cake has a very flexable data layer and I needed several custom datasources as i wasn't always using databases as a data source but other webservices and tcp/ip api's

Database sessions garbage collection issue

2012-08-01 Thread Crazy
I'm having some issues with my sessions. It's probably configuration somewhere, but don't know what to change/where to look. I'm using database sessions for my cake application, these sessions are not getting cleaned up. The app in question I have the issue on is an old one written on 1.3.10

Re: Fatal Error and warnings on cakephp core with PHP 5.3

2010-11-14 Thread Crazy
It has nothing to do with cakephp, it's php 5.3 config that is wrong. Add "date_default_timezone_set('America/Chicago');" to your core.php or "date.timezone = America/Chicago" to your php.ini see php.net for a complete list of supported timezones On 13 nov, 20:57, cricket wrote: > On Sat,

Re: Extremely slow > 5000 ms response time with Cake PHP, please help

2010-10-04 Thread Crazy
I'm not a server expert but what I see with firebug is that the receiving takes 5 seconds. Try using an opcode cacher, it speeds up all my sites by at least a factor 2, I recommend apc. Might be a good idea to use xdebug to see what's taking up all the time, maybe a few bad queries or weird loop.

Re: Best Server Configuration

2010-09-22 Thread Crazy
It all depends on what you're doing. - About php.ini best practices As always, don't load things you don't need :) Check your apache config for keepalives and tweak your prefork/worker settings for example - MySQL best configuration values Depends on your setup/database size, concurrent connectio

Re: Prevent Ajax duplicate Submissions - Current Script

2010-09-20 Thread Crazy
The best way to handle it is to add a return false in the onclick. Example: function DoStuff() { alert('ajax stuff here'); } Or add the function to the onsubmit event handler, would work even better. On Sep 20, 8:13 pm, cricket wrote: > On Mon, Sep 20, 2010 at 1:49 PM, Dave Maharaj wro

Re: Starting a programming blog, should I use CakePHP or wordpress?

2010-09-12 Thread Crazy
CakePHP is a framework, so you have to write the blog yourself. Wordpress is a blog, no need to do anything. For my blog I use wordpress as I find it kind of stupid to reinvent the wheel. Wordpress has tons of themes, plugins and is configurable enough for a blog. If you don't like something in

Re: CakePHP future

2010-09-09 Thread Crazy
I agree with you mark, Allot of companies are still on older php versions, the CentOS/RedHat repositories are still on 5.1.6 if I remember correctly. And I can't see them changing that any time soon. PHP 5.3 features in the framework is all good, but by doing it it will cause the framework not to

Re: passing array as parameters of redirect function

2010-09-07 Thread Crazy
easiest/fastest way, use implode/explode $string = implode('|', array('1', '2')); $array = explode('|'); if you really want to pass an array, do it like this: http://example.com/mycontroller/myaction/?param[]=value1¶m[]=value2&;... and use the php $_REQUEST/$_GET or should also be visible i

Re: RAM overload

2010-09-07 Thread Crazy
Have you also looked at your apache config?, configuring the prefork/ worker settings? Those also have a big impact on how much memory each process takes. Running cake with 8gb ram and have between 350.000 and 450.000 pageviews/day and it's an db intensive site. So you should be just fine if you o

Re: cakephp multilingual site

2010-07-08 Thread Crazy
There is a section in the cookbook about localization: http://book.cakephp.org/view/163/Localization-in-CakePHP This is a function from one of my apps that should do the trick: /* * Sets the language */ private function _setLanguage($lang = null) { if ($this->Cookie->rea

Cake + Simpletest: getting errors on some core tests

2009-11-28 Thread Crazy
Today I wanted to get started with writing some tests, when trying to run the the core tests, I get errors here and there. If I run for example the view tests, I get: 2/2 test cases complete: 95 passes, 0 fails and 0 exceptions. If I run the TestSuite tests: 4/4 test cases complete: 214 passes, 1

Re: CakePHP performance 1.2 - is future any better?

2009-11-23 Thread Crazy
Judging by your setup I believe you should start using a profiler, and optimize your code a bit or take a better look at why your machines perform poorly. I run a site that has around 250k hits/day and it's on one box (Core2Quad 8800 8GB RAM) with the db on the same machine + . It runs on average

Re: addons.mozilla.org soon will leave CakePHP..

2009-11-19 Thread Crazy
What do people consider a 'larger' project?, the addons site of mozilla obviously is one. But what kind of trafic/size does a project need to be considered to be large? I know the answer will be different for each person, but just wondered what most ppl are thinking. On 19 nov, 00:33, kiang wrot

Re: CakePHP Questions - Now out of beta!

2009-11-11 Thread Crazy
Will this site be mentioned on cakephp.org? Looks like the members are growing, and I really like the way it works. Personally I would like that site better then the google groups. It's not that I hate the google groups, but they're just., google groups... They just don't have any usability.

Re: $uses not working in Shell

2009-11-11 Thread Crazy
ng those . > At the top you can add > > App::import('Model','ModelName'); > > now in the execute() function > > $object=new Model() > $object->find('all') ; > > now it will work . > > On Nov 11, 3:46 am, Crazy wrote: > >

Re: intermittent problems connecting to the CSS

2009-11-10 Thread Crazy
How is your css file included in the page? On 10 nov, 21:29, mail wrote: > My site is having what someone described to me as intermittent problems > connecting to the CSS. At times it loads properly and at times, the header > and the footer is not loaded leaving a dirty page as if no CSS is pr

$uses not working in Shell

2009-11-10 Thread Crazy
I'm using a task in one of my cake shell classes. I want to use some models there but $uses doesn't seem to work. There is no 'initialize' method, and even if I add it and call the parent, it still doesn't seem to do the trick. Anything I'm missing? This is what I'm doing: class MyTask extends

Re: Share hosting experience

2009-11-10 Thread Crazy
Running cake won't be a problem most of the time. All decent hosts would do just fine. But just like Miles J mentioned. Depending on your traffic you might have to switch to a VPS or dedicated server. If you only have a couple of hundred to a thousand visitors/month and write your app efficiently

Re: the white screen of death

2009-11-08 Thread Crazy
Most of the time when I get this it is because of syntax errors. As I mostly work on dedicated linux box, I just open a putty window and do a tail -f of /var/logs/httpd/error_log and the cake error log for all the $this->log(); in my code. I have found that to be the best way to debug, as you wi

Re: Cake Hosting - Who is the best?

2009-10-31 Thread Crazy
The good thing about cake is that it will run anywhere. 99% of the hosts will run cake fine. So it all depends on how much you want to spend on the host. And what site you're running. There are some good cheap shared hosting companies around that will do the trick. Think http://www.hostgator.co

Struggling with routes

2009-10-23 Thread Crazy
I haven't used routes allot, so struggling a bit with it. What I want to do is: => /* to the RedirectController, action index => /Api/* to the ApiController, action index So by default, redirect everything to the RedirectController for example: http://domain.com/param to the index method in Re

form helper-> checkbox, issue with simpletest

2009-09-28 Thread Crazy
Hi, When writing tests a project of ours, we used simpletest. We ran into a problem that the formhelper adds a value to the checkbox. This causes that simpletest can not check if the checkbox is checked or not. Is there a reason for the 'value=' to be added?, because this value does not change.

Re: Localization, using multiple pot files

2009-09-23 Thread Crazy
Thanks, just what I wanted to know On 22 sep, 18:30, Miles J wrote: > Of course you can! > > __('textString'); // Uses default.po > __d('errors', 'textString'); // Uses errors.po > __d('help', 'textString'); // Uses help.po

Localization, using multiple pot files

2009-09-22 Thread Crazy
Is it possible to use multiple po files? I have not started with localization yet, so I was wondering if it was possible. What we need is a general translation file, then one that contains all the errors and another one that contains all the help text. So my question is can I switch files someh

Re: Logfile location

2009-08-31 Thread Crazy
(sessions, logs, > cache,..) to wherever you are by changing TMP path or you can only adjust > the LOGS path. > > There is probably nicer way to change TMP dir (since have if > (!defined('TMP'))) but I don't know where could be defined! > > Hope it helps! > &

Logfile location

2009-08-31 Thread Crazy
Hi, In one of my projects it's required that the log files are being logged to /var/logs/ I was wondering if it was possible to change the default location of app/tmp/logs? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: Download code for downloading a file

2009-07-24 Thread Crazy
, using cakephp this way would crash my server within 5 minutes(if not faster) You can find the code I use here: http://pastebin.com/f179e1e49 I've been using it for several years and transfer 15 to 20tb per month using that piece of code. /Crazy On Jul 24, 9:58 am, Vijay Kumbhar wrote: &

Re: Differences between Session types?

2008-12-12 Thread Crazy
I have the same question. I want to use sessions in database. Is this better then files? My site has between 15k and 20k visitors. Is it best performance wize to use file based sessions or in the database? I've tested it, but before putting it live I'd like some more info. I use mysql with the d

Re: CakePHP not recommenable for busy websites?

2008-09-22 Thread Crazy
Out of personal experience I can say, cakephp CAN handle sites that get allot of visitors. I use APC for cashing, that helps allot. Ofcourse you'll always have some overhead of the framework compaired to if you only write what you need when you need it. But that'll take you a long time to write.

Re: Captcha Integration Problem in Cake PHP

2008-09-06 Thread Crazy
Did you create the helper?, it's in the blogpost. If you can't get it to work. I'm still using the old one, you can find it here: http://bakery.cakephp.org/articles/view/captcha-component-with-phpcaptcha I use it intensively and it works great. But I think you should look at the helper you cre

Re: Newlines with the Email component

2008-09-06 Thread Crazy
when using '\n' it will be used as the text \n, while when using "\n" it wil be converted to a newline. php does not parse anything between single quotes(it's the same as doing echo '$var') On 6 sep, 10:30, yaqoob <[EMAIL PROTECTED]> wrote: > I believe there's a difference, in this case, between

Re: Database optimisation (all comments in one table)

2008-09-06 Thread Crazy
Type in google: Database Normalization And you'll find your awnsers. The way you are want to do it is VERY bad. On 6 sep, 11:43, luigi7up <[EMAIL PROTECTED]> wrote: > hola everyone, > > while developing application something crossed my mind. What about > organizing all comments throughout  app

Re: MySQL server versions

2008-09-06 Thread Crazy
1.2RC2 is just as stable. I recommand switching to 1.2. There is no reason to continue using the 1.1 version. There is allot of cool functionallity that you're missing :) On 6 sep, 13:06, Ryan <[EMAIL PROTECTED]> wrote: > Thanks David, I am using 1.1.19.6305. I follow what you're saying > abou

Re: Need help with HttpSocket::post

2008-09-06 Thread Crazy
= 'xml here'; $xml = new Xml($input); $http->post($url, array("PipeMsg" => $xml)); } //recieving end function recieveXML() { App::import('Xml'); $xml = new Xml($_POST['PipeMsg']); } It's between 2 cak

Need help with HttpSocket::post

2008-09-06 Thread Crazy
I need to post xml to a url. I read that this can be done with HttpSocket class, but i can't seem to find an example and there is nothing about it in the manual. Anyone that can give me an example on how to use this? Thanks --~--~-~--~~~---~--~~ You received this

Caching, the proper way to do it

2008-06-21 Thread Crazy
n They do use the same database and tables, but otherwise are completely seperate. Any suggestions on improving it are welcome, this is the first time I'm using caching(only had shared hosting before:p) Crazy --~--~-~--~~~---~--~~ You received this message becaus

Captcha reload problem, works in ff not in IE

2008-06-15 Thread Crazy
Hi, I've implemented the captcha component that was published on the bakery here: http://bakery.cakephp.org/articles/view/captcha-component-with-phpcaptcha Everything work fine, untill I want to reload the image. It works just fine in firefox, but when I try it in IE7 it doesn't refresh. To be m

Re: Performance - gzipp'ing js/css files and version stamping images

2008-06-11 Thread Crazy
at(forgot how to do that, it's fairly easy). Crazy On Jun 11, 5:32 pm, keymaster <[EMAIL PROTECTED]> wrote: > I am currently packing and minifying css/js files for performance. > > I would like to gzip them too, but don't know enough about browsers > and http to know

Re: simple ajax based form

2008-06-11 Thread Crazy
id it is correct:p(I'm not that experianced with cakephp myself :) ) Crazy On Jun 11, 10:47 am, clemos <[EMAIL PROTECTED]> wrote: > Hi Timothée > > Simply try removing this "with" parameter: it's (often) useless, as > the form values will be serialized and

Update to RC1 broke Ajax

2008-06-09 Thread Crazy
', 0);// and forget debug messages $this->layout = ''; //or try with $this->layout = ''; } } When trying to look for the cause I found that when I did "svn update" it stopped working. Hope someone knows the awnser Thanks, Crazy --~--~-~--

Re: Trying to get caching to work

2008-05-28 Thread Crazy
I made that folder and it makes a "_php" file in it, but other wize nothing happends, did I miss something? On 28 mei, 22:32, clemos <[EMAIL PROTECTED]> wrote: > Hi Crazy > > On my app (1.2), caching generates files in a subdirectory > /app/tmp/cache/views. >

Trying to get caching to work

2008-05-28 Thread Crazy
Hi, I've been trying to get caching in cake to work, tried looking in the manual but that chapter hasn't been written yet. So, what I've done is enabled caching in core.php by uncommenting: Configure::write('Cache.check', true); And this is also in core.php Cache::config('defaul

Re: Auth Allow Problem

2008-05-19 Thread Crazy
May 19, 4:47 pm, "[EMAIL PROTECTED]" > > <[EMAIL PROTECTED]> wrote: > > Hi there, > > You should never allow access to the login or logout actions that Auth > > uses. Auth will handle that on its own and the problem you describe > > matches prefectly. &g

Re: Auth Allow Problem

2008-05-19 Thread Crazy
Hah!, it works! Thank you so much, that's another something I learned :) On 19 mei, 16:57, aranworld <[EMAIL PROTECTED]> wrote: > Auth Component will break if you try to allow 'login'. > > On May 19, 1:50 am, Crazy <[EMAIL PROTECTED]> wrote: > > > I

Auth Allow Problem

2008-05-19 Thread Crazy
" or "$this->Auth->allow("login", "register");" to have access to "/users/register" Once I use this I can't seem to log in anymore. The code I am using can be found here: http://bin.cakephp.org/view

Re: Conditions for multiple tables

2008-04-29 Thread Crazy
not, this is > what I do for complex conditions like this. > > Dave > > On Apr 28, 3:23 pm, Crazy <[EMAIL PROTECTED]> wrote: > > > I am wondering if it is possible to give conditions over multiple > > related tables, currently I have this: > > > Table ser

Conditions for multiple tables

2008-04-28 Thread Crazy
I am wondering if it is possible to give conditions over multiple related tables, currently I have this: Table series: - id - name Table genre_series: - serie_id - genre_id Table genres: - id - name Model is set up correctly with HABTM etc and when I do a findAll() I get the correct output. W

Re: Parameters in url

2008-04-27 Thread Crazy
g fancy with passing route parameters > > On Apr 27, 5:05 pm, Crazy <[EMAIL PROTECTED]> wrote: > > > I'm new to cakephp and still trying to figure out allot of stuff:) > > > One of the things I'm strugeling with atm is passing parameters in the > > url,

Parameters in url

2008-04-27 Thread Crazy
I'm new to cakephp and still trying to figure out allot of stuff:) One of the things I'm strugeling with atm is passing parameters in the url, for example my controller is: "/series" Now I want to give an id with it to know what to show, so like "/series/" I know that you can do it with "/ser