Please help Safe Mode PHP server problems
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: Please help Safe Mode PHP server problems
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: cake 2.x auth component bugs with pages controller after changing htaccess files
You can make a sql qury which will delete all from given range.. I think it would be best for performances as well On May 19, 4:55 am, Jimit Kapadya ji...@entourage.in wrote: Hello All, how to delete Multiple tables fields values in cakephp 2.0 -- 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
cake 2.x auth component bugs with pages controller after changing htaccess files
Hi, this is really strange question. I made a simple web presentation (so far I have used cake 1.3 this is my first 2.x project), and added AUTH component looking at the tutorial from this link : http://book.cakephp.org/2.0/en/tutorials-and-examples/simple-acl-controlled-application/simple-acl-controlled-application.html Ok so here is my problem. I have overridden pages controller and made 4 more. They all run perfectly in local host, however , only pages controller bugs on the server. In order to upload code and make it work I had to change my 3 htaccess files , because sever was giving me internal sever error without base variable. Now here is the funny part. The pages controller shows blank page with no errors, even in debug mode 2, whenever I try to access any of the functions for which you have to be logged in to use. Only pages controller, which doesn't use anything unusual, or unstandard. Just a plain blank page and only on that server. In local host it runs normaly. So I did the following : 1) I checked if there is any blank space left - no 2) I checked if allowed functions work - they do 3) When I put smth in before filter and do var_dump it prints it. 4) I tried to print user from session of from auth component , I get null - although in other controllers it works ok 5) This all happens regardless if I am loged in or out 6) I do not get redirected when the function is allowed for normal users, I only get the blank page , i checked to surce of the page, nothing, just html and body tags empty again 7) when i make auth-allow('*') everything runs ok. So only the functions which are not allowed. Since I wasted a whole day on this, I am going to rename the controller and try again because all others are working fine, and in local host even pages work fine. I suppose that since I had to change htaccess files, auth component bugs, but I cant guess what. I will post update about this, however if someone had a similar situation and solved it please help. I guess somehow I got different sessions for these controllers but I have no idea how or why... 0.O ty in advance -- 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: cake 2.x auth component bugs with pages controller after changing htaccess files
I figured id out.. So I did have a char in the end of my while it is because I maade my controller UTF 8 beacuse of some warnings that I needed to make in serbian. However, I didn't make it utf 8 without BOM (notepad ++ has that option), lousy missclick Strange things are the following : in local host , it worked 0.O second thing is, ACL-Allow worked when you make all allowed but doesn't when you need to check if someone is logged in. This behaviour is super strange, because only AUTH component had the problem with my controller. If it was allowed it worked .. Anywyas LOZ .. I just wasted a day on that .. But at least its over .. On 18 мај, 23:35, Miloš Vučinić milosvuci...@gmail.com wrote: Hi, this is really strange question. I made a simple web presentation (so far I have used cake 1.3 this is my first 2.x project), and added AUTH component looking at the tutorial from this link :http://book.cakephp.org/2.0/en/tutorials-and-examples/simple-acl-cont... Ok so here is my problem. I have overridden pages controller and made 4 more. They all run perfectly in local host, however , only pages controller bugs on the server. In order to upload code and make it work I had to change my 3 htaccess files , because sever was giving me internal sever error without base variable. Now here is the funny part. The pages controller shows blank page with no errors, even in debug mode 2, whenever I try to access any of the functions for which you have to be logged in to use. Only pages controller, which doesn't use anything unusual, or unstandard. Just a plain blank page and only on that server. In local host it runs normaly. So I did the following : 1) I checked if there is any blank space left - no 2) I checked if allowed functions work - they do 3) When I put smth in before filter and do var_dump it prints it. 4) I tried to print user from session of from auth component , I get null - although in other controllers it works ok 5) This all happens regardless if I am loged in or out 6) I do not get redirected when the function is allowed for normal users, I only get the blank page , i checked to surce of the page, nothing, just html and body tags empty again 7) when i make auth-allow('*') everything runs ok. So only the functions which are not allowed. Since I wasted a whole day on this, I am going to rename the controller and try again because all others are working fine, and in local host even pages work fine. I suppose that since I had to change htaccess files, auth component bugs, but I cant guess what. I will post update about this, however if someone had a similar situation and solved it please help. I guess somehow I got different sessions for these controllers but I have no idea how or why... 0.O ty in advance -- 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
paginations issue
Hey guys I have a question regarding pagination and filters of the pagination in cake 1.3 . In my index function I have created a filter on top. It's a simple form, and if not empty $this-data on index function I apply conditions for pagination. Example : if (!empty($this-data)) { $date=strtotime($this-data['Invoices']['from']); $start = date('Y-m-d',$date); $date=strtotime($this-data['Invoices']['to']); $end = date('Y-m-d',$date); array_push($cond,array('Invoice.date ='=$start )); array_push($cond,array('Invoice.date ='=$end )); } and so on for the 4 other params. After making conditions I set the data for view this way: $this-paginate = array('conditions' = $cond, 'order' = array('Invoice.created' = 'desc') ); $data = $this-paginate('Invoice'); $this-set('invoices', $this-paginate()); In the view I display data like this : example : th?php echo $this-Paginator-sort('date');?/th and below in td's somthing like td?php echo $invoice['Invoice'] ['date']; ?nbsp;/td The problem comes when a person wants to sort filtered data by clicking on the date label of the table with the data or any other label in the whole table. The pagination just resets to default find all, plus gives the sort function of clicked label. I need to preserve filter conditions but I don't know how to override the link in the head of the table. Is there a way cake can to this , such as set the sort behavior or do I just have to make table header without this : ?php echo $this- Paginator-sort('date');? but to make my own links for this purposes which would be generated every time somebody filters index page. Or , is there some better way to do this in all ? Thank you in advance, Milos -- 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
is this possible ? Seeking advice from mysql gurus :)
Hi :) so far I haven't had any really complex querys so there is one now and I seek for the advice on how to handle it. Now I now how to fix this redneck style (several queries etc, or one big and then filter in controller), however I am looking for a little more elegant solution. I have a model which has about 7 other sub models (has many) . Main is a customer and has many appointments, invoices , payments etc... So I need to fetch a customer and 2 last inserted of each of its has many models. Example is : One specific customer (found by ID) and 2 of his last invoices, 2 of his last payments and so on.. And to make it a bit more complicated, for just one of these sub models (named Credits) I need to fetch all of the active ones... My way so far is to fetch all of the data with classic find and then in one FOR loop filter out data I do not need... Is there a way a single query could do this.. ?? Thank you in advance you mighty mysql gurus :) All the best, Milos -- 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: is this possible ? Seeking advice from mysql gurus :)
Thanks a lot ! Also I just wanted to post one other way to do this because I googled and just found out. before your query just post smth like this.. $this-Custommer-hasMany['Payment']['order'] = 'id DESC'; $this-Custommer-hasMany['Payment']['limit'] = 2; you can also place conditions there. Thanx Jeremy ! All the best ! Milos On Feb 23, 4:27 pm, jeremyharris funeralm...@gmail.com wrote: You can do this in a single find() call, using containable. (It will still create many mysql queries because that's just the way it needs to be done, however it will filter all the data for you). Something like: $this- Customer -find('all', array( 'conditions' = array( 'Customer.id' = 1 ), 'contain' = array( 'Invoice' = array( 'order' = 'Invoice.created DESC', 'limit' = 2 ), 'Credit' = array( 'conditions' = array('Credit.active' = true) ) ) )); This should fetch the customer info and include that customer's last 2 invoices and all active credits. -- 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: Missing View Error: The view for UsersControllerController::login() was not found.
It might be due to your database name. What is the actual controller name for your app, the model name and the table name. Also , did you use cake bake all to auto generate your source or did you write it yourself.. ? On Dec 14, 2:07 pm, Parthasarathy Ramanujam psrama...@gmail.com wrote: Isn't the default routing mapping forRL say /users/login = UsersController-login(); Why then does my app get an additional Controller suffix appended? On Thu, Dec 15, 2011 at 12:27 AM, Parthasarathy Ramanujam psrama...@gmail.com wrote: Hi, I am a newbie to CakePHP and just got CakePHP 1.3 installed and I am trying to build a new website. I have tried to redirect the user first to the login page instead of the standard home/welcome page by editing app/config/routes.php and changing this line: Router::connect('/', array('controller' = 'pages', 'action' = 'display', 'home')); to Router::connect('/', array('controller' = 'users', 'action' = 'login')); However I now get the error *Missing View Error: The view for UsersControllerController::login() was not found. Error: Confirm you have created the file: /home/thambu/workspace/project/app/views/users_controller/login.ctp Notice: If you want to customize this error message, create app/views/errors/missing_view.ctp* I have created users_controller.php file that contains the code for UsersController. I do not understand why is the server trying to route my page to */views/users_controller/login.ctp *and why is CakePhp assuming my Controller should be named UsersControllerController? Please can anyone help me in this regard? Regards Partha -- 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 and AJAX
Thank you very much ! All the best, Milos On Dec 3, 9:25 am, Tilen Majerle tilen.maje...@gmail.com wrote: for response: just create a view like (but not 'default' layout, make a new layout 'ajax') in others functions how to detect ajax: $this-request-is('ajax') CONTENT FOR ajax.ctp layout: ?php print $content_for_layout; ? and in controller to enable this layout: $this-layout = 'ajax'; why this ? this will return just your 'archieve' view -- Lep pozdrav, Tilen Majerlehttp://majerle.eu 2011/12/3 Miloš Vučinić milosvuci...@gmail.com Hello, I haven't used AJAX so far because I never needed it. I read the manuals regarding it, now I am wondering how to do it in cake. My task is following: I have a list of users. Next to each user I have a button which says archive. On click I have to archive the user. Now, I don want to reload the whole page so I want to use AJAX. The way I see it, I would create a regular AJAX call to my url which is function just like any other in cake, like /users/archive/57 where number 57 is id in the database (it will be generated for each button). On server side I would perform the function, but how do I return response. Do I just echo it ? And how does the cake knows it was an AJAX call and that it needs to send a response to a client. And is it ok, for the response to be just a simple ok , or notok string , and then if ok, I just change the archive sting into yes from no in the user list. Can you please give me like quick steps of how would you do it with a quick syntax example. Like : 1) Create a client call to the server 2) Execute function on server the normal way you wold 3) Send response to client (please explain how) Thank you in advance, All the best Milos Vucinic -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 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 athttp://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
Cakephp and AJAX
Hello, I haven't used AJAX so far because I never needed it. I read the manuals regarding it, now I am wondering how to do it in cake. My task is following: I have a list of users. Next to each user I have a button which says archive. On click I have to archive the user. Now, I don want to reload the whole page so I want to use AJAX. The way I see it, I would create a regular AJAX call to my url which is function just like any other in cake, like /users/archive/57 where number 57 is id in the database (it will be generated for each button). On server side I would perform the function, but how do I return response. Do I just echo it ? And how does the cake knows it was an AJAX call and that it needs to send a response to a client. And is it ok, for the response to be just a simple ok , or notok string , and then if ok, I just change the archive sting into yes from no in the user list. Can you please give me like quick steps of how would you do it with a quick syntax example. Like : 1) Create a client call to the server 2) Execute function on server the normal way you wold 3) Send response to client (please explain how) Thank you in advance, All the best Milos Vucinic -- 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: 2.04 vs 1.3
Thank you for response. You are most kind. All the best, Milos On Dec 2, 9:49 am, AD7six andydawso...@gmail.com wrote: On Friday, 2 December 2011 01:23:13 UTC+1, Miloš Vučinić wrote: Also one more question. Am I right to assume that cheat sheet from 2.* is the same as the one provided on http://cakephp.org/files/Resources/CakePHP-1.2-Cheatsheet.pdf 2.0 is faster, easier to use and more functional - I'd use that as our main choice criteria. The concepts haven't changed, but 2.0 is not 100% bc compatible with 1.3 so that cheatsheet is likely to be only 80% relevant/accurate. AD -- 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
2.04 vs 1.3
Hi, just curious, so far I have developed apps in 1.3 .. I haven't done any job in a while cause I was studying and now I see that the new version is up. How different is 2.* for coding ? Can anyone suggest which version to use for a simple scheduling app ... Thanx! Milos -- 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: 2.04 vs 1.3
Also one more question. Am I right to assume that cheat sheet from 2.* is the same as the one provided on http://cakephp.org/files/Resources/CakePHP-1.2-Cheatsheet.pdf . Thank you !! Milos On 2 дец, 00:50, Miloš Vučinić milosvuci...@gmail.com wrote: Hi, just curious, so far I have developed apps in 1.3 .. I haven't done any job in a while cause I was studying and now I see that the new version is up. How different is 2.* for coding ? Can anyone suggest which version to use for a simple scheduling app ... Thanx! Milos -- 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: How safe is CakePhps auth component and other ..
Thank you very much, you are most kind ! All the best, Milos On Sep 9, 4:54 pm, Thomas Ploch profipl...@googlemail.com wrote: 1.) The Auth component is safe. It uses a salted SHA1 encrypted pw by default. It auto-escapes the fields already, so you don't have to bother with it. Just use SSL to encrypt the connection to sensitive parts of the application to be on the (very) safe side. 2.) Well, if you use the Apache web server, and you configured it correctly to write the access.log file, you got everything you need there. (Other web servers have this feature too) Kind regards Thomas Am 09.09.2011 16:44, schrieb Miloš Vučinić: Hi, I have two questions and I hope someone can help me.. I am making application which needs to be relatively safe. So here are questions I have for you: 1. I am using auth component from cakephp , but I cannot escape the login fields because login component works for itself and I cannot edit it's code.. I am wondering is it sql injection safe and are there any possible problems with it regarding security ? 2. I need to log every http request made to my website (so that if someone tries to hack the web site that I have info about his IP address and what exactly they tried to do). I need exact link which was typed and ip address of a computer which made the request. A whole http request would be nice but at least these two. Is there any way to do this (like a pre build component), or where in my source code should I place the code for this .. ? Thank you , all the best Milos -- 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
How safe is CakePhps auth component and other ..
Hi, I have two questions and I hope someone can help me.. I am making application which needs to be relatively safe. So here are questions I have for you: 1. I am using auth component from cakephp , but I cannot escape the login fields because login component works for itself and I cannot edit it's code.. I am wondering is it sql injection safe and are there any possible problems with it regarding security ? 2. I need to log every http request made to my website (so that if someone tries to hack the web site that I have info about his IP address and what exactly they tried to do). I need exact link which was typed and ip address of a computer which made the request. A whole http request would be nice but at least these two. Is there any way to do this (like a pre build component), or where in my source code should I place the code for this .. ? Thank you , all the best Milos -- 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: 404 error
If you are using security component, turn it off, by not including it anywhere. It happens when you include it in the wrong place. Also , see your homepage view page. Suppose it is /home/page/home.ctp and type there anything to see if it will render. On May 2, 11:47 am, jyoti bhandari jytbhand...@gmail.com wrote: i did the same a new refresh loading. did all the changes as told in the installation. I got a page where u get to know, is ur db accesible, connected , temp is writeable,and two things to be changed that is some cipher etc. i am testing it on localhost, nt on online dns. On Mon, May 2, 2011 at 9:10 PM, Sam Sherlock sam.sherl...@gmail.com wrote: try to do the same with a fresh download of cakephp and see if you can get pages/ home to display what is you host? GoDaddy or 11 or other? - S On 2 May 2011 16:27, jyoti bhandari jytbhand...@gmail.com wrote: i did that also On Mon, May 2, 2011 at 8:39 PM, Sam Sherlock sam.sherl...@gmail.comwrote: in the core.php file uncomment the following line (line 69 for me) //Configure::write('App.baseUrl', env('SCRIPT_NAME')); that will then enable cake internal url rewrite - S On 2 May 2011 15:42, jyoti bhandari jytbhand...@gmail.com wrote: i haver emoved all the thee files On Mon, May 2, 2011 at 7:58 PM, Sam Sherlock sam.sherl...@gmail.comwrote: It means the rewrite in htaccess are not work either use cakes internal alternative or try to alter the htaccess adding the following lines to you htaccess files may sort this out (if you have app dir cakephp1.3.8 have 3 htaccess files) - add the following within the Rewrite section RewriteBase /cakephp1.3.8/ RewriteBase /cakephp1.3.8/app/ RewriteBase /cakephp1.3.8/app/webroot/ - S On 2 May 2011 15:17, jyoti bhandari jytbhand...@gmail.com wrote: It is plain. That means it is off. how to on it? On Mon, May 2, 2011 at 6:34 PM, Ma'moon phpir...@gmail.com wrote: just check the URLhttp://localhost/cakephp1.3.8/and see if you get a nice default welcome page colored and styled, if you get this page then your mod_rewrite is ON otherwise it will be OFF or not enabled. Ma'moon On Mon, May 2, 2011 at 3:51 PM, jyoti bhandari jytbhand...@gmail.com wrote: Ma'moom: I actually donno is that on or not. how to figure that out? On Mon, May 2, 2011 at 6:08 PM, Ma'moon phpir...@gmail.com wrote: Can you see the page http://localhost/cakephp1.3.8/http://localhost/cakephp1.3.8/posts/index rendered properly with all style sheets elements? are you sure that you have mod_rewrite enabled in your web server's configuration? Ma'moon On Mon, May 2, 2011 at 3:32 PM, jyoti bhandari jytbhand...@gmail.com wrote: Hi Anand, I did not get what u said, can u please elaborate :D Thanks Jyothi On Mon, May 2, 2011 at 5:36 PM, andy_the ultimate baker anandghaywankar...@gmail.com wrote: first write the name of controller before helper then ur punching index in url where as there is no need, just punch posts then in ur action on controller write print_r($this-data);exit; and see waht u get, if nothing then check action of the ctp by Anand On May 2, 4:43 pm, jyoti bhandari jytbhand...@gmail.com wrote: HI, i have created three pages like following I have created model post,php within models folder ?php class Post extends AppModel { var $name = 'Post';} ? I have created controller posts_controller.php within controller folder. ?php class PostsController extends AppController { var $helpers = array('Html', 'Form'); var $name = 'Posts'; function index() { } } ? I have created folder called as posts within views. within Posts folder, i have created index.ctp file and these are the contents within that file. !-- File: /app/views/posts/index.ctp -- h1Blog posts/h1 After creating all this , i am calling the following url http://localhost/cakephp1.3.8/posts/index This is all situation, now please help me out. It would be gr8 help Thanks Jyothi On Mon, May 2, 2011 at 12:22 PM, Ma'moon phpir...@gmail.com wrote: What is the URL that you are calling in order to render the page? Ma'moon On Mon, May 2, 2011 at 8:00 AM, jyoti bhandari jytbhand...@gmail.comwrote: It is already set to 2. :( On Mon, May 2, 2011 at 4:48 AM, Ma'moon phpir...@gmail.com wrote: in file app/config/core.php change the value of {debug} and set it to 2, refresh the page and check if it throws any errors or warnings. On Sun, May 1, 2011 at 7:20 AM, Jo jytbhand...@gmail.com wrote: Hi, I am new to cakephp. I am installing the cakephp and created model, controller and view according to the tutorial. but i am getting this error The requested URL /cakephp1.3.8/posts/index was not found on this server. Where in , it exists in the folder. I donno
Re: 404 error
I typed quickly, the home page is located in /app/views/pages/ home.ctp . See if it is blank, and if it is, type smth there.. On May 3, 11:44 am, Miloš Vučinić milosvuci...@gmail.com wrote: If you are using security component, turn it off, by not including it anywhere. It happens when you include it in the wrong place. Also , see your homepage view page. Suppose it is /home/page/home.ctp and type there anything to see if it will render. On May 2, 11:47 am, jyoti bhandari jytbhand...@gmail.com wrote: i did the same a new refresh loading. did all the changes as told in the installation. I got a page where u get to know, is ur db accesible, connected , temp is writeable,and two things to be changed that is some cipher etc. i am testing it on localhost, nt on online dns. On Mon, May 2, 2011 at 9:10 PM, Sam Sherlock sam.sherl...@gmail.com wrote: try to do the same with a fresh download of cakephp and see if you can get pages/ home to display what is you host? GoDaddy or 11 or other? - S On 2 May 2011 16:27, jyoti bhandari jytbhand...@gmail.com wrote: i did that also On Mon, May 2, 2011 at 8:39 PM, Sam Sherlock sam.sherl...@gmail.comwrote: in the core.php file uncomment the following line (line 69 for me) //Configure::write('App.baseUrl', env('SCRIPT_NAME')); that will then enable cake internal url rewrite - S On 2 May 2011 15:42, jyoti bhandari jytbhand...@gmail.com wrote: i haver emoved all the thee files On Mon, May 2, 2011 at 7:58 PM, Sam Sherlock sam.sherl...@gmail.comwrote: It means the rewrite in htaccess are not work either use cakes internal alternative or try to alter the htaccess adding the following lines to you htaccess files may sort this out (if you have app dir cakephp1.3.8 have 3 htaccess files) - add the following within the Rewrite section RewriteBase /cakephp1.3.8/ RewriteBase /cakephp1.3.8/app/ RewriteBase /cakephp1.3.8/app/webroot/ - S On 2 May 2011 15:17, jyoti bhandari jytbhand...@gmail.com wrote: It is plain. That means it is off. how to on it? On Mon, May 2, 2011 at 6:34 PM, Ma'moon phpir...@gmail.com wrote: just check the URLhttp://localhost/cakephp1.3.8/andsee if you get a nice default welcome page colored and styled, if you get this page then your mod_rewrite is ON otherwise it will be OFF or not enabled. Ma'moon On Mon, May 2, 2011 at 3:51 PM, jyoti bhandari jytbhand...@gmail.com wrote: Ma'moom: I actually donno is that on or not. how to figure that out? On Mon, May 2, 2011 at 6:08 PM, Ma'moon phpir...@gmail.com wrote: Can you see the page http://localhost/cakephp1.3.8/http://localhost/cakephp1.3.8/posts/index rendered properly with all style sheets elements? are you sure that you have mod_rewrite enabled in your web server's configuration? Ma'moon On Mon, May 2, 2011 at 3:32 PM, jyoti bhandari jytbhand...@gmail.com wrote: Hi Anand, I did not get what u said, can u please elaborate :D Thanks Jyothi On Mon, May 2, 2011 at 5:36 PM, andy_the ultimate baker anandghaywankar...@gmail.com wrote: first write the name of controller before helper then ur punching index in url where as there is no need, just punch posts then in ur action on controller write print_r($this-data);exit; and see waht u get, if nothing then check action of the ctp by Anand On May 2, 4:43 pm, jyoti bhandari jytbhand...@gmail.com wrote: HI, i have created three pages like following I have created model post,php within models folder ?php class Post extends AppModel { var $name = 'Post';} ? I have created controller posts_controller.php within controller folder. ?php class PostsController extends AppController { var $helpers = array('Html', 'Form'); var $name = 'Posts'; function index() { } } ? I have created folder called as posts within views. within Posts folder, i have created index.ctp file and these are the contents within that file. !-- File: /app/views/posts/index.ctp -- h1Blog posts/h1 After creating all this , i am calling the following url http://localhost/cakephp1.3.8/posts/index This is all situation, now please help me out. It would be gr8 help Thanks Jyothi On Mon, May 2, 2011 at 12:22 PM, Ma'moon phpir...@gmail.com wrote: What is the URL that you are calling in order to render the page? Ma'moon On Mon, May 2, 2011 at 8:00 AM, jyoti bhandari jytbhand...@gmail.comwrote: It is already set to 2. :( On Mon, May 2, 2011 at 4:48 AM, Ma'moon phpir...@gmail.com wrote: in file app/config/core.php change the value of {debug} and set it to 2, refresh the page and check if it throws any errors or warnings. On Sun, May 1, 2011 at 7:20 AM, Jo
Re: an appointment system...
Why don't you just use google calendar or some other management support software ? Comparing to what he has to pay you to do it, plus the time you will not be working on something useful it pays off. On Apr 28, 5:14 pm, Tran Cao Thai jasonvoorhees...@gmail.com wrote: i used to play around with full calendar (a plugin of jquery) when doing my bachelor. It is good, but we still had to configure a lot (3000 lines of javascript). In my opinion, building everything from scratch is a lot better than trying to hack some complex systems. So if you still have time, build your own On Thu, Apr 28, 2011 at 11:04 PM, Tan Cheng davidtan...@gmail.com wrote: Hi folks, My boss ask me to create an appointment system, basically, I need a calendar that I can add events, and maybe a message system. I haven't found any good plug-in for this. So anybody has any related experience doing this with php? Where should I start looking at? Any input will be greatly appreciated! Thank you! -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 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 athttp://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: Validation for a complex form
Hi , thanks for helping. My validation rule is, allow all Serbian utf-8 chars (I tried some with utf codes but it didn't work so this works), dot, coma, and a dash and none other chars. It looks like this. 'omrazeniPorf1' = array( 'notempty' = array( 'rule' = '/^[a-z0-9\.\,ŽžĐđŠšĆćČčабвгдђежзијклљмнњопрстћуфхцчћџШ\- АБВГДЂЕЖЗИЈКЛЉМНЊОПРСТЋУФХЦЧЏШ\- ]{1,}$/i', 'message' = 'Morate uneti ime profesora', 'allowEmpty' = false, //'required' = false, //'last' = false, // Stop validation after this rule //'on' = 'create', // Limit validation to 'create' or 'update' operations ), ), View for this concrete field is in my code like this it is a select box with size 5 : ?php echo $this-Form-input('omiljeniProf1' , array('size'='5', 'type'='select','label' = '5.a) Ime prvog profesora ','onchange'='filltext(this,mytext,PollAddForm)','style' = 'width:200px')); ? where 'omiljeniProf1' is the name of the field, and onchange is a function I wrote to automatically fill in some other text field.. Thanx On Apr 24, 12:16 pm, acl68 c...@anjaliebermann.de wrote: Hi Milos, can you post the validation rules for this checkboxes and radio buttons? Anja Am Sonntag, 24. April 2011, um 10:41:55 schrieb Miloš Vučinić: Hi, I have a form which has many select boxes as well as many radio groups. The problem I'm having is that when I validate the data in the model, I receive general error If some data is not entered, but it is not shown under the radio button group or near a select box item. If I place a regular input text field , the validation message is show correctly. Can anyone help me with this ? Did anyone experience similar problems ? All the best, Milos Vucinic -- 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: Validation for a complex form
Also validation for this select box has completely failed, because, that select box was empty, meaning with no data in it, and on submit it passed.. Thanks, Milos On Apr 25, 10:07 am, Miloš Vučinić milosvuci...@gmail.com wrote: Hi , thanks for helping. My validation rule is, allow all Serbian utf-8 chars (I tried some with utf codes but it didn't work so this works), dot, coma, and a dash and none other chars. It looks like this. 'omrazeniPorf1' = array( 'notempty' = array( 'rule' = '/^[a-z0-9\.\,ŽžĐđŠšĆćČčабвгдђежзијклљмнњопрстћуфхцчћџШ\- АБВГДЂЕЖЗИЈКЛЉМНЊОПРСТЋУФХЦЧЏШ\- ]{1,}$/i', 'message' = 'Morate uneti ime profesora', 'allowEmpty' = false, //'required' = false, //'last' = false, // Stop validation after this rule //'on' = 'create', // Limit validation to 'create' or 'update' operations ), ), View for this concrete field is in my code like this it is a select box with size 5 : ?php echo $this-Form-input('omiljeniProf1' , array('size'='5', 'type'='select','label' = '5.a) Ime prvog profesora ','onchange'='filltext(this,mytext,PollAddForm)','style' = 'width:200px')); ? where 'omiljeniProf1' is the name of the field, and onchange is a function I wrote to automatically fill in some other text field.. Thanx On Apr 24, 12:16 pm, acl68 c...@anjaliebermann.de wrote: Hi Milos, can you post the validation rules for this checkboxes and radio buttons? Anja Am Sonntag, 24. April 2011, um 10:41:55 schrieb Miloš Vučinić: Hi, I have a form which has many select boxes as well as many radio groups. The problem I'm having is that when I validate the data in the model, I receive general error If some data is not entered, but it is not shown under the radio button group or near a select box item. If I place a regular input text field , the validation message is show correctly. Can anyone help me with this ? Did anyone experience similar problems ? All the best, Milos Vucinic -- 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: Validation for a complex form
I think I found a bug in cakephp validation .. I just realized one of my problems is this.. If you have a select box, but unpopulated yet because it needs to be filled after click on some other item (e.g another select box) it doesn't get passed as index in array in this-data In my example the index 'omiljeniProf1' has never been shown in $this- data[] so the validation for it never took place.. I think it is a bug, because, if I have a model, which clearly states that I have a field 'omiljeniProf1' and that it must not be null, and in Model- save(this-data) it is not passed, it needs to show an error.. I will have to work around this by checking is it passed in my controller.. But for that, I need to have a way to se if data['omiljeniProf1']==null without generating an error when it doesn't exist.. How to check this without an error ? All the best, Milos On Apr 25, 10:15 am, Miloš Vučinić milosvuci...@gmail.com wrote: Also validation for this select box has completely failed, because, that select box was empty, meaning with no data in it, and on submit it passed.. Thanks, Milos On Apr 25, 10:07 am, Miloš Vučinić milosvuci...@gmail.com wrote: Hi , thanks for helping. My validation rule is, allow all Serbian utf-8 chars (I tried some with utf codes but it didn't work so this works), dot, coma, and a dash and none other chars. It looks like this. 'omrazeniPorf1' = array( 'notempty' = array( 'rule' = '/^[a-z0-9\.\,ŽžĐđŠšĆćČčабвгдђежзијклљмнњопрстћуфхцчћџШ\- АБВГДЂЕЖЗИЈКЛЉМНЊОПРСТЋУФХЦЧЏШ\- ]{1,}$/i', 'message' = 'Morate uneti ime profesora', 'allowEmpty' = false, //'required' = false, //'last' = false, // Stop validation after this rule //'on' = 'create', // Limit validation to 'create' or 'update' operations ), ), View for this concrete field is in my code like this it is a select box with size 5 : ?php echo $this-Form-input('omiljeniProf1' , array('size'='5', 'type'='select','label' = '5.a) Ime prvog profesora ','onchange'='filltext(this,mytext,PollAddForm)','style' = 'width:200px')); ? where 'omiljeniProf1' is the name of the field, and onchange is a function I wrote to automatically fill in some other text field.. Thanx On Apr 24, 12:16 pm, acl68 c...@anjaliebermann.de wrote: Hi Milos, can you post the validation rules for this checkboxes and radio buttons? Anja Am Sonntag, 24. April 2011, um 10:41:55 schrieb Miloš Vučinić: Hi, I have a form which has many select boxes as well as many radio groups. The problem I'm having is that when I validate the data in the model, I receive general error If some data is not entered, but it is not shown under the radio button group or near a select box item. If I place a regular input text field , the validation message is show correctly. Can anyone help me with this ? Did anyone experience similar problems ? All the best, Milos Vucinic -- 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: Validation for a complex form
Thanx that was it. I never expected that when you say, that empty field is disabled that it doesn't work for the null . Do you know how to pass array of values to rule, each time you make a request. I have to check if data for my select box has been entered or some other value ... On Apr 25, 1:18 pm, Jeremy Burns | Class Outfit jeremybu...@classoutfit.com wrote: Try adding 'required' = true to the validation for the field. Jeremy Burns Class Outfit jeremybu...@classoutfit.comhttp://www.classoutfit.com On 25 Apr 2011, at 10:27, Miloš Vučinić wrote: I think I found a bug in cakephp validation .. I just realized one of my problems is this.. If you have a select box, but unpopulated yet because it needs to be filled after click on some other item (e.g another select box) it doesn't get passed as index in array in this-data In my example the index 'omiljeniProf1' has never been shown in $this- data[] so the validation for it never took place.. I think it is a bug, because, if I have a model, which clearly states that I have a field 'omiljeniProf1' and that it must not be null, and in Model- save(this-data) it is not passed, it needs to show an error.. I will have to work around this by checking is it passed in my controller.. But for that, I need to have a way to se if data['omiljeniProf1']==null without generating an error when it doesn't exist.. How to check this without an error ? All the best, Milos On Apr 25, 10:15 am, Miloš Vučinić milosvuci...@gmail.com wrote: Also validation for this select box has completely failed, because, that select box was empty, meaning with no data in it, and on submit it passed.. Thanks, Milos On Apr 25, 10:07 am, Miloš Vučinić milosvuci...@gmail.com wrote: Hi , thanks for helping. My validation rule is, allow all Serbian utf-8 chars (I tried some with utf codes but it didn't work so this works), dot, coma, and a dash and none other chars. It looks like this. 'omrazeniPorf1' = array( 'notempty' = array( 'rule' = '/^[a-z0-9\.\,ŽžĐđŠšĆćČčабвгдђежзијклљмнњопрстћуфхцчћџШ\- АБВГДЂЕЖЗИЈКЛЉМНЊОПРСТЋУФХЦЧЏШ\- ]{1,}$/i', 'message' = 'Morate uneti ime profesora', 'allowEmpty' = false, //'required' = false, //'last' = false, // Stop validation after this rule //'on' = 'create', // Limit validation to 'create' or 'update' operations ), ), View for this concrete field is in my code like this it is a select box with size 5 : ?php echo $this-Form-input('omiljeniProf1' , array('size'='5', 'type'='select','label' = '5.a) Ime prvog profesora ','onchange'='filltext(this,mytext,PollAddForm)','style' = 'width:200px')); ? where 'omiljeniProf1' is the name of the field, and onchange is a function I wrote to automatically fill in some other text field.. Thanx On Apr 24, 12:16 pm, acl68 c...@anjaliebermann.de wrote: Hi Milos, can you post the validation rules for this checkboxes and radio buttons? Anja Am Sonntag, 24. April 2011, um 10:41:55 schrieb Miloš Vučinić: Hi, I have a form which has many select boxes as well as many radio groups. The problem I'm having is that when I validate the data in the model, I receive general error If some data is not entered, but it is not shown under the radio button group or near a select box item. If I place a regular input text field , the validation message is show correctly. Can anyone help me with this ? Did anyone experience similar problems ? All the best, Milos Vucinic -- Our newest site for the community: CakePHP Video Tutorialshttp://tv.cakephp.org Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 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 athttp://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
Validation for a complex form
Hi, I have a form which has many select boxes as well as many radio groups. The problem I'm having is that when I validate the data in the model, I receive general error If some data is not entered, but it is not shown under the radio button group or near a select box item. If I place a regular input text field , the validation message is show correctly. Can anyone help me with this ? Did anyone experience similar problems ? All the best, Milos Vucinic -- 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
minimum memory for cake 1.3
Hi guys, I made a project for my faculty , a temporary web site which collects answers to one poll in cake php 1.3. It runs ok, but when I log into cake admin, I get error that I have reached my 8mb memory limit. having in mind that I did not use much resources , and that in total with auth component I have 10 tables I guess i couldn't made much mess. Everything was baked, and just a few things I added nothing special.. So , I read that 8 mb for cake is not so much. What is some regular sized minimum to run app with cake, and how can I measure project memory usage in apache in my local machine ? Thanks, all the best ! Milos -- 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: Strange error passing from windows to linux
I just read this so I might say something that has already been said.. The key difference in web programing between windows and linux is that linux is case sensetive and windows is not. Especialy when it comes to database. I know that because I had some java project in windows and lost a whole day to figure out why it doesn't work in Linux. So you need to check the way you reference to your key in database. If you use a field with wrong case in Linux such as User.UserFirstName instead of User.user.firstname you will have a problem. I would look for that, because you error indicates that you tried to access field that you do not have, and since your app works in windows, I gues that most probably your problem is in case sensitivity in linux.. And I think you can't turn it off, so youll need to check for every usage of indexes in model.. All the best Milos On Apr 9, 11:40 am, Mariano C. mariano.calan...@gmail.com wrote: Wherever I put this debug($this-MyModel::schema()) i get: T_PAAMAYIM_NEKUDOTAYIM php error :( On 8 Apr, 21:23, cricket zijn.digi...@gmail.com wrote: On Fri, Apr 8, 2011 at 2:28 PM, Mariano C. mariano.calan...@gmail.com wrote: I suppose, I've just made a dump What is the primary key for the model? Is it id? The error is telling you that the model thinks the PK is id but that the database is saying something else. Put debug($this-YourModel::schema()) somewhere so you can see what the DB source is returning. -- 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: URL problem
check your .htaccess file. I had an issue where nothing worked, because cake couldn't find css. In this file you specify the path to webroot and app dir amoung other thigs yo ucan do there. For exaple mine is : IfModule mod_rewrite.c RewriteEngine on RewriteRule^$ app/webroot/[L] RewriteRule(.*) app/webroot/$1 [L] /IfModule but this is in windows, so you'll probably need to change it.. On Apr 9, 12:17 pm, peterhf peter.f...@sbcglobal.net wrote: My mistake. TEST-dev is the name of the database used with this app.http://localhost/TEST-admin/returns the app. I put this in the ...app/webroot/.htaccess,restarted - same problem. IfModule mod_rewrite.c RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d dfskjsdsadjfsddfl RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] /IfModule Does this mean that this file is not being read by apache? Where else could AllowOverride be set to None? On Apr 8, 9:31 pm, cricket zijn.digi...@gmail.com wrote: On Fri, Apr 8, 2011 at 11:35 PM, peterhf peter.f...@sbcglobal.net wrote: http://localhost/TEST-admin/producesthe first page on the application, a login page. I just noticed that you used TEST-admin but also mentioned a TEST-dev. Could this be it? In any case, I posted a reply to someone else this evening about setting up virtual hosts and local subdomains. If you're interested and want more info let me know. debug is set to 2. What about this in your layout? debug(CSS_URL); debug(JS_URL); AllowOverride was set to 'none', I set it to All and restarted the computer - problem persists. That would have done it. Just to be sure they're being read, type some garbage text on a new line in one of them and refresh. If your server doesn't keel over then AllowOverride is still set to None somewhere. Actually, to be really sure, type it in the one inside the webroot dir. Whether your DocumentRoot is TEST-dev, TEST-dev/app, or TEST-dev/app/webroot, the last one should be read (if they're being read at all). -- 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: naming Model
Just a quick question. Why did you have problems with bake ? I used to have one odd problem , so I'll just say it in case it is. I used cake bake all but it never worked (I am curently using windows). No matter how I set databasem it failed all the time.. So once I saw this post and said that in windows you need to give the -app and in path to the app folder example : cake bake all -app c:\xampp\htdocs\project1\app Try this in any case. Trust me, when you are a beginer, this will save your life :) All the best, Milos Vucinic On Apr 9, 9:44 am, euromark dereurom...@googlemail.com wrote: well, you can always override the default behavior I - for example - have a contact model as well as a contact controller because it would make no sense to call it contacts :) the conventions are useful for most cases, in same you can easily adjust the classes manually to get the desired result (even with some pluralization problems - this can even happen in English itself). On 9 Apr., 02:46, Benno benno.dir...@gmail.com wrote: Imagine your native language, say, Japanese, doesn't inflect for pluralization. Now imagine you're using a framework that does. While I'm not going to suggest that 5 months is now reasonable for getting some basic functionality going, it seems totally reasonable to me that 5 months later you still don't understand intuitively why some things are singular and some things are plural. On Apr 9, 8:18 am, euromark dereurom...@googlemail.com wrote: seriously? you have been using cake for 5 months now? you did not yet get the console working or understood the most basic principles as outlined in the cookbook? ähm.. i am speechless On 9 Apr., 02:08, cricket zijn.digi...@gmail.com wrote: On Fri, Apr 8, 2011 at 7:55 PM, cake-learner sh.koiz...@gmail.com wrote: I have following Controller and Model set up manually since the baker is not so easy to use. But somehow I can't get to work. First of all, about the class name, I am not sure why they want to use singular for model and plural for controller A model represents a single entity. So, singular. A controller handles collections of entities (in a sense). So, plural. and small letters for routes.php. It's been nightmare with cakephp project for last 5 months. class TemplatesController extends AppController { $name = Templates; function index(){ } } If you're using PHP 5.x you can leave out $name here. class Template extends exends Model{ $name = Template; } Typo? And it's AppModel. class Template extends AppModel Ditto about $name here. Router::connect('/template_page/:id',array('controller'=templates', 'action' = 'index', 'client'=$domains[0]) ); I don't understand what $domains is so no comment. -- 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: minimum memory for cake 1.3
Thanks a lot, I really apreciate your responce . Kind regards, Milos Vucinic On Apr 9, 1:22 pm, Andras Kende and...@kende.com wrote: Hello, 8MB is not much nowadays, php 5.3 is default setting is 128MB.. Probably 32-64 should be fine for a simpler app... You could Install debug_kit to see memory usage:https://github.com/cakephp/debug_kit#readme also in queries make sure to use fields and correct associations to only pull data out from database which is needed... Andras Kendehttp://www.kende.com On Apr 9, 2011, at 10:24 AM, Miloš Vučinić wrote: Hi guys, I made a project for my faculty , a temporary web site which collects answers to one poll in cake php 1.3. It runs ok, but when I log into cake admin, I get error that I have reached my 8mb memory limit. having in mind that I did not use much resources , and that in total with auth component I have 10 tables I guess i couldn't made much mess. Everything was baked, and just a few things I added nothing special.. So , I read that 8 mb for cake is not so much. What is some regular sized minimum to run app with cake, and how can I measure project memory usage in apache in my local machine ? Thanks, all the best ! Milos -- Our newest site for the community: CakePHP Video Tutorialshttp://tv.cakephp.org Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 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 athttp://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: Memory Leak in Model::Save()
I am not really experienced, but this looks like it is not up to you. It might be that it is not your problem, but servers or cakes.. However I don't think cake was made for generating such large data.. What is the purpose of your project I mean as a whole project. Is it like a web site, or is it console application ? If it is not web oriented php might not be t amount of the perfect solution for you.. Maybe c++ with that data or C# etc.. You could also maybe test to see if it is MySql database problem, CakePHP problem or your server (I'm guessing apache) problem. You can make a script in let's say Java which will make 50 million entries to the database, and see if it will break as well. If that works fine, then you can see if there is a problem with apache (maybe it makes these 2000 b when you do a http://request) by making php script (without usage of cakephp framework, so new project) do a 50 million saves in a row with http request and at last test cake with a 50 million saves with and without http request (by a for loop, $this- model-save). You will get an idea then where the problem lies, and maybe try to work around the issue, not to use that memory leaker etc... Milos On Apr 5, 5:13 am, Dr. Tarique Sani tariques...@gmail.com wrote: Don't really know about the memory leak but I would not use a http request for generating the data If you have to use PHP or CakePHP create a console script and run it via a cron or some other queue system Tarique On Mon, Apr 4, 2011 at 9:08 PM, ProFire profir...@hotmail.com wrote: Hello Fellow Bakers! I have developed an application to generate a family tree. In one of my models, I have attached Tree Behaviour. -- = PHP for E-Biz:http://sanisoft.com = -- 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: Euromark function guaranteeFields($requiredFields, $data = null) {
In risk of looking a little bit stupid, I'll ask this. If you need a field to be required, you can set that in model, so why bother with other stuff ? doI it that way. You can either use predefined rules of cake or make your own using regular expressions.. You can firebug all you want but when you click save, if you didn't input required value (if you even specified what types of character can be used), there is no way you'll pass submitting, and user will not even be redirected from the page.. And if you really need to make something very tricky , you can always use ajax . This component of cake is beautiful. It even flashes messages next to the fields if there is an error with them.. Also one more comment. I do not see much point of protecting your form from being firebuged... Because, if somebody tries to hack a form on the client side (smth that is already loaded in his browser) you can't really stop them. When they receive a form it is kinda their now and they can change it or do whatever they want with it, because you have no control over data on his computer. But, in order to make sure no hacks are gonna happen, just made the same security on the server side of app and there you have it. The security you put on client side is for clients. So that it would make their lives easier, when filling forms etc. But for those evil clients who wish to ruin your work, you put security on server side and you have done all you needed to do. Hope i didn't miss the subject :) All the best, Milos On Apr 2, 9:26 pm, Krissy Masters naked.cake.ba...@gmail.com wrote: Right on. Was only curious since Security create a hash based on the fields I figured there must be some way to do the same thing and use it for whatever reason. Thanks for the info all the same. K -Original Message- From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of euromark Sent: Saturday, April 02, 2011 10:43 PM To: CakePHP Subject: Re: Euromark function guaranteeFields($requiredFields, $data = null) { it is not possible the controller has no direct link to the form helper especially not after a post (and therefore BEFORE the form is rendered again). controller + model are finished before the view even starts to render. you would need to embed the keys as a hidden field in the form itself (+ hash etc to disallow any modifications). but then you could just as well use the security component and you would be already done. so i dont see a point in that. i agree that it can be a pain in the but. in some rare occasions you could use blacklisting (especially if you only want to forbid 1 field of 50 allowed fields). in other occasions you would store those field names in a (long?) array in the model and simply use it in the controller $this-Model-allowedFieldsForEdit etc either way linking the form helper / form inputs to the model logic can probably do more harm than good. i would think about which fields are allowed and manually pass them to the set/save methods. using the model arrays to store the fields will also ensure that after an update of the schema you got all field names in a single place. less likely you will forget to add/delete fields. On 3 Apr., 00:51, Krissy Masters naked.cake.ba...@gmail.com wrote: Sorry I think you missed my point. Example: I have a form with 50 fields. I would have to manually type out all 50 if they have to be in the form = pain Im interested in grabbing all the field names the form has before its rendered. Then use that in the function before saving beforeRender() / beforeFilter(){ grab all the fields your form has before rendering it $form_fields = ??? somefunction to grab all your fields Then use an array / !in_array / arrys_keys to keep / exclude ones that are required to be there $required_fields = array_diff( array('optional', 'fields', 'here' ),$form_fields); //something like that so you type out a few not all type thing } That's what I am wondering, if anyone knows how you could grab a list of fields in the form. Thanks, K -Original Message- From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of cricket Sent: Saturday, April 02, 2011 7:45 PM To: cake-php@googlegroups.com Subject: Re: Euromark function guaranteeFields($requiredFields, $data = null) { On Sat, Apr 2, 2011 at 3:10 PM, Krissy Masters naked.cake.ba...@gmail.com wrote: Reading the bit about making fields required in a form so a user can not firebug them out and thought is there a way to manually grab the names of the fields in a form being rendered in the controller? Form might have 50 fields and you need them all, writing out all of that would be trauma. (but writing the names and updating the model in the future, spellingso on) Security component does something with all the names to makes it hash no? Anyone have any ideas? Here is a
Re: Euromark function guaranteeFields($requiredFields, $data = null) {
And if you hate programming so many fields, just bake the add form for the database table and change it the way you want.. baking takes like a minute to finish . :) I am no baking everything I can :) all the best Milos On Apr 2, 9:26 pm, Krissy Masters naked.cake.ba...@gmail.com wrote: Right on. Was only curious since Security create a hash based on the fields I figured there must be some way to do the same thing and use it for whatever reason. Thanks for the info all the same. K -Original Message- From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of euromark Sent: Saturday, April 02, 2011 10:43 PM To: CakePHP Subject: Re: Euromark function guaranteeFields($requiredFields, $data = null) { it is not possible the controller has no direct link to the form helper especially not after a post (and therefore BEFORE the form is rendered again). controller + model are finished before the view even starts to render. you would need to embed the keys as a hidden field in the form itself (+ hash etc to disallow any modifications). but then you could just as well use the security component and you would be already done. so i dont see a point in that. i agree that it can be a pain in the but. in some rare occasions you could use blacklisting (especially if you only want to forbid 1 field of 50 allowed fields). in other occasions you would store those field names in a (long?) array in the model and simply use it in the controller $this-Model-allowedFieldsForEdit etc either way linking the form helper / form inputs to the model logic can probably do more harm than good. i would think about which fields are allowed and manually pass them to the set/save methods. using the model arrays to store the fields will also ensure that after an update of the schema you got all field names in a single place. less likely you will forget to add/delete fields. On 3 Apr., 00:51, Krissy Masters naked.cake.ba...@gmail.com wrote: Sorry I think you missed my point. Example: I have a form with 50 fields. I would have to manually type out all 50 if they have to be in the form = pain Im interested in grabbing all the field names the form has before its rendered. Then use that in the function before saving beforeRender() / beforeFilter(){ grab all the fields your form has before rendering it $form_fields = ??? somefunction to grab all your fields Then use an array / !in_array / arrys_keys to keep / exclude ones that are required to be there $required_fields = array_diff( array('optional', 'fields', 'here' ),$form_fields); //something like that so you type out a few not all type thing } That's what I am wondering, if anyone knows how you could grab a list of fields in the form. Thanks, K -Original Message- From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of cricket Sent: Saturday, April 02, 2011 7:45 PM To: cake-php@googlegroups.com Subject: Re: Euromark function guaranteeFields($requiredFields, $data = null) { On Sat, Apr 2, 2011 at 3:10 PM, Krissy Masters naked.cake.ba...@gmail.com wrote: Reading the bit about making fields required in a form so a user can not firebug them out and thought is there a way to manually grab the names of the fields in a form being rendered in the controller? Form might have 50 fields and you need them all, writing out all of that would be trauma. (but writing the names and updating the model in the future, spellingso on) Security component does something with all the names to makes it hash no? Anyone have any ideas? Here is a link to his excellent idea incase anyone wants to read up on it. http://www.dereuromark.de/2010/09/21/saving-model-data-and-security/ secion = Protection against missing fields I think it would be best to use a class var in the model. $this-Model-set( $this-data, null, $this-Model-required_fields ); You could even have separate field lists for different actions: $this-Model-set( $this-data, null, $this-Model-required_fields['edit'] ); -- Our newest site for the community: CakePHP Video Tutorialshttp://tv.cakephp.org Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp 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 athttp://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorialshttp://tv.cakephp.org Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 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 athttp://groups.google.com/group/cake-php -- Our newest site
Re: Euromark function guaranteeFields($requiredFields, $data = null) {
I just read smth. So one more comment :) Hope I am not borring you. If you are worried about primary key injection etc, you can always make rights to do stuff. You can have several functions for doing stuff. You can grab data in controller and see if somebody tried to enter a parameter which is not allowed for this kind of users. Like role_id etc, and if they are not null, you blok the save functions. Eg. I have user controller, and I have 2 edit functions and by that 2 different forms. First one is for admins, and second one for users. In users function I check the data before calling model ($this- save($data)) and I see what is in that data. If I find smth I don't want there I would not call the save data function... I can't remember if I actually done that, but I think it is quite doable, because you have access to data var before calling the model.. all the best :) On Apr 3, 10:51 am, Miloš Vučinić milosvuci...@gmail.com wrote: And if you hate programming so many fields, just bake the add form for the database table and change it the way you want.. baking takes like a minute to finish . :) I am no baking everything I can :) all the best Milos On Apr 2, 9:26 pm, Krissy Masters naked.cake.ba...@gmail.com wrote: Right on. Was only curious since Security create a hash based on the fields I figured there must be some way to do the same thing and use it for whatever reason. Thanks for the info all the same. K -Original Message- From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of euromark Sent: Saturday, April 02, 2011 10:43 PM To: CakePHP Subject: Re: Euromark function guaranteeFields($requiredFields, $data = null) { it is not possible the controller has no direct link to the form helper especially not after a post (and therefore BEFORE the form is rendered again). controller + model are finished before the view even starts to render. you would need to embed the keys as a hidden field in the form itself (+ hash etc to disallow any modifications). but then you could just as well use the security component and you would be already done. so i dont see a point in that. i agree that it can be a pain in the but. in some rare occasions you could use blacklisting (especially if you only want to forbid 1 field of 50 allowed fields). in other occasions you would store those field names in a (long?) array in the model and simply use it in the controller $this-Model-allowedFieldsForEdit etc either way linking the form helper / form inputs to the model logic can probably do more harm than good. i would think about which fields are allowed and manually pass them to the set/save methods. using the model arrays to store the fields will also ensure that after an update of the schema you got all field names in a single place. less likely you will forget to add/delete fields. On 3 Apr., 00:51, Krissy Masters naked.cake.ba...@gmail.com wrote: Sorry I think you missed my point. Example: I have a form with 50 fields. I would have to manually type out all 50 if they have to be in the form = pain Im interested in grabbing all the field names the form has before its rendered. Then use that in the function before saving beforeRender() / beforeFilter(){ grab all the fields your form has before rendering it $form_fields = ??? somefunction to grab all your fields Then use an array / !in_array / arrys_keys to keep / exclude ones that are required to be there $required_fields = array_diff( array('optional', 'fields', 'here' ),$form_fields); //something like that so you type out a few not all type thing } That's what I am wondering, if anyone knows how you could grab a list of fields in the form. Thanks, K -Original Message- From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of cricket Sent: Saturday, April 02, 2011 7:45 PM To: cake-php@googlegroups.com Subject: Re: Euromark function guaranteeFields($requiredFields, $data = null) { On Sat, Apr 2, 2011 at 3:10 PM, Krissy Masters naked.cake.ba...@gmail.com wrote: Reading the bit about making fields required in a form so a user can not firebug them out and thought is there a way to manually grab the names of the fields in a form being rendered in the controller? Form might have 50 fields and you need them all, writing out all of that would be trauma. (but writing the names and updating the model in the future, spellingso on) Security component does something with all the names to makes it hash no? Anyone have any ideas? Here is a link to his excellent idea incase anyone wants to read up on it. http://www.dereuromark.de/2010/09/21/saving-model-data-and-security/ secion = Protection against missing fields I think it would be best to use a class var in the model
Re: Euromark function guaranteeFields($requiredFields, $data = null) {
Yeah, at first i didn't really relise what this was about.. But Euromark is right. Just make another function, to which normal users have access, and change the way it inputs fields. You can read from DB to see the old values and place them to be sure they haven't change, and only allowed ones to put from the form. But interesting topic, until you asked I really didn't think of this in cake.. There is also another way that came across my mind for doing this. It's a little odd, but in odd situations odd solutions can be ok. If you have like 50 fileds in db which user shouldn't be able to change and 50 more which he should (raelly aqward situation but let's just say this is it for conversation purposes..), you could make 2 DB tables. First one is consisted of 50 allowed fields + 1 not allowed to change and the other is made of 50 forbiden fields. Logicaly, you have one on one or many on one relation from allowed to notallowd and that is the that +1 field. So you can set up function which changes those 50 allowed plus 1 not allowed fields , and check for only that one which is a connection to forbiden fields. So it is kinda boring, but at least you do not need to check for these 50 fields in your controller... I hope it helps a bit, and that you will make success in your project ! All the best ! Milos On Apr 3, 12:32 pm, euromark dereurom...@googlemail.com wrote: i disagree with Milos in some points but yes, the crucial point is that the main focus should be the server side as far as security is concerned but besides that he proposes hacks that will not only make the code less readable, it also opens the door for many bugs and errors as well as bloating the model unnecessarily´. if you didn't input required value (if you even specified what types of character can be used), there is no way you'll pass submitting actually, you will. what if the validation is only checking if the ID is valid. you still could use the ID of any other user on the site. and the security component will not be able to do anything against it. thats why all fields, that are not intended to be changed should be excluded from being passed on to the model. this way you can ensure that no harm can be done to them. its easy, its short (compared to other solutions like milos), its clean. On 3 Apr., 10:57, Miloš Vučinić milosvuci...@gmail.com wrote: I just read smth. So one more comment :) Hope I am not borring you. If you are worried about primary key injection etc, you can always make rights to do stuff. You can have several functions for doing stuff. You can grab data in controller and see if somebody tried to enter a parameter which is not allowed for this kind of users. Like role_id etc, and if they are not null, you blok the save functions. Eg. I have user controller, and I have 2 edit functions and by that 2 different forms. First one is for admins, and second one for users. In users function I check the data before calling model ($this-save($data)) and I see what is in that data. If I find smth I don't want there I would not call the save data function... I can't remember if I actually done that, but I think it is quite doable, because you have access to data var before calling the model.. all the best :) On Apr 3, 10:51 am, Miloš Vučinić milosvuci...@gmail.com wrote: And if you hate programming so many fields, just bake the add form for the database table and change it the way you want.. baking takes like a minute to finish . :) I am no baking everything I can :) all the best Milos On Apr 2, 9:26 pm, Krissy Masters naked.cake.ba...@gmail.com wrote: Right on. Was only curious since Security create a hash based on the fields I figured there must be some way to do the same thing and use it for whatever reason. Thanks for the info all the same. K -Original Message- From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of euromark Sent: Saturday, April 02, 2011 10:43 PM To: CakePHP Subject: Re: Euromark function guaranteeFields($requiredFields, $data = null) { it is not possible the controller has no direct link to the form helper especially not after a post (and therefore BEFORE the form is rendered again). controller + model are finished before the view even starts to render. you would need to embed the keys as a hidden field in the form itself (+ hash etc to disallow any modifications). but then you could just as well use the security component and you would be already done. so i dont see a point in that. i agree that it can be a pain in the but. in some rare occasions you could use blacklisting (especially if you only want to forbid 1 field of 50 allowed fields). in other occasions you would store those field names in a (long?) array in the model and simply use it in the controller
Re: mp3 player in flash
What do you use for media streaming ? There are different media servers, if you use any.. If not, then you cannot stream these media and you have to wait to load whole song to play it.. So there could be the problem, slow connection or smth like that. Also , did you program that flash or did you use some already done solution... Do you read data from MySql DB, or do you just play fixed playlist from hd.. All the best , Milos On Apr 1, 6:14 pm, Kane The Pirate kanethepir...@gmail.com wrote: Hi, I'm trying to do my cake application play some musics. All the paths are right. It tell the name of the file and it's size, but don't give the music name, or file name, and don't play my music. Some Idea how to do that? -- 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: needed opinion from experienced cakephp user
Thanks for the responses, it's quite a relief :) I'm glad that this kind of traffic is not actually large amount of traffic. Yes I will have more polls at the time, so I will have to make an add action view cached, which will basically generate poll from the information about questions in DB. (Add will have a param which will tell which poll to add).It is a good idea to cache them all. And also , yes I will be good friends with sys admin, I will have a meeting with him today :) Thank you all, Milos Vucinic On Mar 21, 1:14 am, Shaz shazam...@gmail.com wrote: http://www.notgoingtouni.co.uk- on it's launch it took traffic more than what you describe and cakephp didn't crumble one bit. Just make sure your hosting is up to scratch and be really good friends with a sys admin! On Mar 20, 11:39 pm, cricket zijn.digi...@gmail.com wrote: On Sun, Mar 20, 2011 at 7:11 PM, Miloš Vučinić milosvuci...@gmail.com wrote: Hello, I am about to make a poll web site for my faculty. Everything about it is OK, except that it is expected to receive a around 40.000 answers to polls per year. But to make it a little worse, it is expected to receive 90% of these in some 4 months which makes it around 9000 per month , or a 300 per day. These aren't extraordinary numbers as far as any normal DB is concerned. Just be sure that your tables are properly indexed. This is all statistical info, what is expected is to have lot's of days when the web site will not be used, but around 30 days when it will receive 300-500 polls a day, in about 12 hours of the day (nobody will answer these polls at 3am etc ..) So I have to make it to work with a lot of large inserts to my database (one poll has approx 50 questions - fields in DB). Having in mind that I have never worked with this amount of traffic, my questions are following: Can cake put up with this ? Yes. That sort of traffic shouldn't be a problem. If a database is shared (another faculty web sites are working on it) is it going to slow them down a lot, or should this be a dedicated server job ? That depends on what the other uses for the DB are. I wouldn't think that answering a poll would interfere much, if at all, though. Also, is MySQL going to work properly because it is a lot of queries and a large database is needed for this.. It's neither a lot of queries nor an enormous dataset. Lots of sites use MySQL to handle millions of records and *many* thousands of inserts a day. Is it possible to cache content for layout ? The polls are going to be made from back end and stored in a DB. When somebody needs to answer a poll the web site needs to generate it from info from DB. It would be nice to cache it, but how to do that when it is content for layout, and not some element view component.. You can cache an entire page. But, for your purposes, it might be best to cache individual poll views. Will you have more than one poll active at a 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: Auth Error somewhere
Heh, sometimes I had the same issue. I tried to login but I thought I failed although login was success. The thing is, when you login, try to access to smth that that kind of user can and see if it is OK. Also, in app_controller add an loginredirect which will redirect you after successful login, and you will then know for sure that it is all OK. After that add an redirect that if a user is logged in and tries to access /users/login, that he is automatically redirected to another page, so that there is no confusion :) I hope that this is it :) It took me hours :) On Mar 19, 4:37 pm, Krissy Masters naked.cake.ba...@gmail.com wrote: For some reason I can not login. New site 1.3.6 add user success, db password field hashed Go login error password or username and I can not figure out why. Done all this many times before and now stuck on something so trivial I cant even think where to look other than the obvious. Stripped everything out of my functions to bare bones and same thing. I have my libs folder where sites share 1 core cake directory and everything else is fine so hmm.. Cleared cache local, server tmp files. Controllers: public function beforeFilter() { parent::beforeFilter(); $this-Auth-allowedActions = array('*'); $this-Auth-autoRedirect = false; } App_controller public function beforeFilter() { $this-Auth-allow('display'); $this-Auth-authorize = 'controller'; $this-Auth-loginAction = array( 'admin' = false, 'controller' = 'users', 'action' = 'login'); $this-Auth-logoutRedirect = array('controller' = 'pages', 'display' = 'index'); $this-Auth-loginRedirect = array('controller' = 'users', 'action' = 'index', 'admin' = true); $this-Auth-loginError = Invalid E-mail or Password.; $this-Auth-authError = Restriced.; $this-Auth-ajaxLogin = '/elements/users/expired_login'; } public function isAuthorized() { return true; } Users_controller public function beforeFilter() { parent::beforeFilter(); $this-Auth-allowedActions = array('*'); $this-Auth-fields = array('username' = 'email', 'password' = 'password');// db fields hashed saved just fine $this-Auth-autoRedirect = false; } public function login() { if ($this-Session-read('Auth.User')) { $this-Session-setFlash(__( 'You are already logged in. ', true ), 'default', array( 'class' = 'flash_fail' ) ); $this-redirect( array( 'controller' = 'pages', 'action' = 'display', 'about' ) ); } } What am I missing? Gone wrong forgot what? Thanks all K -- 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
needed opinion from experienced cakephp user
Hello, I am about to make a poll web site for my faculty. Everything about it is OK, except that it is expected to receive a around 40.000 answers to polls per year. But to make it a little worse, it is expected to receive 90% of these in some 4 months which makes it around 9000 per month , or a 300 per day. This is all statistical info, what is expected is to have lot's of days when the web site will not be used, but around 30 days when it will receive 300-500 polls a day, in about 12 hours of the day (nobody will answer these polls at 3am etc ..) So I have to make it to work with a lot of large inserts to my database (one poll has approx 50 questions - fields in DB). Having in mind that I have never worked with this amount of traffic, my questions are following: Can cake put up with this ? If a database is shared (another faculty web sites are working on it) is it going to slow them down a lot, or should this be a dedicated server job ? Also, is MySQL going to work properly because it is a lot of queries and a large database is needed for this.. Is it possible to cache content for layout ? The polls are going to be made from back end and stored in a DB. When somebody needs to answer a poll the web site needs to generate it from info from DB. It would be nice to cache it, but how to do that when it is content for layout, and not some element view component.. Thanks a lot ! Milos Vucinic -- 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: needed opinion from experienced cakephp user
Thanks ! I have made on paper the model of DB. Every poll will have it's questions and answers in 2 different tables (2 tables for all polls), and every answer will have the poll and specific question to which is answered so that part is covered. Although it has now came to my mind, that I will actually be making a lot more inserts having in mind that I will have to save each answer separately for the poll... Do you think it can make a problem, or is it OK solution ? Does this type of traffic makes problems to databases All the best, Miloš Vučinić On Mon, Mar 21, 2011 at 00:21, Simon Males s...@sime.net.au wrote: Also, is MySQL going to work properly because it is a lot of queries and a large database is needed for this.. I'm not an experienced CakePHP developer but my suggestions from a DB point of view are: * Use InnoDB as a storage engine. * INSERTs are cheaper then UPDATEs. So the 'vote' is written as a new row, rather then updating an existing one. But more development is required to compute a summary table which will represent the poll as a whole. -- Simon Males -- 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
Forms, Polls and others..
Hi, I am working on a project where I need to make polls and surveys on the web site. Those should be very similar to google spread sheet, but it has to work from my web site. Does anyone know if there are components for form generation or something similar to that, or is there a propper way to start.. ? All the best Milos Vucinic -- 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: Possible Memory Leak
I totally agree with other guys about demonizing it and making the process being able to pause, maybe restart the computer and contine from where you have paused. So I am writting to express wory about a precision of your results. I am not an old cake user and I haven't had a chance to do complex math functions in cake, but having in mind you have so many results you need to go through a simple 0.0001 mistake could multiply to something huge. Esepecialy if you have numbers with a lot of figures eg 123456789123.123456789123456789 Now in some cases floating numbers here just start to loose last figures and you don't even get that reported about that. I think it's cool you are trying to do this in cake because you will proove that anything is possible but I would without a hesitation check the results in math lab - software which actually is programmed , optimased and tested for such calculations and also does them more quickly. Also I believe - not sure - that you can rent supercomputers with matlab or smth like that like cloud computing and get your job done even quicker. I hope i didn't bother you too much :) All the best, Milos On Feb 22, 7:51 am, Maurits van der Schee maur...@vdschee.nl wrote: Hi, I use a single http request. Ah and that is your problem. PHP and web servers in general are not designed to execute long running tasks. I do batch processing in cakephp using a javascript timer that invokes an ajax call to cake every 2 seconds. Cake then executes a small portion of the enormous batch task and logs that. Since this is the type of task you don't want to rush it works very well for me. It is sure is a matter of taste whether or not you think such a solution is pretty and I don't know whether or not it is appropriate in your case. Regards, Maurits On 02/22/2011 01:07 AM, ProFire wrote: I use a single http request. On Feb 21, 11:32 pm, Maurits van der Scheemaur...@vdschee.nl wrote: Hi, Do you use a single http request or multiple invoked by a javascript timer? Regards, Maurits On 02/21/2011 02:49 PM, ProFire wrote: Hi fellowcakephpers, I've been a long time user ofCakePHPand I've been satisfied since I first tried it. In fact, there's no more turning back for me ever since I started it. No framework matchesCakePHPwhen it comes to ease of development. However, very recently, I've encountered a problem I can't figure out the source. I'm dealing with Financial Data and being in finance, my application often have to crunch huge sets of data. I've always been very careful with how my application has handled the data as the data involve is huge and I could run into a memory leak if I don't clear those unused variables. This year, I was tasked to run a very heavy simulation on the financial data that involves possible 100 million mysql queries in a single run. As such, I'm very prepared to let the simulation run over a period of 1 month. However, within 2 days, the application threw a memory exhausted error. What really puzzled me was I had been very careful not to store any unused data in memory. In my algorithm, after I query the data, I store them in a temporary variable. At its final usage, I unset the variable despite knowing that the next iteration the data will be overwritten. That's just to be sure. After each round of simulation, the variables used are stored in the database. After the last $model-save(), I clear every variable used in the simulation, even if the data will be overwritten at the next iteration. All other persistent data throughout the iteration are either integers, floats or unchanging arrays. As such, there's no way these persistent data could be the cause of memory leak. I've debugged as much as I could to pin point the source of the memory leak in my controllers and models, but without any luck. I ran a smaller simulation and monitor the memory size each iteration, I noticed that the memory either stays the same or gets bigger. I still put my faith inCakePHPand I need expert advise on where this memory leak could be. -- 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: Problem with cake 1.2 or not ?
Sorry for not answering sooner, I got some flue so I wasn't really turning my computer on :) Break time :) I just wanted to say thank you for the support , I really appreciate all of the information and advices you gave me. I guess I can wait then because there is no current emergency for upgrading and also after this business year there is probably going to be need for a lot of changes and upgrades and having that in mind it wouldn't be bad to start it in 2.0 than to make it first for 1.3 and then all the same for 2.0 again. Thanks On Feb 18, 3:24 pm, Alejandro Gómez Fernández agom...@gmail.com wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Several years ago we neded to upgrade our management system from oracle 8 when oracle release the version 10. Our provider insists us for migrate to oracle 9 and then to 10. After a long analisys the systems engineers decide to migrate to oracle 10 because the process will be shorter. And it was fine and whe we finish the upgrade, oracle 10 was mostly very stable. This case seems pretty equal to me. Ryan's advice is the most recommended for almost every case. What Ryan says have the most sense if you need to do a seamless upgrade for whatever other reason. Remember, just like Ryans says, a production site will not be based in development versions of framework, database, etc. But if you make re-engineering to your site, this will take time and when you finish the 2.0 framework wil be stable. Or you can wait until this happend. If you upgrade to 1.3 and then again to 2.0 when there is no need to do, it's to make the work two times. Even more, you can add new features just like in any other software version upgrade and no only migrate the framework version. I think it's no needed to do the update now, because you want to upgrade for fear to PHP hosting can be changed to higher version and then the website will no work. This will not happpend in the short time, because php 5.3 it's now the top standard (php it's releasing yet 5.2.x versions) so your production website made with cakephp 1.2 will just work fine for several more months. Obviously, it's highly probable that there are no guide to do the upgrade from 1.2 to 2.0 Regards, Alejandro. El 18/02/2011 01:23, Ryan Schmidt escribi : On Feb 17, 2011, at 21:41, Alejandro G mez Fern ndez wrote: In case you want to upgrade cake to the most recent version I think you must see cake 2.0. It's a development version, but more or less, when you finish your migration it will be a production version. To change to an 1.3.x has no sense to me. Upgrading a production site to the development version of CakePHP that will become 2.0 makes no sense. The final version 2.0 is not released yet, and the developers have provided no guidance on when it will be completed. It might be tomorrow, it might be next year. In the mean time, you might run into issues, the response to which will generally be it's a development version, it's expected to have unresolved problems, go use the stable version. There is a published guide explaining how to upgrade a 1.2 site to 1.3. When 2.0 is released, I would expect there to be a guide explaining how to upgrade a site from 1.3 to 2.0. I would not, however, expect there to be a guide on how to upgrade from 1.2 directly to 2.0; users would be expected to have already upgraded to 1.3. Therefore it makes a great amount of sense to upgrade your 1.2 site to 1.3 now, verify that you've followed the existing upgrade guide properly and that everything works, and publish your site with 1.3, and then, whenever 2.0 does come out, you can tackle that upgrade then. -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (MingW32) Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJNXoELAAoJEHQn9CmeN9DJsmwH/0hKu+83Fb7FxtFNIvpYEocm R+/jrMJCmwWWZMSoLOzF+aXH2fqcJd5evtMag4ErqjjFMIPrS/7JOZIrOM/P6dPK kM672hL/WKTNvzxOPsXx/ywq9ydGHUBz3NM5i23DRP+PDCWoucIfgceZpFuTG2+H AMRHmA/QIVg/zpLP3zzcqtW+eUcDDomUjOFRCVj2NDw6ReHCYh/hkcI4LED0tAX9 PSLPGrOVH6KodySzx+Os3/ABdFUyJtSczqwAa+qOfwLMZiV5S67IoRYMnvtYUYgq 4nfy4/pK/swKOSCpfZneNp1X+/zi7pr2ueFAR0FnMt+lN+3JjrdluwXNtQQsmeU= =Tcoo -END PGP SIGNATURE- -- 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: Problem with cake 1.2 or not ?
Yeah , and also just because this time it makes more sense to wait for a new version of cake it is a rule. The other opinions about upgrading to 1.3 first are also justified. So some kind of conclusion is that there are no rules on when to upgrade immediately or wait for an even newer version, it depends from case to case. :) All the best Milos On Feb 21, 12:42 am, Miloš Vučinić milosvuci...@gmail.com wrote: Sorry for not answering sooner, I got some flue so I wasn't really turning my computer on :) Break time :) I just wanted to say thank you for the support , I really appreciate all of the information and advices you gave me. I guess I can wait then because there is no current emergency for upgrading and also after this business year there is probably going to be need for a lot of changes and upgrades and having that in mind it wouldn't be bad to start it in 2.0 than to make it first for 1.3 and then all the same for 2.0 again. Thanks On Feb 18, 3:24 pm, Alejandro Gómez Fernández agom...@gmail.com wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Several years ago we neded to upgrade our management system from oracle 8 when oracle release the version 10. Our provider insists us for migrate to oracle 9 and then to 10. After a long analisys the systems engineers decide to migrate to oracle 10 because the process will be shorter. And it was fine and whe we finish the upgrade, oracle 10 was mostly very stable. This case seems pretty equal to me. Ryan's advice is the most recommended for almost every case. What Ryan says have the most sense if you need to do a seamless upgrade for whatever other reason. Remember, just like Ryans says, a production site will not be based in development versions of framework, database, etc. But if you make re-engineering to your site, this will take time and when you finish the 2.0 framework wil be stable. Or you can wait until this happend. If you upgrade to 1.3 and then again to 2.0 when there is no need to do, it's to make the work two times. Even more, you can add new features just like in any other software version upgrade and no only migrate the framework version. I think it's no needed to do the update now, because you want to upgrade for fear to PHP hosting can be changed to higher version and then the website will no work. This will not happpend in the short time, because php 5.3 it's now the top standard (php it's releasing yet 5.2.x versions) so your production website made with cakephp 1.2 will just work fine for several more months. Obviously, it's highly probable that there are no guide to do the upgrade from 1.2 to 2.0 Regards, Alejandro. El 18/02/2011 01:23, Ryan Schmidt escribi : On Feb 17, 2011, at 21:41, Alejandro G mez Fern ndez wrote: In case you want to upgrade cake to the most recent version I think you must see cake 2.0. It's a development version, but more or less, when you finish your migration it will be a production version. To change to an 1.3.x has no sense to me. Upgrading a production site to the development version of CakePHP that will become 2.0 makes no sense. The final version 2.0 is not released yet, and the developers have provided no guidance on when it will be completed. It might be tomorrow, it might be next year. In the mean time, you might run into issues, the response to which will generally be it's a development version, it's expected to have unresolved problems, go use the stable version. There is a published guide explaining how to upgrade a 1.2 site to 1.3. When 2.0 is released, I would expect there to be a guide explaining how to upgrade a site from 1.3 to 2.0. I would not, however, expect there to be a guide on how to upgrade from 1.2 directly to 2.0; users would be expected to have already upgraded to 1.3. Therefore it makes a great amount of sense to upgrade your 1.2 site to 1.3 now, verify that you've followed the existing upgrade guide properly and that everything works, and publish your site with 1.3, and then, whenever 2.0 does come out, you can tackle that upgrade then. -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (MingW32) Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJNXoELAAoJEHQn9CmeN9DJsmwH/0hKu+83Fb7FxtFNIvpYEocm R+/jrMJCmwWWZMSoLOzF+aXH2fqcJd5evtMag4ErqjjFMIPrS/7JOZIrOM/P6dPK kM672hL/WKTNvzxOPsXx/ywq9ydGHUBz3NM5i23DRP+PDCWoucIfgceZpFuTG2+H AMRHmA/QIVg/zpLP3zzcqtW+eUcDDomUjOFRCVj2NDw6ReHCYh/hkcI4LED0tAX9 PSLPGrOVH6KodySzx+Os3/ABdFUyJtSczqwAa+qOfwLMZiV5S67IoRYMnvtYUYgq 4nfy4/pK/swKOSCpfZneNp1X+/zi7pr2ueFAR0FnMt+lN+3JjrdluwXNtQQsmeU= =Tcoo -END PGP SIGNATURE- -- 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
Re: Problem with cake 1.2 or not ?
Thank you guys , you have really helped !!! I apologize for not answering sooner because I was busy fixing this issue and now is OK. You confirmed what i suspected and that is that this hosting was not good enough. It had mysql timeout for just 10 sec's and basically when web site needed to make cache to all 35 tables it always got an error. This was not cakephp error. On godaddy's most cheap hosting it works OK , as well as on one other dedicated server which host around 50 websites from my friend who gave me a test account to see if it works out. I hope this thread will also help somebody else having same issue. I would like to ask now for an opinion because I am not so experienced in cakephp programming. So this web site now works fine with cake 1.2 , I may have to update a thing or two but in general it is OK. Would you suggest an upgrade to the most recent version, or do you think it is not necessary. My fear is that at some point, PHP hosting can be changed to higher version and that out of a blue the website will not work. Is my fear justified or am I just talking nonsense ? Thank you kindly for your help ! All the best Milos On Feb 17, 1:40 pm, cricket zijn.digi...@gmail.com wrote: On Wed, Feb 16, 2011 at 1:03 PM, Miloš Vučinić milosvuci...@gmail.com wrote: Now, from time to time i get the warining: Warning (512): SQL Error: 2006: MySQL server has gone away [CORE/cake/libs/model/datasources/ dbo_source.php, line 525] This is not a Cake issue. It may appear to be because it mentions dbo_source.php but that's simply passing on the message as reported by MySQL. Use google to search Error: 2006: MySQL server has gone away. You should contact your hosting company about it. -- 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
Problem with cake 1.2 or not ?
Hi guys, I am a little bit desperate. My hositng house moved to php 5.3 but my web site is on cake php 1.2 made for earlier php versions. My bad luck is that at the very same moment we added shopping cart to the web site when the hosting house changed to php 5.3 and made some restrictions about usage of hosting (shared hosting usage). Now, from time to time i get the warining: Warning (512): SQL Error: 2006: MySQL server has gone away [CORE/cake/libs/model/datasources/ dbo_source.php, line 525] and web site doesn't work with mysql unless it already has cashed content. The rest just doesn't work... Do you think it's a bad hosting or is it possible that cake 1.2 just can't work anymore on new php servers. Also is there a way to upgrade your cms form 1.2 to 1.3 and what would be the steps ? Thanks guys ! -- 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: Cannot modify header information
Which version of cake are you using ? If 1.2.* go to controller.php and delete empty line at the end as well as any other space or hidden characters you might have. Even if you are using some other version check for this. At 99.999 times, this error means you have some empty line or hidden character at the end of your file (behind php?). The best way to do this is to download notepad ++ and open files in it because it has option to view hidden characters as well. Hope this helps, all the best Milos Vucinic On Feb 12, 11:08 am, tubiz tayi...@gmail.com wrote: PLease presently i am testing my cakephp application online but when i tried to visit my admin page at testserver.tunsicash.co.cc/admin i am getting this error Cannot modify header information - headers already sent by (output started at /home/tunsicas/public_html/testserver/app/ models/behaviors/increment Please you can visit the link and check as well would like to know how i can overcome this problem. 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
Re: Blank screen except these characters: dispatch(); }
I had similar issues, not the same so I hope this will help. My web server was overloaded by my activity, because we downloaded and uploaded files for some 6 hours, and we got a sort of a ban on server. It caused bad caching, so I had similar issues, errors for which it took me a long time to understand what are they about. Also, cake was unable to access all of the files on server, so I even had errors like Debugger class not found etc.. You should email and if possible call your hosting company and ask them to reset your status and give you percentage of your server usage. Also, see if you have some part of your code which would cause lot's of SQL queries , or if you are caching something that is not really meant to be cached. For the end, 2 dumb things, but they help sometimes. Make permissions for all sub directories and files in your tmp folder as well as for log files. And also, make sure that you have just one copy of core.php file or some other settings file, because we had a case when we accidentally copied these to more directories and had half of the web site was down. hope this helps, all the best ! Milos Vucinic On Feb 10, 3:36 pm, Ryan Schmidt google-2...@ryandesign.com wrote: On Feb 10, 2011, at 12:07, zzella wrote: Update: When I view the source of the screen, I see the contents of the app/webroot/index.php file! Everything seems to be an invisible comment until it hits the of this line: $Dispatcher-dispatch(); Everything in the file after the appears on the browser screen (ie dispatch(); } ) Would appreciate any ideas on why my page is getting served like this occasionally? Goodness, it sounds like your web server is occasionally forgetting to invoke the PHP interpreter, and is sending the PHP code directly to the browser. I would say that is rather wrong. What web server and version is this, what PHP version and SAPI (apache2, fastcgi, fpm), what OS and version? -- 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
Question about migration from cake 1.2 to 1.3
Hi guys, I need an advice regarding the migration from cake 1.2 to 1.3. I am on project for one web site which was developed in cake 1.2 . I see there is a lot of depraciated errors and I'm wondering if it is possible to migrate having in mind that I am not original author of the web site. The web site is curently working, but I can never know when is the next version of php going to come out (and be updated at the hosting house of the web site) and what changes it will bring so the web site might stop to work . Can somebody give me advice on how should this be done. Maybe somebody who tried someting like this before. What should be the steps for migration .. Should I replace all cake's liberaries or just the ones written in php migration page. Thank you in advance! All the best, Miloš Vučinić -- 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: Paginate page 2+ not working
I believe it is because you put the condition ino paginate but you haven't rewrited the count method. There is an example of this in the cook book , I think the link is this one : http://book.cakephp.org/view/1237/Custom-Query-Pagination . There is one important notice for you here. I had an issue where I needed two diffrent paginations for the same model element, and the problem is, you can rewrite the count function only for one (because you rewrite it to meet your condition). The problem is , how to make count function for multiple conditions such as, show me only published posts, or show all posts if I am logged in as admin in order to publish some posts. Those are 2 different paginations, but I can have only one count function. The solution to this is to make a global variable (i tried to pass an argument to the rewrited count function, but it didn't work for some reason, it may be my mistake) and set it each time before you call your pagination. You put an if clause in the count function, and then if condition one is true, then you return one count value based on that condition (e.g number of all published posts), and if the condition two is true then you return some other value for the count (e.g. I am a administrator, I should see all of the posts, so for the count of pagination my view needs to get the total number of all posts). Hope it helps On Sep 2, 5:24 pm, Michael Gaiser mjgai...@gmail.com wrote: So, I have been trying to get this paginate feature working and I can get the first page properly, but when it returns the 2nd page, the query is empty. Anyone see anything wrong? I suspect it has something to do with the $searchStr arg but am unsure how to get around not having an arg in that function. Thanks. ~Michael function index($searchStr = null) { $results = array(); //Use the searchStr if there is no data. if(empty($this-data) $searchStr != null) { $this-data['autoComplete'] = $searchStr; $this-data['Location']['constrainType'] = -1; } if (!empty($this-data)) { $autoCompleteStr = ''; if($this-data['autoComplete'] != '**') { $autoCompleteStr = $this-data['autoComplete']; } $locationType = $this-data['Location']['constrainType'] - 1; if ($locationType 0) $locationType = %; $this-paginate = array( 'limit'=10, 'contain' =array('ParentLocation.name', 'ParentLocation.type', 'ParentLocation.id', 'ConfirmedUser.username'), 'fields'=array('Location.id', 'Location.name', 'Location.type', 'Location.parent_id', 'Location.longitude', 'Location.latitude', 'Location.confirmed_id'), 'order'=array('Location.name ASC') ); $searchOptions = array('Location.name LIKE' = $autoCompleteStr.'%', 'Location.type' = $locationType); switch($this-data['Location']['adminConstrainType']){ case 0: default: break; case 1: //Non Confirmed $adminCondition = array('Location.confirmed_id' = null); $searchOptions = array_merge($searchOptions, $adminCondition); break; case 2: //Confirmed $adminCondition = array('Location.confirmed_id ' = null); $searchOptions = array_merge($searchOptions, $adminCondition); break; } $results = $this-paginate('Location', $searchOptions); $this-set('locations', $results); debug($results); } $this-set('constrainTypes', $this-__getConstrainTypes()); $this-set('autocomplete', $this-data['autoComplete']); $this-set('adminContrainTypes', $this-__getAdminContrainTypes()); } Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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 For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Undefined variable in view
It might be that your variable is a value of null. Try to put php code in your view which checks if that variable is null or not, and then try to echo it... On Sep 2, 4:05 pm, Richard richard_j...@hotmail.com wrote: Hello all, somehow I can't get the pagescontroller to pass a variable to the view. I have in my pages_controller.php: class PagesController extends AppController { //some code cut out for better reading here var $uses = array('Category'); function display() { //some code cut out for better reading here $this-set('categories', $this-Category-find('list')); } And in my home.ctp I use just this: ?php echo $categories; ? This returns: Undefined variable: categories (from the debug info I can see that PagesController-display() is used) When using debug($this-viewVars); I get this: Array ( [page] = home [subpage] = [title_for_layout] = Home ) Can somebody give me advise on what to do? Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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 For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Ajax Pagination - rearrange pages after item deleting
I think you should refresh your view and then the pagiation should be set as it is supposed to be. I do not have much experience in Ajax so I can't really advise you better on how to make your own paginaton .. On Sep 2, 4:36 pm, Mariano C. mariano.calan...@gmail.com wrote: Suppose to have 3 page, I delete an object from page 2, so I would take the first element from page 3 and use it as last element of page 2, and so on... There's an article or tutorial to explain that? Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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 For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Pagination across controllers
I found one interesting solution to manage everything you need in Pagination.. basicaly, it is all cake. I had an issue, for example, I had to make two different paginations, depending on which page are you looking for the same model (admin or regular user). In pagination var, you can set everything you want, from order for pagination to condition for which ones to show (my e.g , post must be published by admin in order to be viewed by a regular user on the comments page. So I have admin view and regular index for posts). There is only one problem left, and that is count ! No mater what condition you take, cake's pagination will always show you count for all of the database entries and then you can throw away your code. You have to rewrite pagination count function in order to make it work, but then the other one will not work. So I just rewrited the pagination funciton and made one paramter that it receive. I made it a global variable in app controller to make it visible no matter what, because for some reason if I just added param to function it didn't work. So i set it globaly for 1 if I want the first count and for 2 if I want the other one (depending on how i have set var paginations condition) and it is all. Let me know if you need thew source code... On Aug 20, 5:19 pm, Philip Thompson philthath...@gmail.com wrote: Hi all. I've done plenty of searching and been unable to find a solution yet. I'm also fairly new to Cake, but not to PHP. I have ajax pagination working from the currently-view controller/model. However, if I attempt to paginate a list that comes from a different model/controller, I only get 1 result. From Hardware, I get a properly paginated list of hardware items. Hardware has a belongsTo relationship to HardwareType and Location. From Location, I want to include a paginated list of hardware items. If I call the same method from LocationsController as I do in HardwaresController, I only get 1 result. ?php class HardwaresController extends AppController { public $components = array('RequestHandler'); public $helpers = array('Js'=array('Mootools')); public $paginate = array( 'Hardware' = array( 'limit' = 3, 'order' = array( 'Hardware.name' = 'ASC' ), ), ); public function index () { $this-set('hardware', $this-listing()); // This works as expected } public function listing () { return $this-paginate('Hardware'); } } class LocationsController extends AppController { ... public function view ($id) { ... App::import('Controller', 'Hardwares'); $Hardwares = new HardwaresController; $Hardwares-constructClasses(); $this-set('hardwares', $Hardwares-listing()); // This is only 1 result } } class Hardware extends AppModel { public $name = 'Hardware'; public $belongsTo = array('HardwareType', 'Location'); public $order = array('Hardware.name ASC'); ...} ? Can anyone explain why I'm only getting a single result (which is the actual first result) and/or please provide some assistance on how to resolve the issue? Thanks in advance. ~Philip http://lonestarlightandsound.com/ innerHTML is a string. The DOM is not a string, it's a hierarchal object structure. Shoving a string into an object is impure and similar to wrapping a spaghetti noodle around an orange and calling it lunch. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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 For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
meioupload sql error
Hi, I am new to this group and to cake so I appologise if I asked already asked question. I have cake 1.3.3 and meio_upload isn't working for me. I get an error when I try to upload files : Notice (8): Array to string conversion [CORE\cake\libs\model \datasources\dbo_source.php, line 746] Warning (512): SQL Error: 1054: Unknown column 'Array' in 'field list' [CORE\cake\libs\model\datasources\dbo_source.php, line 681] Query: INSERT INTO `modelgs` (`image`, `modified`, `created`) VALUES (Array, '2010-08-10 10:16:23', '2010-08-10 10:16:23') I tried evrything, and after some examination, I realizes that even if I delete the update_meio.php from my behavior folder, that I still get the same message, as if I never included it in my acts_as variable. Can someone please help ? Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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 For more options, visit this group at http://groups.google.com/group/cake-php?hl=en