Re: How can I fetch fields of the $hasAndBelongsToMany joinTable?

2007-05-15 Thread [EMAIL PROTECTED]

Pretty cool. I've got it done:)
Thanks Travis!


--~--~-~--~~~---~--~~
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: Multiple rules of validation per field in CakePHP 1.2? (bakery sucks?)

2007-05-15 Thread Dr. Tarique Sani

On 5/16/07, Travis Cline <[EMAIL PROTECTED]> wrote:
>
> > Whoa! why is X allowed to use the same tone and Y is not?
>
> I suppose I was seeing it as new member vs older member, and saw a
> little difference in expectations that may not really be there.
> Your response isn't as harsh as I made it out to be -- sorry to jump
> on you like that, no hard feelings.

None here either :)

T

-- 
My motto for everyone else -  "Just shut up, damnit!!"
=
PHP for E-Biz: http://sanisoft.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
-~--~~~~--~~--~--~---



Pagination

2007-05-15 Thread [EMAIL PROTECTED]

i am working on a php project.. we are using cake php..
i am new with cake php..
anybody can help me to do pagination...


--~--~-~--~~~---~--~~
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: Multiple rules of validation per field in CakePHP 1.2? (bakery sucks?)

2007-05-15 Thread Travis Cline

> Whoa! why is X allowed to use the same tone and Y is not?

I suppose I was seeing it as new member vs older member, and saw a
little difference in expectations that may not really be there.
Your response isn't as harsh as I made it out to be -- sorry to jump
on you like that, no hard feelings.

Anyhow,
I was playing around with recent model code:
var $validate = array(
'field_name' => array(
array('rule' => 'validationMethod1', 
'message'=>'validationMethod1
failed.'),
array('rule' => 'validationMethod2', 
'message'=>'validationMethod2
failed.'),
),
);
Rule can be an array as to pass parameters to the method (i'm bet
mariano is covering all this though).
There doesn't appear to be good control of ordering yet it just uses
the last one in  -- 'last' isn't being used as far as I can tell.
Pretty slick nonetheless.


Regards,
Travis


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



what is the webroot's controller?

2007-05-15 Thread bittersweet

This is my first time to use cakephp to write web apps. My question is
for the home page of a site, what controller does it go with? I'm
asking because I need to write some logic (retrieve data from DB)  in
the home page.

Thanks in advance,


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

2007-05-15 Thread Dr. Tarique Sani

On 5/16/07, jyrgen <[EMAIL PROTECTED]> wrote:
> the end functionality is
>
> * prevention of multiple logins *
>
You want only one person to be logged in at a time OR you don't want
the same person to login from multiple computers at the same time?

Tarique

-- 
My motto for everyone else -  "Just shut up, damnit!!"
=
PHP for E-Biz: http://sanisoft.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: session serialize handler

2007-05-15 Thread jyrgen

> > i need access to *all* existing valid sessions in the table,
> > so i can test, if a user is already logged in .
>
> What is the end result / functionality you are trying to achieve by doing 
> that?


hello tarique,

the end functionality is

* prevention of multiple logins *

(which i assumed being an easy task to achieve :-)

in fact i like soytuny's idea...

cheers, jyrgen


--~--~-~--~~~---~--~~
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: Bake error: New model Object

2007-05-15 Thread gwoo

does the Product model exist?


--~--~-~--~~~---~--~~
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: Multiple rules of validation per field in CakePHP 1.2? (bakery sucks?)

2007-05-15 Thread Dr. Tarique Sani

On 5/16/07, Travis Cline <[EMAIL PROTECTED]> wrote:
>
> Why not, "yeah it's a workflow problem, you might check trac for a
> feature ticket and create one if it doesn't exit" or the like.
>
> Just kind of disappointed at the tone of the response I guess =/
>

Whoa! why is X allowed to use the same tone and Y is not?

Why not ask the original author that instead of a dismissive "bakery
sucks?" he should write "There seems to be problem with the RSS feed
publishing"

Why not instead of "Frustrated" he should write "Waiting anxiously"

AND if you read my mail carefully I offered him a possible solution to
his possible problem - dismissal would be "Yeah? Write and submit
patch!"

And for the record I am in no way involved in administering Bakery nor
am I one of the developers

Lastly open source mailing list are not a place for ok I will skip that ;)

Cheers
Tarique

-- 
My motto for everyone else -  "Just shut up, damnit!!"
=
PHP for E-Biz: http://sanisoft.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: HowTo: Linked Combobox ?

2007-05-15 Thread Travis Cline

> Wouldn't it be better to preload the data into JSON (or similar) than
> to make an additional round trip to the server for every change of a
> combo box?

For small sets of data, yeah. Generating a new request allows for
greater expansion though.

--
Travis


--~--~-~--~~~---~--~~
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: How can I fetch fields of the $hasAndBelongsToMany joinTable?

2007-05-15 Thread Travis Cline

Hi rik,

I think what you're looking for is the use of the 'with' association.

Relevant thread:
http://groups.google.com/group/cake-php/browse_thread/thread/c50c31ca3549713c/804842a5f6216abe

There's some comment talk here that's relevant but the general article
is outdated, 'with' is in 1.2 and is working fine.
http://www.thinkingphp.org/2006/10/26/modeling-relationships-in-cakephp-faking-rails-throughassociation/

Basically you need to create a new model that defines the joining
table then add 'with'=>'JoinModelName' for your relationship and you
should then get the relationship table data.

You may have a compelling reason but you would be able to simplify
your current models sustaintially if you follow convention for table
names and relationship field names.

--
Travis


--~--~-~--~~~---~--~~
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: HowTo: Linked Combobox ?

2007-05-15 Thread [EMAIL PROTECTED]

Wouldn't it be better to preload the data into JSON (or similar) than
to make an additional round trip to the server for every change of a
combo box?

On May 15, 8:20 pm, "Derick Ng" <[EMAIL PROTECTED]> wrote:
> http://www.devmoz.com/blog/2007/04/04/cakephp-update-a-select-box-usi...
> On 5/16/07, Derick Ng <[EMAIL PROTECTED]> wrote:
>
>
>
> >http://www.devmoz.com/blog/2007/04/04/cakephp-update-a-select-box-usi...
>
> > On 5/15/07, 浪漫様 <[EMAIL PROTECTED]> wrote:
>
> > > Hello Everybody,
> > > How to use SelectTag to make 2 linked Comboboxes??
> > > I want to make the 2nd Combobox change its options depending on the
> > > option selected on the 1st Combobox... that's easy to do in
> > > Javascript... but how to make it work in CakePHP with SelectTags???
> > > Thank you very much!
>
> > > Rohman


--~--~-~--~~~---~--~~
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: Multiple rules of validation per field in CakePHP 1.2? (bakery sucks?)

2007-05-15 Thread Travis Cline

I think he's more so commenting on potential breakage of bakery
articles (which is an issue IMO) rather than trying to track down the
information.

There was a little list-talk on the edit-puts-atricles-back-into-queue
issue and revisioning for articles back in Dec. -- not sure if it's on
the todo for bakery in any form (not seeing a trac ticket).

Sure, he could pull bakery svn and add article revisioning and post
patches but that's somewhat unrealistic.

Ultimately I don't think he should put down for commenting a real
issue.
Yeah he could have phrased it in a different manner but discarding it
because of tone isn't cool.

Why not, "yeah it's a workflow problem, you might check trac for a
feature ticket and create one if it doesn't exit" or the like.

Just kind of disappointed at the tone of the response I guess =/

--
Travis


--~--~-~--~~~---~--~~
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: Multiple rules of validation per field in CakePHP 1.2? (bakery sucks?)

2007-05-15 Thread Dr. Tarique Sani

On 5/16/07, Mariano Iglesias <[EMAIL PROTECTED]> wrote:
>
> @Tarique: that article is regarding how to use the core 1.2 functionality
> for multiple validation per field.
>

Now that you have leaked out what it is - I WANT IT NOW AS WELL!

:P

Tarique

-- 
My motto for everyone else -  "Just shut up, damnit!!"
=
PHP for E-Biz: http://sanisoft.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: session serialize handler

2007-05-15 Thread Dr. Tarique Sani

On 5/15/07, jyrgen <[EMAIL PROTECTED]> wrote:
>
> i need access to *all* existing valid sessions in the table,
> so i can test, if a user is already logged in .
>

What is the end result / functionality you are trying to achieve by doing that?

Tarique

-- 
My motto for everyone else -  "Just shut up, damnit!!"
=
PHP for E-Biz: http://sanisoft.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: CakePHP wallpaper

2007-05-15 Thread Dr. Tarique Sani

On 5/15/07, Anton Dubina <[EMAIL PROTECTED]> wrote:
> Just a vector-drawn CakePHP logo on one-color background for people
> like me who prefer kinda "minimalistic" backgrounds.

May be you would quickly like to add the CakePHP site URL and a
CakePHP registered TM notice before you get your head bitten off ;)

Thanks for the efforts

Tarique

-- 
My motto for everyone else -  "Just shut up, damnit!!"
=
PHP for E-Biz: http://sanisoft.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
-~--~~~~--~~--~--~---



More succinct Textile Helper and Component

2007-05-15 Thread Travis Cline

