Re: Shouldn't the Text Helper use multibyte strings instead?

2007-12-15 Thread Gwoo

The plan with mb is to add support for it through the String class. If
mb is not available the String class will handle it on its own.
Several of the needed string functions exist and tests cover the
current functionality. Then, the String class can be implemented in
the TextHelper, among other things and everyone can be happy.

--~--~-~--~~~---~--~~
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: mysql_affected_rows()

2007-12-15 Thread steve

I found it: getAffectedRows(), for anyone who needs it.
Verified it works.

On Dec 15, 5:50 pm, steve <[EMAIL PROTECTED]> wrote:
> Hi, hope that someone has used this check for affected rows already
> and knows how it works in cakePHP.
>
> I'm simply needing to test for affected rows ( i.e.
> mysql_affected_rows() ).
>
> I did a search in the cakephp API for it and found lastAffected.
>
> If I run an "Update" query on my Post model, and want to get the
> number of rows affected,  is it $this->Post->lastAffected() ?   This
> didn't seem to work. Don't have the error message at the time.
>
> Steve

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



dependent=true not working

2007-12-15 Thread [EMAIL PROTECTED]

Here is my model
class Question extends AppModel {

var $name = 'Question';
var $validate = array(
'question' => VALID_NOT_EMPTY,
'type_id' => VALID_NOT_EMPTY,
);

//The Associations below have been created with all possible keys,
those that are not needed can be removed
var $belongsTo = array(
'Type' =>
array('className' => 'Type',
'foreignKey' => 'type_id',
'conditions' => '',
'fields' => '',
'order' => '',
'counterCache' => ''
),

);

var $hasMany = array(
'Answer' =>
array('className' => 'Answer',
'foreignKey' => 'question_id',
'conditions' => '',
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
'dependent' => true,
'exclusive' => '',
'finderQuery' => '',
'counterQuery' => ''
),

And here is the sql from questions and answers
CREATE TABLE `p6_questions` (
  `id` int(11) NOT NULL auto_increment,
  `question` text NOT NULL,
  `tip` text,
  `type_id` int(11) NOT NULL,
  `published` int(11) default NULL,
  `created` datetime NOT NULL,
  `modified` datetime NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;


CREATE TABLE `p6_answers` (
  `id` int(11) NOT NULL auto_increment,
  `answer` text NOT NULL,
  `rational` text NOT NULL,
  `priority` int(11) default NULL,
  `correct` int(11) default NULL,
  `question_id` int(11) NOT NULL,
  `created` datetime NOT NULL,
  `modified` datetime NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=14 ;


I have p6_ set as the prefix in the config file. I have no other
problems except that when I delelte a question the related answers are
not also deleted. Anyone have any ideas?

--~--~-~--~~~---~--~~
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: DESCRIBE happening too often

2007-12-15 Thread Olexandr Melnyk
SHOW PROCESSLIST

On 12/14/07, Grant Cox <[EMAIL PROTECTED]> wrote:
>
>
> How are you checking that you are getting a lot of DESCRIBE queries
> with DEBUG set to 0?
>
>
> On Dec 14, 7:09 am, "Olexandr Melnyk" <[EMAIL PROTECTED]> wrote:
> > Hello bakers,
> >
> > in one of applications I'm working on, I have noticed DESCRIBE queries
> being
> > executed on every page for all used models. With a load of page views,
> this
> > only creates problems.
> >
> > As far as I know, such queries should be cached if
> > application is in production (DEBUG = 0), but I still get them quite
> > often. I have cheched /app/tmp/ directory permissions, and they are set
> to 777.
> >
> > I am using CakePHP 1.1
> >
> > I don't know if CakePHP's cache expires after a number of pageviews
> since
> > last update or after a set
> > period of time, but is there a way to extend its lifetime?
> >
> > Thanks
> >
> > --
> > Sincerely yours,
> > Olexandr Melnyk <> >
>


-- 
Sincerely yours,
Olexandr Melnyk
http://omelnyk.net/

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



mysql_affected_rows()

2007-12-15 Thread steve

Hi, hope that someone has used this check for affected rows already
and knows how it works in cakePHP.

I'm simply needing to test for affected rows ( i.e.
mysql_affected_rows() ).

I did a search in the cakephp API for it and found lastAffected.

If I run an "Update" query on my Post model, and want to get the
number of rows affected,  is it $this->Post->lastAffected() ?   This
didn't seem to work. Don't have the error message at the time.

Steve

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



Same Model&Controller but different Views for 2 different domains

2007-12-15 Thread Lloyd

I'm just wondering, is there a simple or even feasible way of having
different views for 2 different domains - but the same model and
controller?  Ie, both websites so to speak will be exactly the same in
content but just differ in appearance.. maybe I could do this in
routes.. I'm not sure.. any help would be awesome, thanks

--~--~-~--~~~---~--~~
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: Model Queries inside Model Objects?

2007-12-15 Thread Marcin Domanski aka kabturek

$this->findBy* from the User model
you can access the associated model using $this->AssociatedModel-
>find...

you should stick most of the model/query stuff inside models (fat
models, thin controllers)

loading models is an option but it really depends on the situation -
generally you shouldnt load models in other models but its possible so
there are situation when its necessary.

On Dec 15, 6:45 am, oracle411 <[EMAIL PROTECTED]> wrote:
> Hi Guys,
>
> I currently validating from my controllers using Model findBy*
> methods.  Usually using many different model queries inside one
> controller.  Something like this:
>
> //get user object
> $results = $this->User->findByEmail($this->data['User']['email']);
> if ($results && $results['User']['password'] == md5($this->data['User']
> ['password'])) {
>
> I want to start using cake 1.2 validation methods, where we stick most
> of our validation inside our Model objects.  Their we can define
> custom rules to use for validation.  My question is how do I use
>   $this->User->findByEmail
> type of methods inside the model itself and using other models inside
> models?  Is their a way to do this or do I just keep using my
> controller to validation certain things.
>
> Thanks
--~--~-~--~~~---~--~~
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: Extended Validation !?

2007-12-15 Thread Adam Royle

Use... $this->data[$this->name]['fieldname']



function checkEmpty($value) {
$valid = false;
if ($value == 'c' && !empty($this->data[$this->name]['field4']) {
$valid = true;
} elseif (($value == 'a' || $value == 'b') &&

!empty($this->data[$this->name]['field2']) &&

empty($this->data[$this->name]['field3'])) {
$valid = true;
}
return $valid;
}




I often use pr($this) in my model to figure out how certain things
work.

Cheers,
Adam


On Dec 16, 8:08 am, stefuNz <[EMAIL PROTECTED]> wrote:
> hi chris!
>
> i think i found what you meant ... "custom validation methods", right?
>
> but i have one little problem. i don't know how to access field2,
> field3, field4 when validating field1...
> here's my approach:
>
> var $validate = array(
> 'field1' => array(
> 'rule' => array('checkEmpty'),
> 'message' => 'Required field empty.'
> )
> );
> function checkEmpty($data) {
> $valid = false;
> print_r($data);
> if($data == "c" AND !empty($field4)) $valid = true;
> elseif(($data == "a" OR $data == "b") AND !empty($field2) AND !
> empty($field3)) $valid = true;
> return $valid;
> }
>
> you see ... i don't know how to access field2 - field4
> do you know how i can handle that situation?
> sorry im just new to cakephpp
>
> sincerely
> stefan
>
> On 15 Dez., 20:36, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
>
> > On Dec 15, 2007 2:34 PM, stefuNz <[EMAIL PROTECTED]> wrote:
>
> > > Hi!
>
> > > I want to use validation for the following situation:
>
> > > I have a select field (field1) with options a,b,c
> > > If field1 is a or b then field2 and field3 may not be empty (text
> > > fields)
> > > if field1 is c then field4 may not be empty ...
>
> > > is there a way to use the validation for this or has it to be
> > > "manually"
>
> > Sounds to me like it is definitely custom validation, which means
> > you'll have to do it "manually".  Luckily it's very easy to do it.
>
> >http://tempdocs.cakephp.org/#TOC121877
>
> > Hope that helps.
>
> > --
> > Chris Hartjes
>
> > My motto for 2007:  "Just build it, damnit!"
>
> >
@ TheKeyboard -http://www.littlehart.net/atthekeyboard
--~--~-~--~~~---~--~~
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: Access to related model data from Behavior?

2007-12-15 Thread chewie124

I inspected the model passed in in the setup(), beforeValidate(),
beforeSave() and afterSave() methods in the Behavior I'm writing, and
the $model->data element only had the data for the main model;  I
couldn't find the child model's data in the Behavior's scope.  It
looks like the the full associative array with the children model data
in a multi-model form posting is only available in the controller's
scope.
--~--~-~--~~~---~--~~
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: Extended Validation !?

2007-12-15 Thread stefuNz

hi chris!

i think i found what you meant ... "custom validation methods", right?

but i have one little problem. i don't know how to access field2,
field3, field4 when validating field1...
here's my approach:

var $validate = array(
'field1' => array(
'rule' => array('checkEmpty'),
'message' => 'Required field empty.'
)
);
function checkEmpty($data) {
$valid = false;
print_r($data);
if($data == "c" AND !empty($field4)) $valid = true;
elseif(($data == "a" OR $data == "b") AND !empty($field2) AND !
empty($field3)) $valid = true;
return $valid;
}

you see ... i don't know how to access field2 - field4
do you know how i can handle that situation?
sorry im just new to cakephpp

sincerely
stefan



On 15 Dez., 20:36, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On Dec 15, 2007 2:34 PM, stefuNz <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi!
>
> > I want to use validation for the following situation:
>
> > I have a select field (field1) with options a,b,c
> > If field1 is a or b then field2 and field3 may not be empty (text
> > fields)
> > if field1 is c then field4 may not be empty ...
>
> > is there a way to use the validation for this or has it to be
> > "manually"
>
> Sounds to me like it is definitely custom validation, which means
> you'll have to do it "manually".  Luckily it's very easy to do it.
>
> http://tempdocs.cakephp.org/#TOC121877
>
> Hope that helps.
>
> --
> Chris Hartjes
>
> My motto for 2007:  "Just build it, damnit!"
>
> @ TheKeyboard -http://www.littlehart.net/atthekeyboard
--~--~-~--~~~---~--~~
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: Access to related model data from Behavior?

2007-12-15 Thread chewie124

Can you give any more details on how to access the related model's
data (child models) in the beforeSave(&$model) callback?  I just tried
it out and couldn't find the associated model's data in

$model->data

or

$model->ChildModel->data

Thanks,
Rich
--~--~-~--~~~---~--~~
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: Preserve other params using paginator

2007-12-15 Thread Matjaz Drolc

Thanks, it works.

On 15 dec., 22:15, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> In app_controller i add
>
> function connectNamed($data=null,$exclude=array()) {
> if (!isset($data)) {
> $data=$this->passedArgs;
> }
> if (!is_array($data)) return;
> foreach ($data as $key => $value) {
> if (!is_numeric($key) && !in_array($key,$exclude)) {
> Router::connectNamed(array($key));
> }
> }
> }
>
> in controller I use
> $this->connectNamed();
> $this->set('options',$this->passedArgs);
> where $fieldFilter is a list of variables that needn't to pass in
> paginator.
>
> in start of view use something like
> options(array('url' => $options));?>
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



How can I build a Forum with Cake?

2007-12-15 Thread 703designs

Can someone help me out? I'd like to build a forum using CakePHP. I'll
end up documenting my efforts in a tutorial at some point.
--~--~-~--~~~---~--~~
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: Preserve other params using paginator

2007-12-15 Thread [EMAIL PROTECTED]

In app_controller i add

function connectNamed($data=null,$exclude=array()) {
if (!isset($data)) {
$data=$this->passedArgs;
}
if (!is_array($data)) return;
foreach ($data as $key => $value) {
if (!is_numeric($key) && !in_array($key,$exclude)) {
Router::connectNamed(array($key));
}
}
}

in controller I use
$this->connectNamed();
$this->set('options',$this->passedArgs);
where $fieldFilter is a list of variables that needn't to pass in
paginator.


in start of view use something like
options(array('url' => $options));?>

--~--~-~--~~~---~--~~
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: Shouldn't the Text Helper use multibyte strings instead?

2007-12-15 Thread Chris Hartjes

On Dec 15, 2007 3:26 PM, mclee <[EMAIL PROTECTED]> wrote:
>
> This is wierd, why so harsh?
>
> Is everybody allowed to commit back to the repository?
> I can send in my code on the Text Helper.

Not harsh, just asking.  I mean, if it's so simple then by all means
submit a patch.  Best way to do it is by going to trac.cakephp.org and
filing a ticket along with your patch.  If the core dev team likes it,
it will make it's way into the code.

-- 
Chris Hartjes

My motto for 2007:  "Just build it, damnit!"

@TheKeyboard - http://www.littlehart.net/atthekeyboard

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



Preserve other params using paginator

2007-12-15 Thread Matjaz Drolc

I'm using Cakephp 1.2.

I have URL like this: http://xyz.com/admin/news/list/author:7. When I
click on any link generated by Cake's paginator, the author param
dissapears. How to preserve it?

--~--~-~--~~~---~--~~
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: Shouldn't the Text Helper use multibyte strings instead?

2007-12-15 Thread mclee

This is wierd, why so harsh?

Is everybody allowed to commit back to the repository?
I can send in my code on the Text Helper.

On Dec 16, 3:24 am, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On Dec 15, 2007 12:05 PM, mclee <[EMAIL PROTECTED]> wrote:
>
>
>
> > Well, we have 'function_exists', don't we?
>
> > Surely we can do a degrade if mb_substr is not installed.
>
> Are you volunteering to do it?
>
> --
> Chris Hartjes
>
> My motto for 2007:  "Just build it, damnit!"
>
> @TheKeyboard -http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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: Form Helper in 1.2 not found ???

2007-12-15 Thread stefuNz

awww FORGET IT !
just found that i wrote var $helpers = array('Form'); in the model and
not the controller ...

nevermind :(

On 15 Dez., 21:56, stefuNz <[EMAIL PROTECTED]> wrote:
> Hey ...
> Sorry for my second question this evening ;)
>
> But I just found this error:
>
> Notice (8): Undefined variable: form [CORE\app\views\users
> \register.thtml, line 66]
>
> Context | Code
>
> $this   =   array("name" => "Users", "here" => "/cakeproject/users/
> register", "parent" => null, "action" => "register", "model" => null,
> "association" => null, "field" => null, "fieldSuffix" => null,
> "modelId" => null, "uses" => false, "helpers" => array, "viewPath" =>
> "users", "layoutPath" => null, "viewVars" => array, "__scripts" =>
> array, "pageTitle" => false, "models" => array, "base" => "/
> cakeproject", "layout" => "default", "autoRender" => true,
> "autoLayout" => true, "params" => array, "hasRendered" => false,
> "loaded" => array, "ext" => ".ctp", "subDir" => null, "themeWeb" =>
> null, "plugin" => null, "pluginPath" => null, "pluginPaths" => array,
> "passedArgs" => array, "__passedVars" => array, "uuids" => array,
> "_log" => null, "webroot" => "/cakeproject/", "modelNames" => array,
> "data" => null, "webservices" => null, "cacheAction" => false)
> $___viewFn  =   "D:\xampp\xampp\htdocs\cakeproject\app\views\users
> \register.thtml"
> $___dataForView =   array("ip" => "127.0.0.1", "host" => "localhost")
> $loadHelpers=   true
> $cached =   false
> $loadedHelpers  =   array("Html" => array, "Session" => array)
> $helper =   array("helpers" => null, "__active" => true, "valid" =>
> false, "error" => false, "_userAgent" =>
> "97d3931cf333eb6077958dca0114c3f6", "path" => false, "lastError" =>
> null, "security" => null, "time" => 1197751853, "sessionTime" =>
> false, "watchKeys" => array, "_log" => null, "base" => "/cakeproject",
> "webroot" => "/cakeproject/", "here" => "/cakeproject/users/register",
> "params" => array, "action" => "register", "data" => null, "themeWeb"
> => null, "plugin" => null)
> $replace=   "s"
> $camelBackedHelper  =   "session"
> $html   =   array("tags" => array, "base" => "/cakeproject", "here" => "/
> cakeproject/users/register", "params" => array, "action" =>
> "register", "data" => null, "_crumbs" => array, "__docTypes" => array,
> "helpers" => null, "webroot" => "/cakeproject/", "themeWeb" => null,
> "plugin" => null, "namedArgs" => null, "argSeparator" => null,
> "validationErrors" => null, "__tainted" => null, "__cleaned" => null,
> "_log" => null)
> $session=   array("helpers" => null, "__active" => true, "valid" 
> =>
> false, "error" => false, "_userAgent" =>
> "97d3931cf333eb6077958dca0114c3f6", "path" => false, "lastError" =>
> null, "security" => null, "time" => 1197751853, "sessionTime" =>
> false, "watchKeys" => array, "_log" => null, "base" => "/cakeproject",
> "webroot" => "/cakeproject/", "here" => "/cakeproject/users/register",
> "params" => array, "action" => "register", "data" => null, "themeWeb"
> => null, "plugin" => null)
> $ip =   "127.0.0.1"
> $host   =   "localhost"
> $BASE   =   "/cakeproject"
> $params =   array("pass" => array, "controller" => "users", "action" =>
> "register", "plugin" => null, "form" => array, "url" => array, "bare"
> => 0, "webservices" => null, "models" => array)
> $page_title =   false
>
> create('User'); ?>
>
> include - CORE\app\views\users\register.thtml, line 66
> View::_render() - CORE\cake\libs\view\view.php, line 765
> View::render() - CORE\cake\libs\view\view.php, line 320
> Controller::render() - CORE\cake\libs\controller\controller.php, line
> 664
> Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 280
> Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 248
> [main] - CORE\app\webroot\index.php, line 84
>
> Fatal error: Call to a member function create() on a non-object in
>
> Now ... whats this? I even explicitically included the helper via var
> $helpers = array('Form'); but doesn't work ...
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Form Helper in 1.2 not found ???

2007-12-15 Thread stefuNz

Hey ...
Sorry for my second question this evening ;)

But I just found this error:



Notice (8): Undefined variable: form [CORE\app\views\users
\register.thtml, line 66]

Context | Code

$this   =   array("name" => "Users", "here" => "/cakeproject/users/
register", "parent" => null, "action" => "register", "model" => null,
"association" => null, "field" => null, "fieldSuffix" => null,
"modelId" => null, "uses" => false, "helpers" => array, "viewPath" =>
"users", "layoutPath" => null, "viewVars" => array, "__scripts" =>
array, "pageTitle" => false, "models" => array, "base" => "/
cakeproject", "layout" => "default", "autoRender" => true,
"autoLayout" => true, "params" => array, "hasRendered" => false,
"loaded" => array, "ext" => ".ctp", "subDir" => null, "themeWeb" =>
null, "plugin" => null, "pluginPath" => null, "pluginPaths" => array,
"passedArgs" => array, "__passedVars" => array, "uuids" => array,
"_log" => null, "webroot" => "/cakeproject/", "modelNames" => array,
"data" => null, "webservices" => null, "cacheAction" => false)
$___viewFn  =   "D:\xampp\xampp\htdocs\cakeproject\app\views\users
\register.thtml"
$___dataForView =   array("ip" => "127.0.0.1", "host" => "localhost")
$loadHelpers=   true
$cached =   false
$loadedHelpers  =   array("Html" => array, "Session" => array)
$helper =   array("helpers" => null, "__active" => true, "valid" =>
false, "error" => false, "_userAgent" =>
"97d3931cf333eb6077958dca0114c3f6", "path" => false, "lastError" =>
null, "security" => null, "time" => 1197751853, "sessionTime" =>
false, "watchKeys" => array, "_log" => null, "base" => "/cakeproject",
"webroot" => "/cakeproject/", "here" => "/cakeproject/users/register",
"params" => array, "action" => "register", "data" => null, "themeWeb"
=> null, "plugin" => null)
$replace=   "s"
$camelBackedHelper  =   "session"
$html   =   array("tags" => array, "base" => "/cakeproject", "here" => "/
cakeproject/users/register", "params" => array, "action" =>
"register", "data" => null, "_crumbs" => array, "__docTypes" => array,
"helpers" => null, "webroot" => "/cakeproject/", "themeWeb" => null,
"plugin" => null, "namedArgs" => null, "argSeparator" => null,
"validationErrors" => null, "__tainted" => null, "__cleaned" => null,
"_log" => null)
$session=   array("helpers" => null, "__active" => true, "valid" =>
false, "error" => false, "_userAgent" =>
"97d3931cf333eb6077958dca0114c3f6", "path" => false, "lastError" =>
null, "security" => null, "time" => 1197751853, "sessionTime" =>
false, "watchKeys" => array, "_log" => null, "base" => "/cakeproject",
"webroot" => "/cakeproject/", "here" => "/cakeproject/users/register",
"params" => array, "action" => "register", "data" => null, "themeWeb"
=> null, "plugin" => null)
$ip =   "127.0.0.1"
$host   =   "localhost"
$BASE   =   "/cakeproject"
$params =   array("pass" => array, "controller" => "users", "action" =>
"register", "plugin" => null, "form" => array, "url" => array, "bare"
=> 0, "webservices" => null, "models" => array)
$page_title =   false



create('User'); ?>


include - CORE\app\views\users\register.thtml, line 66
View::_render() - CORE\cake\libs\view\view.php, line 765
View::render() - CORE\cake\libs\view\view.php, line 320
Controller::render() - CORE\cake\libs\controller\controller.php, line
664
Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 280
Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 248
[main] - CORE\app\webroot\index.php, line 84


Fatal error: Call to a member function create() on a non-object in

Now ... whats this? I even explicitically included the helper via var
$helpers = array('Form'); but doesn't work ...
--~--~-~--~~~---~--~~
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: Accelerating cakePHP

2007-12-15 Thread John David Anderson (_psychic_)


On Dec 15, 2007, at 1:12 PM, Chris Hartjes wrote:

>
> On Dec 15, 2007 3:00 PM, Pillow <[EMAIL PROTECTED]> wrote:
>>
>> Hi,
>> I've website which has about 3 uniq visits per day (up to 1500
>> online). The problem is that CMS written on CakePHP consumes too much
>> of CPUs power.
>>
>> Almost everything is beeing cached (whole views, sometimes db
>> results).
>>
>> In addition the same site was earlier driven by some poor free system
>> which hadn't even had cache, and the CPU usage was about 6 times  
>> less.
>>
>> Do you have any tricks and tips to speed up system based on cake?
>>
>
> Sounds like it was poorly designed, as 3 hits a day isn't what I
> would consider high traffic.  However, I would suggest the following:

(agreed)

> 1) install a PHP opcode cache like APC
> 2) make sure you have appropriate database indexes in place
> 3) spend some time profiling your code using tools like Xdebug and
> Cachegrind to find out where the slow spots really are.

