Re: highest traffic cakePHP 1.2 sites?

2010-01-20 Thread mehodgson
We are running a CakePHP frontend with 3-4 Million page views a month
at www.good.is. We combined using memcached and some custom page
caching to increase performance.
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


Problem with multiple memcached configs

2009-11-17 Thread mehodgson
I am trying to set up multiple configurations for the Memcache engine
to allow for varying caching periods in CakePHP 1.2.5. I have set up
the following:

Cache::config(
'long',
array(
'engine' = 'Memcache',
'duration'= 100800,
'probability'= 100,
'prefix' = Inflector::slug(APP_DIR) . '_',
'servers' = array(
'127.0.0.1:11211'
),
'compress' = false,
)
 );

 Cache::config(
'short',
array(
'engine' = 'Memcache',
'duration'= 60,
'probability'= 100,
'prefix' = Inflector::slug(APP_DIR) . '_',
'servers' = array(
'127.0.0.1:11211'
),
'compress' = false,
)
 );

 Cache::config(
'mid',
array(
'engine' = 'Memcache',
'duration'= 3600,
'probability'= 100,
'prefix' = Inflector::slug(APP_DIR) . '_',
'servers' = array(
'127.0.0.1:11211'
),
'compress' = false,
)
 );

The problem I am running into is that when I try to access cached data
with Cache::read('key', 'long') or Cache::read('key', 'short') it
defaults to the settings for 'mid', the last defined Cache::config, so
I am unable to access the data.

Anyone see anything I am doing wrong here, or is this a bug in the
core here?

--

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-...@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=.




Re: Problem with multiple memcached configs

2009-11-17 Thread mehodgson
Never mind answered my own question. Looks like it's a bug in the
Cache class.

I Added the following line to the Cache::read() function

$_this-_Engine[$engine]-settings = $settings;


just before the call to the engine to read.

Everything works as it should now.



On Nov 17, 10:06 am, mehodgson mehodg...@gmail.com wrote:
 I am trying to set up multiple configurations for the Memcache engine
 to allow for varying caching periods in CakePHP 1.2.5. I have set up
 the following:

 Cache::config(
         'long',
         array(
                 'engine' = 'Memcache',
                 'duration'= 100800,
                 'probability'= 100,
                 'prefix' = Inflector::slug(APP_DIR) . '_',
                 'servers' = array(
                         '127.0.0.1:11211'
                 ),
                 'compress' = false,
         )
  );

  Cache::config(
         'short',
         array(
                 'engine' = 'Memcache',
                 'duration'= 60,
                 'probability'= 100,
                 'prefix' = Inflector::slug(APP_DIR) . '_',
                 'servers' = array(
                         '127.0.0.1:11211'
                 ),
                 'compress' = false,
         )
  );

  Cache::config(
         'mid',
         array(
                 'engine' = 'Memcache',
                 'duration'= 3600,
                 'probability'= 100,
                 'prefix' = Inflector::slug(APP_DIR) . '_',
                 'servers' = array(
                         '127.0.0.1:11211'
                 ),
                 'compress' = false,
         )
  );

 The problem I am running into is that when I try to access cached data
 with Cache::read('key', 'long') or Cache::read('key', 'short') it
 defaults to the settings for 'mid', the last defined Cache::config, so
 I am unable to access the data.

 Anyone see anything I am doing wrong here, or is this a bug in the
 core here?

--

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-...@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=.




Re: Problem with cake and HTML encoding

2009-07-09 Thread mehodgson

Are you using the Sanitize component on your data?  If you are you and
you use the clean() function you may need to set encode=false.



On Jul 8, 6:15 am, Ernesto e.fanz...@gmail.com wrote:
 Hello.

 i'm having some troubles with cake.

 here's my this-data array

 Array(
         [id] = 30
         [date] = 2009-11-23
 )

 here's a piece of my SQL dump

 UPDATE `table` SET `id` = 30, `date` = '2009#45;11#45;23' WHERE
 `table`.`id` = 30

 why is cake de-coding the - in date???
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Model Behavior function replaces passed data with model object

2009-07-08 Thread mehodgson

I am having a weird problem with a new model behavior I am trying to
implement. When I try to pass a value ($data) into the model behavior
function the passed value is replaced with the model object. The
passed value is a string before $this-enCrypt() is called, but within
the behavior function $data contains the model's object. Here is my
code:

Model:

function save($data = null, $validate = true, $fieldList = array())
{
if(isset($data['Model']['field'])  $data['Model']['field'])
{
$data['Model']['field'] = 
$this-enCryptCC($data['Model']
['field']);
}

return parent::save($data, $validate, $fieldList);
}


Behavior:

class GlobalBehavior extends ModelBehavior {

function enCrypt($data = null)
{
if ($data != null) {
$td = mcrypt_module_open('cast-256', '', 'ecb', '');
$iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td),
MCRYPT_RAND);
mcrypt_generic_init($td, ENCRYPT_KEY, $iv);
$encrypted_data = mcrypt_generic($td, $data);
$encoded = base64_encode($encrypted_data);
if (!mcrypt_generic_deinit($td) || !mcrypt_module_close
($td)) {
$encoded = false;
}
} else {
$encoded = false;
}
return $encoded;
}

function deCrypt($data = null)
{
if ($data != null) {
$data = (string) base64_decode(trim($data));
$td = mcrypt_module_open('cast-256', '', 'ecb', '');
$iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td),
MCRYPT_RAND);
mcrypt_generic_init($td, ENCRYPT_KEY, $iv);
$data = (string) trim(mdecrypt_generic($td, $data));
if (!mcrypt_generic_deinit($td) || !mcrypt_module_close
($td)) {
$data = false;
}
} else {
$data = false;
}
return $data;
}
}

Anybody have any ideas what is happening?
--~--~-~--~~~---~--~~
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: Model Behavior function replaces passed data with model object

2009-07-08 Thread mehodgson

Sorry, I had a typo in the original post...model function should be as
follows:

Model:
function save($data = null, $validate = true, $fieldList =
array())
{
if(isset($data['Model']['field'])  $data['Model']
['field'])
{
$data['Model']['field'] = $this-enCrypt($data
['Model']
['field']);
}
return parent::save($data, $validate, $fieldList);
}
On Jul 8, 11:46 am, mehodgson mehodg...@gmail.com wrote:
 I am having a weird problem with a new model behavior I am trying to
 implement. When I try to pass a value ($data) into the model behavior
 function the passed value is replaced with the model object. The
 passed value is a string before $this-enCrypt() is called, but within
 the behavior function $data contains the model's object. Here is my
 code:

 Model:

         function save($data = null, $validate = true, $fieldList = array())
         {
                 if(isset($data['Model']['field'])  $data['Model']['field'])
                 {
                         $data['Model']['field'] = 
 $this-enCryptCC($data['Model']
 ['field']);
                 }

                 return parent::save($data, $validate, $fieldList);
         }

 Behavior:

 class GlobalBehavior extends ModelBehavior {

         function enCrypt($data = null)
         {
             if ($data != null) {
             $td = mcrypt_module_open('cast-256', '', 'ecb', '');
             $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td),
 MCRYPT_RAND);
             mcrypt_generic_init($td, ENCRYPT_KEY, $iv);
             $encrypted_data = mcrypt_generic($td, $data);
             $encoded = base64_encode($encrypted_data);
             if (!mcrypt_generic_deinit($td) || !mcrypt_module_close
 ($td)) {
                 $encoded = false;
             }
         } else {
             $encoded = false;
         }
         return $encoded;
     }

     function deCrypt($data = null)
     {
         if ($data != null) {
             $data = (string) base64_decode(trim($data));
             $td = mcrypt_module_open('cast-256', '', 'ecb', '');
             $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td),
 MCRYPT_RAND);
             mcrypt_generic_init($td, ENCRYPT_KEY, $iv);
             $data = (string) trim(mdecrypt_generic($td, $data));
             if (!mcrypt_generic_deinit($td) || !mcrypt_module_close
 ($td)) {
                 $data = false;
             }
         } else {
             $data = false;
         }
         return $data;
     }

 }

 Anybody have any ideas what is happening?
--~--~-~--~~~---~--~~
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: Model Behavior function replaces passed data with model object

2009-07-08 Thread mehodgson

Du'oh...my bad...forgot about that. It's been a while since I have
written a behavior.  Thanks.

On Jul 8, 12:01 pm, Jon Bennett jmbenn...@gmail.com wrote:
 Hi,

  I am having a weird problem with a new model behavior I am trying to
  implement. When I try to pass a value ($data) into the model behavior
  function the passed value is replaced with the model object. The
  passed value is a string before $this-enCrypt() is called, but within
  the behavior function $data contains the model's object. Here is my
  code:

 It's not that weird, it's intentional - the first param is always the
 model that calls the method, have a read up 
 onhttp://book.cakephp.org/view/595/Creating-Behaviors

 Cheers,

 Jon

 --

 jon bennett
 w:http://www.jben.net/
 iChat (AIM): jbendotnet Skype: jon-bennett