I just posted two snippets:
http://cakeforge.org/snippet/detail.php?type=snippet&id=183
http://cakeforge.org/snippet/detail.php?type=snippet&id=184

Which re-implement a Textile Helper and a Component such as those that
walker posted in the bakery:
http://bakery.cakephp.org/articles/view/textile-2-0-0-helper
http://bakery.cakephp.org/articles/view/textile-component

I take a different approach, just wrapping the main Textile methods.
Textile lives as classTextile.php (from http://textile.thresholdstate.com/
) in a vendors directory.

This is more succinct and doesn't break the naming of the main methods
(TextileThis and TextileRestricted).

--
Travis


--~--~-~--~~~---~--~~
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: Multiple rules of validation per field in CakePHP 1.2? (bakery sucks?)

2007-05-15 Thread Mariano Iglesias

@Tarique: that article is regarding how to use the core 1.2 functionality
for multiple validation per field.

@Athies: that's my article, it will be published shortly, just be patient.

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de Dr. Tarique Sani
Enviado el: Miércoles, 16 de Mayo de 2007 01:23 a.m.
Para: cake-php@googlegroups.com
Asunto: Re: Multiple rules of validation per field in CakePHP 1.2? (bakery
sucks?)

If you really want to read about the topic - it has been beaten to
death on this list


--~--~-~--~~~---~--~~
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: Multiple rules of validation per field in CakePHP 1.2? (bakery sucks?)

2007-05-15 Thread Dr. Tarique Sani

On 5/16/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> The rss feed for bakery.cakephp.org listed a good article titled
> "Multiple rules of validation per field in CakePHP

If you really want to read about the topic - it has been beaten to
death on this list
http://cheesecake-photoblog.org/doku.php?id=multiple_validations_per_field_in_cakephp_1.2
is my version of the same there are some others

> 1.2" (bakery.cakephp.org/articles/view/369) yesterday.  Today I can't
> reach it.  It says "Unable to provide the article you requested; it is
> currently pending approval for public viewing"?

If you want to complain - then I would ask you what are you willing to
do to make Bakery administration suck less?

In short the answer is usually out there - search and you shall find

Cheers
Tarique


-- 
My motto for everyone else -  "Just shut up, damnit!!"
=
PHP for E-Biz: http://sanisoft.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
-~--~~~~--~~--~--~---



json displaying data

2007-05-15 Thread pete

hi,
i have a controller which prints out json data

function grid_data()
{
  $projects =  $this->Project->getProjects();
  $rows=2;
  echo 
$_GET['callback'].'({"total":"'.$rows.'","results":'.$this-
>json->encode($projects).'})';

}



the javascript for my datagrid calls
http://localhost/cake/projects/grid_data

the json string is printed out but also the html code from
default.thtml...is there a way to avoid printing the html code?

http://localhost/cake/projects/grid_data
({"total":"2","results":
[{"id":"1","ProjectTitle":"Bumble","StartDate":"2007-05-10","EndDate":"2007-05-30","Status":"0","Type":"0"}]})

http://www.w3.org/1999/xhtml";>



thx

pete


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



My own generateList

2007-05-15 Thread dasiel

Hi
I can't use the findAll(), generateList() funtions from Cake, I'm
working whit MSSQL Server 2000 and  I'm using the Adodb library. For
some reason when I try to use them I get some errors, for this reason
I need to use my own generate list. Where I can see some example about
it?
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
-~--~~~~--~~--~--~---



Is there a way to order named parameters in a URL? (in 1.2)

2007-05-15 Thread Aaron Shafovaloff

Is there a way to order named parameters in a URL? I've tried sending
my array fields in a different order to Router::url, but it seems to
always order them for me in a way I don't want.


--~--~-~--~~~---~--~~
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 fetch fields of the $hasAndBelongsToMany joinTable?

2007-05-15 Thread [EMAIL PROTECTED]

Hi all,
$hasAndBelongsToMany associations will fetch the fields of the
associated tables, but will not fetch the fields of the joinTable
ifself.

joinTable:
CREATE TABLE `my_keyword` (
`userId` int(10) unsigned NOT NULL default '0',
`keywordId` int(10) unsigned NOT NULL default '0',
`addTime` int(10) unsigned NOT NULL default '0',
`categoryId` smallint(6) NOT NULL default '40',
PRIMARY KEY  (`userId`,`keywordId`)
);

Here's my code:

class Keyword extends AppModel {
var $name = 'Keyword';
var $useTable = 'cms_keyword';
var $primaryKey = 'keywordId';
var $hasAndBelongsToMany = array(
'User' => array(
'className' => 'User',
'joinTable' => 'my_keyword',
'foreignKey' => 'keywordId',
'associationForeignKey' => 'userId',
'uniq' => true
)
);
}

class User extends AppModel {
var $name = 'User';
var $useTable = 'user';
var $primaryKey = 'userId';
var $belongsTo = array(
'UserKeyword' => array(
'className' => 'UserKeyword',
'foreignKey' => 'userId'
)
);
}

class KeywordsController extends AppController {
var $name = 'Keywords';
var $recursive = 2;

function index() {
$k = $this->Keyword->read(null, 7);
var_dump($k); // This will output an array with 'User' and
'Keyword', but no fields about the 'joinTable' (my_keyword), but I
also need the fields of my_keyword: addTime & categoryId.
}
}

How can I fetch the fields of the 'joinTable' with
$hasAndBelongsToMany associations?

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



$this->params after $this->paginate call

2007-05-15 Thread Kuzmich

After I call $this->paginate in my controller, $this->params in a page
template point to Paginator helper params instead of controller
params.

// page template
debug($this->params);

before $this->paginate:
Array
(
[controller] => logs
[action] => search
...
)

After:
Array
(
[page] => 1
[current] => 50
[count] => 1171
[prevPage] =>
[nextPage] => 1
[pageCount] => 24
...
)

Any ideas how to get controller's params?
cakephp 1.2.0.4798 alpha


--~--~-~--~~~---~--~~
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: Question about findAll array

2007-05-15 Thread Dazweeja

Nice work, grigri. I'm fairly new to Cake and I thought that this
would be such a common thing to do that it would form part of the core
functionality. After all, if you are going to pass an array to any non-
Cake-specific function - that is, to any external application or a non-
Cake-specific function that exists inside your Cake framework  - the
second type of array that I have described is far more useful than the
standard Cake-ified version. I thought I must be missing something but
maybe I wasn't after all. I don't mean to gripe about Cake though -
the framework on the whole is excellent and I can't thank the
developers enough.

On May 15, 10:35 pm, grigri <[EMAIL PROTECTED]> wrote:
> Heh I was thinking the exact same thing - I wrote a code submission
> for the bakery on this, but it's not been approved yet.
>
> In the meantime I've pasted the Behavior code here 
> :http://pastebin.sk/en/1596/
>
> Just add the $actsAs = array('SimpleResults') to any model and it'll
> work transparently.
>
> (This is assuming you're using 1.2 - if not, you could incorporate the
> code from the behavior into your AppModel and it would do the same
> thing)


--~--~-~--~~~---~--~~
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: Using CakePHP to extend existing website

2007-05-15 Thread snautz

http://www.thinkingphp.org/2006/05/04/using-cakephp-in-external-php-systems-cmss-weblogs-etc/

On 15 май, 17:56, Chandra <[EMAIL PROTECTED]> wrote:
> The company I work for has a PHP/MySQL (and the Smarty Template
> Framework as a front end) based website that been running for a little
> whilethe time has come to add more functionality to the site.  I'd
> like to use use CakePHP to add these new features on...and I need to
> see if it's even possible (I'm a Cake newbie) and then need to sell it
> to my boss.  I was hoping somone could answer a few simple questions
> for me:
>
> 1.  Site Authentication is done using PHP sessions stored in a
> database...Can Cake use the same session methods or will the users
> have to re-authenticate as they pass between the old and new
> functionality (and vice-versa)
>
> 2.  There is some business logic and classes from the old site I need
> to use - anything to watch out for?
>
> 3.  In accessing the existing MySQL database schema...I can use Cake's
> CRUD capabilities...or is there a alternate way I should be accessing
> the data?
>
> Thanks for all your help,
>
> Chandra


--~--~-~--~~~---~--~~
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: Using CakePHP to extend existing website

2007-05-15 Thread snautz

http://www.thinkingphp.org/2006/05/04/using-cakephp-in-external-php-systems-cmss-weblogs-etc/

