Session data does not get stored in database on live server

2012-03-08 Thread flosky
Hi everyone,

When I work on my own PC everything works fine. But when I move the
project to a live server it doesnt save any session data in the
database anymore. The table is just empty. I'm on cake 2.0.4.

* I do have a session cookie, so that is working
* I created the db table with the cake console, so no problems should
occur there
* Session Handler is set to database
* Session Component is loaded in AppController.php

Since it is working on my PC I suspect a server configuration problem.
But there should be no configuration neccessary. All cake needs to do
is access the database which is working.

I'm pretty stumped. Anyone out there who can help me out??

Thanks very much!

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


problems with custom datasource

2011-12-28 Thread flosky
Hi everyone,

I am writing a custom datasource with cake 2.x to get data from an api
call.
I did everything according to the twitter example in the book.
But when I run a Model->find('all') I get following error message:

Error: Database table examples for model Example was not found.

I suspect something wrong in the code of the DataSource.
This is my code for the DataSource (as you can see its pretty much
dummy code, just to get it working):

class ExampleSource extends DataSource {
 protected $_schema = array(
'tweets' => array(
'id' => array(
'type' => 'integer',
'null' => true,
'key' => 'primary',
'length' => 11,
),
'text' => array(
'type' => 'string',
'null' => true,
'key' => 'primary',
'length' => 140
),
'status' => array(
'type' => 'string',
'null' => true,
'key' => 'primary',
'length' => 140
),
)
);

/**
 * Constructor
 *
 */
public function __construct($config) {
parent::__construct($config);
}

public function read($model, $queryData = array()) {
return array('nothing' => array('id' => 1, 'text' => 'nothing',
'status' => 'success'));
}

 public function listSources() {
return array('tweets');
}

public function describe($model) {
return $this->_schema['tweets'];
}
}
?>


Any hints?

Thanks, flosky

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Fixture with 'Double' Datatype

2011-12-12 Thread flosky
Hi everyone,

I have a database table row with the datatype 'double'.
When I create the Fixture with cake bake it sets the 'type' to float.
Manually entering 'double' results in an error.

Is there a way to test double values in model test cases??

Using cake 2.0.2 by the way.

Thanks
-flosky

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Update field in associated model???

2011-12-11 Thread flosky

Thanks, Geoff, the single quotes did the trick.

I'm still surprized that this seems to be a very uncommon approach by
me.

Is everyone out there doing a find() query first to get the 'id' value
and then calling save()???

-flosky

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Update field in associated model???