--~--~-~--~~~---~--~~
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 model import and find conditions

2009-06-23 Thread mehodgson

Have you tried using $this-loadModel('ModelName'); in your controller
instead of App::import?  Not sure if it will work for what you are
doing, but I have done similar things using it without issue.


On Jun 15, 2:28 am, VVilku wil...@interia.pl wrote:
 Hello (and sorry for my english) :)

 I have a small problem with the import model, and the condition in the
 method of using 'find'. Terms of use related model. The condition has
 a reference to a related model (belongsTo).

 A simple example:

 I have 2 models:
 1) User
 class User extends AppModel {
         var $name = 'User';
         var $hasMany = array(
                         'Memoir' = array('className' = 'Memoir',
                                                                 'foreignKey' 
 = 'user_id',
                                                                 'dependent' 
 = false,
                         ),
         );
 2) Memoir
 class Memoir extends AppModel {
         var $name = 'Memoir';
         var $belongsTo = array(
                         'User' = array('className' = 'User',
                                                                 'foreignKey' 
 = 'user_id',
                         )
         );

 I have this condition for paginate options::
 $this-paginate = array(
             'conditions'=array('Memoir.status' = 1, 'User.status' =
 1),
             'order'=array('Memoir.updated'='desc'),
             );

 When I use it in the controller, everything is ok.

 But when I try to use it after the import model in to another
 controller, I receives an error.

 I tried App::import and ClassRegistry::init().

                 //App::import('Model', $section['model']);
                 //$model = new $section['model']();
                 $model = ClassRegistry::init($section['model']);

                 $results = $model-find('all', array
 ( 'conditions'=array('Memoir.status' = 1, 'User.status' = 1)));

 SQL Error: 1054: Unknown column 'User.status' in 'where clause'

 I understand that the imported model is not somehow related to the
 model of 'User'.
 What can I do? Please :)

 I'm stuck.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Cake losing sessions randomly

2008-10-13 Thread mehodgson

I am stumped...I have built a cakePHP application that uses the auth
component and I am having the strangest problem.  The site will
occasionally just drop the session data for no apparent reason. I can
login using the auth component, then just click the refresh button and
let the page load.  Sometimes it pulls up the session data and
sometimes it does not find the session. The strange part is that if I
refresh again it will usually come up with the session data, so it
isn't losing the session all together.

Currently running 1.2 RC3 with the following settings:
Configure::write('Session.cookie', 'AHJ');
Configure::write('Session.timeout', '3600');
Configure::write('Session.start', true);
Configure::write('Session.checkAgent', true); (Tried both true and
false settings, but same problem with either)
Configure::write('Security.level', 'medium');

Does anyone have any thoughts on what might be causing this?


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cake losing sessions randomly

2008-10-13 Thread mehodgson

Just to make sure this wasn't the case I switched to database storage
of sessions, but I am still having the same issue.  Sometimes it finds
a the session data and sometimes it doesn't.  Seems completely random.

On Oct 13, 10:48 am, Samuel DeVore [EMAIL PROTECTED] wrote:
 Is this on your server or a shared server.  I have run into some hosts
 where the session store in /tmp gets walked on seemingly at random.  I
 would try changing the session store to cake to put it in your app
 tmp/session store. This helped me on one client site (can't remember
 the host)  and I have just started doing it by default this way for
 now

 Sam D

 On Mon, Oct 13, 2008 at 10:27 AM, mehodgson [EMAIL PROTECTED] wrote:

  I am stumped...I have built a cakePHP application that uses the auth
  component and I am having the strangest problem.  The site will
  occasionally just drop the session data for no apparent reason. I can
  login using the auth component, then just click the refresh button and
  let the page load.  Sometimes it pulls up the session data and
  sometimes it does not find the session. The strange part is that if I
  refresh again it will usually come up with the session data, so it
  isn't losing the session all together.

  Currently running 1.2 RC3 with the following settings:
  Configure::write('Session.cookie', 'AHJ');
  Configure::write('Session.timeout', '3600');
  Configure::write('Session.start', true);
  Configure::write('Session.checkAgent', true); (Tried both true and
  false settings, but same problem with either)
  Configure::write('Security.level', 'medium');

  Does anyone have any thoughts on what might be causing this?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Hosting A Cake App On GoDaddy!

2008-10-13 Thread mehodgson