On 15 май, 20:48, Chandra <[EMAIL PROTECTED]> wrote:
> Rocky..thanks for the reply.  I am worried most about the
> authentication/sessions issue...Any idea if Cake and PHP sessions can
> work together.  I can't have the users reauthenticate themselves as
> they go between the regular PHP site and Cake site.
>
> -Chandra
>
> On May 15, 1:09 pm, rockit <[EMAIL PROTECTED]> wrote:
>
> > Hi Chandra i'm new as well to cake but i don't see any huge roadblocks
> > in using cake to extend your application.
>
> > if you notice in the bakery, there is a good resource on how to use
> > smarty for your presentation logic.
>
> > the business logic and classes can be placed in as components with a
> > few minor tweaks.
>
> > as far as accessing the db schema, you can do it the cake way or your
> > own way.
>
> > there's a bit of tweaking that would need to be done to your app i
> > imagine, but i wouldn't say it would have to go as far as refactoring
> > the code.  Most OO-PHP code in my experience has worked great with
> > cake.
>
> > On May 15, 11:56 am, Chandra <[EMAIL PROTECTED]> wrote:
>
> > > The company I work for has a PHP/MySQL (and the Smarty Template
> > > Framework as a front end) based website that been running for a little
> > > whilethe time has come to add more functionality to the site.  I'd
> > > like to use use CakePHP to add these new features on...and I need to
> > > see if it's even possible (I'm a Cake newbie) and then need to sell it
> > > to my boss.  I was hoping somone could answer a few simple questions
> > > for me:
>
> > > 1.  Site Authentication is done using PHP sessions stored in a
> > > database...Can Cake use the same session methods or will the users
> > > have to re-authenticate as they pass between the old and new
> > > functionality (and vice-versa)
>
> > > 2.  There is some business logic and classes from the old site I need
> > > to use - anything to watch out for?
>
> > > 3.  In accessing the existing MySQL database schema...I can use Cake's
> > > CRUD capabilities...or is there a alternate way I should be accessing
> > > the data?
>
> > > Thanks for all your help,
>
> > > Chandra- 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
-~--~~~~--~~--~--~---



Multiple rules of validation per field in CakePHP 1.2? (bakery sucks?)

2007-05-15 Thread [EMAIL PROTECTED]

The rss feed for bakery.cakephp.org listed a good article titled
"Multiple rules of validation per field in CakePHP
1.2" (bakery.cakephp.org/articles/view/369) yesterday.  Today I can't
reach it.  It says "Unable to provide the article you requested; it is
currently pending approval for public viewing"?  How long does it take
to approve articles for public viewing?  Is there a way to view this
article when I am logged in?  Why is it even showing in the RSS feed
if I can only view it for day?

- Frustrated


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



ajax drag

2007-05-15 Thread Michael Augustyniak

I need just drag ( move ) the div around on page

but this not working for me

drag('test', array('change' => false)) ?>

div('test')?>

divEnd('test'); ?>

can someone push me in right direction please ?
thank you

--~--~-~--~~~---~--~~
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: Using CakePHP to extend existing website

2007-05-15 Thread snautz

you can check out this link
http://www.thinkingphp.org/2006/05/04/using-cakephp-in-external-php-systems-cmss-weblogs-etc/

On 15 май, 17:56, Chandra <[EMAIL PROTECTED]> wrote:
> The company I work for has a PHP/MySQL (and the Smarty Template
> Framework as a front end) based website that been running for a little
> whilethe time has come to add more functionality to the site.  I'd
> like to use use CakePHP to add these new features on...and I need to
> see if it's even possible (I'm a Cake newbie) and then need to sell it
> to my boss.  I was hoping somone could answer a few simple questions
> for me:
>
> 1.  Site Authentication is done using PHP sessions stored in a
> database...Can Cake use the same session methods or will the users
> have to re-authenticate as they pass between the old and new
> functionality (and vice-versa)
>
> 2.  There is some business logic and classes from the old site I need
> to use - anything to watch out for?
>
> 3.  In accessing the existing MySQL database schema...I can use Cake's
> CRUD capabilities...or is there a alternate way I should be accessing
> the data?
>
> Thanks for all your help,
>
> Chandra


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



Bake error: New model Object

2007-05-15 Thread Gtm


I'm working thru an IBM tutorial (link below) and have hit a snag.
When trying to Bake (v 1.1.14.4797) my Product controller, Bake is
exiting without any msg or error.  I've believe I've traced the
failure to line (approx.) 1340, $modelObj =& new $currentModelName();
in __BakeActions.  It just dies here.  I've checked the
$currentModelName var, it's seems correct: 'Product'.

Anyone have any thoughts on this before I try to dig deeper.

-G


https://www6.software.ibm.com/developerworks/education/os-php-cake2/section3.html


--~--~-~--~~~---~--~~
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: Using CakePHP to extend existing website

2007-05-15 Thread the_woodsman

There´s so many config options for sessions that sharing them shouldn
´t be a problem, but from personal experience, I´ve found it a real
headache, especially with the double login issue you describe.
There are many posts about it, but all addressing slightly different
issues.

You could of course experiment with this first, it might prove simpler
for you than it did for me.

Someone who´s done this should write a case study for the bakery, it´d
help a ton of people, and might stop so many posts about this
cluttering the group.

Just my two cents...

Woody


On May 15, 11:48 am, Chandra <[EMAIL PROTECTED]> wrote:
> Rocky..thanks for the reply.  I am worried most about the
> authentication/sessions issue...Any idea if Cake and PHP sessions can
> work together.  I can't have the users reauthenticate themselves as
> they go between the regular PHP site and Cake site.
>
> -Chandra
>
> On May 15, 1:09 pm, rockit <[EMAIL PROTECTED]> wrote:
>
> > Hi Chandra i'm new as well to cake but i don't see any huge roadblocks
> > in using cake to extend your application.
>
> > if you notice in the bakery, there is a good resource on how to use
> > smarty for your presentation logic.
>
> > the business logic and classes can be placed in as components with a
> > few minor tweaks.
>
> > as far as accessing the db schema, you can do it the cake way or your
> > own way.
>
> > there's a bit of tweaking that would need to be done to your app i
> > imagine, but i wouldn't say it would have to go as far as refactoring
> > the code.  Most OO-PHP code in my experience has worked great with
> > cake.
>
> > On May 15, 11:56 am, Chandra <[EMAIL PROTECTED]> wrote:
>
> > > The company I work for has a PHP/MySQL (and the Smarty Template
> > > Framework as a front end) based website that been running for a little
> > > whilethe time has come to add more functionality to the site.  I'd
> > > like to use use CakePHP to add these new features on...and I need to
> > > see if it's even possible (I'm a Cake newbie) and then need to sell it
> > > to my boss.  I was hoping somone could answer a few simple questions
> > > for me:
>
> > > 1.  Site Authentication is done using PHP sessions stored in a
> > > database...Can Cake use the same session methods or will the users
> > > have to re-authenticate as they pass between the old and new
> > > functionality (and vice-versa)
>
> > > 2.  There is some business logic and classes from the old site I need
> > > to use - anything to watch out for?
>
> > > 3.  In accessing the existing MySQL database schema...I can use Cake's
> > > CRUD capabilities...or is there a alternate way I should be accessing
> > > the data?
>
> > > Thanks for all your help,
>
> > > Chandra- 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: HowTo: Linked Combobox ?

2007-05-15 Thread Derick Ng
http://www.devmoz.com/blog/2007/04/04/cakephp-update-a-select-box-using-ajax/
On 5/16/07, Derick Ng <[EMAIL PROTECTED]> wrote:
>
>
> http://www.devmoz.com/blog/2007/04/04/cakephp-update-a-select-box-using-ajax/
>
> On 5/15/07, 浪漫様 <[EMAIL PROTECTED]> wrote:
> >
> >
> > Hello Everybody,
> > How to use SelectTag to make 2 linked Comboboxes??
> > I want to make the 2nd Combobox change its options depending on the
> > option selected on the 1st Combobox... that's easy to do in
> > Javascript... but how to make it work in CakePHP with SelectTags???
> > Thank you very much!
> >
> > Rohman
> >
> >
> > > >
> >
>

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

2007-05-15 Thread soytuny

Maybe you could add a session_id column to your users table. When a
user logs in you can store their session_id in the table.  Now every
time a user requests a page, check the session_id in the table against
the current value returned by PHP's session_id().  If it is not the
same, log the user out because someone else logged in with their name.

I'm not very experienced with sessions, so I could be way off.

Russell Austin


On May 15, 2:49 pm, jyrgen <[EMAIL PROTECTED]> wrote:
> hm. do you mean i should rather store the login state
> somewhere else, in another table... ?


--~--~-~--~~~---~--~~
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: Update two models with one form

2007-05-15 Thread Pento

So what problem to use for names of input elements of the form names
like
Users/field1,Sites/field1 and in controller call save methods for
both models?

On 16 май, 07:33, gerbenzomp <[EMAIL PROTECTED]> wrote:
> I have a form where users can register (model: users), but they should
> also be able to create a sitename (model: sites) in that same form.
> How should I approach 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: PhpGacl component license

2007-05-15 Thread Mariano Iglesias

It's released under the same license as CakePHP: MIT.

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de Hubbo
Enviado el: Martes, 15 de Mayo de 2007 09:53 p.m.
Para: Cake PHP
Asunto: PhpGacl component license

What license, if any, are you planning to use for your PhpGacl
component?


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



PhpGacl component license

2007-05-15 Thread Hubbo

This question is for Mariano Iglesias but I guess there will be others
wanting to know the answer too.

I have been looking at various solutions for a permission system for
our company project and have come to the conclusion that we will be
using phpGACL. I see that Mariano already has made a component and
after some testing we see that it, with some future modifications,
probably will fill some of the basic functionality we need. However,
we can't use the code until we know in what license you plan to
distribute it with it.

What license, if any, are you planning to use for your PhpGacl
component?

With best regards,
Michel


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



Update two models with one form

2007-05-15 Thread gerbenzomp

