Re: Multiple CakePHP sites, one system

2012-04-11 Thread Dr. Loboto
Try to set different session cookie name for each of your sites. And check other settings here: http://book.cakephp.org/2.0/en/development/sessions.html On 11 апр, 20:59, Joey Mukherjee joe...@gmail.com wrote: I have several CakePHP sites on a single system all with different databases and

Re: Site wide settings with Configure::write and read

2012-04-11 Thread Dr. Loboto
AppController:        function beforeFilter() {               //Loading model on the fly               $this-loadModel('Setting');               //Fetching All params         Configure::write('settings', $this-Setting- find('list', array ('fields' = array ('Setting.name',

Re: Am i breaking MVC?

2011-10-19 Thread Dr. Loboto
New model for this task is good way to go. Simple and clean. And extendable easier in case if data import become more tricky then now. On 19 окт, 21:52, Ernesto e.fanz...@gmail.com wrote: Hi all. i have a simple app wich uses 2 different DBs. The second DB is used just to import data on a

Re: redirects or exceptions?

2011-10-18 Thread Dr. Loboto
From my point redirect is always bad in case of not found record. Without 404 status no engine will know that URL is invalid. I personally did redirects with 404 status on one project, but never thought is it valid from HTTP perspective or not. Hope that customization of NotFoundException allows

Re: Translate model validation question

2011-10-13 Thread Dr. Loboto
http://book.cakephp.org/view/1230/Localization-in-CakePHP Reload invalidate() method. On 13 окт, 18:38, heohni heidi.anselstet...@consultingteam.de wrote: Hi, I have this in my app_model.php public $validate = array();     public function __construct($id = false, $table = null, $ds =

Re: ckaephp 2.0 using Configure::read in model construct method

2011-09-11 Thread Dr. Loboto
If Configure::read() outputs right value, and this is really output from right place, your very first code in this thread is the one you need. My assumption was that you don't get right value by Configure::read() in model constructor because it is not set yet (I explained it before). And this

Re: ckaephp 2.0 using Configure::read in model construct method

2011-09-09 Thread Dr. Loboto
If you write into Configure in AppController::beforeFiler() it happens after models creation in most cases (at least prior Cake 2.0). So you better create some init function in model for this and call it manually after Configure set. In init function re-attach behavior with new params because

Re: Clone Site Error

2011-09-04 Thread Dr. Loboto
Clear caches at /app/tmp - it's first that should be done on clone. Look at site code - is there any hardcoded file path or URL of site? Any of this can create hidden infinite loop as Jeremy suspected. On 4 сен, 13:09, Krissy Masters naked.cake.ba...@gmail.com wrote: On site 1 (no problem /

Re: Using GET not POST returns empty $this-data

2011-09-02 Thread Dr. Loboto
With GET request your data goes to $this-params['url'] On 31 авг, 21:11, Thomas thomas...@gmail.com wrote: I am trying to make a very simple link up between an android app (appinventor) and a standard cake app.  I have created the blog tutorial and it all works great.  I can make my app link

Re: Fatal Error

2011-08-23 Thread Dr. Loboto
You do not have MySQL driver named mysql installed but demand it in databases.php On 22 авг, 19:37, Shervin kapil shervinka...@nasoindia.com wrote: Hi,     when running my source code following Fatal error is displaying. Fatal error: Call to undefined function mysql_query() in D:

Re: debug level on ajax request

2011-08-22 Thread Dr. Loboto
The best way is to fix that warnings and notices. Good app never throws this kind of shit. On 18 авг, 20:18, p r perab...@googlemail.com wrote: yes the Requesthandler is in use and the debug level is set correctly to 0 but errors and notices doesn't care. It seems the backtrace is added before

Re: Missing Database Table

2011-08-16 Thread Dr. Loboto
Did you correct database name in database.php ? Cake says table not found also in case of not found database. On 15 авг, 18:47, culp alan.culp...@googlemail.com wrote: Hello, I'm new to cake so please bear with me here. I've set up an application locally, tested it and all runs fine.  I've

Re: Using SELECT... FOR UPDATE in cakephp

2011-08-12 Thread Dr. Loboto
Start transaction, select, save, close transaction. Something like this: $DS = $this-getDataSource(); $DS-begin(); $this-find(...); if ($this-save(...)) { $DS-commit(); } else { $DS-rollback(); } On 11 авг, 00:10, Teddy Zeenny teddyzee...@gmail.com wrote: Hi, Is there a way in cakephp

Re: Validation!

2011-08-01 Thread Dr. Loboto
All as euromark said, but use http://www.php.net/manual/en/function.parse-url.php function for correct URL split into pieces. On Jul 30, 7:19 pm, euromark dereurom...@googlemail.com wrote: I use a custom validation rule which completes the schema and maks the url always the same (adding

Re: CAKEPHP Group by problem in paginate..

2011-07-24 Thread Dr. Loboto
1. You should use or GROUP BY or DISTINCT; 2. DISTINCT works for whole row, not particular field there. Your whole row includes ID which is unique; 3. When you have LIMIT you get not more then this number of values. So only first 12 values is absolutely correct behavior as you noted LIMIT 12

Re: Internationalizing Validation Rules Messages in 2.0

2011-07-24 Thread Dr. Loboto
http://book.cakephp.org/view/1230/Localization-in-CakePHP - last 2 code blocks On Jul 24, 10:58 pm, Javier javier.iba...@gmail.com wrote: Hi, What is the recommended approach to internationalize validation error messages in 2.0? Thanks, -Javier -- Our newest site for the community:

Re: utf8 in bake

2011-07-22 Thread Dr. Loboto
I barely understand what are you talking about but can say one major thing: there should NO be BOM mark in ANY file. For PHP it's just data outside code and it will be outputed. Output of this excess character cause not set headers and doctype ignorance in some browsers. If you so worry about

Re: CakePHP Pages Occasionally Losing Layout - Please Help!

2011-07-22 Thread Dr. Loboto
I saw such behavior without caching - it will happen if fatal error occurs after (or during) content render but before layout render. Every once in a while behavior I got with execution time limit exceeded because of too heavy load on dev server - this is fatal error too. Don't know can this help

Re: Is there a time out for shells?

2011-07-15 Thread Dr. Loboto
PHP can crash without error. I had this in case of memory run out and in case of undefined static method call. Both cases were discovered by XDebug logs with same symptoms - suddenly starts Cake error handle and exit procedure. When look into your code where crash starts it happens just before

Re: cacheQueries and memory usage

2011-07-09 Thread Dr. Loboto
You right, no any visible source for memory leak. Hope Cake team see this your post. On 8 июл, 15:40, DanielMedia danielmedi...@gmail.com wrote: To test I just added a fresh install of CakePHP to a completely different server. I created a sample table with the following structure: CREATE

Re: How to use Router::connect and a anchor?

2011-07-07 Thread Dr. Loboto
Much better use standard feature: $html-link( __('Our Partners', true), array( 'controller' = 'pages', 'action' = 'display', 'partner', '#' = 'slide1' ) ) On 4 июл, 10:41, heohni heidi.anselstet...@consultingteam.de wrote: Great!Great!Great

Re: cacheQueries and memory usage

2011-07-07 Thread Dr. Loboto
Two more things can cause memory consumption: callbacks and associations. Both are not in act when use query() method. I personally used both find() and save() in same circumstances and had no problem. However, there was cacheQueries turned off in AppModel and no associations at all plus callbacks

Re: Render

2011-06-28 Thread Dr. Loboto
Just do not redirect in view. Redirection must be done in controller. On Jun 25, 3:16 am, Prabha Vathi prabha.ridd...@gmail.com wrote: Hi, I have two actions in post controller view and random in random i render view action. But in view action i check the id for empty. If it is empty then

Re: Accessing controller from view/ element

2011-06-19 Thread Dr. Loboto
Retrieve it in controller and set to view. Do it at beforeRender(), for example. On Jun 18, 12:39 pm, thom cyber.phanto...@gmail.com wrote: I'd like to create a header that contain data from database. But I'm stucked at how to load the data from the database. I already tried requestAction, but

Re: Working with a DB without Cake Convention

2011-06-15 Thread Dr. Loboto
Model: class Availability extends AppModel { var $name = 'Availability'; var $useTable = 'bform'; function something() { return $this-find('list', array ('fields' = array ('row1', 'row2_E'))); } } In controller: function index() { $this-set('bform',

Re: How get the database name from a Model?

2011-06-15 Thread Dr. Loboto
$databaseName = $this-getDataSource()-config['database']; On 16 июн, 00:06, Celso cels...@gmail.com wrote: Hi ! How get the database name from a Model? Because the $useDbConfig returns only the name of config.. thanks, celso -- Our newest site for the community: CakePHP Video Tutorials

Re: Load models without model files

2011-06-15 Thread Dr. Loboto
Make stub model with $useTable = false, load it, then call $this- setSource('table_name') on it. Or list all static models in AppModel, overwrite __construct() there and set $useTable to false there for any not listed name. On 16 июн, 02:49, qua...@gmail.com qua...@gmail.com wrote: Hi, I have

Re: app_controller overwriting title_for_layout variable

2011-06-09 Thread Dr. Loboto
The way to set this var from controller is $this-pageTitle = 'My own title'; Cake set this value as $title_for_layout itself. On Jun 9, 3:08 am, mandar man...@wealthbird.com wrote: Hi, Im setting title_for_layout in one my Site controllers index() function but when page is viewed title comes

Re: Problem with find condition, not getting the updated data.

2011-06-09 Thread Dr. Loboto
Please show your save call. On Jun 9, 1:23 pm, Guru guru.ur.heartb...@gmail.com wrote: Hello Everyone,     I'm facing a very strange problem with find query. In a function I'm calling find query(assume query as A) initially on a condition, this fetches that data accurately and I'm updating

Re: Connect to multiple databases dynamically

2011-06-08 Thread Dr. Loboto
You can create connection config dynamically with ConnectionManager::create($name, $config) call. $name is name of your new config (used in $this-useDbConfig) and $config is array of same structure as in DATABASE_CONFIG class. First you create new connection config, then in target model you must

Re: SEND EMAIL FUNCTION INSIDE CONTROLLER

2011-06-08 Thread Dr. Loboto
Remove configure::write('debug', 0); from your mail function and see actual error. On Jun 7, 7:08 pm, andreguerreiro85 andreguerreir...@gmail.com wrote: Hi there, i'm having a problem calling a function to send email inside another function in a controller. i'm calling the function here on

Re: SEND EMAIL FUNCTION INSIDE CONTROLLER

2011-06-08 Thread Dr. Loboto
The blank page is because of $this-autoRender = false; and no redirect to other page (which won't work anyway while there is error). The error looks like PHPMailer one. Check file C:\xampp\htdocs\pcg_servidor\vendors \PHPMailer_v5.0.2\class.phpmailer.php at line 1 053 for conditions that give

Re: Editing ID

2011-05-26 Thread Dr. Loboto
If you want to update ID of record you must use saveField() or updateAll() method. Cake checks if record exists to determine if INSERT of UPDATE query is needed for save() or saveAll() call. New ID in data takes precedence over ID you set directly. So Cake don't find record with new ID and

Re: Set::extract on an array containing one element

2011-05-05 Thread Dr. Loboto
and now everything seems to work. Still, it's strange that when I add another element with random key, it's now working. Anyway, I'll find an alternative for my ids. Thanks for the reply. On 4 mai, 08:01, Dr. Loboto drlob...@gmail.com wrote: Set::extract(/Some/thing, $data) assumes

Re: Set::extract on an array containing one element

2011-05-05 Thread Dr. Loboto
for my ids. Thanks for the reply. On 4 mai, 08:01, Dr. Loboto drlob...@gmail.com wrote: Set::extract(/Some/thing, $data) assumes that you have true list - array with numeric keys 0, 1, 2, ... - but not an associative array with keys some, thing, ... or 4, 2, 15, ... If you call

Re: Set::extract on an array containing one element

2011-05-04 Thread Dr. Loboto
Set::extract(/Some/thing, $data) assumes that you have true list - array with numeric keys 0, 1, 2, ... - but not an associative array with keys some, thing, ... or 4, 2, 15, ... If you call it as Set::extract(/Some/thing, array_values($data)) when $data is associative array it will pass. On 3

Re: Slow connection to Data base

2011-04-26 Thread Dr. Loboto
http://dev.mysql.com/doc/refman/5.1/en/server-options.html#option_mysqld_skip-name-resolve On Apr 26, 8:12 pm, Hartmann diogo...@gmail.com wrote: Hello everybody! I've installed and configured cake 1.3.8 on an Ubunutu Server 10.10 all right. Before configuring the database, the cake home

Re: Memory Leak in Model::Save()

2011-04-10 Thread Dr. Loboto
With debug 2 and cacheQueries = false nothing is saved and this source of leaks is eliminated. On Apr 9, 2:01 am, Ryan Schmidt google-2...@ryandesign.com wrote: On Apr 8, 2011, at 07:18, ProFire wrote: Well, whether it's memory leaks or not, I'm experiencing a memory exhaustion.

Re: Model class not found

2011-04-07 Thread Dr. Loboto
?php class Tag extends AppModel { $name = 'Tag'; } ? On Apr 7, 9:35 pm, abhimanyu bv vmabhi...@gmail.com wrote: lass Tag extends AppModel { $name = 'Tag'; } Fatal error: Class 'Tag' not found in /home/downtown/public_html/test_cake/cake/libs/ class_registry.php on line 140 in

Re: Non-existent data source

2011-04-05 Thread Dr. Loboto
Confirm that file you edit is named app/model/post.php (strictly lowercased, no spaces) Confirm that class name in that file is Post (and nothing else) and extends AppModel class Your problem now after '$blog' to 'blog' fix is that model is not loaded. On Apr 6, 1:06 am, prasad gaddai

Re: Datasource schemas defined into models

2011-03-31 Thread Dr. Loboto
would like to have others' opinion before to make a pull request. Please let me know if I missed something in that description. On 30 mar, 04:43, Dr. Loboto drlob...@gmail.com wrote: Model have schema() method which call describe() method of data source if supported. For manual per

Re: Datasource schemas defined into models

2011-03-29 Thread Dr. Loboto
Model have schema() method which call describe() method of data source if supported. For manual per-model schemas you can override its schema() method. For datasource-managed schemas you should take a look into its describe() method. On 29 мар, 03:50, Clément Hallet clem...@challet.eu wrote:

Re: How to load content on a specific area of the page with ajax

2011-03-13 Thread Dr. Loboto
You should include prototype.js lib yourself as said on http://book.cakephp.org/#!/view/1358/AJAX On Mar 13, 5:39 am, Chris theswimmingf...@gmail.com wrote: I have a single post I want to load for my website. I made a controller function         function homeview(){        

Re: requestAction question

2011-02-27 Thread Dr. Loboto
just left it out to not complicate thing even more Hope that gives you a better idea. Thanks. K -Original Message- From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of Dr. Loboto Sent: Friday, February 25, 2011 11:25 AM To: CakePHP Subject: Re

Re: requestAction question

2011-02-25 Thread Dr. Loboto
Now I don't understand what do you need. Change other part of page when load something by AJAX? Just make other AJAX request to update this part too. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site

Re: Folders inside img/

2011-02-24 Thread Dr. Loboto
Wrong filename/path. Cake catches all requests to non-existent files. On 23 фев, 17:51, Aleksandr (cligs.ee) aleksandr.losse...@gmail.com wrote: I created a folder cropped_images inside img folder and uploaded my photos there. But when I try to open them in the browser, Apache decides to

Re: requestAction question

2011-02-24 Thread Dr. Loboto
Based on your description I do not see need in requestAction at all. If all you need is 1 model call and one element output you can add data call to appropriate actions or beforeFilter/beforeRender and add element output to the view/layout. Just one more line of code in comparison with

Re: Missing Database Table

2011-02-18 Thread Dr. Loboto
If all tables seems missing there are several possibilities: 1. App cannot cannot connect to DB (unfortunately Cake do not have separate error message for this case); 2. You select wrong database; 3. MySQL users rights are messed and you can connect, choose DB, but cannot select from tables

Re: Problem with loadModel and afterSave

2011-02-17 Thread Dr. Loboto
Does it really loads this model? Simplest check is by class name: pr(get_class($this-Setting)); On 17 фев, 15:36, pablosky pablo00...@hotmail.com wrote: Hello. I have a controller that using another model . And save some data: $this-loadModel('Setting');

Re: Behaviour? Plugin?

2011-02-07 Thread Dr. Loboto
Definitely not plugin. Maybe behavior with afterSave callback. On 7 фев, 07:52, Krissy Masters naked.cake.ba...@gmail.com wrote: I have not started so I have no code to show, but rather a question to point me in the right direction. Location hasMany Attractions Location hasMany Hotels

Re: Logging of PHP fatal errors not working

2011-02-03 Thread Dr. Loboto
Cake's logging settings can work only when Cake is working. If PHP dies on parse error it just don't reach Cake setup code at all. Same about fatal error before Cake sets own log. Etc. You better read PHP docs before blame Cake ones. -- Our newest site for the community: CakePHP Video Tutorials

Re: Problem with copeied folder

2011-01-22 Thread Dr. Loboto
You must clear caches on copying. On 22 янв, 13:07, Gopinath T.M gopi4bre...@gmail.com wrote: i am working cakephp application. that folder name(application foldername) - sample This is orginal url of application -http://prog.appps.com/sample i like to maintain this application also

Re: Auth flash errors appearing in IE when not expected

2011-01-21 Thread Dr. Loboto
such as this. On Jan 21, 4:14 am, Dr. Loboto drlob...@gmail.com wrote: Of course it will have negative effect. More requests to server, less immediate pages for users. But in many cases you cannot avoid it. IE (at least 6-7) have another negative effect of caching. Imagine

Re: Cache code with APC

2011-01-20 Thread Dr. Loboto
APC caches code automatically if opcode cache is enabled there. It is by default. If you want to use APC as data cache with Cake you must setup Cake cache (example exists in config). It will be user cache for APC. On Jan 20, 11:23 am, Dave Maharaj m...@davemaharaj.com wrote: How do you cache the

Re: Auth flash errors appearing in IE when not expected

2011-01-20 Thread Dr. Loboto
Of course it will have negative effect. More requests to server, less immediate pages for users. But in many cases you cannot avoid it. IE (at least 6-7) have another negative effect of caching. Imagine that you have tabbed page where tabs are loaded with AJAX. And main tab have absolutely same

Re: Changing /webroot and /views directories

2011-01-18 Thread Dr. Loboto
Original is hidden deep in structure. 1.2 doc: http://book.cakephp.org/view/36/Additional-Class-Paths 1.3 doc: http://book.cakephp.org/view/916/Additional-Class-Paths On Jan 18, 7:03 pm, DragonFlyEye dragonflyey...@gmail.com wrote: Ah! Thank you, Mr. Loboto! Hmm... Really seems like that

Re: Changing /webroot and /views directories

2011-01-17 Thread Dr. Loboto
http://book.cakephp.org/view/1568/Configuration-and-application-bootstrapping On 17 янв, 23:17, DragonFlyEye dragonflyey...@gmail.com wrote: Because I am setting up a core web engine that will drive a number of different sites for my company, it makes sense to me to change the location of the

Re: CakePHP 1.3 : language routing through url ?

2011-01-14 Thread Dr. Loboto
domain. On Jan 14, 2:44 pm, Erik_V e...@cobradesign.be wrote: Dr Loboto, Thank you; your suggestion is exactly what I've been using upto now. This seems this has one serious drawback: I have to add a $this-params['language'] to each cake generated link. It breaks the automagically generated

Re: CakePHP 1.3 : language routing through url ?

2011-01-13 Thread Dr. Loboto
Something like this I think: Router::connect( array('/:lang/:controller/:action/*'), array(), array('lang' = 'en|fr') ); Router::connect( array('/:lang/:controller'), array('action' = 'index'), array('lang' = 'en|fr') ); Standard routes with language. Plus check

Re: newbie question on custom function

2011-01-13 Thread Dr. Loboto
You can just define your utils functions as functions in bootstrap.php and they will be always accessible without create component overhead and use in controller only restriction. On Jan 13, 2:54 pm, roy roy...@gmail.com wrote: I am new to cakephp and i have go through those tutorials. May be I

Re: setflash edit

2011-01-12 Thread Dr. Loboto
You see page cached by browser when hit previous button there. Disable cache at all by $this-disableCache() in controller, or do not use previous button. On 13 янв, 02:14, lvdb lj.vandenb...@kpnplanet.nl wrote: Hello Amit, Thank you for your reply. I will try to explain it First I am

Re: Clueless...Help please

2011-01-10 Thread Dr. Loboto
Check error logs. And/or turn debug on and go to page to see actual errors. On Jan 10, 8:13 pm, javier0051 javier.ange...@gmail.com wrote: Hi I am a completely newbie to cake php. A new customer has a site developed with cake php and we recently moved the site to one of our boxes but we

Re: Complex LIKE Conditions in CakePHP

2010-12-23 Thread Dr. Loboto
array( array('Product.short_description LIKE' = %_ $plural _%), array('Product.short_description LIKE' = %_ $singular _%) ) On 22 дек, 18:35, Christopher Geheran cgehe...@gmail.com wrote: So, I am attempting to have multiple like conditions on the same field, as follows, and Im sending this

Re: Why unbind directive doesn't works on read function?

2010-12-11 Thread Dr. Loboto
Because unbind works only for one next query but you do two reads. On Dec 11, 6:21 pm, Mariano C. mariano.calan...@gmail.com wrote: I have two function getBasicInfo read specific book's information through $book_id then pass the record readed to increaseOwners that should upgrade owners field

Re: cakephp - sql injection test always shows failure

2010-12-09 Thread Dr. Loboto
Set debug to 1. With debug=2 you see SQL log and this addon see there strings it sent. On Dec 9, 5:38 pm, Binu bino...@gmail.com wrote: Hi, I have a project developed using cakephp 1.3 and for testing I used SQL Inject me addon (firefox)https://addons.mozilla.org/en-US/firefox/addon/7597/

Re: Model-find('first', ...) returns false on error or empty result

2010-12-07 Thread Dr. Loboto
Sometimes find returns false for not found records and sometimes it returns empty array. At least I saw this in Cake 1.2 empty($records) check will return true for both cases of not found and for SQL error too. Same as simple $records check. On 7 дек, 19:08, euromark dereurom...@googlemail.com

Re: Model-find('first', ...) returns false on error or empty result

2010-12-06 Thread Dr. Loboto
For SQL error you can check $this-Model-getDataSource()-error property. On Dec 7, 7:10 am, qua...@gmail.com qua...@gmail.com wrote: Hi all, It appears Model-find('first', ...) returns false in both cases: 1) SQL error 2) Empty result How am I supposed to know which is which if it behaves

Re: Application specific config

2010-12-06 Thread Dr. Loboto
You can also put it into any new file in config dir and load it: app/config/settings.php : Configure::write('foo', 'bar'); app/config/bootstrap.php : config('settings'); On Dec 7, 6:58 am, cricket zijn.digi...@gmail.com wrote: On Mon, Dec 6, 2010 at 6:18 PM, Kristofer krishop...@gmail.com

Re: CakePHP not load views

2010-12-05 Thread Dr. Loboto
There also can be some error between view render and layout render. For example, execution timeout. In this case only view will be outputed, not wrapped by layout. On Dec 4, 7:39 pm, cricket zijn.digi...@gmail.com wrote: On Fri, Dec 3, 2010 at 3:27 PM, Raul Mangolin e...@raulmangolin.com wrote:

Re: CakePHP 1.3 - RequestHandler-respondAs(js) not working in beforeFilter

2010-12-05 Thread Dr. Loboto
AJAX processing is very strange and called at very strange times. Try to move your logic from beforeFilter() to beforeRender(). If nothing helps you can hack RequestHandler to not re-set Content- Type... On Dec 3, 11:25 am, starchild.no1 starchild@gmail.com wrote: Hi all, I'm doing an ajax

Re: pagination url options

2010-11-25 Thread Dr. Loboto
There is common URL format in Cake: http://book.cakephp.org/view/1448/url You can also check http://api.cakephp.org/class/router#method-Routerurl for more params. On Nov 25, 12:37 pm, Dmitry Shevchenko dmitr...@gmail.com wrote: Thank you Dr. Loboto This is really great fix. - all works

Re: pagination url options

2010-11-23 Thread Dr. Loboto
$paginator-options(array('url' = array('?' = $this- data['Search'])); On 24 ноя, 09:31, Dmitry Shevchenko dmitr...@gmail.com wrote: I found a very bad solution 1. make convert from array to url manually 2. add this to parameters array 3. unset not flat array's in param f.e. $seeking_url =

Re: action redirect not working

2010-11-17 Thread Dr. Loboto
Read FULL error message. It tells where output occurs in the ... part posted by you. On Nov 18, 9:17 am, Briko03 nathanrlar...@gmail.com wrote: I dont have a line 746 anywhere. On Nov 17, 10:16 pm, Briko03 nathanrlar...@gmail.com wrote: Not sure what you mean by that. On Nov

Re: getting a blank page

2010-10-24 Thread Dr. Loboto
NEVER use queries without limit. You just go out of memory. By the way, phpmyadmin SET limit 30. That's why you see there results at all. On Oct 24, 3:34 pm, ravidp ravid.pa...@gmail.com wrote: by the way, if i run this query on phpmyadmin,  it works fine returns about 200,000 results. Check

Re: cakePHP + openID component (cakebaker) + google

2010-10-21 Thread Dr. Loboto
Google needs HTTPS instead of HTTP as MyOpenId. On Oct 22, 1:32 am, Dmitry Shevchenko dmitr...@gmail.com wrote: Hi. I'm trying to run example fromhttp://code.42dh.com/openid/. For regular openID provider like MyOpenid it works fine, but when I'm trying to use it for google

Re: Validation causes memory exhausting

2010-10-14 Thread Dr. Loboto
What validation rules do you use? If there is isUnique, for example, for each check it makes database query, result is saved in memory (if cacheQueries is on) and query string is saved in SQL log (if debug is 2). On Oct 13, 5:15 pm, senser nikolay.engyo...@gmail.com wrote: Hello, I try to save

Re: Getting numeric array keys from query... need model names.

2010-10-06 Thread Dr. Loboto
We had same problem on find queries with MySQL 5.0 and model for view based on UNION query. For a while we lived with check for key, then upgraded MySQL to 5.1 and problem gone. On Oct 5, 9:28 pm, foldiman vi...@vinceallen.com wrote: I'm currently deploying a CakePHP site that works fine in one

Re: cakephp dynamic databases.

2010-10-04 Thread Dr. Loboto
'],                           'database' = $user['User']['dbname'])   ); }* Once the user session is active (User is logged in) switch to the userDb. If needed you can still switch back. (just define the $useDbConfig in the model for when u need either the default or the user db.) Thanks again Dr. Loboto :) 2010

Re: cakephp dynamic databases.

2010-10-04 Thread Dr. Loboto
apreciated. 2010/10/4 Dr. Loboto drlob...@gmail.com Yes, this is something I mean. Just one little suggestion - instantiate model as ClassRegistry::init('User') instead of App::import() and new User(). As only in this case model will be fully initialized. On Oct 4, 2:44 am, Jos Gerrits

Re: Best way to handle sub-tabs

2010-10-04 Thread Dr. Loboto
Just check AJAX in view as $this-params['isAjax'] and output full view or only subtab element, that's all the difference. Same you can check in controller. On 5 окт, 01:48, Joey Mukherjee joe...@gmail.com wrote: It is different since the subtab is updated by Ajax.  At least that's what I think.

Re: HTML Purifier or Sanitize core library

2010-10-04 Thread Dr. Loboto
Don't know about that component. We implemented behavior that repair and sanitize user HTML with HTML Purifier library before save to DB. In this case expensive purifing is done only once, on save, instead of every time, on view. On 5 окт, 00:02, Loic Duros loic.du...@gmail.com wrote: Hello,

Re: unbind USER model inside the USER controller

2010-10-04 Thread Dr. Loboto
Pagination consist of 2 queries - count and retrieve ones. So you need to call $this-Book-unbindModel('User', false) before $this- paginate('Book') call to unbind User model forever. You can call bindModel() after paginate() again with second param false to restore Book model state if you need. By

Re: cakephp dynamic databases.

2010-10-01 Thread Dr. Loboto
You can improve your beforeFilter solution by doing it in bootstrap.php: request login database there and create new database config. In this case you can keep $useDbConfig in all models pointing to dynamic config and do not hit missing DB error. On Oct 1, 7:52 pm, Jos Gerrits

Re: find with null

2010-10-01 Thread Dr. Loboto
'conditions' = array('title'=null, 'OR' = array('title'= $TitleArray)) On Oct 1, 3:04 pm, lyba l...@poczta.fm wrote: Anyone knows why the following does not produce valid SQL syntax and how to go get the right result? $TitleArray = array('a', 'b', 'c');                 $result =

Re: CakePHP ignores notEmpty validation rule when the field's name is not a key in $data! (Bug or Feature?)

2010-09-30 Thread Dr. Loboto
'required' key serves not existent fields, false by default. var $validate = array( 'name' = array( 'notempty' = array( 'rule' = array('notempty'), 'required' = true // this rule will

Re: Do I need to use sanitize?

2010-09-29 Thread Dr. Loboto
I personally never user Sanitize as don't want to break user-entered data. Instead of it I use h() to escape all text on HTML output. On save to database also nothing needed as Cake properly escape data itself. So if you send HTML emails you need just escape user-entered text and that's all. On

Re: Form validation errors

2010-09-18 Thread Dr. Loboto
In this case better turn off persistentModel as you did and reopen ticket. Looks like it is definitely CakePHP bug. On Sep 17, 6:09 pm, Jeremy Burns | Class Outfit jeremybu...@classoutfit.com wrote: Thanks Dr Loboto. Unfortunately that has no effect. Jeremy Burns Class Outfit jeremybu

Re: Form validation errors

2010-09-17 Thread Dr. Loboto
('OrderAddress.address1'); Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 17 Sep 2010, at 03:46, Dr. Loboto wrote: Output get_class($this-MyModelThatDontValidate) or call custom model method to check that models are really loaded. Also check that you approach save

Re: Form validation errors

2010-09-16 Thread Dr. Loboto
99.9% - your models are not loaded at all because you named them not in lowercase. On 16 сен, 20:52, Jeremy Burns jeremybu...@classoutfit.com wrote: I'm a bit stumped. I've developed some code on my local machine (MAMP) and when a form fails validation I get the right error messages displayed

Re: Form validation errors

2010-09-16 Thread Dr. Loboto
Sep 2010, at 18:30, Dr. Loboto wrote: 99.9% - your models are not loaded at all because you named them not in lowercase. On 16 сен, 20:52, Jeremy Burns jeremybu...@classoutfit.com wrote: I'm a bit stumped. I've developed some code on my local machine (MAMP) and when a form fails

Re: Fatal Error::

2010-09-13 Thread Dr. Loboto
Just do not pass strings as $options parameter. It must be array. On Sep 14, 6:55 am, Dave Maharaj m...@davemaharaj.com wrote: Server info says PHP 5.2 My guess is it was something I did and forgot to check after a change. But it's all working fine now. Not sure why the HTML helper threw an

Re: Bootstrapping in 1.3

2010-09-13 Thread Dr. Loboto
For such installation you must provide more precise paths to App::build: App::build( array ( 'controllers' = array ( CONTROLLERS, CAKE_CORE_INCLUDE_PATH.DS.'shares'.DS.'controllers'.DS, ), ) ); And

Re: Application Design Advice Needed

2010-09-13 Thread Dr. Loboto
One users table with basic info needed for authentication and common for both types of users, plus separate profile tables as needed. If all admins info fit users table you need only coaches table with their additional data. On Sep 13, 7:01 pm, veganista liam.lina...@googlemail.com wrote: Hello

Re: Returning routed controller and action

2010-09-13 Thread Dr. Loboto
If I understand your needs you may use $this-params of controller. pr($this-params); // when accessed as /users/register Array ( [pass] = Array ( ) [named] = Array ( ) [controller] = users [action] = register [plugin] = [url] = Array

Re: $this-params['url'] doesn't work

2010-09-11 Thread Dr. Loboto
Inside requestAction you have requestAction URL. On Sep 11, 12:57 pm, zoran lu...@lupusart.net wrote: ?php class MainMenusController extends AppController {         var $name = 'MainMenus';         var $uses = array('MainMenu');         var $lang;  /**  * All the admin_ functions are

Re: Validation translations

2010-09-09 Thread Dr. Loboto
Or you can define your invalidate() function in app_model: public function invalidate($field, $value = true) { if (is_string($value)) { return parent::invalidate($field, __($value)); } else { return parent::invalidate($field); } } Or you can try not use messages

Re: RAM overload

2010-09-08 Thread Dr. Loboto
Remove all that models from $uses and associations. Load only models you need and bind only associations you need for concrete query. Avoid requestAction(). Use lazy loader for helpers. Your models take about 4.25MB and your helpers take about 3.75MB. Avoid keep in controller/model and set

Re: Problems with two hasOne-relationed models: no vice versa

2010-09-06 Thread Dr. Loboto
The pair to hasOne is belongsTo. On Sep 7, 4:08 am, DerBjörn b.unkh...@googlemail.com wrote: Hi, i have 2 models that are connected between each other with hasOnes: - ModelA var $hasOne = array(      'ModelsB' = array(      'classname' = 'ModelsB',      'foreignKey' = modelA_id, ...

Re: Landing Page Optimization

2010-08-24 Thread Dr. Loboto
Check what you need in controller (cookies?) and render different view/ layout instead of default auto-render. On Aug 24, 8:45 am, EMR evanmr...@gmail.com wrote: Hi Guys, I am completely new to CakePHP and am looking to do some landing page optimization (A/B Testing) using Google's Landing

Re: CakePHP 1.3 error in command: this-Html-link( $this-Html-image(cal.png) ... ,

2010-08-18 Thread Dr. Loboto
$options = $this-Html-link( $this-Html-image(cal.png), 'cal.png', array( 'onClick' = return showCalendar('. $htmlAttributes['id']. ', '. $this-format. '); return false;, 'escape' = false ) ); On Aug 18, 1:56 am, Tom

  1   2   3   4   5   6   >