I might also add

4) Move rewrite instructions to apache conf rather than .htaccess
5) Use unbind model (or something similar) more extensively.

-- John

--~--~-~--~~~---~--~~
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: Accelerating cakePHP

2007-12-15 Thread Chris Hartjes

On Dec 15, 2007 3:00 PM, Pillow <[EMAIL PROTECTED]> wrote:
>
> Hi,
> I've website which has about 3 uniq visits per day (up to 1500
> online). The problem is that CMS written on CakePHP consumes too much
> of CPUs power.
>
> Almost everything is beeing cached (whole views, sometimes db
> results).
>
> In addition the same site was earlier driven by some poor free system
> which hadn't even had cache, and the CPU usage was about 6 times less.
>
> Do you have any tricks and tips to speed up system based on cake?
>

Sounds like it was poorly designed, as 3 hits a day isn't what I
would consider high traffic.  However, I would suggest the following:

1) install a PHP opcode cache like APC
2) make sure you have appropriate database indexes in place
3) spend some time profiling your code using tools like Xdebug and
Cachegrind to find out where the slow spots really are.


-- 
Chris Hartjes

My motto for 2007:  "Just build it, damnit!"

@TheKeyboard - http://www.littlehart.net/atthekeyboard

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



Accelerating cakePHP

2007-12-15 Thread Pillow