I have a form where users can register (model: users), but they should
also be able to create a sitename (model: sites) in that same form.
How should I approach 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: session serialize handler

2007-05-15 Thread jyrgen


> Why not just register a session handling function to do that?

because i don't want to mess / overwrite / interfere with cake's gc,
which is just doing fine.

i need to collect garbage only once, before someone attempts
to login. by means of this i make sure that compare only against
active accounts.

> I think you're asking for help but refusing to accept what's been
> suggested. :)

not true :-) this communication helps a lot, even though the thread
has grown way too long.

i will reconsider my approach storing the login state in the
session...





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

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


On May 15, 2007, at 4:14 PM, jyrgen wrote:

>
>> PHP sessions are managed by a garbage-collection routine and have
>> expiration times.
>
> thanks, yes i know. i do collect garbage "manually" by deleting
> expired rows from the session table (before the login).

Why not just register a session handling function to do that?

> please don't get me wrong.

I think you're asking for help but refusing to accept what's been  
suggested. :)

-- 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: How controller method, called by $ajax->dropRemote, can get ID of a dropped element.

2007-05-15 Thread [EMAIL PROTECTED]

Thanks a lot bernardo!!

seriously, thanks a lot !!

a big lot

Dieter



On May 15, 10:39 pm, bernardo <[EMAIL PROTECTED]> wrote:
> Try:
>  dropRemote('droppable_id',
>  array('accept'=>'title'),
>  array('url'=>'/mycontroller/
> myaction/',
>
> 'with'=>'{draggedid:element.id}')
>  'update'=>'droppable_id')); ?
>
>
>
> Then you can use $this->params['form']['draggedid'] in your
> controller.
>
> On Apr 12, 8:08 am, "Derim" <[EMAIL PROTECTED]> wrote:
>
> > Hi
>
> > I want to use drag and drop feature in my new CakePHP project.
> > I spent most the day today trying to figure out how controller action,
> > called by  $ajax->dropRemote can get id of the draggable element.
> > Searching on google and manual didn't helped.
>
> > Here is simplified version of code I use for dropRemote.
> > dropRemote('droppable_id',
> > array('accept'=>'title'),
> > array('url'=>'/mycontroller/myaction/',
> > 'update'=>'droppable_id')); ?>
> > 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: session serialize handler

2007-05-15 Thread jyrgen

> PHP sessions are managed by a garbage-collection routine and have
> expiration times.

thanks, yes i know. i do collect garbage "manually" by deleting
expired rows from the session table (before the login).

please don't get me wrong. i worked all this out, and it was running
until my provider installed a php hardening patch, which encrypts the
session data.. all i can do now is to disable the session encryption.
ok. php's session serialization is differen from the serialize
command.
fo


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

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


On May 15, 2007, at 3:58 PM, jyrgen wrote:

>
> yeah, you're right. I could set up an extra table for this, or
> add an extra column to the user record. but when a session
> is not closed properly, the login value remains 1.

PHP sessions are managed by a garbage-collection routine and have  
expiration times.

-- 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: session serialize handler

2007-05-15 Thread jyrgen

yeah, you're right. I could set up an extra table for this, or
add an extra column to the user record. but when a session
is not closed properly, the login value remains 1.


> You definitely could...but then you have to make sure you delete old
> records so that you don't record someone as being logged in when they
> are not.


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

2007-05-15 Thread Chris Hartjes

On 5/15/07, jyrgen <[EMAIL PROTECTED]> wrote:
>
> hm. do you mean i should rather store the login state
> somewhere else, in another table... ?
>

You definitely could...but then you have to make sure you delete old
records so that you don't record someone as being logged in when they
are not.

-- 
Chris Hartjes

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

@TheBallpark - http://www.littlehart.net/attheballpark
@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 serialize handler

2007-05-15 Thread Chris Hartjes

On 5/15/07, jyrgen <[EMAIL PROTECTED]> wrote:
> Than my "boss" came up and said : hey can you modify the
> login logic so that a user cannot login twice (because our
> customers tend to borrow their accounts to colleagues)
> Sure i can do. So what do i have to do ? I search the session
> table to make sure that a user is not logged in twice
> hm... don't you agree ??

Don't you see your mistake?  You agreed to do something before making
sure you could actually do it. :)

Yes, what you suggest is logical BUT without understanding HOW PHP
stores the info in the sessions table you can't possibly pull the data
you want out of a session.  I know I keep saying it, but you need to
go read on how PHP stores the data in a sessions table.

-- 
Chris Hartjes

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

@TheBallpark - http://www.littlehart.net/attheballpark
@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 serialize handler

2007-05-15 Thread jyrgen

hm. do you mean i should rather store the login state
somewhere else, in another table... ?


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

2007-05-15 Thread jyrgen

Hi Mr.Tufty,

ok, i tell you whole story.

I build a website with cake. I'm kind of making a living of it.
I set up my own auth system, which is nothing more than
a login form and a validation against login/password.

I highly appreciated cake's session/cookie mechanism, so i
employed it :-)

Than my "boss" came up and said : hey can you modify the
login logic so that a user cannot login twice (because our
customers tend to borrow their accounts to colleagues)
Sure i can do. So what do i have to do ? I search the session
table to make sure that a user is not logged in twice
hm... don't you agree ??

What can you see, when you evaluate $_SESSION ?
Or $this->session in cake ? You see the session of the
current user, but not the login state of *all* users.

jyrgen



On 15 Mai, 22:17, MrTufty <[EMAIL PROTECTED]> wrote:
> Jyrgen,
>
> I still don't understand why you feel the need to override Cake's
> internal session handling in favour of your own.
>
> It's simple, ok. If you want to read the existing session just use
> $this->Session->read('User.username'); or $session->read('User.username'); in 
> the view. Obviously this would need
>
> customising to exactly what you call your fields, but you should be
> able to work with that to get the information you're looking for.
>
> Stephen Orr
>
> On May 15, 8:46 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
>
> > On 5/15/07, jyrgen <[EMAIL PROTECTED]> wrote:
>
> > > thats it. no magic with " | " signs, or custom deserialization.
>
> > The magic is the way PHP stores sessions itself.  Honest.  Again, go
> > read up on custom session handlers because it does explain how PHP
> > stores the session data if you go with the defaults.
>
> > --
> > Chris Hartjes
>
> > My motto for 2007:  "Just build it, damnit!"
>
> > @TheBallpark -http://www.littlehart.net/attheballpark
> > @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: CakePHP Component with Constructor parameters - How do I Instantiate?

2007-05-15 Thread Felix Geisendörfer
I don't think you are trying to write a component. Put your file in 
/app/vendors/my_class.php, load it via vendor('my_class'); and work with 
it as you normally would with any class.

-- Felix
--
http://www.thinkingphp.org
http://www.fg-webdesign.de


Humble Groups wrote:
> Hi,
>
>I am trying to implement custom RecursiveIterator, so I wrote a 
> component in app/controllers/components/Recursive_Thread_Iterator.php as
>
> 
> class RecursiveThreadIteratorComponent extends ArrayIterator
> implements RecursiveIterator {
>
> function hasChildren() {
> $message = $this->current();
>   return isset($message['children'][0]);
> }
>
> function getChildren() {
> $message = $this->current();
> return $message['children'][0];
> }
> }
> ?>
>
> Now, I am not able instantiate it since it expects constructor 
> parameter. If I try
> var $components = array('RecursiveThreadIterator');
>
> it throws error on initializing the ArrayIterator. If I use the 
> following syntax after removing the $components, it throws *Fatal 
> error*: Class 'RecursiveThreadIteratorComponent' not found in * 
> \view-messages\app\controllers\messages_controller.php* on 
> line *37
>
> *$foo =& new RecursiveThreadIteratorComponent($thread_messages);
>
> When I checked the components.php, it does not initialize by calling 
> the constructor and handle initializing SessionComponent seperately.
>
> Is there anyway I instantiate by passing parameter?
>
> TIA
>
>
>
>
> >

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



CakePHP Component with Constructor parameters - How do I Instantiate?

2007-05-15 Thread Humble Groups
Hi,

   I am trying to implement custom RecursiveIterator, so I wrote a component
in app/controllers/components/Recursive_Thread_Iterator.php as

current();
  return isset($message['children'][0]);
}

function getChildren() {
$message = $this->current();
return $message['children'][0];
}
}
?>

Now, I am not able instantiate it since it expects constructor parameter. If
I try
var $components = array('RecursiveThreadIterator');

it throws error on initializing the ArrayIterator. If I use the following
syntax after removing the $components, it throws *Fatal error*: Class
'RecursiveThreadIteratorComponent' not found in *
\view-messages\app\controllers\messages_controller.php* on line *37

*$foo =& new RecursiveThreadIteratorComponent($thread_messages);

When I checked the components.php, it does not initialize by calling the
constructor and handle initializing SessionComponent seperately.

Is there anyway I instantiate by passing parameter?

TIA

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



New install pages problem

2007-05-15 Thread david_setwise

I am setting up a new installation of cake to begin my first project.
All the cake files are in www.myurl.com/cake/.  I updated the app/
views/layouts/default.thtml and app/views/pages/home.thtml files and
they show up fine.  However, no matter what url I type in the browser
(Ex: www.myurl.com/cake/pages/other , www.myurl.com/cake/asdf/asdf ),
the views/pages/home.thtml file is being rendered.  Can anyone point
me in the right direction?

