Re: Searching non existent related models

2009-07-27 Thread Jaydeep Dave
try:

$this-paginate['conditions'] = array(
 'OR' = array (
 'User.name IS' = 'NULL',
 'Recipe.id IS' = ' NULL'
 )
 );
---

$this-paginate['conditions'] = array(
 'OR' = array (
 'User.name IS' = null,
 'Recipe.id IS' = null
 )
 );




$this-paginate['conditions'] = array(
 'OR' = array (
 'User.name' = null,
 'Recipe.id' = null
 )
 );

Jaydeep Dave

On Mon, Jul 27, 2009 at 12:33 PM, byqsri marco.rizze...@gmail.com wrote:


 It doesnt work.
 The resulted query is :
 `User`.`name` = 'IS NULL'

 On 27 Lug, 04:30, Dr. Loboto drlob...@gmail.com wrote:
  Probably something like this:
 
  $this-paginate['conditions'] = array(
  'OR' = array (
  'User.name' = 'IS NULL',
  'Recipe.id' = 'IS NULL'
  )
  );
 
  On Jul 24, 2:32 am, iFeghali igor.fegh...@gmail.com wrote:
 
 
 
   Hello All,
 
   Say I have a User hasMany Recipes. Now I want to search for all users
   with an empty name OR users that doesn't have any recipe. How do I
   turn that piece of code in what I want:
 
   $this-paginate['conditions'] = array('User.name' = 'IS NULL');
   $this-set('users', $this-paginate());
 
   Can I do that in a single query condition ?
 
   Thank you.- Nascondi testo citato
 
  - Mostra testo citato -
 



-- 
Regards,

Jaydeep Dave
Mobile: +919898456445
Email: jaydipd...@yahoo.com

--~--~-~--~~~---~--~~
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: How to inheirt form other controllers?

2009-07-27 Thread Jaydeep Dave
You can use that controller (Model) in app_controller.php;
var $uses = array('User', 'Curl', 'Services');  // etc ;)

---

In your end controller you can use something like

$this-User-Controller-method();// Dont know the exact snippet
... but search in google.


On Mon, Jul 27, 2009 at 3:52 PM, Michael Gaiser mjgai...@gmail.com wrote:

 I want to have my UserAdmin controller inherit from my User controller
 instead of AppController. but it cannot seem to find it. Is there a special
 way to do this in cake or can I just use and include statment? Thanks.

 ~MJG

 



-- 
Regards,

Jaydeep Dave
Mobile: +919898456445
Email: jaydipd...@yahoo.com

--~--~-~--~~~---~--~~
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: Searching non existent related models

2009-07-27 Thread Jaydeep Dave
Nevery used HAMBT
but u can try something like
http://www.nabble.com/Conditions-on-2-models-with-the-relationship-hasMany-td24387079.html


On Mon, Jul 27, 2009 at 6:22 PM, iFeghali igor.fegh...@gmail.com wrote:


 Thank you Jaydeep. Now how do I do the same for a HABTM ? It is not
 joined in the query by default.

 On 27 jul, 05:25, Jaydeep Dave jaydipd...@gmail.com wrote:
  try:
 
  $this-paginate['conditions'] = array(
   'OR' = array (
   'User.name IS' = 'NULL',
   'Recipe.id IS' = ' NULL'
   )
   );

 



-- 
Regards,

Jaydeep Dave
Mobile: +919898456445
Email: jaydipd...@yahoo.com

--~--~-~--~~~---~--~~
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: SecurityComponent::requireAuth : when?

2009-07-27 Thread Jaydeep Dave
Hi Lucas,
I think it blocks the page using http authentication method (similar to
.htpasswd)



On Mon, Jul 27, 2009 at 10:34 AM, Lucas Costa lucasrco...@gmail.com wrote:


 Hello fellows, I think there's a lack of examples of the use of
 SecurityComponent's requireAuth method.

 What is indeed the purpose of this method?

 What vulnerabilities does it cover?

 Is it or how is it related to the AuthComponent?

 Could you give some examples of the right use?

 Thank you all.

 Lucas Costa

 



-- 
Regards,

Jaydeep Dave
Mobile: +919898456445
Email: jaydipd...@yahoo.com

--~--~-~--~~~---~--~~
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: How to remove items from $this-data

2009-07-27 Thread Jaydeep Dave
Create a function in your controller:
private function filter_my_data()
{
   unset($this-data['ChartsKpi'][x]);
}

// And use it in your add/edit functions


function add() {
   if(!empty($this-data)) {
   $this-filter_my_data();
   ...
   ... // Save Data
   }
}