I tried setting one up on go daddy once, but ran into a lot of
issues.  The main one being it is not possible to use MOD_REWRITE, so
you have to use the cakephp url rewriting alternative.  I was able to
get things working once I did that, but not having the clean urls
possible with MOD_REWRITE is a big disadvantage with go daddy.

On Oct 13, 6:08 am, AceStudio [EMAIL PROTECTED] wrote:
 A client of mine purchased a web hosting package on GoDaddy but after
 i uploaded the application on it... it wasn't working. i have been
 racking my head on how to make it work but all to no avail.

 I need to know who has successfully hosted on a GoDaddy server, so the
 person could tell me how he tweaked the server.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cake losing sessions randomly

2008-10-13 Thread mehodgson

As I posted above it is set to Medium.

On Oct 13, 11:33 am, Ketan Shah [EMAIL PROTECTED] wrote:
 whats your security level? (core.php)

 On Oct 13, 11:12 pm, mehodgson [EMAIL PROTECTED] wrote:

  Just to make sure this wasn't the case I switched to database storage
  of sessions, but I am still having the same issue.  Sometimes it finds
  a the session data and sometimes it doesn't.  Seems completely random.

  On Oct 13, 10:48 am, Samuel DeVore [EMAIL PROTECTED] wrote:

   Is this on your server or a shared server.  I have run into some hosts
   where the session store in /tmp gets walked on seemingly at random.  I
   would try changing the session store to cake to put it in your app
   tmp/session store. This helped me on one client site (can't remember
   the host)  and I have just started doing it by default this way for
   now

   Sam D

   On Mon, Oct 13, 2008 at 10:27 AM, mehodgson [EMAIL PROTECTED] wrote:

I am stumped...I have built a cakePHP application that uses the auth
component and I am having the strangest problem.  The site will
occasionally just drop the session data for no apparent reason. I can
login using the auth component, then just click the refresh button and
let the page load.  Sometimes it pulls up the session data and
sometimes it does not find the session. The strange part is that if I
refresh again it will usually come up with the session data, so it
isn't losing the session all together.

Currently running 1.2 RC3 with the following settings:
Configure::write('Session.cookie', 'AHJ');
Configure::write('Session.timeout', '3600');
Configure::write('Session.start', true);
Configure::write('Session.checkAgent', true); (Tried both true and
false settings, but same problem with either)
Configure::write('Security.level', 'medium');

Does anyone have any thoughts on what might be causing this?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: this-redirect() deletes any variable set by using this-set() method.

2008-07-14 Thread mehodgson

If you are setting variables and just need to display an alternate
page based on situational data, you might also be able to use $this-
render() in your controller to display a different view page.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: this-redirect() deletes any variable set by using this-set() method.

2008-07-14 Thread mehodgson

...Code got cut off.

$this-gt;render() to display the alternate view
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Editing paginator URL

2008-04-25 Thread mehodgson

I don't know if this was something to do with my setup, but I had
problems with setting the url options for pagination when using admin
routing. my pagination links were coming out /admin/users/admin_index/
page:2/search:term

I had to add an action parameter to the url options array to make it
work:

$paginator-options(array('url' = array('search'=$search,
'action'='index')));

Just thought I'd post it in case someone else gets the same issue
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Rendering element from controller

2008-04-14 Thread mehodgson

1.2.x uses a new syntax for rendering elements:

$this-element('helpbox', array('cache' = true));

You should probably look over the temp docs for 1.2 it will help to
understand the changes that have been made from 1.1: 
http://tempdocs.cakephp.org/


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Auth component not retrieving User data

2008-03-31 Thread mehodgson

I have set up a basic authentication using the Auth component, but the
values for $this-Auth-user() are not being set for most of the user
data fields.  When a login is processed only the user id and username
fields are set to the database values in the Auth session data, all
other user information is let empty.

Is there some setting I need to specify for the auth component to
retrieve all of the user data and write it to the session? Or do I
just need to retrieve it separately?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Memcache and CakePHP

2008-01-01 Thread mehodgson



On Dec 30 2007, 11:02 am, Mike Lewis [EMAIL PROTECTED] wrote:
 So I installed memcache + added the code to core.php:

 Cache::config('default', array('engine' = 'Memcache',
              'duration' = 3600, //[optional]
              'probability' = 100, //[optional]
                  'servers' = array(
                            'memcache.ip.address'
                          ), //[optional]
                    'compress' = true,
                )
            );

 CakePHP said it detected memcache -- so whats next?

 Does it just run on its own, or do I have to add some more code to the
 actual application. If so, what is it?

 Thanks,
 Mike