Thanks, David


--~--~-~--~~~---~--~~
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: How controller method, called by $ajax->dropRemote, can get ID of a dropped element.

2007-05-15 Thread bernardo

Try:
 dropRemote('droppable_id',
 array('accept'=>'title'),
 array('url'=>'/mycontroller/
myaction/',
 
'with'=>'{draggedid:element.id}')
 'update'=>'droppable_id')); ?
>

Then you can use $this->params['form']['draggedid'] in your
controller.

On Apr 12, 8:08 am, "Derim" <[EMAIL PROTECTED]> wrote:
> Hi
>
> I want to use drag and drop feature in my new CakePHP project.
> I spent most the day today trying to figure out how controller action,
> called by  $ajax->dropRemote can get id of the draggable element.
> Searching on google and manual didn't helped.
>
> Here is simplified version of code I use for dropRemote.
> dropRemote('droppable_id',
> array('accept'=>'title'),
> array('url'=>'/mycontroller/myaction/',
> 'update'=>'droppable_id')); ?>
> 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: session serialize handler

2007-05-15 Thread Chris Hartjes

On 5/15/07, jyrgen <[EMAIL PROTECTED]> wrote:
>
>
> thats it. no magic with " | " signs, or custom deserialization.

The magic is the way PHP stores sessions itself.  Honest.  Again, go
read up on custom session handlers because it does explain how PHP
stores the session data if you go with the defaults.

-- 
Chris Hartjes

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

@TheBallpark - http://www.littlehart.net/attheballpark
@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 serialize handler

2007-05-15 Thread MrTufty

Jyrgen,

I still don't understand why you feel the need to override Cake's
internal session handling in favour of your own.

It's simple, ok. If you want to read the existing session just use
$this->Session->read('User.username'); or $session-
>read('User.username'); in the view. Obviously this would need
customising to exactly what you call your fields, but you should be
able to work with that to get the information you're looking for.

Stephen Orr

On May 15, 8:46 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On 5/15/07, jyrgen <[EMAIL PROTECTED]> wrote:
>
>
>
> > thats it. no magic with " | " signs, or custom deserialization.
>
> The magic is the way PHP stores sessions itself.  Honest.  Again, go
> read up on custom session handlers because it does explain how PHP
> stores the session data if you go with the defaults.
>
> --
> Chris Hartjes
>
> My motto for 2007:  "Just build it, damnit!"
>
> @TheBallpark -http://www.littlehart.net/attheballpark
> @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 serialize handler

2007-05-15 Thread Chris Hartjes

On 5/15/07, jyrgen <[EMAIL PROTECTED]> wrote:
>
> c'mon that's really kiddy stuff. i'm talking about software design,
> and i would like to know why this or that has been implemented.
> if you would point every user to the sources, what's the use of
> this group then ?
> why is there a custom serialization, introducing the " | " separator ?
> i *might* be able to understand if i could find it in the sources, but
> at least in the session lib (see code above) there is nothing.

If you can't figure it out, no shame in that.  You might want to read
up on how custom session  handlers are created because it might point
you in the right direction.  Without learning how to build one of
these things, I'd say you have no hope of solving your problem.

-- 
Chris Hartjes

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

@TheBallpark - http://www.littlehart.net/attheballpark
@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 serialize handler

2007-05-15 Thread jyrgen


> Sorry you feel differently.  If you have the source, you should be
> able to figure it out.

c'mon that's really kiddy stuff. i'm talking about software design,
and i would like to know why this or that has been implemented.
if you would point every user to the sources, what's the use of
this group then ?
why is there a custom serialization, introducing the " | " separator ?
i *might* be able to understand if i could find it in the sources, but
at least in the session lib (see code above) there is nothing.


--~--~-~--~~~---~--~~
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: Cascade Delete

2007-05-15 Thread rockit

cool, that fixed the problem.

Thanks for the help!

On May 15, 2:46 pm, Hellbot <[EMAIL PROTECTED]> wrote:
> as i known
> 'dependent' - must be a boolean (not a string)
> and you don't need to specify default parameter in model::delete function
>
>  class Inventory extends AppModel {
>
>var $name = 'Inventory';
>var $validate = array(
>'title' => VALID_NOT_EMPTY,
>'description' => VALID_NOT_EMPTY,
>'cost' => VALID_NOT_EMPTY,
>);
>
>var $hasMany = array(
>'Photo' =>
>array('className' => 'Photo',
>'foreignKey' => 'inventory_id',
>'dependent' => true //
> real boolean variable
>),
>
>);}
>
> ?>
>
>  class InventoriesController extends AppController {
>
>var $name = 'Inventories';
>var $uses = array('Inventory', 'Photo');
>var $helpers = array('Html', 'Form' );
>
>function admin_delete($id = null) {
>if(!$id) {
>$this->Session->setFlash('Invalid id for Inventory');
>$this->redirect('/admin/inventories/index');
>}
>if($this->Inventory->del($id)) { // you don't need to
> specify default value
>$this->Session->setFlash('The Inventory
> deleted: id '.$id.'');
>$this->redirect('/admin/inventories/index');
>}
>}}
>
> ?>
>
> 2007/5/15,rockit<[EMAIL PROTECTED]>:
>
> > do i have my dependent keys set properly in my models?  and is the
> > $cascade option properly being passed in my delete function?


--~--~-~--~~~---~--~~
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: Using CakePHP to extend existing website

2007-05-15 Thread Chandra

Rocky..thanks for the reply.  I am worried most about the
authentication/sessions issue...Any idea if Cake and PHP sessions can
work together.  I can't have the users reauthenticate themselves as
they go between the regular PHP site and Cake site.

-Chandra


On May 15, 1:09 pm, rockit <[EMAIL PROTECTED]> wrote:
> Hi Chandra i'm new as well to cake but i don't see any huge roadblocks
> in using cake to extend your application.
>
> if you notice in the bakery, there is a good resource on how to use
> smarty for your presentation logic.
>
> the business logic and classes can be placed in as components with a
> few minor tweaks.
>
> as far as accessing the db schema, you can do it the cake way or your
> own way.
>
> there's a bit of tweaking that would need to be done to your app i
> imagine, but i wouldn't say it would have to go as far as refactoring
> the code.  Most OO-PHP code in my experience has worked great with
> cake.
>
> On May 15, 11:56 am, Chandra <[EMAIL PROTECTED]> wrote:
>
>
>
> > The company I work for has a PHP/MySQL (and the Smarty Template
> > Framework as a front end) based website that been running for a little
> > whilethe time has come to add more functionality to the site.  I'd
> > like to use use CakePHP to add these new features on...and I need to
> > see if it's even possible (I'm a Cake newbie) and then need to sell it
> > to my boss.  I was hoping somone could answer a few simple questions
> > for me:
>
> > 1.  Site Authentication is done using PHP sessions stored in a
> > database...Can Cake use the same session methods or will the users
> > have to re-authenticate as they pass between the old and new
> > functionality (and vice-versa)
>
> > 2.  There is some business logic and classes from the old site I need
> > to use - anything to watch out for?
>
> > 3.  In accessing the existing MySQL database schema...I can use Cake's
> > CRUD capabilities...or is there a alternate way I should be accessing
> > the data?
>
> > Thanks for all your help,
>
> > Chandra- 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: session serialize handler

2007-05-15 Thread jyrgen

> So why don't you go into the source of CakePHP and look at the code?

guess what i did... i found... nothing which helped me any further.
thats why i posted this problem again ,
but thanks, anyway (not ironic)


--~--~-~--~~~---~--~~
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: Using CakePHP to extend existing website

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


On May 15, 2007, at 8:56 AM, Chandra wrote:

>
> The company I work for has a PHP/MySQL (and the Smarty Template
> Framework as a front end) based website that been running for a little
> whilethe time has come to add more functionality to the site.  I'd
> like to use use CakePHP to add these new features on...and I need to
> see if it's even possible (I'm a Cake newbie) and then need to sell it
> to my boss.  I was hoping somone could answer a few simple questions
> for me:
>
> 1.  Site Authentication is done using PHP sessions stored in a
> database...Can Cake use the same session methods or will the users
> have to re-authenticate as they pass between the old and new
> functionality (and vice-versa)

You might just want to read the cookies to get the session_id, and  
use a Cake model to grab the session data and craft a cake session  
using that data. I've done it before and it works great for SSO  
situations.

>
> 2.  There is some business logic and classes from the old site I need
> to use - anything to watch out for?

Divide be zero can be nasty. I wouldn't worry about null pointer  
exceptions, though. :) Just use include_once/require_once like you  
normally would. Sometimes it's nice to encase things in components/ 
helpers, but whatever suits you best.

>
> 3.  In accessing the existing MySQL database schema...I can use Cake's
> CRUD capabilities...or is there a alternate way I should be accessing
> the data?

Cake can do it. Give it a try with scaffolding to see how it will end  
up working for you. You may have to configure a few things if your  
schema isn't CakePHP naming convention compliant, though.

-- 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: session serialize handler

2007-05-15 Thread Chris Hartjes