Hi,
I've website which has about 3 uniq visits per day (up to 1500
online). The problem is that CMS written on CakePHP consumes too much
of CPUs power.

Almost everything is beeing cached (whole views, sometimes db
results).

In addition the same site was earlier driven by some poor free system
which hadn't even had cache, and the CPU usage was about 6 times less.

Do you have any tricks and tips to speed up system based on cake?

Thx,
Pillow
--~--~-~--~~~---~--~~
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: Extended Validation !?

2007-12-15 Thread Chris Hartjes

On Dec 15, 2007 2:34 PM, stefuNz <[EMAIL PROTECTED]> wrote:
>
> Hi!
>
> I want to use validation for the following situation:
>
> I have a select field (field1) with options a,b,c
> If field1 is a or b then field2 and field3 may not be empty (text
> fields)
> if field1 is c then field4 may not be empty ...
>
> is there a way to use the validation for this or has it to be
> "manually"

Sounds to me like it is definitely custom validation, which means
you'll have to do it "manually".  Luckily it's very easy to do it.

http://tempdocs.cakephp.org/#TOC121877

Hope that helps.

-- 
Chris Hartjes

My motto for 2007:  "Just build it, damnit!"

@TheKeyboard - http://www.littlehart.net/atthekeyboard

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



Extended Validation !?