All you need to do from there is use the memcache component and helper
to start caching.

A quick test for memcache:

Set your controller to cache the results of some query data that would
be displayed on the page:

if(!($someData = $this-Memcache-get('someData')))
{
//get data from DB
$someData = $this-SomeModel-find( );

//set memcached value
$this-Memcache-set('someData', $someData, 3600); //cache for one
hour
}

Upload the controller file with the memcache code and view the page to
cache the data. Then make a change to the data in the DB.  Clear your
cache and refresh the page. If the old data is displayed memcached is
working.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Pages Controller issue

2007-11-21 Thread mehodgson

I am working on an ecommerce site using v1.2 and I am having a weird
problem with anything static pages run through the pages
controller.

The navigation is set up to dynamically pull the product information
from the database to create all of the necessary links. I currently
have the appController set like this:

class AppController extends Controller
{
var $components = array('Session');
var $uses = array('Product');

function beforeFilter()
{
$subProducts = $this-Product-
findAll('Product.status='.PRODUCT_ACTIVE,null,null,2); // this is
line 48 referred to in the error below
$this-set('subProducts', $subProducts);
}
}


 It works for perfectly for any of the pages that are run through any
of the other controllers, but the pages controller gives me this
message:

Fatal error: Call to a member function on a non-object in
(directory_path)/app/app_controller.php on line 48

Just as an experiment I set $uses = array('Product'); in the pages
controller and the dynamic navigation worked, but as expected I get
the missing model error for pages.

It seems like setting $uses = null; in the pages controller is
overriding the $uses=array('Product'); in the app controller and
causing the $this-Products fatal call to a member functionon a non-
object.

Does anyone have any suggestions on how to deal with this?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Confusing problem with insert/update via AJAX (have exhausted solutions find via search)

2007-11-21 Thread mehodgson

This may be the problem, in your controller your set:

$this-params['marked_jobs']['Mark']['jm_j_id'] = $j_id;

and in your model your set:

var $primaryKey = 'jm_j_id';

...so in your controller you are setting the passed value to 'jm_j_id'
which is the PK.