2011-12-10 Thread flosky
@Andras: I tried that and get following error msg: SQLSTATE[42S22]:
Column not found: 1054 Unknown column 'jap' in 'field list'.
(I'm trying to set the 'prefered_lang' to 'jap').

@Geoff: I did that and it works. But I dont want to do an (in my
oppinion) unnecessary read operation.
Since I have a 'hasOne' relationship the 'user_id' should also be
unique.

Is there another way?

-flosky

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Model Test Case SQL Error

2011-12-09 Thread flosky
Thanks, I changed that in my setup.


On 8 Dez., 21:33, José Lorenzo  wrote:
> Well, the 'bit' column is not officially supported, so it interpreted it as
> binary. The best of doing booleans is with tinyint(1)

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Update field in associated model???

2011-12-09 Thread flosky
Hi everyone.

I'm having trouble with what should be an easy task.
First up I'm using Cake 2.0.2.
I have a User and Setting table with User hasOne Setting association.
Now I want to update fields of the Setting table, 'prefered_language'
for example.
This does either not work at all, or creates a new row and doesnt
update.
What I would expect to work is the following:
$data = array('Setting' => array('user_id' => $user_id,
'prefered_language' => $lang));
$this->save($data);
But this creates a new row!!
I can of course (but i dont want to) read the id first and include
that into the $data array.

I have also tried saveAssociated via the User model (which doesnt work
at all).

Since that should be a common task, how have some of you guys
implemented this??

Thanks
-flosky

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Model Test Case SQL Error

2011-12-08 Thread flosky
After some further testing and commenting things out in my code, I
found out that there is something wring in the $fields array (that was
automatically populated by cake from the DB schema).
To be precise: I have a field 'blocked', which has the datatype bit(1)
and the default value: 0.
What Cake wrote in the $fields array for this row is: 'blocked' =>
array('type' => 'text', 'null' => false, 'default' => 'b\'0\'',
'length' => 1, 'collate' => NULL, 'comment' => '')
When I change 'type' to integer it works again!!

Is this a bug?

-flosky

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Model Test Case SQL Error

2011-12-08 Thread flosky
Hi everyone,

I'm using Cake 2.0.2 and just started a new app where I want to do
some Tests on the Models.
So far I have created a User and Setting model, both with the Cake
Console.
For both I added two records to the Fixture and tried to run simple
test for find('all');
For the Setting test case that works fine. For the User test case I
get following error:
SQLSTATE[42S02]: Base table or view not found: 1146 Table xyz does not
exist.

To try to fix this I made the setup as simple as possible:
- I removed all model assosiations
- I only loaded the one Fixture I need the Test Case
- I dindt even use '$this->User' anymore in the end (in the Test Case)

When I set the $records variable in the Fixture to an empty array, the
error went away.

When I googled this I could only find a discussion about an error in
relation to table prefixes, but I'm not using any.

Any hints??

Thanks,
flosky

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Console/cake schema not working a 100%?

2011-11-09 Thread flosky
Hi guys,

I'm on cake 2.0.2 and using the Console to backup my schema. But I
thing its not working a 100%.

1. When I try to use 'Console/cake schema create' I get an error
message saying: 'schema.php could not be loaded'
2. The generated files (by 'generate' and 'dump') do not contain the
table 'cake_sessions'.

Am I doing sth wrong or is this a bug in the console??

-flosky

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: can't connect to db

2011-11-07 Thread flosky
Ok, got it now.
When I deleted the comments header of the database.php file I also
deleted the 'http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: can't connect to db

2011-11-07 Thread flosky
I just tried to set the db config via the cake shell and got this
error message at the end:
Fatal error: Class 'DATABASE_CONFIG' not found in /home/flosky/
Workspace/wtg2/lib/Cake/Console/Command/Task/DbConfigTask.php on line
262

Does anyone know what that means?

-flosky

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: can't connect to db

2011-11-07 Thread flosky
I hope its ok that I poste here instead of opening a new question.

I also can't connect to the (mysql) db.
I can login via mysql command line tool, so the user rights are ok.
I checked phpinfo(); -> mysql_pdo is installed with version 5.5.14 and
enabled.

Am I missing something?

-flosky

On 6 Nov., 03:02, Sandy Wilkins  wrote:
> Is the DocumentRoot of your http.conf pointing to the webroot folder?
>
> On Nov 5, 7:55 pm, bluethundr  wrote:
>
>
>
>
>
>
>
> > ## cake cannot connect to the databse
>
> > Your tmp directory is writable.
>
> > The FileEngine is being used for caching. To change the config edit
> > APP/config/core.php
>
> > Your database configuration file is present.
>
> > Cake is NOT able to connect to the database.
>
> > ## database config file
>
> > class DATABASE_CONFIG {
>
> >         var $default = array(
> >                 'driver' => 'mysql',
> >                 'persistent' => false,
> >                 'host' => 'localhost',
> >                 'login' => 'admin',
> >                 'password' => 'secret',
> >                 'database' => 'cake',
> >                 'prefix' => '',
> >                 'port' => '/var/lib/mysql/mysql.sock',
> >                  //'encoding' => 'utf8',
> >         );
>
> >         var $test = array(
> >                 'driver' => 'mysql',
> >                 'persistent' => false,
> >                 'host' => 'localhost',
> >                 'login' => 'admin',
> >                 'password' => 'secret',
> >                 'database' => 'cakeblog',
> >                 'prefix' => '',
> >                 'port' => '/var/lib/mysql/mysql.sock',
> >                  //'encoding' => 'utf8',
> >         );
>
> > }
>
> > ## user can connect to (and use) database on the command line
>
> > [root@cloud cake]# mysql -uadmin -psecret
> > Welcome to the MySQL monitor.  Commands end with ; or \g.
> > Your MySQL connection id is 2
> > Server version: 5.5.17-log MySQL Community Server (GPL) by Remi
>
> > Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights
> > reserved.
>
> > Oracle is a registered trademark of Oracle Corporation and/or its
> > affiliates. Other names may be trademarks of their respective
> > owners.
>
> > Type 'help;' or '\h' for help. Type '\c' to clear the current input
> > statement.
>
> > mysql> use cake
> > Database changed
>
> > thank you!

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Exceptions, best practice

2011-10-24 Thread flosky
Thanks for the reply.
Does that mean that I don't neccessarily need a custom Exception
handler for my own Exceptions if I catch them myself?

-flosky

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Exceptions, best practice

2011-10-24 Thread flosky
Hi everyone,

I am going to rewrite my app with cake 2.0 and want to make sure I
understand everything before I start. I just read the chapter on
Exceptions and want to clearify some things.

1) Even though I could use try / catch within my app, it is
recommended to use the build in Exception handler or renderer.

2) If I add my own Exceptions, I also need to use a custom Exception
handler as the default handler doesn't know what to do with my custom
Exceptions.

Can you please say if these statements are right or wrong and if
wrong, why.

Thank you
-flosky

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakePHP 2.0 Released

2011-10-17 Thread flosky
Great work guys.