On Mon, Jul 27, 2009 at 8:51 AM, DavidH djhollingwo...@gmail.com wrote:


 Hi

 I'm using CakePHP 1.2.3.8166 with PHP 5.2.9 on Apache 2.10

 I'm hoping someone will give me a hand with what is essentially a PHP
 question as oposed to a question about CakePHP.

 I'm returning this data array from my add.ctp view:

 Array
 (
[Chart] = Array
(
[title] = Test Chart
[chart_type_id] = 1
[width] = 128
[height] = 128
)

[ChartsKpi] = Array
(
[1] = Array
(
[kpi_id] = 1
[kpi_colour_id] = 2
[width] = 5
)
[2] = Array
(
[kpi_id] = 2
[kpi_colour_id] = 3
[width] = 5
)
[3] = Array
(
[kpi_id] = 0
[kpi_colour_id] =
[width] =
)
[4] = Array
(
[kpi_id] = 0
[kpi_colour_id] =
[width] =
)
[5] = Array
(
[kpi_id] = 0
[kpi_colour_id] =
[width] =
)
[6] = Array
(
[kpi_id] = 0
[kpi_colour_id] =
[width] =
)
[16] = Array
(
[kpi_id] = 0
[kpi_colour_id] =
[width] =
)
[17] = Array
(
[kpi_id] = 0
[kpi_colour_id] =
[width] =
)
 ...
)
 )

 You see all the sub arrays of [ChartsKpi] that have a kpi_id == 0? I
 dont want to save those so I've a beforeSave callback in my ChartsKpi
 model and I was trying to unset($this-data['ChartsKpi'][x]); but this
 isn't working.

 Is there an accepted way for taking data out of $this-data before
 doing a save?

 Thanks

 David

 



-- 
Regards,

Jaydeep Dave
Mobile: +919898456445
Email: jaydipd...@yahoo.com

--~--~-~--~~~---~--~~
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: Which Server OS to choose

2009-07-27 Thread Jaydeep Dave
I have used Fedora 9 (Desktop Edition)
Then I switched my complete system to Ubuntu Server Edition.

I liked Ubuntu. Server Edition is really light weight, fast and stable.



On Mon, Jul 27, 2009 at 9:03 AM, DavidH djhollingwo...@gmail.com wrote:


 My own preference is for OpenSuse 11. I was using Ubuntu (version 7.x
 and then 8.x); but I had issues with authorization taking a long time.
 This was annoying when saving files from Dreamweaver on my desktop
 over ftp sessions to the server. In the end I got fed up with it and
 switched (back to) SuSE.

 On Jul 27, 5:42 pm, Kau-Boy bernhard...@gmail.com wrote:
  I bought a new root server as my hoster has a very bad support on the
  managed servers. Now I have to choose a good OS to run a Webserver for
  my first big CakePHP project.
 
  So I want to ask the community which OS to choose. I have to say, that
  I am not a linux expert The only OS I have used is Ubuntu Desktop. I
  am very happy how easy it is to apt-get install a new software. But
  how about update to a new version of PHP or MySQL. What are the
  arguments for or against Ubuntu and which OS would you suggest?
 
  Here is a list of OS' I can choose from:
 
  openSUSE 11
  CentOS 5
  Debian 4.0 (etch)
  Ubuntu 8.04 LTS
  Ubuntu 6.06 LTS
 
  I hope that this post will also help others, who have to decide which
  OS to choose!
 



-- 
Regards,

Jaydeep Dave
Mobile: +919898456445
Email: jaydipd...@yahoo.com

--~--~-~--~~~---~--~~
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: Problem with HBTM tables. (included image)

2009-07-27 Thread Jaydeep Dave
Brother, I don't know your problem.  But you can try this.
http://www.google.co.in/search?rlz=1C1CHNG_enIN333IN333sourceid=chromeie=UTF-8q=HBTM

On Mon, Jul 27, 2009 at 11:33 AM, Carlos Suarez Fontalvo 
eng.carlos.sua...@gmail.com wrote:


 Excuse me, but, nobody has answer me. It's anyone here can help me?.
 tnx a lot.
 



-- 
Regards,

Jaydeep Dave
Mobile: +919898456445
Email: jaydipd...@yahoo.com

--~--~-~--~~~---~--~~
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: keep hitting mysql memory limit, even in Cake Shell when exporting large xml file

2009-07-26 Thread Jaydeep Dave
You can try something like this in your shell


?php

...
..

$page = 1;

while(1) {

 $records = $this-findAll(conditions' = array(bla bla bla),
'fields' = 'Model.*' ,'limit' = 50, 'page' = $page);

 if($records) {
  // Write Your XML in a File.
 }else{
   break;
 }

$page = $page + 50;
}

This will help you a lot.

Regards,

Jaydeep Dave

