Re: accessing a url param in a router

2007-04-07 Thread Zoltan

Ok,

this is what I have now:
Router::connect('/:id', array('controller' => 'places','action' =>
'view'), array ('id' => '[a-z_0-9]{1,15}') );

The error I get is, if I enter something like: http://127.0.0.1:8084/edragon

it thinks it's looking for a controller called Edragon:

Missing controller
You are seeing this error because controller EdragonController could
not be found...
class EdragonController extends AppController {

Cake, helpful as usual, is slightly more confused than I am :)

Zoltan



On Mar 24, 4:11 pm, "nate" <[EMAIL PROTECTED]> wrote:
> Yeah, that's not really how you're supposed to use it.  See the
> example here:http://cake.insertdesignhere.com/posts/view/10
>
> On Mar 24, 1:55 pm, "Zoltan" <[EMAIL PROTECTED]> wrote:
>
> > I found making this the last condition seems to do the trick, but I'm
> > not sure if this is the proper way to do it:
>
> > Router::connect('/[0-9]{1,4}', array('controller' => 'places','action'
> > => 'view', $_GET['url'] ));
>
> > Zoltan
>
> > On Mar 24, 12:49 pm, "Chowsapal" <[EMAIL PROTECTED]> wrote:
>
> > > I'm not sure I know the best answer for this, but one thing you could
> > > do is:
>
> > > Router::connect('/:param_name', array('controller' => 'places',
> > > 'action' => 'view'));
>
> > > This will set $this->params['param_name'] to 123 or whatever is
> > > there.  As far as limiting this to only numbers, or using info from
> > > the first parameter in the second one, I'm not really sure.  hth.
>
> > > On Mar 24, 10:34 am, "Zoltan" <[EMAIL PROTECTED]> wrote:
>
> > > > I'm sure this has been asked before, but I haven't be able to turn up
> > > > the answer:
>
> > > > I want to have a url like mysite/123 resolve to mysite/places/view/506
>
> > > > Using 1.2, I have a route like:
> > > > Router::connect('/[0-9]+', array('controller' => 'places', 'action' =>
> > > > 'view', $this->params['url'] <-- **doesn't work ***  ));  // places/
> > > > view/506
>
> > > > how do I specify this?
>
> > > > thanks,
> > > > Zoltan


--~--~-~--~~~---~--~~
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 to stop Ajax triggered by onLoad event?

2007-04-07 Thread skyblueink

The code below, using prototype and Ajax, populates 3 s.  But,
once the page is loaded and Event.observing is acting, can I stop the
populating with a click button? I thought Event.stop() and
Event.stopObserving() should come, and did some tries but failed.

Event.observe(window, 'load',function(event)
{Ajax.Updater('red','/test/content.php?id=red',...)

Event.observe(window, 'load',function(event)
{Ajax.Updater('red','/test/content.php?id=blue',...)

Event.observe(window, 'load',function(event)
{Ajax.Updater('red','/test/content.php?id=orange',...)


--~--~-~--~~~---~--~~
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: Best Practice with Behaviors or How To Make a Model Act As...

2007-04-07 Thread err_

https://trac.cakephp.org/browser/branches/1.2.x.x/cake/libs/model/behaviors/tree.php?rev=4521

On Apr 5, 5:25 pm, "BlenderStyle" <[EMAIL PROTECTED]> wrote:
> The concept of behaviors is a new one to me. I understand that views
> have helpers, controllers have components, and models have behaviors,
> but I still don't grasp how to use these correctly. So, I did some
> research:
>
> cake/libs/model/model.php
> cake/libs/model/behavior.php
> Various Google Group posts (a lot from nate)
> Slug Behavior:http://bakery.cakephp.org/articles/view/295
> Transaction Behavior:http://bakery.cakephp.org/articles/view/228
> Touch Behavior:http://bakery.cakephp.org/articles/view/198
> Chapter 15 in Agile Web Development with Rails
>
> The thing that really hit the nail on the head for me, is how a
> behavior is used in a model - actAs. That makes it much, much easier
> to understand. If I wanted my model to act as a tree (MPTT), I could
> create a behavior called TreeBehavior and tell my model to act like a
> tree. If I wanted my model to act like a list, I could do that too.
> Very cool stuff. Is this the best way to think of behaviors? Anyone
> have some thoughts on how to use behaviors in the MVC-intended way?
>
> I'm assuming Cake is going to have some built-in behaviors, but right
> now (1.2.0.4451alpha), cake/libs/model/behaviors is empty. Does anyone
> know if there are some on the way? I understand that the Cake team is
> busy (http://groups.google.com/group/cake-php/browse_thread/thread/
> 683cdd4820eb2c03/df729d09968eaf7d), so I'm not trying to be pushy, I'm
> just curious. An MPTT behavior would be awesome to do things like move/
> delete a branch of nodes.


--~--~-~--~~~---~--~~
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 do I point my domain to a specific view?

2007-04-07 Thread Poncho

Open "{cakeapp}/config/routes.php"

Lets say the page you want the root of your site to point to "/pages/
display/home"

$Route->connect('/', array('controller' => 'pages', 'action' =>
'display', 'home'));

That would be if you are using the built-in PagesController. For my
current project I created my own PagesController with a 'splash'
method with a physical content page (this site requires a splash page)
and a 'read' method that grabs the content from the database. In this
case, the routes would look something like this:

$Route->connect('/', array('controller' => 'pages', 'action' =>
'splash'));
$Route->connect('/home', array('controller' => 'pages', 'action' =>
'read', 'home'));
$Route->connect('/pages/:action/*', array('controller' => 'pages',
'action' => 'read', 'home'));

On Apr 8, 2:38 am, "peterhf" <[EMAIL PROTECTED]> wrote:
> I'm certain that this question has been asked a thousand timea and
> answered two thousand times! I just couldn't find it on the lists.
>
> How to I point my domain, "http://www.my_domain_name.com/";, to a
> specific view so that I don't have to do 
> "http://www.my_domain_name.com/view_name/";.
>
> Thanks in advance for your help.
>
> Peter -


--~--~-~--~~~---~--~~
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 do I point my domain to a specific view?

2007-04-07 Thread peterhf

I'm certain that this question has been asked a thousand timea and
answered two thousand times! I just couldn't find it on the lists.

How to I point my domain, "http://www.my_domain_name.com/";, to a
specific view so that I don't have to do "http://
www.my_domain_name.com/view_name/".

Thanks in advance for your help.

Peter -


--~--~-~--~~~---~--~~
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: Limiting findAll() fields in associations

2007-04-07 Thread Mariano Iglesias

If it's on a per-find basis that you need to make the change, sure, just use
bindModel() to "rebind" the model changing those details. Otherwise doing
another association like you mentioned also works.

-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 joel
Enviado el: Sábado, 07 de Abril de 2007 09:45 p.m.
Para: Cake PHP
Asunto: Re: Limiting findAll() fields in associations

Thanks, Mariano!  That makes sense.  Is there any easy way to change
this on the fly?  Otherwise, I guess I could just make another hasMany
association, like CommentTeaser, that only has those fields.


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



Problem loading custom helper when calling views using admin routing...

2007-04-07 Thread zen

good day bakers!

I am trying to create a custom helper that extends the Html helper,
basicly following the manual...

Here's my helper class:
found in cake/app/views/link.php

class LinkHelper extends Helper
{
var $helpers = array('Html');

function makeEdit($title, $url)
{
  ...
}
}

and in my controller where i'd like to use it,
I include at the top...

$helpers = array('Html', 'Link');

But now when i load a view that belongs to this controller
under admin/ (admin/players/add for example),
the following warning messages are outputted:

//
class LinkHelper extends Helper { function makeEdit($title, $url)
{ } }
Warning: session_start() [function.session-start]: Cannot send session
cookie - headers already sent by (output started at C:\myPHP\cake\app
\views\helpers\link.php:8) in C:\myPHP\cake\cake\libs\session.php on
line 154

Warning: session_start() [function.session-start]: Cannot send session
cache limiter - headers already sent (output started at C:\myPHP\cake
\app\views\helpers\link.php:8) in C:\myPHP\cake\cake\libs\session.php
on line 154

Warning: Cannot modify header information - headers already sent by
(output started at C:\myPHP\cake\app\views\helpers\link.php:8) in C:
\myPHP\cake\cake\libs\session.php on line 155

Missing Helper Class
You are seeing this error because the view helper class LinkHelper
can't be found or doesn't exist.

//

But when i call another action in the controller such as players/add,
no warning messages
are outputted.

what is wrong with my code?! am i missing a
step or something? how can i fix this?

Any help would be greatly appreciated!

thx guys! ^^


--~--~-~--~~~---~--~~
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: Limiting findAll() fields in associations

2007-04-07 Thread joel

Thanks, Mariano!  That makes sense.  Is there any easy way to change
this on the fly?  Otherwise, I guess I could just make another hasMany
association, like CommentTeaser, that only has those fields.


--~--~-~--~~~---~--~~
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: Limiting findAll() fields in associations

2007-04-07 Thread Mariano Iglesias

Just as you can set 'foreignKey' or 'className' on the association array,
use 'fields':

var $hasMany = array(
array('Comment' => array( 
'fields' => array('id', 'title')
))
);

In cake/libs/model/datasources/dbo_source.php, you can see that on line 879
for self joins (hasOne and belongsTo):

$self['fields'] = am($self['fields'], $this->fields($linkModel, $alias,
(isset($assocData['fields']) ? $assocData['fields'] : '')));

And line 1019 for hasMany:

'fields' => $this->fields($linkModel, $alias, $assocData['fields']),

-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 joel
Enviado el: Sábado, 07 de Abril de 2007 09:28 p.m.
Para: Cake PHP
Asunto: Limiting findAll() fields in associations

Let's say I have a Blog with many Comments, but I only want to return
some of the fields for the Blog and its Comments.  Is it possible to
use findAll() to only return, for example, the fields Blog.id and
Blog.title (which I know how to do using the $fields parameter in
findAll), but also only Comment.id and Comment.title in all
associated, hasMany, Comments?


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



Limiting findAll() fields in associations

2007-04-07 Thread joel

Let's say I have a Blog with many Comments, but I only want to return
some of the fields for the Blog and its Comments.  Is it possible to
use findAll() to only return, for example, the fields Blog.id and
Blog.title (which I know how to do using the $fields parameter in
findAll), but also only Comment.id and Comment.title in all
associated, hasMany, Comments?

This doesn't work:

$this->Blog->findAll(null, array('Blog.id', 'Blog.title',
'Comment.id', 'Comment.title'));

Any ideas?


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



Re: where to find any doc about 1.2.0.4798alpha version

2007-04-07 Thread John David Anderson


On Apr 7, 2007, at 5:43 PM, BlenderStyle wrote:

>
> http://api.cakephp.org/ is always pretty good. Also, the source code
> is commented well.
>
> On Apr 7, 2:07 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>> I recently moved to the 1.2.0 version ,a lot of things change .
>>
>> where to find manual or doc?

1.2 is a developer release. There will be no docs for 1.2 until final  
release.

-- 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: where to find any doc about 1.2.0.4798alpha version

2007-04-07 Thread BlenderStyle

http://api.cakephp.org/ is always pretty good. Also, the source code
is commented well.

On Apr 7, 2:07 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> I recently moved to the 1.2.0 version ,a lot of things change .
>
> where to find manual or doc?


--~--~-~--~~~---~--~~
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 cake a solution for hosting set-up?

2007-04-07 Thread Poncho

I'm not exactly sure of your question, but I'll give you an example of
how I set cake up on my local Tiger system.

If you don't have the latest MySQL and PHP installed, follow the
instructions on http://www.entropy.ch/software/macosx/.
To easily create symlinks, download from either
http://seiryu.home.comcast.net/symboliclinker.html or
http://www.naratt.com/MakeSymlink.html

I have a "Dev" folder in my user account "/Users/{username}/Dev", I
would extract the cake archive here and rename it accordingly "/Users/
{username}/Dev/mysite/".

Now create a symlink of your "mysite" directory and move it to "/
Library/WebServer/Documents/"

Now your website should be accessible from "http://localhost/mysite/";

I hope that makes some kind of sense to you.

Cheers;
Poncho


On Apr 7, 7:09 pm, "jofftan" <[EMAIL PROTECTED]> wrote:
> I'm having a hard time installed it on my Tiger OsX local machine
> because it needs a lot of config.
> So installing it on a webhosting server(RedHat)  that I don't have
> config access look almost impossible.


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



routing: custom sitename before EACH controller

2007-04-07 Thread gerbenzomp

I've read the article on routing (http://bakery.cakephp.org/articles/
view/86) and serached through this group, but couldn't really find an
answer to this question:

How can I enable users to have their custom sitename, like this:

http://www.site.com/users_custom_sitename/controller/action/

So each user has their own sitename, and ALL controllers and actions
come after that in the URL.

Is there a way to do this without having to make custom routes for
every controller and action?


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



$html->formTag() and security component

2007-04-07 Thread yolabingo

I'm new to Cake.  I'm using Cake 1.1.x and started adding
"requireAuth" constraints to my controllers.  According to the manual,
this requires I generate my forms using $html->formTag(), which
(according to the API) is deprecated and its use seems to be
discouraged elsewhere on this list.

Does anyone have suggestions on how I should proceed?  Will using
$html->formTag() make my life terrible in the near future?  I'd really
like to be able to use requireAuth() if possible.

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: conditions in 1.1.14.4797 doesn't work at all?

2007-04-07 Thread mariano.iglesias

Fixed in:

https://trac.cakephp.org/changeset/4818

-MI


--~--~-~--~~~---~--~~
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: conditions in 1.1.14.4797 doesn't work at all?

2007-04-07 Thread Mariano Iglesias

And when you do report it please attach your controllers/models so we can
easily test it. Thanks :)

-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 [EMAIL PROTECTED]
Enviado el: Sábado, 07 de Abril de 2007 03:44 p.m.
Para: Cake PHP
Asunto: conditions in 1.1.14.4797 doesn't work at all?

After upgrading cake's core libs from 1.1.13.4450 to 1.1.14.4797
condituins in model relations (like hasOne = ...
'conditions="Classname.field='zzz'") doesn't work at all.


--~--~-~--~~~---~--~~
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: conditions in 1.1.14.4797 doesn't work at all?

2007-04-07 Thread Mariano Iglesias

Can you please report this to trac?

https://trac.cakephp.org

Anytime you find what seems to be a bug please report it to trac. Otherwise
we have to go through all google group emails to see if anyone reported a
bug here. Not every optimal, if you ask me.

-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 [EMAIL PROTECTED]
Enviado el: Sábado, 07 de Abril de 2007 03:44 p.m.
Para: Cake PHP
Asunto: conditions in 1.1.14.4797 doesn't work at all?

After upgrading cake's core libs from 1.1.13.4450 to 1.1.14.4797
condituins in model relations (like hasOne = ...
'conditions="Classname.field='zzz'") doesn't work at all.


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



conditions in 1.1.14.4797 doesn't work at all?

2007-04-07 Thread [EMAIL PROTECTED]


After upgrading cake's core libs from 1.1.13.4450 to 1.1.14.4797
condituins in model relations (like hasOne = ...
'conditions="Classname.field='zzz'") doesn't work at all.

PHP4, mySQL4.


--~--~-~--~~~---~--~~
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 cake a solution for hosting set-up?

2007-04-07 Thread jofftan

I'm having a hard time installed it on my Tiger OsX local machine
because it needs a lot of config.
So installing it on a webhosting server(RedHat)  that I don't have
config access look almost impossible.


--~--~-~--~~~---~--~~
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 to generateList with more than more value per key?

2007-04-07 Thread zen

thx :)


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



associationForeignKey not working --trying self join

2007-04-07 Thread bingo

hi,

I have a table with following structure

posts_keywords:
   post_id
   keyword_id
   created


I am trying to find coocurring keywords for this I created a
association like this

var $belongsTo = array(
'Coocurrence' =>
  array('className' => 'PostsKeyword',
  'foreignKey' => 'post_id',
  'associationForeignKey' => 'post_id',
  'conditions' => '',
  'fields' => 'PostsKeyword.keyword_id, Coocurrence.keyword_id'
)
);

However, cakephp ignores my specifications for associationForeignKey
and fields and the final SQL is this

SELECT PostsKeyword.post_id, PostsKeyword.keyword_id, Posts.created,
Coocurrence.post_id, Coocurrence.keyword_id, Coocurrence.created FROM
`posts_keywords` AS `PostsKeyword` LEFT JOIN `posts_keywords` AS
`Coocurrence` ON `PostsKeyword`.`post_id` = `Coocurrence`.`id`

where this should be
left join on . 'PostsKeyword'.'post_id' =
'Coocurrence'.'post_id'

I am not sure what's the problem

Regards,
bingo


--~--~-~--~~~---~--~~
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: Making REST Requests to a web-server like yahoo

2007-04-07 Thread Chris Hartjes

On 4/7/07, Tonyz <[EMAIL PROTECTED]> wrote:
>
> I have no need to parse xml as the response is in php serialized. My
> only concern is doing in php the http request and after some searches
> I think will use the pear package html client as my host has no curl.
>

Why can't you use file_get_contents?

-- 
Chris Hartjes

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

rallyhat.com - digital photo scavenger hunt
@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: new auth component in cake 1.2

2007-04-07 Thread [EMAIL PROTECTED]

First attempt at providing some insight into the new AuthComponent:
http://dieter.plaetinck.be/figuring_out_cakephp_new_authcomponent

On Apr 6, 8:21 pm, "gar" <[EMAIL PROTECTED]> wrote:
> Would it be possible for me to take a stab at making a doc on how to
> use this functionality?  If someone provides me with some source code
> on the usage I will try to figure it out and write up a pseudo startup
> doc on it.
>
> The reason why I want to dive into this auth method instead of OthAuth
> is that I feel going forward, this authentication method will be
> integrated tightly into the whole cake framework.  So with each cake
> update if auth needs to be updated they will do so.  If the auth is
> part of the cake framework I would rather spend the extra time to
> figure out how to use it now rather than to convert the auth system to
> this one later.  I could be wrong about this tight integration and if
> i am please let me know.
>
> My question is.  Does anyone have any scripts that is utilizing the
> AuthComponent now?  Any starting point beside from scratch will be
> fine.  If so can I get a copy of it and how the db looks like also?
> If not I will try to figure it out from the auth.php class file.  Dont
> know how far I will get with that way =(.
>
> gar
>
> On Apr 5, 10:53 pm, "R. Rajesh Jeba Anbiah"
>
> <[EMAIL PROTECTED]> wrote:
> > On Apr 6, 1:38 am, "Samuel DeVore" <[EMAIL PROTECTED]> wrote:
>
> > > On 4/5/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > > > how can i find manual, trytourial about new auth coponent+acl  in cake
> > > > 1.2 ?
>
> > > I guess you could write it ;)  I am not sure there is anything out there 
> > > yet.
>
> > There is indeed an Auth component  > trunk/cake/1.2.x.x/cake/libs/controller/components/auth.php> in 1.2.
>
> > I too was interested in this component and when asked in IRC,
> > PhpNut informed me that, we have to write many stuffs and can use the
> > methods found in the Auth component. So, I'd thought of settling in
> > othAuth for now.
>
> >HTH.
>
> > --
> >   
> > Email: rrjanbiah-at-Y!comBlog:http://rajeshanbiah.blogspot.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: Selecting far relations

2007-04-07 Thread [EMAIL PROTECTED]

"I like my Databases only when it's totally normalized"

Hmm. I like my database when it accurately reflects the business model
it represents, and when it functionally makes sense. Relational
databases are supposed to make your life easier, not harder.

Fully normalized database are great, but not always optimal! Besides
that, adding "Invoice=[HasOne]=> Customer " does not necessarily de-
normalize your database; It depends on your business model.
Furthermore, by not adding "Invoice=[HasOne]=> Customer ":
1- you are significantly increasing the complexity of your code
2- you are significantly increasing the load on the database
3- and if you allow tickets to be modified(moved to another invoice or
customer) then you will have several anomalies to overcome

think about it...


On Apr 1, 3:47 pm, "MYRZ" <[EMAIL PROTECTED]> wrote:
> Thanks all,
>
> But i won't be adding a relation between Customer and Invoices. I like
> my Databases only when it's totally normalized  (http://
> en.wikipedia.org/wiki/Database_normalization). No duplicate
> information (so also DRY), and no anomalies.
>
> So i think i'll go for the custom query.


--~--~-~--~~~---~--~~
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: mysterious SQL query

2007-04-07 Thread [EMAIL PROTECTED]

The DESC command asks the database to DESCribe a table. Cake uses
these queries to get the names and data types of your fields.

Try running "DESC `users`" and look at the results.



On Apr 7, 7:25 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> 1   DESC `groups`   3   3   4
> 2   DESC `users`4   4   4
> 3   DESC `contacts` 7   7   4
> 4   SELECT COUNT(*) AS count FROM `groups` AS `Group` WHERE 1 = 1
>
> when I debug ,I always find some sql query like above ...
>
> I didn't do anything to cause that query ,what hell does that do?


--~--~-~--~~~---~--~~
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 to generateList with more than more value per key?

2007-04-07 Thread [EMAIL PROTECTED]

I don't know if its possible using generateList, but it's pretty easy
to make your own list.
Here are a couple examples; (The first one less desirable because it
uses a database function which is unique to mysql.)

$list = array();
$rows = $this->Player->query("SELECT id, CONCAT(firstname, ' ',
lastname) as fullname FROM players");
foreach($rows as $row){$list[$row['id']] = $row['fullname'];}

$list = array();
$rows = $this->Player->findAll(null,
array('id','firstname','lastname'));
foreach($rows as $row){$list[$row['id']] = $row['firstname'].' '.
$row['lastname'] ;}

regards,
cook


On Apr 7, 7:43 am, "zen" <[EMAIL PROTECTED]> wrote:
> Hi, Cake noob here...
>
> I've been searching for a while for this...
> but can't seem to find the solution...
>
> basicly what i'd like to do is to generate an array
> using generateList, then populate a dropdown using
> the result set. what i can't seem to do is to make
> it generate more than more value per key, here is the
> code:
>
> $this->set(
> 'Players',
> $this->Player->generateList(null, 'lastname ASC', null,
> '{n}.Player.id', '{n}.Player.lastname')
> );
>
> I's to make so that it becomes smth like this
> (obviously the following code doesn't work):
>
> $this->set(
> 'Players',
> $this->Player->generateList(null, 'lastname ASC', null,
> '{n}.Player.id', '{n}.Player.firstname'.' '.'{n}.Player.lastname')
> );
>
> so that the result set is smth like this:
> array(
> '1' => 'Kobe Bryant',
> '2' => 'D-Wade',
> '3' => 'Chien-Ming Wang',
> '4' => 'Dice-K Matsuzaka'
> );


--~--~-~--~~~---~--~~
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 to execute OthAuth protected actions with a CRON job?

2007-04-07 Thread CraZyLeGs

log someone without password ? eh talk about security..
maybe a hash of the password and login with some salt

Anyway look here http://bakery.cakephp.org/articles/view/99 in the
comments "11  Howto automaticly sign in a user."

On Apr 6, 11:54 pm, "Bootstrapper" <[EMAIL PROTECTED]>
wrote:
> Excellent! Thanks CraZyLeGs!
>
> Just to verify - I assume the PHP code you're talking about below goes
> into the PHP file that the CRON job calls, right? This is basically
> the code for logging someone directly through code, rather than
> through the login form.
>
> But isn't there a way to directly log someone in without knowing there
> password? I also need my users to be able to link into their account
> by email, so far the only methods I know for doing that require me to
> keep their clear-text passwords, which is obviously not good.
>
> Any suggestions?


--~--~-~--~~~---~--~~
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 to execute OthAuth protected actions with a CRON job?

2007-04-07 Thread CraZyLeGs

log someone without password ? eh talk about security..
maybe a hash of the password and login with some salt

Anyway look here http://bakery.cakephp.org/articles/view/99 in the
comments "11  Howto automaticly sign in a user."

On Apr 6, 11:54 pm, "Bootstrapper" <[EMAIL PROTECTED]>
wrote:
> Excellent! Thanks CraZyLeGs!
>
> Just to verify - I assume the PHP code you're talking about below goes
> into the PHP file that the CRON job calls, right? This is basically
> the code for logging someone directly through code, rather than
> through the login form.
>
> But isn't there a way to directly log someone in without knowing there
> password? I also need my users to be able to link into their account
> by email, so far the only methods I know for doing that require me to
> keep their clear-text passwords, which is obviously not good.
>
> Any suggestions?


--~--~-~--~~~---~--~~
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 to generateList with more than more value per key?

2007-04-07 Thread GreyCells

http://groups.google.com/group/cake-php/browse_thread/thread/b32341e00a1324bb/916efdf548c20b68?lnk=gst&q=afterfind+fullname&rnum=1#916efdf548c20b68

On Apr 7, 12:43 pm, "zen" <[EMAIL PROTECTED]> wrote:
> Hi, Cake noob here...
>
> I've been searching for a while for this...
> but can't seem to find the solution...
>
> basicly what i'd like to do is to generate an array
> using generateList, then populate a dropdown using
> the result set. what i can't seem to do is to make
> it generate more than more value per key, here is the
> code:
>
> $this->set(
> 'Players',
> $this->Player->generateList(null, 'lastname ASC', null,
> '{n}.Player.id', '{n}.Player.lastname')
> );
>
> I's to make so that it becomes smth like this
> (obviously the following code doesn't work):
>
> $this->set(
> 'Players',
> $this->Player->generateList(null, 'lastname ASC', null,
> '{n}.Player.id', '{n}.Player.firstname'.' '.'{n}.Player.lastname')
> );
>
> so that the result set is smth like this:
> array(
> '1' => 'Kobe Bryant',
> '2' => 'D-Wade',
> '3' => 'Chien-Ming Wang',
> '4' => 'Dice-K Matsuzaka'
> );


--~--~-~--~~~---~--~~
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 to deal with $this->User->findById('3')['User']['name']

2007-04-07 Thread GreyCells

If you find you're writing the same old find($conditions, $fields)
time after time, why not encapsulate it as a method on your User model
class?

e.g. : User->findMyUserStuff($userId);

And you get extra 'DRY' points :)

If you're just fetching one field then use $model->field();

~GreyCells

On Apr 7, 8:33 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> when code in cake,I always encounter the situation $this->User-
>
> >findById('3')['User']['name'] ,something like that.
>
> but it doesn't work.I know.I used to coding like this :$foo = 
> $this->User->findById('3'); $foo['User']['name'],but I am really tired of
>
> that .
>
> so what really need to be done in php?


--~--~-~--~~~---~--~~
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 to generateList with more than more value per key?

2007-04-07 Thread zen

Hi, Cake noob here...

I've been searching for a while for this...
but can't seem to find the solution...

basicly what i'd like to do is to generate an array
using generateList, then populate a dropdown using
the result set. what i can't seem to do is to make
it generate more than more value per key, here is the
code:

$this->set(
'Players',
$this->Player->generateList(null, 'lastname ASC', null,
'{n}.Player.id', '{n}.Player.lastname')
);

I's to make so that it becomes smth like this
(obviously the following code doesn't work):

$this->set(
'Players',
$this->Player->generateList(null, 'lastname ASC', null,
'{n}.Player.id', '{n}.Player.firstname'.' '.'{n}.Player.lastname')
);

so that the result set is smth like this:
array(
'1' => 'Kobe Bryant',
'2' => 'D-Wade',
'3' => 'Chien-Ming Wang',
'4' => 'Dice-K Matsuzaka'
);


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



mysterious SQL query

2007-04-07 Thread [EMAIL PROTECTED]

1   DESC `groups`   3   3   4
2   DESC `users`4   4   4
3   DESC `contacts` 7   7   4
4   SELECT COUNT(*) AS count FROM `groups` AS `Group` WHERE 1 = 1


when I debug ,I always find some sql query like above ...

I didn't do anything to cause that query ,what hell does that do?


--~--~-~--~~~---~--~~
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 to deal with $this->User->findById('3')['User']['name']

2007-04-07 Thread Seb

no way to do that in PHP, afaik. the { } string operators will not
operate on a function.

However if you add something like this to your app_controller;

[code]

function get($data, $member) {
if (!is_array($member)) {
$member = explode('.', $member);
}
foreach($member as $m) {
if (isset($data[$m])) {
$data = $data[$m];
} else {
trigger_error("Oups! There is no '$m' defined! 
(req:
'".implode('.',$member)."')",E_USER_NOTICE);
break;
}
}
return $data;
}
[/code]


You'll be able to do something like this;

$foo = $this->get($this->User->findbyId('3'),'User.name');

and.. for efficiency's sake, you could do something like this instead;
extracts only the username... instead of the whole user obj...
$foo = $this->get($this->User-
>findbyId('3',array('name')),'User.name');


Hope this helps!

Seb.


On Apr 7, 5:33 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> when code in cake,I always encounter the situation $this->User-
>
> >findById('3')['User']['name'] ,something like that.
>
> but it doesn't work.I know.I used to coding like this :$foo = 
> $this->User->findById('3'); $foo['User']['name'],but I am really tired of
>
> that .
>
> so what really need to be done in php?


--~--~-~--~~~---~--~~
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: unserialize error

2007-04-07 Thread jyrgen


finally i found a way to implement a custom
session garbage collection. luckily there
is the "expires" field which can be evaluated
instead of the serialized value in the data array:

// custom session garbage collection

$sessions = $this->Mysession->findAll();
foreach($sessions as $session){
if($session['Mysession']['expires']Mysession->del($session['Mysession']['id']);
}
  }

use the mysession model i posted above.

majna, wasn't it this what you have been looking for ?

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: where to find any doc about 1.2.0.4798alpha version

2007-04-07 Thread Dr. Tarique Sani

On 4/7/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> I can't quite understand most of the *html and form helper*...
>
> and the function doc is limited.

I can't understand most of the things around me either but the way I
approach such things is define clearly what I want to do with them.

What do you want to do with html and form helper?

Have you tried just baking a view to see what turns up?

http://cake.insertdesignhere.com/posts/view/15 Nate describes some of
the form automagic here.

Cheers
Tarique

-- 
=
PHP for E-Biz: http://sanisoft.com
Cheesecake-Photoblog needs you!: http://cheesecake-photoblog.org
=

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



Re: where to find any doc about 1.2.0.4798alpha version

2007-04-07 Thread [EMAIL PROTECTED]

I can't quite understand most of the *html and form helper*...

and the function doc is limited.

On 4月7日, 下午6时16分, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote:
> On 4/7/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> > I recently moved to the 1.2.0 version ,a lot of things change .
>
> There isn't any but if you run the code through phpDoc you will get
> decent api documentation.
>
> However moves from 1.1 to 1.2 are much less painful than moves between
> some of the earlier versions of 1.1 itself :P
>
> What is the exact problem you are facing?
>
> Cheers
> Tarique
>
> --
> =
> PHP for E-Biz:http://sanisoft.com
> Cheesecake-Photoblog needs you!:http://cheesecake-photoblog.org
> =


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



Re: Making REST Requests to a web-server like yahoo

2007-04-07 Thread Tonyz

I have no need to parse xml as the response is in php serialized. My
only concern is doing in php the http request and after some searches
I think will use the pear package html client as my host has no curl.

Thanks for your response.

I was wondering if cake 1.2 has or will have included classes for web
modelling from external websites.

gOOD eASTER

On 7 Apr, 00:03, "Eric C Blount" <[EMAIL PROTECTED]> wrote:
> After searching for a couple of minutes, I found the XML class Kjell is
> speaking of:http://keithdevens.com/software/phpxml
>
> In case anyone else was as interested as I was...
>
> HTH,
> Eric
>
> On 4/6/07, Kjell Bublitz <[EMAIL PROTECTED]> wrote:
>
>
>
> > Chris, i think you switched something here.
>
> > file_get_contents is available since PHP 4.3.0.
> > It is file_put_contents which is only available in PHP5.
>
> > I second that XML parsing sucks in PHP4. There is a wonderful class
> > available i used in many projects already. It's a xml class from Keith
> > Devens (google). But it is strictly for PHP4, because it uses a method
> > which is deprecated in PHP5, so watch it.
>
> > Hope this helps.
>
> > On 4/6/07, Chris Hartjes <[EMAIL PROTECTED]> wrote:
>
> > > I second what Kjell said:  file_get_contents is your easiest solution
> > > if using PHP 5, otherwise use the curl functions.  XML parsing sucks
> > > in PHP 4, so I hope you can use PHP 5.
>
> > > Give me SimpleXML or give me death! :)
>
> > > On 4/6/07, Tonyz <[EMAIL PROTECTED]> wrote:
>
> > > > I read this article on yahoo developer network because I would like in
> > > > my cake app to display search results from yahoo. The article is at
> > > >http://developer.yahoo.com/php/howto-reqRestPhp.html
>
> > > > There is some built in class of cake who can perform rest request to a
> > > > webserver with curl or file_get_contents?
>
> > > --
> > > Chris Hartjes
>
> > > My motto for 2007:  "Just build it, damnit!"
>
> > > rallyhat.com - digital photo scavenger hunt
> > > @TheBallpark -http://www.littlehart.net/attheballpark
> > > @TheKeyboard -http://www.littlehart.net/atthekeyboard
>
> > --
> > Regards, Kjell
> >www.m3nt0r.de


--~--~-~--~~~---~--~~
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: the controller::flash() function doesn't work

2007-04-07 Thread [EMAIL PROTECTED]

 * Production Mode:
 *  0: No error messages, errors, or warnings shown. Flash messages
redirect.

thx a lot .
problem solved.

On 4月7日, 下午5时26分, "Larry E. Masters aka PhpNut" <[EMAIL PROTECTED]>
wrote:
> Try setting DEBUG = 0 in core.php
>
> Read the doc comment above the define also...
>
> --
> /**
> * @author Larry E. Masters
> * @var string $userName
> * @param string $realName
> * @returns string aka PhpNut
> * @access  public
> */


--~--~-~--~~~---~--~~
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: unserialize error

2007-04-07 Thread jyrgen

valid sessions on my system look like this

Config|a:3:{s:4:"rand";i:1735136669;s:4:"time";i:1175943092;s:
9:"userAgent";s:32:"cc98eaffc23c634e0efd75ab9e36e810";}
User|a:5:{s:2:"id";s:1:"6";s:9:"author_id";s:1:"5";s:
12:"publisher_id";s:1:"0";s:9:"logged_in";i:1;s:4:"type";s:1:"A";}

(two arrays)

i'm asking myself if the "|", lets my reading fail...

this works for my, instead of unserialize:

$temp = mysql_query('SELECT * FROM sessions');
while ($row = mysql_fetch_array($temp)){
$variables = array(  );
$a = preg_split( "/(\w+)\|/", $row['data'], -1,
PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE );
for( $i = 0; $i < count( $a ); $i = $i+2 ) {
$variables[$a[$i]] = unserialize( $a[$i+1] );
}
}

should be combined with a session model in order to
avoid explicit sql quering.

i can live with that :-)

still searching for a method to collect session garbage.
once i got this done, multiple logins are prevented and
my auth system will be finished...

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: unserialize error

2007-04-07 Thread majna


Also I need to grab username from session. Sessions are set to
database. Cake 1.1.13.
Session data filed is NOT just serilalized. Is there any other way
beside  reg exp?



On Apr 7, 12:22 pm, "jyrgen" <[EMAIL PROTECTED]> wrote:
> i'm still struggling with reading data from the sessions
> table.
>
> at least i'm now able to retrieve session entries, after
> i set up a simple model like this.
>
> class Session extends AppModel{
> var $name = 'Session';
> }
>
> but when i try to print out the session data in a controller
>
> $sessions = $this->Session->findAll();
> foreach($sessions as $session){
> $d=$session['Session']['data'];
> pr(unserialize($d));
> }
>
> i get this error:
>
> Notice: unserialize(): Error at offset 0 of 117 bytes in /var/www/cake/
> app/controllers/users_controller.php on line 88
>
> with 117 being the last position "}" of the serialized string
>
> Config|a:3:{s:4:"rand";i:1024300043;s:4:"time";i:1175942427;s:
> 9:"userAgent";s:32:"cc98eaffc23c634e0efd75ab9e36e810";}
>
> thanks for your help!
>
> 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: unserialize error

2007-04-07 Thread jyrgen

oops. i just noticed that the Session model interferes
with the Session object.
therefore i renamed the Session model into

mysession.php

class Mysession extends AppModel{

var $name = 'Mysession';

var $useTable = 'sessions';
}
j.


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



unserialize error

2007-04-07 Thread jyrgen

i'm still struggling with reading data from the sessions
table.

at least i'm now able to retrieve session entries, after
i set up a simple model like this.

class Session extends AppModel{
var $name = 'Session';
}

but when i try to print out the session data in a controller

$sessions = $this->Session->findAll();
foreach($sessions as $session){
$d=$session['Session']['data'];
pr(unserialize($d));
}

i get this error:

Notice: unserialize(): Error at offset 0 of 117 bytes in /var/www/cake/
app/controllers/users_controller.php on line 88

with 117 being the last position "}" of the serialized string

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

thanks for your help!

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: where to find any doc about 1.2.0.4798alpha version

2007-04-07 Thread Dr. Tarique Sani

On 4/7/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> I recently moved to the 1.2.0 version ,a lot of things change .
>
There isn't any but if you run the code through phpDoc you will get
decent api documentation.

However moves from 1.1 to 1.2 are much less painful than moves between
some of the earlier versions of 1.1 itself :P

What is the exact problem you are facing?

Cheers
Tarique

-- 
=
PHP for E-Biz: http://sanisoft.com
Cheesecake-Photoblog needs you!: http://cheesecake-photoblog.org
=

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



RE: where to find any doc about 1.2.0.4798alpha version

2007-04-07 Thread Mariano Iglesias

If you recently downloaded, guess you *DID* read the announcement:

http://bakery.cakephp.org/articles/view/322

"We are still working on the new documentation, but there is some good
information already on the Bakery and in some of the blogs about the new
features."

-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 [EMAIL PROTECTED]
Enviado el: Sábado, 07 de Abril de 2007 06:08 a.m.
Para: Cake PHP
Asunto: where to find any doc about 1.2.0.4798alpha version

I recently moved to the 1.2.0 version ,a lot of things change .

where to find manual or doc?


--~--~-~--~~~---~--~~
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: the controller::flash() function doesn't work

2007-04-07 Thread Larry E. Masters aka PhpNut
Try setting DEBUG = 0 in core.php

Read the doc comment above the define also...



-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

--~--~-~--~~~---~--~~
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: the controller::flash() function doesn't work

2007-04-07 Thread jyrgen

flash itself won't redirect.

$this->Session->setFlash('Invalid id for Article.');
$this->redirect('/articles/search');

works for me.

paste some code.

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



where to find any doc about 1.2.0.4798alpha version

2007-04-07 Thread [EMAIL PROTECTED]

I recently moved to the 1.2.0 version ,a lot of things change .

where to find manual or doc?


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



the controller::flash() function doesn't work

2007-04-07 Thread [EMAIL PROTECTED]

it just doesn't work. it shows the msg but doesn't do the redirect job.


--~--~-~--~~~---~--~~
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 to deal with $this->User->findById('3')['User']['name']

2007-04-07 Thread [EMAIL PROTECTED]

when code in cake,I always encounter the situation $this->User-
>findById('3')['User']['name'] ,something like that.

but it doesn't work.I know.I used to coding like this :$foo = $this-
>User->findById('3'); $foo['User']['name'],but I am really tired of
that .

so what really need to be done in php?


--~--~-~--~~~---~--~~
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: Installing CakePHP on Windows

2007-04-07 Thread Devraj Mukherjee

Ensure that you are allowing Override of variables using .htaccess
files and that mod_rewrite is turned on

On 4/7/07, etng <[EMAIL PROTECTED]> wrote:
> find
> > DirectoryIndex index.html index.html.var
>
> change it to :
> > DirectoryIndex index.php index.html index.htm
>
>
> Then everything will go ok
>
>
>
>
> On 4/2/07, behrangsa < [EMAIL PROTECTED]> wrote:
> >
> >
> > Hi,
> >
> > I figured out what was causing the error: A misplaced .htaccess file. Now
> > everything works fine.
> >
> > Regards,
> > Behi
> >
> >
> > Ronald Chaplin wrote:
> > >
> > > Hello,
> > >
> > > I use a downloadable solution called WAMP. It is a self extracting
> package
> > > that installs Apache PHP5 Mysql4 and some nice tools. As far as I can
> tell
> > > from your listing, you should connect to port 80, not 8080. Do you have
> > > another service running besides Apache like IIS that would be taking
> > > control
> > > of port 80? I would highly suggest using WAMP
> > > http://www.wampserver.com/en/
> > >
> > > I also put each cake project I'm working on in a separate folder as this
> > > is
> > > the simplest.
> > >
> > > On 4/1/07, Behi < [EMAIL PROTECTED]> wrote:
> > >>
> > >>
> > >> Hi all,
> > >>
> > >> I've installed Apache 2.0.59 and PHP 5.2.1 successfully on Windows.
> > >> I've extracted Cake 1.1.13 to the htdocs directory. But whenever I
> > >> point my browser to http://localhost:8080/cake/ instead of seeing
> > >> Cake's default homepage, I see the directory listing. Any ideas what's
> > >> probably wrong with my configuration? The contents of my httpd.conf
> > >> file is attached to the end of this post.
> > >>
> > >> Thanks in advance,
> > >> Behi
> > >>
> > >> (Note: I am an absolute Apache/PHP newbie!)
> > >>
> > >> #
> > >> # Based upon the NCSA server configuration files originally by Rob
> > >> McCool.
> > >> #
> > >> # This is the main Apache server configuration file.  It contains the
> > >> # configuration directives that give the server its instructions.
> > >> # See http://httpd.apache.org/docs/2.0/> for
> detailed information
> > >> about
> > >> # the directives.
> > >> #
> > >> # Do NOT simply read the instructions in here without understanding
> > >> # what they do.  They're here only as hints or reminders.  If you are
> > >> unsure
> > >> # consult the online docs. You have been warned.
> > >> #
> > >> # The configuration directives are grouped into three basic sections:
> > >> #  1. Directives that control the operation of the Apache server
> > >> process as a
> > >> # whole (the 'global environment').
> > >> #  2. Directives that define the parameters of the 'main' or 'default'
> > >> server,
> > >> # which responds to requests that aren't handled by a virtual
> > >> host.
> > >> # These directives also provide default values for the settings
> > >> # of all virtual hosts.
> > >> #  3. Settings for virtual hosts, which allow Web requests to be sent
> > >> to
> > >> # different IP addresses or hostnames and have them handled by the
> > >> # same Apache server process.
> > >> #
> > >> # Configuration and logfile names: If the filenames you specify for
> > >> many
> > >> # of the server's control files begin with "/" (or "drive:/" for
> > >> Win32), the
> > >> # server will use that explicit path.  If the filenames do *not* begin
> > >> # with "/", the value of ServerRoot is prepended -- so "logs/foo.log"
> > >> # with ServerRoot set to "C:/Apache/Apache2" will be interpreted by
> > >> the
> > >> # server as "C:/Apache/Apache2/logs/foo.log".
> > >> #
> > >> # NOTE: Where filenames are specified, you must use forward slashes
> > >> # instead of backslashes (e.g., "c:/apache" instead of "c:\apache").
> > >> # If a drive letter is omitted, the drive on which Apache.exe is
> > >> located
> > >> # will be used by default.  It is recommended that you always supply
> > >> # an explicit drive letter in absolute paths, however, to avoid
> > >> # confusion.
> > >> #
> > >>
> > >> ### Section 1: Global Environment
> > >> #
> > >> # The directives in this section affect the overall operation of
> > >> Apache,
> > >> # such as the number of concurrent requests it can handle or where it
> > >> # can find its configuration files.
> > >> #
> > >>
> > >> #
> > >> # ServerRoot: The top of the directory tree under which the server's
> > >> # configuration, error, and log files are kept.
> > >> #
> > >> # NOTE!  If you intend to place this on an NFS (or otherwise network)
> > >> # mounted filesystem then please read the LockFile documentation
> > >> (available
> > >> # at http://httpd.apache.org/docs/2.0/mod/
> > >> mpm_common.html#lockfile>);
> > >> # you will save yourself a lot of trouble.
> > >> #
> > >> # Do NOT add a slash at the end of the directory path.
> > >> #
> > >> ServerRoot "C:/Apache/Apache2"
> > >>
> > >> #
> > >> # ScoreBoardFile: File used to store internal server process
> > >> information.
> > >> # If unspecified (the default), the scoreboard will be stored in an
> > >> # a