The released was also featured on one of the biggest german tech news
sites.
http://www.heise.de/newsticker/meldung/CakePHP-legt-nach-Version-2-0-offiziell-vorgestellt-1362057.html

-flosky

On 17 Okt., 07:44, Matt Kaufman  wrote:
> Yes, Also --- Does this bring a lot of opportunity to come for rewriting and 
> enhancing the quality of many of the major and or popular plugins out there 
> for < 2.0 Stable?
>
> I love the new file naming (Config/, etc,) and Structure of it entirely!
>
> Matt Kaufmanhttp://mkfmn.com/
>
> Sent from my iPhone
>
> On Oct 16, 2011, at 10:40 PM, DerekGardiner  wrote:
>
>
>
>
>
>
>
> > How long with cake 1.3* be supported? We've just spent a significant
> > amount of time writing an application in 1.3* and would be gutted to
> > find out if we have to port to 2.0 already.
>
> > On Oct 16, 11:40 pm, "O.J. Tibi"  wrote:
> >> Yeah! Rave party everywhere for CakePHP 2.0! Wuzah!
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: 2.0 Upgrade Problem (with $controller->request in RequestHandlerComponent)

2011-10-17 Thread flosky
Could this be because of the lazy loading functionality that was added
to cake 2.0?
That would be my guess.

-flosky

On 17 Okt., 00:35, zuha  wrote:
> (I have searched for answers, I have attempted self-debugging for 4+ hours,
> Including going through the core up and down. )
>
> Its going to be hard to be clear on this problem but here's my best
> effort...
>
> In /lib/CAke/Controller/Component/RequestHandlerComponent.php in the
> initialize function I put these two lines (line 110 & 111 if it helps)...
>
>         debug($controller->name);
>         debug($controller->request->params);
>
> The controller name is printed as expected, but the second line gives me
> this output:
>
> *Notice* (8): Trying to get property of non-object 
> [*CORE\Cake\Controller\Component\RequestHandlerComponent.php*, line *111*]
>
> I believe this means that somehow CakeRequest is not making its way into the
> Controller being passed to the RequestHandler Component.  Since we do see
> the Controller name though (btw, we see helpers var and others too), the
> controller is there.  In the end what it does is cause a fatal error when
> the Request Handler later calls to a $this->request->parseAccept()
> function.  
>
> What would cause a controller to not load CakeRequest?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Replace user_id to username

2011-10-17 Thread flosky
Hi Mitchell,

I guess that 'user_id' is the foreign key to the users table?
If so, you should add a 'hasOne' relationship in the comments model
(comments have one user).
When that is working, cake automatically gets the corresponding user
data when you use find().
Now you can pass the results to the view and get the username with
$post['User']['username'].

-flosky

On 17 Okt., 11:03, euromark  wrote:
> did you add
> $this->displayField = 'username';
> to the user model?
>
> On 17 Okt., 02:58, Mitchell Vargo  wrote:
>
>
>
>
>
>
>
> > Is there an easy way of replacing the user_id to username in a view
> > that looks like this?
>
> > 
> >         
> >         
> >         
> >         
> >                 
> >                 
> >                 
> >                 
> >                 
> >         
> >          >                 $i = 0;
> >                 foreach ($post['Comment'] as $comment): ?>
> >                 
> >                         
> >                         
> >                         
> >                          
> > <--- I want to
> > change this into the users username
> >                         
> >                                 Html->link(__('View'), 
> > array('controller' =>
> > 'comments', 'action' => 'view', $comment['id'])); ?>
> >                                 Html->link(__('Edit'), 
> > array('controller' =>
> > 'comments', 'action' => 'edit', $comment['id'])); ?>
> >                                  > $this->Form->postLink(__('Delete'), array('controller'
> > => 'comments', 'action' => 'delete', $comment['id']), null, __('Are
> > you sure you want to delete # %s?', $comment['id'])); ?>
> >                         
> >                 
> >         
> >         
> > 
> > 

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Custom Plugin not loading anymore

2011-09-06 Thread Flosky
Hey everyone,

I had a fully working setup on my pc where i was developing my cake
app. With that I was using a custom plugin that I downloaded. I put it
in /plugins and I could use the helper and component that came with
the plugin.

Now I want to transfer this setup to a cloud hoster
(cloudcontrolled.com). To try this step by step, I got  a fresh cake
version from the website and loaded it up. For this the cake folder is
in ther root directory and there is no app folder (the controller,
view, model,plugins,.. files are in the root directory as well).
When I add the plugin helper to the app_controller.php I get an error
message indicating that the Javascript helper isnt working anymore. I
read that this indicates that some helper isnt loading properly. When
i remove the plugin helper everything works again.

Are there other settings that could screw this up (like routes,
rewrite rules, default directory settings, ...)??
I also used the latest version of cake, but there shouldn't be any
issues with that, should there??

I would greatly appretiate some help.

Cheers, Flosky

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php