2007-12-15 Thread stefuNz

Hi!

I want to use validation for the following situation:

I have a select field (field1) with options a,b,c
If field1 is a or b then field2 and field3 may not be empty (text
fields)
if field1 is c then field4 may not be empty ...

is there a way to use the validation for this or has it to be
"manually"
--~--~-~--~~~---~--~~
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: Can CakePHP allow a /users/username/action directory syntax?

2007-12-15 Thread Chris Hartjes

On Dec 15, 2007 12:59 PM, Theo Chakkapark <[EMAIL PROTECTED]> wrote:
>
> I have a website that I'd love to convert to CakePHP, and I was
> wondering if there was a means to use a URL syntax that goes like
> this:
>
> /users//

You can create custom routes that map URL's to controller/action
pairs.  Read up in the old manual and the new manual
(http://tempdocs.cakephp.org) on how to create routes.

-- 
Chris Hartjes

My motto for 2007:  "Just build it, damnit!"

@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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: Shouldn't the Text Helper use multibyte strings instead?

2007-12-15 Thread Chris Hartjes

On Dec 15, 2007 12:05 PM, mclee <[EMAIL PROTECTED]> wrote:
>
> Well, we have 'function_exists', don't we?
>
> Surely we can do a degrade if mb_substr is not installed.
>

Are you volunteering to do it?

-- 
Chris Hartjes

My motto for 2007:  "Just build it, damnit!"

@TheKeyboard - http://www.littlehart.net/atthekeyboard

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



Can CakePHP allow a /users/username/action directory syntax?

2007-12-15 Thread Theo Chakkapark

I have a website that I'd love to convert to CakePHP, and I was
wondering if there was a means to use a URL syntax that goes like
this:

/users//

For example, I have a user named "Pete" who would like to post to his
blog; he would go here to do so:

www.website.com/users/Pete/Post

Also, I want to create a registration form, and put it at /
registration, but I get gripes that I need a registration model; I
don't want to put the registration at /users/registration, is there a
way around this?

Using CakePHP 1.2.

Thanks.

--~--~-~--~~~---~--~~
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: Shouldn't the Text Helper use multibyte strings instead?

2007-12-15 Thread mclee

Well, we have 'function_exists', don't we?

Surely we can do a degrade if mb_substr is not installed.

On Dec 16, 12:51 am, Gwoo <[EMAIL PROTECTED]> wrote:
> Does every php install have mb_substr() ?

--~--~-~--~~~---~--~~
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: Shouldn't the Text Helper use multibyte strings instead?

2007-12-15 Thread Gwoo

Does every php install have mb_substr() ?
--~--~-~--~~~---~--~~
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: Access to related model data from Behavior?

2007-12-15 Thread Gwoo

data is cleared out at the end of the Model::save(), so afterSave does
not get it. What I do is set the data for the related model in the
beforeSave, then in the afterSave the related model data is available
and can be saved on its own.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Newbie needs help

2007-12-15 Thread [EMAIL PROTECTED]

I am a php hack making the move to cakephp. So far so good with
setting up the db and baking all the MVCs. You can see everything here

http://cake.reviewfornurses.com

Here is my first of many questions.

I want to be able to add questions on one page that will let me also
add the answers/rational and subcodes, subjects, types etc. Instead of
having to use all of the edit view.

I noticed when building the question_controller.php in bake I could
add other models to it. Should I add the answers model to the
questions_controller? Or should I just work with the controllers now?


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



Shouldn't the Text Helper use multibyte strings instead?

2007-12-15 Thread mclee

Hi,

I'm using CakePHP 1.2.0.5875.

When I dig into the code of Text Helper, I found out that in functions
like
truncate() or excerpt(), it calls substr() instead of multibyte
friendly functions like
mb_substr().

Will this be fixed? Or will there be another Text Helper for
multibytes?

--~--~-~--~~~---~--~~
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: Frustration with simple Ajax request

2007-12-15 Thread bingo

hi

If you are trying to return JSON Object, I would suggest doing the
following

1. in your view/users folder, create a json folder
2. withing views/users/json folder create a get_user_details.ctp file
with the following code
object($data); //converts PHP array into JSON object
array
?>

3. $data is whatever data you set in your controller. In your case it
will be
$this->set('data', array('success'=> true, 'data'=>
array('recordid'=>1, 'first'=>Jack,...)

Regards,
bingo

On Dec 15, 7:31 am, majna <[EMAIL PROTECTED]> wrote:
> make getUserDetails.ctp
> set data from controller to this view.
> in view use, php json_encode
>
> On Dec 15, 10:56 am, Eli S <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi all,
> > I have spent a long time looking for a solution to this without luck.
>
> > I am trying to use the excellent JS library Extjs with cake 1.2 latest
> > build.
>
> > I am trying to make a simple ajax request to a controller
>
> >  > class UsersController extends AppController{
> > var $helpers = array('Html', 'Form', 'Javascript');
>
> > function admin(){
> > $this->layout = 'extadmin';
> > $this->set('users', $this->User->findById(18));
> > }
>
> > function getUserDetails(){
> > $this->layout = 'ajax';
> > echo("{success: true, data:{recordid:'1', 
> > first:'Jack',
> > last:'Slocum', company:'Ext JS', email:'[EMAIL PROTECTED]',
> > state:'OH', dob:'04/15/2007', fee:'50'} }");
> > }
> > }
> > ?>
>
> > when making an Ajax request to /users/getUserDetails I get the
> > "Missing View" cakephp standard error response.
>
> > This really perplexes me because I would assume that with
> > layout='ajax' being set no view would be necessary.
>
> > If I wasn't bald I would be tearing my hair out right now!!- Hide quoted 
> > text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
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: Frustration with simple Ajax request

2007-12-15 Thread majna

make getUserDetails.ctp
set data from controller to this view.
in view use, php json_encode


On Dec 15, 10:56 am, Eli S <[EMAIL PROTECTED]> wrote:
> Hi all,
> I have spent a long time looking for a solution to this without luck.
>
> I am trying to use the excellent JS library Extjs with cake 1.2 latest
> build.
>
> I am trying to make a simple ajax request to a controller
>
>  class UsersController extends AppController{
> var $helpers = array('Html', 'Form', 'Javascript');
>
> function admin(){
> $this->layout = 'extadmin';
> $this->set('users', $this->User->findById(18));
> }
>
> function getUserDetails(){
> $this->layout = 'ajax';
> echo("{success: true, data:{recordid:'1', 
> first:'Jack',
> last:'Slocum', company:'Ext JS', email:'[EMAIL PROTECTED]',
> state:'OH', dob:'04/15/2007', fee:'50'} }");
> }
> }
> ?>
>
> when making an Ajax request to /users/getUserDetails I get the
> "Missing View" cakephp standard error response.
>
> This really perplexes me because I would assume that with
> layout='ajax' being set no view would be necessary.
>
> If I wasn't bald I would be tearing my hair out right now!!
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Frustration with simple Ajax request

2007-12-15 Thread Eli S

Hi all,
I have spent a long time looking for a solution to this without luck.

I am trying to use the excellent JS library Extjs with cake 1.2 latest
build.

I am trying to make a simple ajax request to a controller

layout = 'extadmin';
$this->set('users', $this->User->findById(18));
}