On 5/15/07, jyrgen <[EMAIL PROTECTED]> wrote:
>
> > Wouldn't it better for you to learn how it works instead of someone
> > just spoon-feeding you an answer?
>
> now that's a great help ! :-)
>

Sorry you feel differently.  If you have the source, you should be
able to figure it out.

-- 
Chris Hartjes

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

@TheBallpark - http://www.littlehart.net/attheballpark
@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: Using CakePHP to extend existing website

2007-05-15 Thread rtconner

(FYI I only have experience and knowledge of 1.2 - which has no
documentation)

1. Yes. Cake has db sessions.. and if data does not line up, just
write your own session handler

2. Drop your 3rd party classes in the vendors directory and use them
as much or little as you wish

3. Yes thats fine. You might have to help cake figure out what table
are named what and related to what, since you are not going along with
cakes default naming scheme. But you can set it up fine to wok with
your database, whatever the scheme, and then of course use CRUD.

On May 15, 8:56 am, Chandra <[EMAIL PROTECTED]> wrote:
> The company I work for has a PHP/MySQL (and the Smarty Template
> Framework as a front end) based website that been running for a little
> whilethe time has come to add more functionality to the site.  I'd
> like to use use CakePHP to add these new features on...and I need to
> see if it's even possible (I'm a Cake newbie) and then need to sell it
> to my boss.  I was hoping somone could answer a few simple questions
> for me:
>
> 1.  Site Authentication is done using PHP sessions stored in a
> database...Can Cake use the same session methods or will the users
> have to re-authenticate as they pass between the old and new
> functionality (and vice-versa)
>
> 2.  There is some business logic and classes from the old site I need
> to use - anything to watch out for?
>
> 3.  In accessing the existing MySQL database schema...I can use Cake's
> CRUD capabilities...or is there a alternate way I should be accessing
> the data?
>
> Thanks for all your help,
>
> Chandra


--~--~-~--~~~---~--~~
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: Cascade Delete

2007-05-15 Thread Hellbot

as i known
'dependent' - must be a boolean (not a string)
and you don't need to specify default parameter in model::delete function

 VALID_NOT_EMPTY,
   'description' => VALID_NOT_EMPTY,
   'cost' => VALID_NOT_EMPTY,
   );

   var $hasMany = array(
   'Photo' =>
   array('className' => 'Photo',
   'foreignKey' => 'inventory_id',
   'dependent' => true //
real boolean variable
   ),

   );
}
?>

Session->setFlash('Invalid id for Inventory');
   $this->redirect('/admin/inventories/index');
   }
   if($this->Inventory->del($id)) { // you don't need to
specify default value
   $this->Session->setFlash('The Inventory
deleted: id '.$id.'');
   $this->redirect('/admin/inventories/index');
   }
   }
}
?>

2007/5/15, rockit <[EMAIL PROTECTED]>:
> do i have my dependent keys set properly in my models?  and is the
> $cascade option properly being passed in my delete function?

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

2007-05-15 Thread jyrgen

thanks Matt,

generally i don't post anything here before looking in to source.

ok, so what do we find in the session lib:

the database read function :

function __read($key) {
$db =& ConnectionManager::getDataSource('default');
$table = $db->fullTableName(CAKE_SESSION_TABLE, false);
$row = $db->query("SELECT " . $db->name($table.'.data') . " 
FROM " .
$db->name($table) . " WHERE " . $db->name($table.'.id') . " = " . $db-
>value($key), false);

if ($row && !isset($row[0][$table]) && isset($row[0][0])) {
$table = 0;
}

if ($row && $row[0][$table]['data']) {

return $row[0][$table]['data'];
} else {
return false;
}
}


and the reference:


session_set_save_handler(array('CakeSession','__open'),

array('CakeSession', '__close'),

array('CakeSession', '__read'),

array('CakeSession', '__write'),

array('CakeSession', '__destroy'),

array('CakeSession', '__gc'));

thats it. no magic with " | " signs, or custom deserialization.



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

2007-05-15 Thread jyrgen

> Wouldn't it better for you to learn how it works instead of someone
> just spoon-feeding you an answer?

now that's a great help ! :-)


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

2007-05-15 Thread Chris Hartjes

On 5/15/07, jyrgen <[EMAIL PROTECTED]> wrote:
>
> i wished that phpnut or any other guy who wrote this lib
> could be pointed to this thread... :-)

Wouldn't it better for you to learn how it works instead of someone
just spoon-feeding you an answer?  From my conversations with PhpNut,
I suspect he'd be giving a similar answer.  The source contains
everything you need to figure to solve your problem.

Now get to it! :)


-- 
Chris Hartjes

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

@TheBallpark - http://www.littlehart.net/attheballpark
@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: CakePHP wallpaper

2007-05-15 Thread Sliv

Nice! ;)

On May 15, 12:54 pm, Anton Dubina <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I really like CakePHP and I thought I could somehow contribute to
> community. So I've made this simple wallpaper:
>
> http://dubina.ru/archives/38
>
> Just a vector-drawn CakePHP logo on one-color background for people
> like me who prefer kinda "minimalistic" backgrounds.
>
> Anyway, just let me know how do you find it.
>
> --
> Anton


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

2007-05-15 Thread jyrgen

i wished that phpnut or any other guy who wrote this lib
could be pointed to this thread... :-)



--~--~-~--~~~---~--~~
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: Using CakePHP to extend existing website

2007-05-15 Thread rockit

Hi Chandra i'm new as well to cake but i don't see any huge roadblocks
in using cake to extend your application.

if you notice in the bakery, there is a good resource on how to use
smarty for your presentation logic.

the business logic and classes can be placed in as components with a
few minor tweaks.

as far as accessing the db schema, you can do it the cake way or your
own way.

there's a bit of tweaking that would need to be done to your app i
imagine, but i wouldn't say it would have to go as far as refactoring
the code.  Most OO-PHP code in my experience has worked great with
cake.

On May 15, 11:56 am, Chandra <[EMAIL PROTECTED]> wrote:
> The company I work for has a PHP/MySQL (and the Smarty Template
> Framework as a front end) based website that been running for a little
> whilethe time has come to add more functionality to the site.  I'd
> like to use use CakePHP to add these new features on...and I need to
> see if it's even possible (I'm a Cake newbie) and then need to sell it
> to my boss.  I was hoping somone could answer a few simple questions
> for me:
>
> 1.  Site Authentication is done using PHP sessions stored in a
> database...Can Cake use the same session methods or will the users
> have to re-authenticate as they pass between the old and new
> functionality (and vice-versa)
>
> 2.  There is some business logic and classes from the old site I need
> to use - anything to watch out for?
>
> 3.  In accessing the existing MySQL database schema...I can use Cake's
> CRUD capabilities...or is there a alternate way I should be accessing
> the data?
>
> Thanks for all your help,
>
> Chandra


--~--~-~--~~~---~--~~
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: Regular expression in Router::connect

2007-05-15 Thread Matthias Bauer

On 15.05.2007 02:50 Aaron Shafovaloff wrote:

> I figured it out:
> 
> Router::connect('/:group/:curriculum/*',
> array('controller'=>'curriculum'),array('curriculum'=>'\b(?:(?!
> curriculum|courses|facilitators|configuration)\w)+\b'));

Your parens are off. The negative lookahead assertions should group all
the alternatives, so try:

\b(?!(?:curriculum|courses|facilitators|configuration))\w+\b


-Matt

--~--~-~--~~~---~--~~
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: cake delivers strange session data

2007-05-15 Thread jyrgen

does that mean that my hosting provider activated the
suhosin patch ? that would explain it.
can i decrypt the data manually ?

> Suhosin or a similar PHP-securing extension that auto-encrypts Session
> and Cookie vars, maybe?
>
> -Matt


--~--~-~--~~~---~--~~
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: cake delivers strange session data

2007-05-15 Thread Matthias Bauer

On 14.05.2007 22:25 jyrgen wrote:

> without changing anything on the server, session data seem corrupt.
> all of sudden the data column does not contain neatly serialized
> data like :
> 
> Config|a:3:{s:4:"rand";i:6637528;s:4:"time";i:1179...
> 
> but
> 
> UPDATE `sessions` SET `data` = '7YDr60NnYV1R2asLTAPMDb-
> q3OO1lqf22IDYuIJBAswmyfMyO2Y3oYFdi3TGWsqh1hPFh4XWN0aEQNQFmIhGuRtpqDmpZ8Fm
> 
> do you know where this comes from ?

Suhosin or a similar PHP-securing extension that auto-encrypts Session
and Cookie vars, maybe?

-Matt

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



/bare/controller/action for admin?

2007-05-15 Thread Gonzalo Servat
Hi All,

I've had a read of the cake/libs/router.php file and noticed a handy route
connect:

   $this->connect('/bare/:controller/:action/*', array('bare' =>
'1'));

I could use this, even more so if it respected the CAKE_ADMIN prefix. Any
ideas if it can be done or how I'd need to modify the above for it to work?
I was thinking something along the lines of:

$this->connect('/bare/' . CAKE_ADMIN . '/:controller/:action/*', array(
'bare' => '1', 'admin' => '1',  ) );

... placed above the current connect call for /bare/. Of course this would
mean you couldn't have an AdminController, and I'm missing something (a
regex, perhaps?) as I'm not sure how to set the action to be CAKE_ADMIN
concatenated with '_' . :action. maybe instead of /bare/ it could be called
'/bare_' . CAKE_ADMIN or something?

Thanks in advance!

- Gonzalo

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

2007-05-15 Thread Matthias Bauer

On 15.05.2007 18:44 jyrgen wrote:

> pr(serialize($_SESSION));
> 
> results in :
> 
> a:1:{s:6:"Config";a:3:{s:4:"rand";i:1482441247;s:4:"time";i:
> 1179248446;s:9:"userAgent";s:32:"cc98eaffc23c634e0efd75ab9e36e810";}}
> 
> so fine-.
> 
> but note the different notation in the sessions table:
> 
> Config|a:3:{s:4:"rand";i:1482441247;s:4:"time";i:1179247983;s:
> 9:"userAgent";s:32:"cc98eaffc23c634e0efd75ab9e36e810";}

It's obviously *not* just a call to serialize($_SESSION) then.

> php fails to unserialize this string !!

Split the string at the | character, then use the first part as the
array key, and deserialize the second part into the array's value.

Why don't you just look into the Cake source?

-Matt

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

2007-05-15 Thread jyrgen

> Why can't you set a cookie?  Way easier.

how do you mean ?
cookies are activated. please explain


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

2007-05-15 Thread jyrgen

> Again, why are you trying to read entries from the session table?

in the session i store the user ID, as well as a flag
"logged_in" (equals
0 or 1). so i can test in my actions if the user is authenticated.

does that make sense ?

now imagine another user with the account data (doesn't matter where
he got them from, maybe a person of trust).
i simply want to avoid double logins.


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

2007-05-15 Thread Chris Hartjes

On 5/15/07, jyrgen <[EMAIL PROTECTED]> wrote:
>
> i get a php error, of course, the format is not accepted,
>
> Notice: unserialize(): Error at offset 0 of 117 bytes in /var/www/cake/
> app/views...
>
> how does cake do it ? this is what i just don't get into my head,
> since the
> session lib is able to read and write values from / to the db 

So why don't you go into the source of CakePHP and look at the code?

-- 
Chris Hartjes

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

@TheBallpark - http://www.littlehart.net/attheballpark
@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
-~--~~~~--~~--~--~---



Cascade Delete

2007-05-15 Thread rockit

have 2 models.

 VALID_NOT_EMPTY,
'description' => VALID_NOT_EMPTY,
'cost' => VALID_NOT_EMPTY,
);

//The Associations below have been created with all possible keys,
those that are not needed can be removed
var $hasMany = array(
'Photo' =>
array('className' => 'Photo',
'foreignKey' => 'inventory_id',
'conditions' => '',
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
'dependent' => 'true',
'exclusive' => '',
'finderQuery' => '',
'counterQuery' => ''
),

);

}
?>

 VALID_NOT_EMPTY,
);

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

);

}
?>

and in my controller i would like when i do a $this->del has all of
the associated data deleted.  here in the function in my controller.

Session->setFlash('Invalid id for Inventory');
$this->redirect('/admin/inventories/index');
}
if($this->Inventory->del($id, $cascade=true)) {
$this->Session->setFlash('The Inventory deleted: id 
'.$id.'');
$this->redirect('/admin/inventories/index');
}
}
}
?>

do i have my dependent keys set properly in my models?  and is the
$cascade option properly being passed in my delete function?


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

2007-05-15 Thread jyrgen

i get a php error, of course, the format is not accepted,

Notice: unserialize(): Error at offset 0 of 117 bytes in /var/www/cake/
app/views...

how does cake do it ? this is what i just don't get into my head,
since the
session lib is able to read and write values from / to the db 





--~--~-~--~~~---~--~~
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: othAuth Performance

2007-05-15 Thread Dave J

oh ok cool
so really, the hit should be negligible.

I'll do some benchmarking when i have progressed some more and see how
it goes.

thanks!



On May 15, 4:51 pm, CraZyLeGs <[EMAIL PROTECTED]> wrote:
> othAuth only does a session check, if the the action is public it
> doesn't even go to the session.
> but yea to each his/her needs
>
> On May 14, 7:17 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:> On 5/14/07, 
> Dave J <[EMAIL PROTECTED]> wrote:
>
> > > My question is this.   as it is right now...  I'm using CakePHP's
> > > admin routing functions to implement the admin actions (ie. the admin
> > > actions are sitting alongside the 'public' actions in the same
> > > controller).  Now, on a heavily visited site... does anyone have
> > > experience regarding any slowdowns by using the othAuth component?
>
> > That's how I personally would do it.  Keep the auth stuff for the
> > areas that need it.
>
> > --
> > Chris Hartjes
>
> > My motto for 2007:  "Just build it, damnit!"
>
> > @TheBallpark -http://www.littlehart.net/attheballpark
> > @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
-~--~~~~--~~--~--~---



if I wanna use setEncoding to set names ,where to code ?

2007-05-15 Thread [EMAIL PROTECTED]

thx

in model? where?


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



CakePHP wallpaper

2007-05-15 Thread Anton Dubina

Hi,

I really like CakePHP and I thought I could somehow contribute to
community. So I've made this simple wallpaper:

http://dubina.ru/archives/38

Just a vector-drawn CakePHP logo on one-color background for people
like me who prefer kinda "minimalistic" backgrounds.

Anyway, just let me know how do you find it.

--
Anton


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

2007-05-15 Thread Chris Hartjes

On 5/15/07, jyrgen <[EMAIL PROTECTED]> wrote:
>
> php fails to unserialize this string !!
>
> thats why i cannot read entries from the session table.
>

Again, why are you trying to read entries from the session table?

-- 
Chris Hartjes

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

@TheBallpark - http://www.littlehart.net/attheballpark
@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: Quick Dum Question

2007-05-15 Thread Enchy

I got it

  $pagination->sortBy('sname', 'Supplier', 'Supplier'),
$pagination->sortBy('name','Customer','Customer'),

On May 15, 2:03 pm, Enchy <[EMAIL PROTECTED]> wrote:
> What do I change to this to get "sname" in my while loop?
>
>  class Order extends AppModel {
>var $name = 'Order';
>
> var $belongsTo = array('Customer' =>
>  array('className' => 'Customer',
>'conditions'=> '',
>'order' => 'name ASC',
>'limit' => '',
>'foreignKey'=> 'customer_id',
>'dependent' => true,
>'exclusive' => false,
>'finderQuery'   => ''
>  ),
>   'Supplier' =>
>  array('className' => 'Supplier',
>'conditions'=> '',
>'order' => 'sname ASC',
>'limit' => '',
>'foreignKey'=> 'supplier_id',
>'dependent' => true,
>'exclusive' => false,
>'finderQuery'   => ''
>  )
>
> );
>
> }
>
> ?>
>
>  function index() {
>
> $criteria=NULL;
> list($order,$limit,$page) = $this->Pagination->init($criteria); // 
> Added
>
> $data = $this->Order->findAll($criteria, NULL, $order, $limit,
> $page); // Extra parameters added
> $this->set('data',$data);
> }
>
> $pagination->setPaging($paging); // Initialize the pagination
> variables
> $th = array (
> $pagination->sortBy('id'),
> $pagination->sortBy('dateoforder'),
> $pagination->sortBy('eta'),
> $pagination->sortBy('sname'),
> $pagination->sortBy('customer_id'),
> $pagination->sortBy('total'),
> $pagination->sortBy('ref'),
> $pagination->sortBy(' ')
> ); // Generate the pagination sort links
> echo $html->tableHeaders($th); // Create the table headers with sort
> links if desired
>
> foreach ($data as $output)
> {
> $tr = array (
>
> $html->link($output['Order']['ordernum'], "/Orders/Edit/
> {$output['Order']['id']}"),
> $output['Order']['id'],
> $output['Order']['eta'],
> $output['Order']['sname'],
> $html->link("Delete", "/Orders/Delete/{$output['Order']
> ['id']}",null,'Are you sure?')
>
> );
> echo $html-
>
> >tableCells($tr,array('class'=>'altRow'),array('class'=>'evenRow'));
> }
>
> I tried playing around with findall but Im not sure how to print it by
> output and orderby?
>
> L


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

2007-05-15 Thread Chris Hartjes

On 5/15/07, Chris Hartjes <[EMAIL PROTECTED]> wrote:
> On 5/15/07, jyrgen <[EMAIL PROTECTED]> wrote:
> >
> > i need access to *all* existing valid sessions in the table,
> > so i can test, if a user is already logged in .
> >
>
> Why can't you set a cookie?  Way easier.
>

Although now that I think about it, a better solution is a custom
session handler with the user ID as the key of the table.  Short of
using some other method of keeping track who is logged in, I can't
imagine an easy way.

So what array structure *do* you get when you read the table and
unserialize the response?

-- 
Chris Hartjes

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

@TheBallpark - http://www.littlehart.net/attheballpark
@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 serialize handler

2007-05-15 Thread Chris Hartjes

On 5/15/07, jyrgen <[EMAIL PROTECTED]> wrote:
>
> i need access to *all* existing valid sessions in the table,
> so i can test, if a user is already logged in .
>

Why can't you set a cookie?  Way easier.

-- 
Chris Hartjes

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

@TheBallpark - http://www.littlehart.net/attheballpark
@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 serialize handler

2007-05-15 Thread jyrgen

i don't think i need a custom session handler.

cake's session component *is* such a handler.

i just want to get the data column deserialized, thats all.

but it seems impossible with this format i find in the db.

for example where does the " | " sign come from ??


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

2007-05-15 Thread jyrgen

i need access to *all* existing valid sessions in the table,
so i can test, if a user is already logged in .


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

2007-05-15 Thread jyrgen

example:

pr($_SESSION);

gives

Array
(
[Config] => Array
(
[rand] => 1482441247
[time] => 1179248446
[userAgent] => cc98eaffc23c634e0efd75ab9e36e810
)

)


pr(serialize($_SESSION));

results in :

a:1:{s:6:"Config";a:3:{s:4:"rand";i:1482441247;s:4:"time";i:
1179248446;s:9:"userAgent";s:32:"cc98eaffc23c634e0efd75ab9e36e810";}}

so fine-.

but note the different notation in the sessions table:

Config|a:3:{s:4:"rand";i:1482441247;s:4:"time";i:1179247983;s:
9:"userAgent";s:32:"cc98eaffc23c634e0efd75ab9e36e810";}

php fails to unserialize this string !!

thats why i cannot read entries from the session table.

jyrgen





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

2007-05-15 Thread Chris Hartjes

On 5/15/07, jyrgen <[EMAIL PROTECTED]> wrote:
>
> why can't i simply use php's (un)serialize in order to get
> data out of the session table ?

Do you mean you want to read data out of the session table and then
unserialize it?  Um, that's exactly what a session handler does for
you, and it even puts it in a nice $_SESSION superglobal for you.

I'd love to see an example of where you feel it's necessary to bypass
the session handler and access the raw session data.  Seems to me the
only reason to do that would be...to write your own session handler.

-- 
Chris Hartjes

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

@TheBallpark - http://www.littlehart.net/attheballpark
@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
-~--~~~~--~~--~--~---



session serialize handler

2007-05-15 Thread jyrgen

why can't i simply use php's (un)serialize in order to get
data out of the session table ?

i might be wrong but i expected this to work, since php
internal serialize handling is activated:

ini_set('session.serialize_handler', 'php');

thanks, jyrgen


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



Using CakePHP to extend existing website

2007-05-15 Thread Chandra

The company I work for has a PHP/MySQL (and the Smarty Template
Framework as a front end) based website that been running for a little
whilethe time has come to add more functionality to the site.  I'd
like to use use CakePHP to add these new features on...and I need to
see if it's even possible (I'm a Cake newbie) and then need to sell it
to my boss.  I was hoping somone could answer a few simple questions
for me:

1.  Site Authentication is done using PHP sessions stored in a
database...Can Cake use the same session methods or will the users
have to re-authenticate as they pass between the old and new
functionality (and vice-versa)

2.  There is some business logic and classes from the old site I need
to use - anything to watch out for?

3.  In accessing the existing MySQL database schema...I can use Cake's
CRUD capabilities...or is there a alternate way I should be accessing
the data?

Thanks for all your help,

Chandra


--~--~-~--~~~---~--~~
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: othAuth Performance

2007-05-15 Thread CraZyLeGs

othAuth only does a session check, if the the action is public it
doesn't even go to the session.
but yea to each his/her needs

On May 14, 7:17 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On 5/14/07, Dave J <[EMAIL PROTECTED]> wrote:
>
>
>
> > My question is this.   as it is right now...  I'm using CakePHP's
> > admin routing functions to implement the admin actions (ie. the admin
> > actions are sitting alongside the 'public' actions in the same
> > controller).  Now, on a heavily visited site... does anyone have
> > experience regarding any slowdowns by using the othAuth component?
>
> That's how I personally would do it.  Keep the auth stuff for the
> areas that need it.
>
> --
> Chris Hartjes
>
> My motto for 2007:  "Just build it, damnit!"
>
> @TheBallpark -http://www.littlehart.net/attheballpark
> @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: Question about findAll array

2007-05-15 Thread Mariano Iglesias

Check the private messages on the bakery for your article.

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de grigri
Enviado el: Martes, 15 de Mayo de 2007 09:36 a.m.
Para: Cake PHP
Asunto: Re: Question about findAll array

Heh I was thinking the exact same thing - I wrote a code submission
for the bakery on this, but it's not been approved yet.


--~--~-~--~~~---~--~~
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: ife() aim ?

2007-05-15 Thread grigri

Apparently it's because it's more readable, and you can't get the
operator precedence wrong.

On 15 May, 11:25, isk <[EMAIL PROTECTED]> wrote:
> Hi all!
>
> Who can explain me why ife() function is implemented by cake ? I mean
> why just not use ternary operation:
> cond ? expr1 : expr2
> ??
>
> 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: Question about findAll array

2007-05-15 Thread grigri

Heh I was thinking the exact same thing - I wrote a code submission
for the bakery on this, but it's not been approved yet.

In the meantime I've pasted the Behavior code here : http://pastebin.sk/en/1596/

Just add the $actsAs = array('SimpleResults') to any model and it'll
work transparently.

(This is assuming you're using 1.2 - if not, you could incorporate the
code from the behavior into your AppModel and it would do the same
thing)


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



Quick Dum Question

2007-05-15 Thread Enchy

What do I change to this to get "sname" in my while loop?


 array('className' => 'Customer',
   'conditions'=> '',
   'order' => 'name ASC',
   'limit' => '',
   'foreignKey'=> 'customer_id',
   'dependent' => true,
   'exclusive' => false,
   'finderQuery'   => ''
 ),
  'Supplier' =>
 array('className' => 'Supplier',
   'conditions'=> '',
   'order' => 'sname ASC',
   'limit' => '',
   'foreignKey'=> 'supplier_id',
   'dependent' => true,
   'exclusive' => false,
   'finderQuery'   => ''
 )

);





}
?>

 function index() {

$criteria=NULL;
list($order,$limit,$page) = $this->Pagination-
>init($criteria); // Added
$data = $this->Order->findAll($criteria, NULL, $order, $limit,
$page); // Extra parameters added
$this->set('data',$data);
}


$pagination->setPaging($paging); // Initialize the pagination
variables
$th = array (
$pagination->sortBy('id'),
$pagination->sortBy('dateoforder'),
$pagination->sortBy('eta'),
$pagination->sortBy('sname'),
$pagination->sortBy('customer_id'),
$pagination->sortBy('total'),
$pagination->sortBy('ref'),
$pagination->sortBy(' ')
); // Generate the pagination sort links
echo $html->tableHeaders($th); // Create the table headers with sort
links if desired

foreach ($data as $output)
{
$tr = array (

$html->link($output['Order']['ordernum'], "/Orders/Edit/
{$output['Order']['id']}"),
$output['Order']['id'],
$output['Order']['eta'],
$output['Order']['sname'],
$html->link("Delete", "/Orders/Delete/{$output['Order']
['id']}",null,'Are you sure?')

);
echo $html-
>tableCells($tr,array('class'=>'altRow'),array('class'=>'evenRow'));
}



I tried playing around with findall but Im not sure how to print it by
output and orderby?

L


--~--~-~--~~~---~--~~
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: acl help aro->create

2007-05-15 Thread [EMAIL PROTECTED]


Did u look in the api?
http://api.cakephp.org/1.2/classes.html
http://api.cakephp.org/1.2/class_aro.html

class Aro extends AclNode {
class AclNode extends AppModel {
class Model extends Overloadable {
 The create method is here in the model class:
 http://api.cakephp.org/1.2/model_8php-source.html#l00887

So, no. "$aro->create(1,null,'SomeText');" is not valid.

cook


On May 14, 4:49 pm, mdcatc <[EMAIL PROTECTED]> wrote:
> Has the create method changed format from the 1.1 version? In other
> words is the $aro->create(1,null,'SomeText'); still a valid format. Or
> is the creation of Aro's and Aco's changed?
>
> Also where are these classes defined for aro and aco I couldn't find
> them, will continue to search!
>
> On May 14, 2:19 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
> > ACL in 1.2 has changed (quite significantly). AFAIK ACL is not yet
> > functional in 1.2.
>
> >http://groups.google.com/group/cake-php/msg/b03b899ebb73b488?hl=en&;
>
> > On May 14, 1:12 pm, christianandradet <[EMAIL PROTECTED]>
> > wrote:
>
> > > hi
> > > i am working with cakephp 1.2..., i'am traying to use this in
> > > application,
> > > $aro = new Aro();
> > > $aro->create(1, null, 'admin');
>
> > > but when I execute it the user is not created and no error message is
> > > displayed, but when i use the same function with cakephp 1.1 it works
>
> > > What should i do, does the way to use this changed to this version??
> > > Please help


--~--~-~--~~~---~--~~
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: is there any chance that using cakephp in apache not support mod_write

2007-05-15 Thread Vladimir

yep, using 404 "Page not found" error


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



ife() aim ?

2007-05-15 Thread isk

Hi all!

Who can explain me why ife() function is implemented by cake ? I mean
why just not use ternary operation:
cond ? expr1 : expr2
??

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



  1   2   >