On Sun, Jul 26, 2009 at 1:41 AM, majna majna...@gmail.com wrote:



 Try with :
 $mysqli = ConnectionManager::getDataSource('default');
 $mysqli-disconnect();
 $mysqli-connect();


 debug($mysqli-connected);
 debug($mysqli-connection);


 On Jul 26, 7:55 am, JamesF usaexportexpe...@gmail.com wrote:
  MY PROBLEM:
  i am running into a wall with this one. basically i have a large xml
  file that i am rendering using XmlHelper. We are talking about a
  25-50mb file. This is basically a product data feed. I have tried
  quite a few methods to overcome the memory limit but no luck.
 
  MY ERROR:
  Fatal error: Allowed memory size of 83886080 bytes exhausted (tried to
  allocate 53 bytes) in /home/username/usr/cakedev/cake/libs/model/
  datasources/dbo/dbo_mysqli.php on line 402
 
  WHAT I HAVE DONE TO TRY AND FIX IT:
 
  1) Initially i set this up to render through the web in one
  shotthis cause execution limit timeouts and memory errors.
 
  2)I broke up the data requests in seperate chunks of 500 records using
  internal method calls, like $listings = $this-getListings($start_id,
  $limit); This caused the same problem
 
  3) I set the whole thing up via the cake shell interface. It works
  great except for the fact that i keep running up against the same
  limit, even with staggered chunks of records in different method
  calls.
 
  MY GUESS:
  is that Cake is keeping an open connection with the database for the
  life of the script.
 
  MY SPECIFIC QUESTIONS:
  can i disconnect and reconnect from the database inside of the script?
  specifically can i do this in a cake shell script? will this solve my
  memory problem? am i going about this the wrong way entirely?
 
  thanks again anyone who has some advice!
 



-- 
Regards,

Jaydeep Dave
Mobile: +919898456445
Email: jaydipd...@yahoo.com

--~--~-~--~~~---~--~~
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: 'set' and 'render' together? access set variables from different view?

2009-07-26 Thread Jaydeep Dave
There is something wrong with you variable or index.ctp

otherwise the code, u have shown should work properly.

Jaydeep Dave

On Sat, Jul 25, 2009 at 8:40 PM, Josh joshs.silver...@gmail.com wrote:


 This seems like a very simple question, but I have been struggling
 with it for quite a while. How can I use the 'set' function and then
 the 'render' function while still being able to access my set
 variables from the view? It seems to me that 'set' only makes
 variables available in the view that matches the action. How can I get
 around this?

 e.g.

 //exampleController

$this-set('a', $a);
$this-render('index');

 //index.ctp

?php echo $a ?;

 



-- 
Regards,

Jaydeep Dave
Mobile: +919898456445
Email: jaydipd...@yahoo.com

--~--~-~--~~~---~--~~
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: keep hitting mysql memory limit, even in Cake Shell when exporting large xml file

2009-07-26 Thread Jaydeep Dave
Same thing was happening with me before a couple of days...

The problem was i have set the cron to run every 5 mins.

but the script was not completing within 5 mins... so there were multiple
instances running.. which caused mysql down.

.

sometimes, the problem is always different then we think of.

Jaydeep Dave

On Sun, Jul 26, 2009 at 7:09 AM, JamesF usaexportexpe...@gmail.com wrote:


 i took the drastic step of increasing my php memory limit to avoid
 dealing with this right now but i dont think its a long term solution
 by any means.


 On Jul 26, 1:55 am, JamesF usaexportexpe...@gmail.com wrote:
  MY PROBLEM:
  i am running into a wall with this one. basically i have a large xml
  file that i am rendering using XmlHelper. We are talking about a
  25-50mb file. This is basically a product data feed. I have tried
  quite a few methods to overcome the memory limit but no luck.
 
  MY ERROR:
  Fatal error: Allowed memory size of 83886080 bytes exhausted (tried to
  allocate 53 bytes) in /home/username/usr/cakedev/cake/libs/model/
  datasources/dbo/dbo_mysqli.php on line 402
 
  WHAT I HAVE DONE TO TRY AND FIX IT:
 
  1) Initially i set this up to render through the web in one
  shotthis cause execution limit timeouts and memory errors.
 
  2)I broke up the data requests in seperate chunks of 500 records using
  internal method calls, like $listings = $this-getListings($start_id,
  $limit); This caused the same problem
 
  3) I set the whole thing up via the cake shell interface. It works
  great except for the fact that i keep running up against the same
  limit, even with staggered chunks of records in different method
  calls.
 
  MY GUESS:
  is that Cake is keeping an open connection with the database for the
  life of the script.
 
  MY SPECIFIC QUESTIONS:
  can i disconnect and reconnect from the database inside of the script?
  specifically can i do this in a cake shell script? will this solve my
  memory problem? am i going about this the wrong way entirely?
 
  thanks again anyone who has some advice!
 



-- 
Regards,

Jaydeep Dave
Mobile: +919898456445
Email: jaydipd...@yahoo.com

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