function getUserDetails(){
$this->layout = 'ajax';
echo("{success: true, data:{recordid:'1', first:'Jack',
last:'Slocum', company:'Ext JS', email:'[EMAIL PROTECTED]',
state:'OH', dob:'04/15/2007', fee:'50'} }");
}
}
?>

when making an Ajax request to /users/getUserDetails I get the
"Missing View" cakephp standard error response.

This really perplexes me because I would assume that with
layout='ajax' being set no view would be necessary.

If I wasn't bald I would be tearing my hair out right now!!

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



Few questions from a Cake newcomer...

2007-12-15 Thread Funkdafied

I've just started using CakePHP and so far it looks great. However,
after reading the manual and putting together a quick try-out site
with scaffolding/bake, a few questions remain..

1. If I go to "http://localhost/users";, it works just fine and the
index page comes up as expected.. but all links seem to have a top-
level directory of "app". eg:
http://localhost/app/users/add
http://localhost/app/users
How can I remove "app" from the URL? Pages work fine without (and
with) it, but all links seem to have it by default even though it's
unnecessary.

2. I'd like to create a "mobile" version of my website, accessible
from mobile/cell phones.. I want the URL to be something like
"domain.com/mobile", so it would have pages such as "domain.com/mobile/
users". They would share the same controller and model as the main
page but with a different view. How would I do this?