On Nov 21, 8:34 am, designvoid [EMAIL PROTECTED] wrote:
 Hi there!

 I'm trying to perform an insert query via an ajax call, having
 searched throughout the group, I have come to the conclusion that it
 is something to do with Cake taking the only parameter passed as the
 PK and performing an update rather than an insert. I have found posts
 regarding this suggesting setting the id to null at start of function,
 using the model-create command etc, but none of these seem to work...

 I'll paste some snippets, this is my view file with the AJAX call:

 input id=job_mark_?php echo $item['j_id']; ? type=checkbox
 onClick=new Ajax.Updater('jobs_marked','markit/?php echo
 $item['j_id']; ?', {asynchronous:true, evalScripts:true}); /

 This is my controller function:

 function markit($j_id)
 {
 $this-Mark-id = null;
 $this-params['marked_jobs']['Mark']['jm_j_id'] = $j_id;

 if ($this-Mark-save($this-params['marked_jobs']))
 {
 $this-set('jobs', $this-Job-findAll());
 $this-set('marked_jobs', $this-Mark-findAll());
 $this-render('marked', 'ajax');
 }
 }

 And this is my 'mark' model:

 class Mark extends AppModel {
 var $name = 'Mark';
 var $primaryKey = 'jm_j_id';
 var $useTable = 'jobs_marked';

 var $hasOne = array('Job' =
 array('className'= 'Job',
 'conditions'   = '',
 'order'= '',
 'dependent'=  true,
 'foreignKey'   = 'j_id'
 )
 );

 }

 I hope that this is something simple that I have overlooked and one of
 you fine people can shed some light on it...
 TIA,
 d.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Pages Controller issue

2007-11-21 Thread mehodgson

I tried switching the pages controller to $uses = array(); and now I
get this error:

Missing controller

You are seeing this error because controller Controller could not be
found.

Notice: If you want to customize this error message, create app/views/
errors/missing_controller.ctp

Fatal: Create the class below in file: app/controllers/controller.php

?php
class Controller extends AppController {
   var $name = '';
}
?

Did they change this behavior in the newest build of 1.2?


On Nov 21, 1:05 pm, Walker Hamilton [EMAIL PROTECTED] wrote:
 Read 
 this:http://cakebaker.42dh.com/2007/10/30/what-i-didnt-knew-about-controll...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Pages Controller issue

2007-11-21 Thread mehodgson

Never mind that last question...had a typo in my routes that was
causing the problem.

Thanks.

On Nov 21, 1:33 pm, mehodgson [EMAIL PROTECTED] wrote:
 I tried switching the pages controller to $uses = array(); and now I
 get this error:

 Missing controller

 You are seeing this error because controller Controller could not be
 found.

 Notice: If you want to customize this error message, create app/views/
 errors/missing_controller.ctp

 Fatal: Create the class below in file: app/controllers/controller.php

 ?php
 class Controller extends AppController {
var $name = '';}

 ?

 Did they change this behavior in the newest build of 1.2?

 On Nov 21, 1:05 pm, Walker Hamilton [EMAIL PROTECTED] wrote:

  Read 
  this:http://cakebaker.42dh.com/2007/10/30/what-i-didnt-knew-about-controll...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Joins across databases with useTable ??

2007-05-18 Thread mehodgson

Is there any reason why you wouldn't use Cake's Built in model
relationships.  Defining a hasOne or hasMany relationship in the Model
should do the trick.

On May 17, 4:25 am, floepi [EMAIL PROTECTED] wrote:
 Hi,

 i would like to make a join over two databases.

 In plain mySQL that is easy like

 ... from a.user LEFT JOIN b.countries ...

 where a and b are on the same host.

 I tried to do the same thing in cake by defining in the country model

 var $useTable = 'b.countries';

 but it always comes up with an error. Does anybody know how i can use
 the cakes database abstraction but still make cross database joins.
 Rewriting all the queries in the model like save is not really a nice
 option.

 Cheers

 Phil


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Where to find Senior PHP/CakePHP Developer?

2007-03-12 Thread mehodgson

Not quite a CakePHP question, but loosely related...

The company I work for is in need of an additional staff senior PHP
developer experienced with Cake PHP in the Los Angeles area.  The boss
has been looking for months and has yet to find anyone that fits the
bill.

I am swamped try to do all of the development on my own (one developer
doing the work of two)  and was hoping someone in the group might be
looking, or able to point me in the direction of somewhere to search
for good PHP talent since the boss can't seem to find any good
candidates.

Thanks,

Michael


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Where to find Senior PHP/CakePHP Developer?

2007-03-12 Thread mehodgson

It's basically on-site in Los Angeles.  It will be salaried, but I am
not sure what they are planning to offer (should be competitive with
going market rate).  The benefits are pretty good and it's a young,
fairly cool firm.   I like working here (other than my current
workload, that is).

Michael

On Mar 12, 2:05 pm, GoodMoJo [EMAIL PROTECTED] wrote:
 Hi Michael,

 Is there some place where one might be able to obtain more information
 on the position?  Is it an onsite job?  Contract/Salary?

 - Chris

 On Mar 12, 12:30 pm, mehodgson [EMAIL PROTECTED] wrote:

  Not quite a CakePHP question, but loosely related...

  The company I work for is in need of an additional staff senior PHP
  developer experienced with Cake PHP in the Los Angeles area.  The boss
  has been looking for months and has yet to find anyone that fits the
  bill.

  I am swamped try to do all of the development on my own (one developer
  doing the work of two)  and was hoping someone in the group might be
  looking, or able to point me in the direction of somewhere to search
  for good PHP talent since the boss can't seem to find any good
  candidates.

  Thanks,

  Michael


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Strange CakePHP Issue

2007-03-05 Thread mehodgson

We are only caching Static pages, so none of the dynamic pages are
cached.  Would the models be cached regardless?

On Mar 5, 11:37 am, xhoch2 [EMAIL PROTECTED] wrote:
 Have you empty the cache after moving your work (tmp/cache/models)?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Strange CakePHP Issue

2007-03-05 Thread mehodgson

Ah...I see now.  I'll give that a try.  Hopefully it will do the
trick.

Thanks.

On Mar 5, 12:00 pm, AD7six [EMAIL PROTECTED] wrote:
 On Mar 5, 8:57 pm, mehodgson [EMAIL PROTECTED] wrote:

  We are only caching Static pages, so none of the dynamic pages are
  cached.  Would the models be cached regardless?

  On Mar 5, 11:37 am, xhoch2 [EMAIL PROTECTED] wrote:

   Have you empty the cache after moving your work (tmp/cache/models)?

 Try deleting all the files under tmp/cach/models as xhoch2 suggested,
 and answer that yourself on the first page request ;).

 Cheers,

 AD


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---