3. I see that layouts have placeholders for content and the title..
but what do I do about menus? In particular, I'd like to be able
highlight the current menu item but obviously not put the markup in
all views.

4. I noticed "bake" can create admin pages, but how can I make them
secure with a password?

5. I'm sure it's simple but how would I make a page such as
"domain.com/legal" ? There's no model behind it, it doesn't really
need a controller.. and the name is singular.

So theres a fair bit there.. and I'll probably have more questions as
I go along but I really appreciate anyone's assistance in answering
the above. thanks :)

--~--~-~--~~~---~--~~
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: form->create() ::: how can use onSubmit in form->create()

2007-12-15 Thread MrTufty

It WAS a huge disaster. I got involved with Cake at that point, and I
almost gave it up because of the huge inaccuracies present in the
Wiki. At any given point there were 3 or 4 suggestions on how to do
each task, and 3 of them would be wrong somewhere along the line - but
of course you wouldn't know which.

The Bakery and the Manual (even in it's half-finished form) are of a
MUCH higher quality than any Wiki could ever be.

Chris, I didn't realise you weren't around at that point - I've gotten
so used to seeing your name on these groups, I figured you'd been
around forever!

Tufty

On Dec 14, 7:21 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On Dec 14, 2007 1:06 PM, WordPress Guru <[EMAIL PROTECTED]> wrote:
>
>
>
> > Thanks Chris, and grigri
>
> > I understand the differnce between a manual and I think the purpose of
> > any good document is to at least inform the reader about the
> > parameters of any method. The api is so poorly documented that in most
> > case it does not tell in any detail about the parameters. For example
> > in one case, it tells that options array is just like form_remote_tag
>
> I'm sorry if you think I was implying that you didn't understand the
> difference between a manual and an API.  That wasn't my intent.
>
> I agree that parts of the API could be better documented, perhaps with
> an example of it's use.
>
>
>
> > Maybe a user editable wiki will do the job, or something like php.net
> > which has user contributions as part of the manual.
>
> This was done in the past (before I got involved with CakePHP) and
> apparently it was a huge disaster.
>
> --
> Chris Hartjes
>
> My motto for 2007:  "Just build it, damnit!"
>
> @TheKeyboard -http://www.littlehart.net/atthekeyboard
--~--~-~--~~~---~--~~
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: Session, destruction (not happening?)

2007-12-15 Thread majna

for first part check
http://groups.google.com/group/cake-php/browse_thread/thread/6c991fc8bbddd18e/33ec269fdbd366d5?lnk=st&q=gc#33ec269fdbd366d5



On Dec 15, 6:48 am, jarmstrong <[EMAIL PROTECTED]> wrote:
> Hi everyone,
>
> So I am seeing that the cake_sessions table is not getting automatically
> cleaned up by cake for the stale session variables. I have created a shell
> process "ClearSessions" which is run in a cron job and clears out session
> that have persissted longer than what I allow. Does anyone have any best
> practices here for the people that are running higher traffic cake apps? I
> have also made this table MyIsam in MySql as it is 80% read and 80% write.
>
> Secondly, there are a LOT of updates that are getting written back. Does
> anyone have an idea on how this could be slimmed down? For instance I
> believe this is partially due to the high number of requestAction calls I
> have going on.
> --
> View this message in 
> context:http://www.nabble.com/Session%2C-destruction-%28not-happening-%29-tp1...
> Sent from the CakePHP mailing list archive at Nabble.com.
--~--~-~--~~~---~--~~
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: RequestAction parameters

2007-12-15 Thread MrTufty

One tip to avoid error messages like this would be to change the
definition of your function to:

function index($username = null) {

That way if a username is not passed, it doesn't break.

BUT, that doesn't solve your problem, which appears to be that the
username isn't being set at all - have you tried outputting $username
in the view, to see if it actually contains anything?

Tufty

On Dec 14, 9:24 pm, Fabian <[EMAIL PROTECTED]> wrote:
> I did the following
>
> requestAction('archives/index/'.$username); ?
>
>
>
> and then in the controller
>
>  class ArchivesController extends AppController {
> var $name = 'archives';
>
> //echo $username;
> function index($username) {
> $archives = $this->Archive->findByUser($username);
> if(isset($this->params['requested'])) {
>  return $archives;
> }
> $this->set('archives', $archives);
> }}
>
> ?>
>
> And I get this error:
>
> Warning: Missing argument 1 for ArchivesController::index() in C:
> \Program Files\xampp\htdocs\cake\app\controllers
> \archives_controller.php on line 5
>
> Notice: Undefined variable: username in C:\Program Files\xampp\htdocs
> \cake\app\controllers\archives_controller.php on line 6
>
> On Dec 14, 2:17 pm, jarmstrong <[EMAIL PROTECTED]> wrote:
>
> > You can get away with just adding the arguments after the function name 
> > using
> > slashes to split each argument.
>
> > You can do something like this:
>
> > requestAction('archives/index/'.$i_love_Cake); ?>
>
> > --
> > View this message in 
> > context:http://www.nabble.com/RequestAction-parameters-tp14339603p14339776.html
> > Sent from the CakePHP mailing list archive at Nabble.com.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---