Re: can't connect to db

2011-11-05 Thread Tim Dunphy
whoops! silly me! I forgot to install the php-mysql extension! I did
that and now it's working. So thanks for your help!

tim

On Sun, Nov 6, 2011 at 12:04 AM, Andras Kende  wrote:
> I think you need mysql.so extension for the cake 1.3
> and pdo_mysql.so for cake 2.0
> Just paste the errors into google, the answer should be there somewhere...
> http://www.somacon.com/p109.php
>
> Andras Kende
> http://www.kende.com
> On Nov 5, 2011, at 10:52 PM, Tim Dunphy wrote:
>
> ok, update. so I decided to ls the php modules directory
>
> [root@cloud cake]# ls -l /usr/lib64/php/modules/
> total 2392
> -rwxr-xr-x 1 root root   63008 Sep 30 14:14 curl.so
> -rwxr-xr-x 1 root root 1838496 Sep 30 14:14 fileinfo.so
> -rwxr-xr-x 1 root root   32984 Sep 30 14:14 json.so
> -rwxr-xr-x 1 root root   98312 Sep 30 14:14 pdo.so
> -rwxr-xr-x 1 root root   24264 Sep 30 14:14 pdo_sqlite.so
> -rwxr-xr-x 1 root root  257440 Sep 30 14:14 phar.so
> -rwxr-xr-x 1 root root   15416 Mar 30  2011 phpcups.so
> -rwxr-xr-x 1 root root   82112 Sep 30 14:14 zip.so
>
> and saw that pdo.so was there.
>
> so I got rid of pdo_mysql.so from the  extension=php.ini file and left
> extension=pdo.so in there. then I restarted apache. and now this is
> what happens when I run the mysql connect script you've provided:
>
> [root@cloud cake]# php mysql.php
> PHP Warning:  Module 'PDO' already loaded in Unknown on line 0
> PHP Fatal error:  Call to undefined function mysql_connect() in
> /var/www/cakephp-cakephp-73205dc/mysql.php on line 2
>
> any thoughts? thanks!
>
>
>
> On Sat, Nov 5, 2011 at 11:48 PM, Tim Dunphy  wrote:
>
> Thanks for that! It seems that php can't find it's pdo librarries
>
>
> [root@cloud cake]# php mysql.php
>
> PHP Warning:  PHP Startup: Unable to load dynamic library
>
> '/usr/lib64/php/modules/pdo_mysql.so' -
>
> /usr/lib64/php/modules/pdo_mysql.so: cannot open shared object file:
>
> No such file or directory in Unknown on line 0
>
> PHP Warning:  Module 'PDO' already loaded in Unknown on line 0
>
> PHP Fatal error:  Call to undefined function mysql_connect() in
>
> /var/www/cakephp-cakephp-73205dc/mysql.php on line 2
>
> I can't ls the module file
>
> [root@cloud cake]# ls -l /usr/lib64/php/modules/pdo_mysql.so
>
> ls: /usr/lib64/php/modules/pdo_mysql.so: No such file or directory
>
>
> But the rpm database tells me that php-pdo is already installed.
>
> [root@cloud cake]# rpmquery  php-pdo
>
> php-pdo-5.3.8-5.el5.remi.1
>
> so what gives? :)
>
>
>
>
> On Sat, Nov 5, 2011 at 11:38 PM, Andras Kende  wrote:
>
> Maybe php5-mysql support not enabled ? You could try a plain php file to
> test without cakephp
>
> 
> mysql_connect("localhost", "admin", "secret") or die(mysql_error());
>
> echo "Connected to MySQL";
>
> mysql_select_db("cake") or die(mysql_error());
>
> echo "Connected to Database";
>
> ?>
>
> 'Andras Kende
>
> http://www.kende.com
>
> On Nov 5, 2011, at 10:25 PM, Tim Dunphy wrote:
>
> Hello and thanks for your reply..
>
> I tried removing the port setting as you've suggested and moved from
>
> cake 1.3 to cake 2.0 but the result was the same!
>
> class DATABASE_CONFIG {
>
>        public $default = array(
>
>                'datasource' => 'Database/Mysql',
>
>                'persistent' => false,
>
>                'host' => 'localhost',
>
>                'login' => 'admin',
>
>                'password' => 'secret',
>
>                'database' => 'cake',
>
>                'prefix' => '',
>
>                //'encoding' => 'utf8',
>
>        );
>
>        public $test = array(
>
>                'datasource' => 'Database/Mysql',
>
>                'persistent' => false,
>
>                'host' => 'admin',
>
>                'login' => 'root',
>
>                'password' => 'secret',
>
>                'database' => 'cakeblog',
>
>                'prefix' => '',
>
>                //'encoding' => 'utf8',
>
>        );
>
> }
>
> On Sat, Nov 5, 2011 at 10:03 PM, Ma'moon  wrote:
>
> Most likely you need to leave the port section empty in your db
>
> configuration
>
> On Sat, Nov 5, 2011 at 9: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',
>
> 

Re: can't connect to db

2011-11-05 Thread Andras Kende
I think you need mysql.so extension for the cake 1.3
and pdo_mysql.so for cake 2.0

Just paste the errors into google, the answer should be there somewhere...
http://www.somacon.com/p109.php


Andras Kende
http://www.kende.com

On Nov 5, 2011, at 10:52 PM, Tim Dunphy wrote:

> ok, update. so I decided to ls the php modules directory
> 
> [root@cloud cake]# ls -l /usr/lib64/php/modules/
> total 2392
> -rwxr-xr-x 1 root root   63008 Sep 30 14:14 curl.so
> -rwxr-xr-x 1 root root 1838496 Sep 30 14:14 fileinfo.so
> -rwxr-xr-x 1 root root   32984 Sep 30 14:14 json.so
> -rwxr-xr-x 1 root root   98312 Sep 30 14:14 pdo.so
> -rwxr-xr-x 1 root root   24264 Sep 30 14:14 pdo_sqlite.so
> -rwxr-xr-x 1 root root  257440 Sep 30 14:14 phar.so
> -rwxr-xr-x 1 root root   15416 Mar 30  2011 phpcups.so
> -rwxr-xr-x 1 root root   82112 Sep 30 14:14 zip.so
> 
> and saw that pdo.so was there.
> 
> so I got rid of pdo_mysql.so from the  extension=php.ini file and left
> extension=pdo.so in there. then I restarted apache. and now this is
> what happens when I run the mysql connect script you've provided:
> 
> [root@cloud cake]# php mysql.php
> PHP Warning:  Module 'PDO' already loaded in Unknown on line 0
> PHP Fatal error:  Call to undefined function mysql_connect() in
> /var/www/cakephp-cakephp-73205dc/mysql.php on line 2
> 
> any thoughts? thanks!
> 
> 
> 
> On Sat, Nov 5, 2011 at 11:48 PM, Tim Dunphy  wrote:
>> Thanks for that! It seems that php can't find it's pdo librarries
>> 
>> 
>> [root@cloud cake]# php mysql.php
>> PHP Warning:  PHP Startup: Unable to load dynamic library
>> '/usr/lib64/php/modules/pdo_mysql.so' -
>> /usr/lib64/php/modules/pdo_mysql.so: cannot open shared object file:
>> No such file or directory in Unknown on line 0
>> PHP Warning:  Module 'PDO' already loaded in Unknown on line 0
>> PHP Fatal error:  Call to undefined function mysql_connect() in
>> /var/www/cakephp-cakephp-73205dc/mysql.php on line 2
>> 
>> I can't ls the module file
>> 
>> [root@cloud cake]# ls -l /usr/lib64/php/modules/pdo_mysql.so
>> ls: /usr/lib64/php/modules/pdo_mysql.so: No such file or directory
>> 
>> 
>> But the rpm database tells me that php-pdo is already installed.
>> 
>> [root@cloud cake]# rpmquery  php-pdo
>> php-pdo-5.3.8-5.el5.remi.1
>> 
>> so what gives? :)
>> 
>> 
>> 
>> 
>> On Sat, Nov 5, 2011 at 11:38 PM, Andras Kende  wrote:
>>> Maybe php5-mysql support not enabled ? You could try a plain php file to 
>>> test without cakephp
>>> 
>>> >> mysql_connect("localhost", "admin", "secret") or die(mysql_error());
>>> echo "Connected to MySQL";
>>> mysql_select_db("cake") or die(mysql_error());
>>> echo "Connected to Database";
>>> ?>
>>> 
>>> 'Andras Kende
>>> http://www.kende.com
>>> 
>>> On Nov 5, 2011, at 10:25 PM, Tim Dunphy wrote:
>>> 
 Hello and thanks for your reply..
 
 I tried removing the port setting as you've suggested and moved from
 cake 1.3 to cake 2.0 but the result was the same!
 
 class DATABASE_CONFIG {
 
public $default = array(
'datasource' => 'Database/Mysql',
'persistent' => false,
'host' => 'localhost',
'login' => 'admin',
'password' => 'secret',
'database' => 'cake',
'prefix' => '',
//'encoding' => 'utf8',
);
 
public $test = array(
'datasource' => 'Database/Mysql',
'persistent' => false,
'host' => 'admin',
'login' => 'root',
'password' => 'secret',
'database' => 'cakeblog',
'prefix' => '',
//'encoding' => 'utf8',
);
 }
 
 On Sat, Nov 5, 2011 at 10:03 PM, Ma'moon  wrote:
> Most likely you need to leave the port section empty in your db
> configuration
> 
> On Sat, Nov 5, 2011 at 9: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',
>>  

Re: can't connect to db

2011-11-05 Thread Tim Dunphy
ok, update. so I decided to ls the php modules directory

[root@cloud cake]# ls -l /usr/lib64/php/modules/
total 2392
-rwxr-xr-x 1 root root   63008 Sep 30 14:14 curl.so
-rwxr-xr-x 1 root root 1838496 Sep 30 14:14 fileinfo.so
-rwxr-xr-x 1 root root   32984 Sep 30 14:14 json.so
-rwxr-xr-x 1 root root   98312 Sep 30 14:14 pdo.so
-rwxr-xr-x 1 root root   24264 Sep 30 14:14 pdo_sqlite.so
-rwxr-xr-x 1 root root  257440 Sep 30 14:14 phar.so
-rwxr-xr-x 1 root root   15416 Mar 30  2011 phpcups.so
-rwxr-xr-x 1 root root   82112 Sep 30 14:14 zip.so

and saw that pdo.so was there.

so I got rid of pdo_mysql.so from the  extension=php.ini file and left
extension=pdo.so in there. then I restarted apache. and now this is
what happens when I run the mysql connect script you've provided:

[root@cloud cake]# php mysql.php
PHP Warning:  Module 'PDO' already loaded in Unknown on line 0
PHP Fatal error:  Call to undefined function mysql_connect() in
/var/www/cakephp-cakephp-73205dc/mysql.php on line 2

any thoughts? thanks!



On Sat, Nov 5, 2011 at 11:48 PM, Tim Dunphy  wrote:
> Thanks for that! It seems that php can't find it's pdo librarries
>
>
> [root@cloud cake]# php mysql.php
> PHP Warning:  PHP Startup: Unable to load dynamic library
> '/usr/lib64/php/modules/pdo_mysql.so' -
> /usr/lib64/php/modules/pdo_mysql.so: cannot open shared object file:
> No such file or directory in Unknown on line 0
> PHP Warning:  Module 'PDO' already loaded in Unknown on line 0
> PHP Fatal error:  Call to undefined function mysql_connect() in
> /var/www/cakephp-cakephp-73205dc/mysql.php on line 2
>
> I can't ls the module file
>
> [root@cloud cake]# ls -l /usr/lib64/php/modules/pdo_mysql.so
> ls: /usr/lib64/php/modules/pdo_mysql.so: No such file or directory
>
>
> But the rpm database tells me that php-pdo is already installed.
>
> [root@cloud cake]# rpmquery  php-pdo
> php-pdo-5.3.8-5.el5.remi.1
>
> so what gives? :)
>
>
>
>
> On Sat, Nov 5, 2011 at 11:38 PM, Andras Kende  wrote:
>> Maybe php5-mysql support not enabled ? You could try a plain php file to 
>> test without cakephp
>>
>> > mysql_connect("localhost", "admin", "secret") or die(mysql_error());
>> echo "Connected to MySQL";
>> mysql_select_db("cake") or die(mysql_error());
>> echo "Connected to Database";
>> ?>
>>
>> 'Andras Kende
>> http://www.kende.com
>>
>> On Nov 5, 2011, at 10:25 PM, Tim Dunphy wrote:
>>
>>> Hello and thanks for your reply..
>>>
>>> I tried removing the port setting as you've suggested and moved from
>>> cake 1.3 to cake 2.0 but the result was the same!
>>>
>>> class DATABASE_CONFIG {
>>>
>>>        public $default = array(
>>>                'datasource' => 'Database/Mysql',
>>>                'persistent' => false,
>>>                'host' => 'localhost',
>>>                'login' => 'admin',
>>>                'password' => 'secret',
>>>                'database' => 'cake',
>>>                'prefix' => '',
>>>                //'encoding' => 'utf8',
>>>        );
>>>
>>>        public $test = array(
>>>                'datasource' => 'Database/Mysql',
>>>                'persistent' => false,
>>>                'host' => 'admin',
>>>                'login' => 'root',
>>>                'password' => 'secret',
>>>                'database' => 'cakeblog',
>>>                'prefix' => '',
>>>                //'encoding' => 'utf8',
>>>        );
>>> }
>>>
>>> On Sat, Nov 5, 2011 at 10:03 PM, Ma'moon  wrote:
 Most likely you need to leave the port section empty in your db
 configuration

 On Sat, Nov 5, 2011 at 9: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
>
>
> [roo

Re: can't connect to db

2011-11-05 Thread Tim Dunphy
Thanks for that! It seems that php can't find it's pdo librarries


[root@cloud cake]# php mysql.php
PHP Warning:  PHP Startup: Unable to load dynamic library
'/usr/lib64/php/modules/pdo_mysql.so' -
/usr/lib64/php/modules/pdo_mysql.so: cannot open shared object file:
No such file or directory in Unknown on line 0
PHP Warning:  Module 'PDO' already loaded in Unknown on line 0
PHP Fatal error:  Call to undefined function mysql_connect() in
/var/www/cakephp-cakephp-73205dc/mysql.php on line 2

I can't ls the module file

[root@cloud cake]# ls -l /usr/lib64/php/modules/pdo_mysql.so
ls: /usr/lib64/php/modules/pdo_mysql.so: No such file or directory


But the rpm database tells me that php-pdo is already installed.

[root@cloud cake]# rpmquery  php-pdo
php-pdo-5.3.8-5.el5.remi.1

so what gives? :)




On Sat, Nov 5, 2011 at 11:38 PM, Andras Kende  wrote:
> Maybe php5-mysql support not enabled ? You could try a plain php file to test 
> without cakephp
>
>  mysql_connect("localhost", "admin", "secret") or die(mysql_error());
> echo "Connected to MySQL";
> mysql_select_db("cake") or die(mysql_error());
> echo "Connected to Database";
> ?>
>
> 'Andras Kende
> http://www.kende.com
>
> On Nov 5, 2011, at 10:25 PM, Tim Dunphy wrote:
>
>> Hello and thanks for your reply..
>>
>> I tried removing the port setting as you've suggested and moved from
>> cake 1.3 to cake 2.0 but the result was the same!
>>
>> class DATABASE_CONFIG {
>>
>>        public $default = array(
>>                'datasource' => 'Database/Mysql',
>>                'persistent' => false,
>>                'host' => 'localhost',
>>                'login' => 'admin',
>>                'password' => 'secret',
>>                'database' => 'cake',
>>                'prefix' => '',
>>                //'encoding' => 'utf8',
>>        );
>>
>>        public $test = array(
>>                'datasource' => 'Database/Mysql',
>>                'persistent' => false,
>>                'host' => 'admin',
>>                'login' => 'root',
>>                'password' => 'secret',
>>                'database' => 'cakeblog',
>>                'prefix' => '',
>>                //'encoding' => 'utf8',
>>        );
>> }
>>
>> On Sat, Nov 5, 2011 at 10:03 PM, Ma'moon  wrote:
>>> Most likely you need to leave the port section empty in your db
>>> configuration
>>>
>>> On Sat, Nov 5, 2011 at 9: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
>>>
>>> --
>>> 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
>>> oth

Re: can't connect to db

2011-11-05 Thread Andras Kende
Maybe php5-mysql support not enabled ? You could try a plain php file to test 
without cakephp

";
mysql_select_db("cake") or die(mysql_error());
echo "Connected to Database";
?>

'Andras Kende
http://www.kende.com

On Nov 5, 2011, at 10:25 PM, Tim Dunphy wrote:

> Hello and thanks for your reply..
> 
> I tried removing the port setting as you've suggested and moved from
> cake 1.3 to cake 2.0 but the result was the same!
> 
> class DATABASE_CONFIG {
> 
>public $default = array(
>'datasource' => 'Database/Mysql',
>'persistent' => false,
>'host' => 'localhost',
>'login' => 'admin',
>'password' => 'secret',
>'database' => 'cake',
>'prefix' => '',
>//'encoding' => 'utf8',
>);
> 
>public $test = array(
>'datasource' => 'Database/Mysql',
>'persistent' => false,
>'host' => 'admin',
>'login' => 'root',
>'password' => 'secret',
>'database' => 'cakeblog',
>'prefix' => '',
>//'encoding' => 'utf8',
>);
> }
> 
> On Sat, Nov 5, 2011 at 10:03 PM, Ma'moon  wrote:
>> Most likely you need to leave the port section empty in your db
>> configuration
>> 
>> On Sat, Nov 5, 2011 at 9: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
>> 
>> --
>> 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
>> 
> 
> 
> 
> -- 
> GPG me!!
> 
> gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B
> 
> -- 
> 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

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

Re: how can i protect my code from the duplicaters

2011-11-05 Thread John
On Nov 6, 1:18 am, WebbedIT  wrote:
> But as I said in my earlier post, could you not place in the remotely
> hosted application a call to your servers to check for a valid
> license?  I know a lot of games are now going this way where you have
> to be online to be able to play them as the game polls there servers
> to check your have a valid license.

Well if you give access to source anyone can bypass the check quite
easily. In fact no license checking has stopped unwanted use of
software (games included).

The only way to not worry is if you have a self controlled API based
service that your client code will be depending upon. Then you can
check for the license validity in your trusted server and if it's
expired or illegal you just block access so the client side is
useless.

I have used a couple of zen encrypted applications, it's not always
that easy to set up in the server environment for all the PHP/zen
versions available. The question is whether your application is
"costing" more than the cost of encrypting/setting up.

-- 
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-05 Thread Tim Dunphy
Hello and thanks for your reply..

I tried removing the port setting as you've suggested and moved from
cake 1.3 to cake 2.0 but the result was the same!

class DATABASE_CONFIG {

public $default = array(
'datasource' => 'Database/Mysql',
'persistent' => false,
'host' => 'localhost',
'login' => 'admin',
'password' => 'secret',
'database' => 'cake',
'prefix' => '',
//'encoding' => 'utf8',
);

public $test = array(
'datasource' => 'Database/Mysql',
'persistent' => false,
'host' => 'admin',
'login' => 'root',
'password' => 'secret',
'database' => 'cakeblog',
'prefix' => '',
//'encoding' => 'utf8',
);
}

On Sat, Nov 5, 2011 at 10:03 PM, Ma'moon  wrote:
> Most likely you need to leave the port section empty in your db
> configuration
>
> On Sat, Nov 5, 2011 at 9: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
>
> --
> 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
>



-- 
GPG me!!

gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B

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


Baking projects done right from console?

2011-11-05 Thread John
Let's take an empty folder, hereafter as...  (!) and extract a
fresh cake 2.0 download.

That leaves you with files in \app, \lib etc.

Run "cake bake project" inside . Cake understands your app
name as  and path as .

Then strangely it offers \myapp as the path to the
project while it should be just \app according to the doc suggestions:


First, realize that there are three main parts to a Cake application:

The core CakePHP libraries, in /lib/Cake.
Your application code, in /app.
The application’s webroot, usually in /app/webroot.


You decide to follow the docs and change it to \app
and accept the copy of the skeleton, but not much is copied. You get
only the homepage and core.php and a message saying

Unable to set console path for app/Console.
CakePHP is not on your `include_path`, CAKE_CORE_INCLUDE_PATH will be
hard coded
.
You can fix this by adding CakePHP to your `include_path`.
Unable to set CAKE_CORE_INCLUDE_PATH, you should change it in
\app\webroot\index.php
Project baked but with some issues..

All other folders have an "empty." file inside just like after the
extract.

Instead if you keep the /myapp suggestion, the skeleton is copied
perfectly even though the message for "include_path" is displayed
again.

-- 
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: Handling images

2011-11-05 Thread Joseph Núñez
Uploadify is great, I'm using it for a project that handle images in a
site. It's cool, if you need help with Uploadify and AJAX just send me an
email, I can share my experience using Uploadify & CakePHP.

-- 
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: Handling images

2011-11-05 Thread Nate
Thanks Joseph,

It's a work in progress - so yes, I can change over to InnoDB.

Saving the post first isn't really the method I'm looking for. I'm
interested in something like Uploadify, which I just discovered and am
trying to get it going.

I like it because it starts uploading and processing the image as soon
as you select it.

-- 
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: cake-sql-log in my layout

2011-11-05 Thread Sam Sherlock
element('sql_dump'); ?>

but using the DebugKit plugin gives you more
 - S




On 5 November 2011 16:50, Stefano  wrote:

> how i can show in my layout the executed queries?
>
> for example :
>
> /view/layout/my_layout.ctp
>
> 
>   
>
>   
>
>
> >
>
>   
> 
>
> --
> 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
>

-- 
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-05 Thread Ma'moon
Most likely you need to leave the port section empty in your db
configuration

On Sat, Nov 5, 2011 at 9: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
>

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


can't connect to db

2011-11-05 Thread bluethundr
## 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


mod_rewrite in cake

2011-11-05 Thread bluethundr
hello cake! I am attempting to use mod_rewrite and running into some
problems.. if I set AllowOverride to ALL the site goes away.. if I set
it to none it comes back


## cake site disappears if AllowOverride ALL is set

[Sat Nov 05 20:17:04 2011] [error] [client xx.xx.xx.xx] File does not
exist: /var/www/html/var

## if webroot is set to this in httpd.conf


Options FollowSymLinks
AllowOverride ALL


## it fails with the above error

## if webroot is set to this in httpd.conf


Options FollowSymLinks
AllowOverride None


## the site comes back.. why would this be?

-- 
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: Handling images

2011-11-05 Thread Joseph Núñez
You should submit de post first, save the post information in the session
and then submit the images. Are you using InnoDB?

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


cake-sql-log in my layout

2011-11-05 Thread Stefano
how i can show in my layout the executed queries?

for example :

/view/layout/my_layout.ctp


   

   




   


-- 
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: how can i protect my code from the duplicaters

2011-11-05 Thread WebbedIT
I think the only options are the previously suggested IonCube and
ZendGuard, but whilst they've been around a while, I've only ever
encountered IonCube once when downloading a developer version of
LemonStand.

I suppose what I was trying to say is that whilst in theory this
sounds a great idea, the fact that very few of us come into contact
with encrypted code possibly goes to show that very few companies go
to the bother (or that we don't deem our code to be that precious).
To be honest, from my experience of setting up a developers copy of
LemonStand for a customer, I think that using IonCube will actually
lose them a significant number of potential clients who won't get past
the barrier of having to have the neccessary server setup to decrypt
the files.

But as I said in my earlier post, could you not place in the remotely
hosted application a call to your servers to check for a valid
license?  I know a lot of games are now going this way where you have
to be online to be able to play them as the game polls there servers
to check your have a valid license.

Paul.

On Nov 5, 11:17 am, Jeremy Burns | Class Outfit
 wrote:
> Exactly! Just to be clear, we're not dealing with mission critical stuff 
> or bank accounts. The issue is that if you sell a web based application to a 
> company that then runs it on their own infrastructure, it'd be cool to be 
> able to protect your interests somehow and ensure you can manage a recurring 
> annual income from it. I guess one answer is "don't build it in PHP", but 
> that's a cop-out!
>
> Jeremy Burns
> Class Outfit
>
> http://www.classoutfit.com
>
> On 5 Nov 2011, at 11:03, WebbedIT wrote:
>
>
>
>
>
>
>
> > Would never of thought of software at that sort of high end level
> > being developed using uncompiled/unencrypted code of any flavour.
> > Could just see me walking into a bank, having a look at there source
> > code and tweaking a few PHP functions :)
>
> > On Nov 4, 6:47 pm, Jeremy Burns | Class Outfit
> >  wrote:
> >> I'm thinking of apps running on internal banking servers (real case 
> >> scenario) where hosting it remotely is a no-no for security reasons. 
> >> Encrypting that would be pretty fantastic.
>
> >> Jeremy Burns
> >> Class Outfit
>
> >>http://www.classoutfit.com
>
> >> On 4 Nov 2011, at 18:42, WebbedIT wrote:
>
> >>> @Jeremy: I would be wary of allowing any software licensed annually to
> >>> be hosted on another server. Apps licensed in this way tend to be more
> >>> like an SAAS app and as such would be centrally stored to allow for
> >>> maintenance, upgrades etc.
>
> >>> If it is a plugin that we're talking about then the license tends to
> >>> get you a period of support and access to upgrades, so to let your
> >>> license expires means you can continue to use the plugin without
> >>> upgrades/fixes.
>
> >>> Have you ever, or no of anyone else, who has bought code where you had
> >>> to decrypt it (try finding a shared hosting service that has ioncube/
> >>> zend guard installed)?  Maybe you could have a call from the remote
> >>> server to a database on your server which checked if a license is
> >>> valid?
>
> >>> HTH, Paul
>
> >>> On Nov 4, 9:38 am, AD7six  wrote:
>  On Nov 4, 10:13 am, WebbedIT  wrote:
>
> > @Ryan: If you could not raise a smile at Andy's response in this
> > thread then you really could do with a weekend off.  Your response is
> > nicer than Andy's but they both mean the same thing ... "Why on earth
> > do you need to protect your code?!?"
>
>  Actually my "point" (there was no point in my answer) was more this:
>
> http://lmgtfy.com/?q=protect+php+files
>
>  if you can type your question in google and the answer pops up - it's
>  not a question that belongs on any support forum. Less so here, for a
>  question that has nothing specific to do with CakePHP.
>
>  AD
>
> >>> --
> >>> Our newest site for the community: CakePHP Video 
> >>> Tutorialshttp://tv.cakephp.org
> >>> Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp 
> >>> 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 
> > 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

Re: How can I make this file upload javascript work in cakephp?

2011-11-05 Thread WebbedIT
Barricades, welcome to the community!

If you are so new to CakePHP and JavaScript then I would suggest
sticking to plugins and helpers that other people within the community
use, this way you are much more likely to get support.  I certainly
would not go and learn how to use the script above so I could then
educate you on how to use it, but a quick Google search shows there
are various existing image upload tools available for CakePHP along
with tutorials on how to set them up:

http://lmgtfy.com/?q=cakephp%3Dimage%2Bupload

HTH, Paul.

On Nov 5, 2:45 pm, barricades  wrote:
> I'm learning (trying to anyway) how to use cakephp, and I have a
> little javascript which I'd like to use, but I'm having problems
> figuring out how to make it work with cakephp.
>
> The javascript uploads a photo and displays it in a div elsewhere on
> the page without reloading and makes it look like ajax. It uses a
> hidden iframe.
>
> I think the problems I've having are to do with relative paths and
> basically where to put everything. I've to admit I'm not much of a
> programmer yet so it's probably something really simple I'm not doing
> but the script doesn't have tutorial and like I said I'm new to cake.
>
> If anyone fancied helping me out by giving me a run through of what to
> do I'd be really grateful. Talk to me like I know nothing, I know very
> little :) Here's the script's 
> website:http://atwebresults.com/php_ajax_image_upload/
>
> By the way, I know this might not be the best script on the 'net but
> it does seem to do exactly what I want to do (vis-a-vis the preview)
> and I'd like to get it working :)

-- 
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: How to get related username in view?

2011-11-05 Thread WebbedIT
@Daniel: Glad u got it working

@Andras: In the above example you do use contain so we are all on the
same page, but you should not run the find on Post if looking for ONE
Category and it's MANY Posts (if any exist).  Your method will return
the category record for every post found and to echo the category name
in the view you would need to echo $categories[0]['Category']['name']
which is not very clever, and worse still if the category does not yet
have any posts the category data will not be returned.

The method Jeremy suggests returns just one Category with its related
Posts (if any exist) along with their related User all in the right
context for the Category view.  However, if your paginating the posts,
then you would then have to run paginate on the Post model.

@Jeremy: You, give up? No!

On Nov 5, 6:58 pm, Andras Kende  wrote:
> Paul,
>
> Sorry for confusion.
>
> Daniel first question was to display posts on a page (posts belongs to 
> category and user)
>
> I suggested earlier its better to start the query from post instead from 
> category, so you could get
> anything from the 3 tables with a single query..
>
> If there are more related models in posts table you can add contain like:
>
> $categories = $this->Category->Post->find('all', array(
>         'fields' => array(
>                 'Category.name',
>                 'Post.id',
>                 'Post.comment',
>                 'User.username',
>         ),
>         'conditions' => array('Category.id' => $id),
>         'contain' => array(
>                 'Category', 'User'
>         )
> ));
>
> Also its resulting a cleaner array,  I guess its easier to paginate as well..
>
> Andras Kende
>
> On Nov 5, 2011, at 5:59 AM, WebbedIT wrote:
>
>
>
>
>
>
>
> > @Andras: Have you read the rest of the thread? Jeremy is trying to
> > show Daniel how to use containable so he can specifically say what
> > models and fields he wants to fetch during his find call.  It's very
> > unhelpful you chiming in 25 messages into the thread telling him to
> > pull the model and ALL it's unnecessary related model data (a point
> > that was covered earlier in the thread).
>
> > @Daniel: Jeremy has given you all the correct information.  The
> > following will pull the category matching $id and all it's matching
> > Posts and their Users (if you have your relationships set correctly.
>
> > $this->Category->find(
> >  'first',
> >  array(
> >    'conditions' => array('Category.id' => $id),
> >    'Contain' => array(
> >      'Post' => array(
> >        'User' => array(
> >          'User.id',
> >          'User.name'
> >        )
> >      )
> >    )
> >  )
> > )
>
> > If you're still having problems understanding this please go back to
> > the cookbook and follow what it tells you step by step, there is
> > nothing in this thread which is not covered there as this is basic
> > stuff:
> >http://book.cakephp.org/view/1323/Containable
>
> > HTH, Paul.
>
> > On Nov 4, 11:06 pm, Andras Kende  wrote:
> >> Daniel,
>
> >> The easiest way to do what you need is:
>
> >>  >> class CategoriesController extends AppController {
>
> >> public function index($id = null) {
> >> $posts = $this->Category->Post->find('all', array(
> >> 'conditions' => array('Category.id' => $id),
> >> ));
> >> // print_r($posts); to debug...
> >> $this->set(compact('posts'));
>
> >> }
> >> }
>
> >> This will just do a single query with 2 left joins..
> >> Just make sure all 3 models has the relationships setup correctly..
>
> >> Andras Kende
>
> > --
> > 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


Handling images

2011-11-05 Thread Nate
I'm curious how I would go about setting up my script to process
multiple pictures and attach them to a post that doesn't exist yet.

In other words, a user is in the process of creating a new post - and
uploads an image that automatically gets processed (Some AJAX goodness
going on in the background). The post hasn't yet been submitted, but
now I need to associate the picture(s) with that post once it does get
submitted.

When the photo is uploaded and processed, and the response comes back
with the image name, would I put the name of the image in a hidden
field that gets submitted with the form?

Any other suggestions on how to accomplish this?

-- 
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: admin_add() cannot be accessed directly

2011-11-05 Thread 100rk
> is exactly -> /users/admin_add

Touché.

1. Read http://book.cakephp.org/2.0/en/development/routing.html#prefix-routing
2. Use arrays for urls in views, you'll get correct url /admin/users/
add

-- 
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: How to get related username in view?

2011-11-05 Thread Andras Kende
Paul,

Sorry for confusion.

Daniel first question was to display posts on a page (posts belongs to category 
and user)

I suggested earlier its better to start the query from post instead from 
category, so you could get
anything from the 3 tables with a single query..

If there are more related models in posts table you can add contain like:

$categories = $this->Category->Post->find('all', array(
'fields' => array(
'Category.name',
'Post.id',
'Post.comment',
'User.username',
),
'conditions' => array('Category.id' => $id),
'contain' => array(
'Category', 'User'
)
));

Also its resulting a cleaner array,  I guess its easier to paginate as well..


Andras Kende



On Nov 5, 2011, at 5:59 AM, WebbedIT wrote:

> @Andras: Have you read the rest of the thread? Jeremy is trying to
> show Daniel how to use containable so he can specifically say what
> models and fields he wants to fetch during his find call.  It's very
> unhelpful you chiming in 25 messages into the thread telling him to
> pull the model and ALL it's unnecessary related model data (a point
> that was covered earlier in the thread).
> 
> @Daniel: Jeremy has given you all the correct information.  The
> following will pull the category matching $id and all it's matching
> Posts and their Users (if you have your relationships set correctly.
> 
> $this->Category->find(
>  'first',
>  array(
>'conditions' => array('Category.id' => $id),
>'Contain' => array(
>  'Post' => array(
>'User' => array(
>  'User.id',
>  'User.name'
>)
>  )
>)
>  )
> )
> 
> If you're still having problems understanding this please go back to
> the cookbook and follow what it tells you step by step, there is
> nothing in this thread which is not covered there as this is basic
> stuff:
> http://book.cakephp.org/view/1323/Containable
> 
> HTH, Paul.
> 
> On Nov 4, 11:06 pm, Andras Kende  wrote:
>> Daniel,
>> 
>> The easiest way to do what you need is:
>> 
>> > class CategoriesController extends AppController {
>> 
>> public function index($id = null) {
>> $posts = $this->Category->Post->find('all', array(
>> 'conditions' => array('Category.id' => $id),
>> ));
>> // print_r($posts); to debug...
>> $this->set(compact('posts'));
>> 
>> }
>> }
>> 
>> This will just do a single query with 2 left joins..
>> Just make sure all 3 models has the relationships setup correctly..
>> 
>> Andras Kende
> 
> -- 
> 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

-- 
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: admin_add() cannot be accessed directly

2011-11-05 Thread Ogalav
is exactly -> /users/admin_add

admin_add.ctp -> correct
User.php ->model correct
UsersController -> controller correct

but when goint to call the function admin_add, throw this error

in fact, anything  ->soy_function

Modelxs/soy_function.ctp -> correct
Modelx.php ->model correct
ModelxsController -> controller correct

neither  throw
soy_fucntion() cannot be accessed directly

you`ll have idea of what happens..

thanks

On 5 nov, 13:17, 100rk  wrote:
> Sounds like wrong url - not /users/admin_add but /admin/users/add

-- 
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: Problem Auth Component | CakePHP 2.0.2

2011-11-05 Thread Serkan Sipahi
hi,

thank you for your note. But it still doesnt work. 

'fields' => array('username' => 'usr', 'password' => 'pwd')...doesnt work as 
well !!!
'fields' => array('username' => 'User.usr', 'password' => 'User.pwd') ...doesnt 
work as well !!!


Controller:


class PricerobotStoreEnginesController extends AppController {

    public $components = array(
    'Auth'=> array(
    'authenticate' => array(
    'Form' => array(
    'fields' => array('username' => 'usr', 'password' => 
'pwd')
                        //'fields' => array('username' => 'User.usr', 
'password' => 'User.pwd') ...doesnt work as well !!!

    )
    )
    )
    );
}


class UsersController extends AppController {
    
    public $components = array('Auth','Security');
    
    public function login() {

    if ($this->request->is('post')) {
    if ($this->Auth->Login()) {
    $this->redirect(array('controller' => 
'PricerobotStoreEngines', 'action' => 'index'));
    } else {
    $this->Session->setFlash(__('Username or password is 
incorrect'));
    $this->redirect(array('controller' => 'users', 'action' => 
'login'));
    }
    }
    
    }
    public function logout() {
    $this->redirect($this->Auth->logout());
 }
}


View:


echo $this->Form->create();
echo $this->Form->input('usr');   //text
echo $this->Form->password('pwd');   //password
echo $this->Form->end('Login');

Database:
Table: users
fields: usr, pwd




Von: Ryan Schmidt 
An: cake-php@googlegroups.com
Gesendet: 12:40 Samstag, 5.November 2011 
Betreff: Re: Problem Auth Component | CakePHP 2.0.2


On Nov 5, 2011, at 03:46, Serkan Sipahi wrote:

> I really need help. What is my cake mistake?

I assume you need to do what it says in the documentation, and inform CakePHP 
that your username is stored in the field "usr" and the password is in the 
field "pwd"; see the part under "To configure different fields for user in 
$components array":

http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#configuring-authentication-handlers


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

-- 
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: How to get related username in view?

2011-11-05 Thread Daniel
On Nov 5, 5:41 am, Jeremy Burns | Class Outfit
 wrote:
> Sometimes, I give up.
>

OK, after correcting some mistakes I got it to work.  To start with I
don't have a "name" field in the users table, it's "username", OK that
one was my fault.  Secondly it should be 'contain' not 'Contain'.
Lastly when specifying the fields in the array I did not need
'user.id' or 'user.username' just 'id' and 'username'.

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


How can I make this file upload javascript work in cakephp?

2011-11-05 Thread barricades
I'm learning (trying to anyway) how to use cakephp, and I have a
little javascript which I'd like to use, but I'm having problems
figuring out how to make it work with cakephp.

The javascript uploads a photo and displays it in a div elsewhere on
the page without reloading and makes it look like ajax. It uses a
hidden iframe.

I think the problems I've having are to do with relative paths and
basically where to put everything. I've to admit I'm not much of a
programmer yet so it's probably something really simple I'm not doing
but the script doesn't have tutorial and like I said I'm new to cake.

If anyone fancied helping me out by giving me a run through of what to
do I'd be really grateful. Talk to me like I know nothing, I know very
little :) Here's the script's website: 
http://atwebresults.com/php_ajax_image_upload/

By the way, I know this might not be the best script on the 'net but
it does seem to do exactly what I want to do (vis-a-vis the preview)
and I'd like to get it working :)

-- 
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: CakePHP2.0.1 - Problem with saving HABTM

2011-11-05 Thread Mattia Manzati
Ok, I've upgraded to 2.0.2, changed the code of
EpisodeReleaseController.php, and i have fixed the add problem. Now I
am building the edit function. I have used the console cake bake
controller to create it, but it seems that each time I press save it
adds a new association.
Example;
"Post" as been added with "TagA" and "TagC". I edit it and in the
multiple select I deselect the "TagC" and select the "TagB". I'd
expect now to have only "TagA" and "TagB", but if I press save it
shows: "TagA,TagC,TagA,TagB".

Code here:
https://github.com/ilmattodel93/IMattiDel93-s-Site/blob/master/app/Controller/EpisodeReleasesController.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


security threat using this->here?

2011-11-05 Thread euromark
I searched for answers to this topic at stackoverflow
http://stackoverflow.com/questions/7985366/additional-this-here-security-still-necessary/7985529

/**
 *  Don't you EVER remove this line else you will make the whole
 *  application a swiss cheese for XSS!
 *  We often call echo $this->here in our form actions and this would
 *  be exactly where the injection would take place.
 */
$this->here = preg_replace('/("|\')/', 'â€',
addslashes(strip_tags($this->here)));

Maybe a core member could shed some light on the subject on how big a
vulnerability it was to use $this->here (In 2.0 $this->here is now
$this->request->here) inside the application.
You could probably always use h() on echoing it. But lets assume we
don't (it would probably mess up part of the url).
Do we still need to apply such a patch manually before using it? Or is
the url already cleaned in some way?
Same probably goes for $this->request->url and the referer and
possibly other request parts.

Looking at CakeRequest, Router, etc I couldn't find any such xss
cleaning approaches used. but maybe I just missed sth.
If not the case it would be good to know if the above approach is
sufficing and to what parts of the request data it should be applied.
probably the ones that are echoed out at some point since xss can only
work if in the source code.
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: admin_add() cannot be accessed directly

2011-11-05 Thread 100rk
Sounds like wrong url - not /users/admin_add but /admin/users/add

-- 
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: How to get related username in view?

2011-11-05 Thread Ajay Kumar
On Sat, Nov 5, 2011 at 11:11 AM, Jeremy Burns | Class Outfit <
jeremybu...@classoutfit.com> wrote:

> Sometimes, I give up.
>
> Jeremy Burns
> Class Outfit
>
> http://www.classoutfit.com
>
> On 4 Nov 2011, at 23:06, Andras Kende wrote:
>
> Daniel,
>
> The easiest way to do what you need is:
>
>  class CategoriesController extends AppController {
>
> public function index($id = null) {
> $posts = $this->Category->Post->find('all', array(
> 'conditions' => array('Category.id' => $id),
> ));
> // print_r($posts); to debug...
> $this->set(compact('posts'));
> }
>
> }
>
> This will just do a single query with 2 left joins..
> Just make sure all 3 models has the relationships setup correctly..
>
>
> Andras Kende
>
> --
> 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
>
>
>  --
> 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
>

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


admin_add() cannot be accessed directly

2011-11-05 Thread Ogalav
what`s this error??..

my views are corrects, like ->admin_add

and the controller the function

public function admin_add() {
if ($this->request->is('post')) {
$this->User->create();
if ($this->User->save($this->request->data)) {
$this->Session->setFlash(__('The user has been 
saved'));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The user could not 
be saved. Please,
try again.'));
}
}
}

so.. what it throw this error??...with function add() success but
admin_add nothing happing instead give it "admin_add() cannot be
accessed directly"

-- 
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: Problem Auth Component | CakePHP 2.0.2

2011-11-05 Thread Ryan Schmidt

On Nov 5, 2011, at 03:46, Serkan Sipahi wrote:

> I really need help. What is my cake mistake?

I assume you need to do what it says in the documentation, and inform CakePHP 
that your username is stored in the field "usr" and the password is in the 
field "pwd"; see the part under "To configure different fields for user in 
$components array":

http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#configuring-authentication-handlers


-- 
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: how can i protect my code from the duplicaters

2011-11-05 Thread Jeremy Burns | Class Outfit
Exactly! Just to be clear, we're not dealing with mission critical stuff or 
bank accounts. The issue is that if you sell a web based application to a 
company that then runs it on their own infrastructure, it'd be cool to be able 
to protect your interests somehow and ensure you can manage a recurring annual 
income from it. I guess one answer is "don't build it in PHP", but that's a 
cop-out!

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 5 Nov 2011, at 11:03, WebbedIT wrote:

> Would never of thought of software at that sort of high end level
> being developed using uncompiled/unencrypted code of any flavour.
> Could just see me walking into a bank, having a look at there source
> code and tweaking a few PHP functions :)
> 
> On Nov 4, 6:47 pm, Jeremy Burns | Class Outfit
>  wrote:
>> I'm thinking of apps running on internal banking servers (real case 
>> scenario) where hosting it remotely is a no-no for security reasons. 
>> Encrypting that would be pretty fantastic.
>> 
>> Jeremy Burns
>> Class Outfit
>> 
>> http://www.classoutfit.com
>> 
>> On 4 Nov 2011, at 18:42, WebbedIT wrote:
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>>> @Jeremy: I would be wary of allowing any software licensed annually to
>>> be hosted on another server. Apps licensed in this way tend to be more
>>> like an SAAS app and as such would be centrally stored to allow for
>>> maintenance, upgrades etc.
>> 
>>> If it is a plugin that we're talking about then the license tends to
>>> get you a period of support and access to upgrades, so to let your
>>> license expires means you can continue to use the plugin without
>>> upgrades/fixes.
>> 
>>> Have you ever, or no of anyone else, who has bought code where you had
>>> to decrypt it (try finding a shared hosting service that has ioncube/
>>> zend guard installed)?  Maybe you could have a call from the remote
>>> server to a database on your server which checked if a license is
>>> valid?
>> 
>>> HTH, Paul
>> 
>>> On Nov 4, 9:38 am, AD7six  wrote:
 On Nov 4, 10:13 am, WebbedIT  wrote:
>> 
> @Ryan: If you could not raise a smile at Andy's response in this
> thread then you really could do with a weekend off.  Your response is
> nicer than Andy's but they both mean the same thing ... "Why on earth
> do you need to protect your code?!?"
>> 
 Actually my "point" (there was no point in my answer) was more this:
>> 
 http://lmgtfy.com/?q=protect+php+files
>> 
 if you can type your question in google and the answer pops up - it's
 not a question that belongs on any support forum. Less so here, for a
 question that has nothing specific to do with CakePHP.
>> 
 AD
>> 
>>> --
>>> 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

-- 
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: how can i protect my code from the duplicaters

2011-11-05 Thread WebbedIT
Would never of thought of software at that sort of high end level
being developed using uncompiled/unencrypted code of any flavour.
Could just see me walking into a bank, having a look at there source
code and tweaking a few PHP functions :)

On Nov 4, 6:47 pm, Jeremy Burns | Class Outfit
 wrote:
> I'm thinking of apps running on internal banking servers (real case scenario) 
> where hosting it remotely is a no-no for security reasons. Encrypting that 
> would be pretty fantastic.
>
> Jeremy Burns
> Class Outfit
>
> http://www.classoutfit.com
>
> On 4 Nov 2011, at 18:42, WebbedIT wrote:
>
>
>
>
>
>
>
> > @Jeremy: I would be wary of allowing any software licensed annually to
> > be hosted on another server. Apps licensed in this way tend to be more
> > like an SAAS app and as such would be centrally stored to allow for
> > maintenance, upgrades etc.
>
> > If it is a plugin that we're talking about then the license tends to
> > get you a period of support and access to upgrades, so to let your
> > license expires means you can continue to use the plugin without
> > upgrades/fixes.
>
> > Have you ever, or no of anyone else, who has bought code where you had
> > to decrypt it (try finding a shared hosting service that has ioncube/
> > zend guard installed)?  Maybe you could have a call from the remote
> > server to a database on your server which checked if a license is
> > valid?
>
> > HTH, Paul
>
> > On Nov 4, 9:38 am, AD7six  wrote:
> >> On Nov 4, 10:13 am, WebbedIT  wrote:
>
> >>> @Ryan: If you could not raise a smile at Andy's response in this
> >>> thread then you really could do with a weekend off.  Your response is
> >>> nicer than Andy's but they both mean the same thing ... "Why on earth
> >>> do you need to protect your code?!?"
>
> >> Actually my "point" (there was no point in my answer) was more this:
>
> >>http://lmgtfy.com/?q=protect+php+files
>
> >> if you can type your question in google and the answer pops up - it's
> >> not a question that belongs on any support forum. Less so here, for a
> >> question that has nothing specific to do with CakePHP.
>
> >> AD
>
> > --
> > 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: How to get related username in view?

2011-11-05 Thread WebbedIT
@Andras: Have you read the rest of the thread? Jeremy is trying to
show Daniel how to use containable so he can specifically say what
models and fields he wants to fetch during his find call.  It's very
unhelpful you chiming in 25 messages into the thread telling him to
pull the model and ALL it's unnecessary related model data (a point
that was covered earlier in the thread).

@Daniel: Jeremy has given you all the correct information.  The
following will pull the category matching $id and all it's matching
Posts and their Users (if you have your relationships set correctly.

$this->Category->find(
  'first',
  array(
'conditions' => array('Category.id' => $id),
'Contain' => array(
  'Post' => array(
'User' => array(
  'User.id',
  'User.name'
)
  )
)
  )
)

If you're still having problems understanding this please go back to
the cookbook and follow what it tells you step by step, there is
nothing in this thread which is not covered there as this is basic
stuff:
http://book.cakephp.org/view/1323/Containable

HTH, Paul.

On Nov 4, 11:06 pm, Andras Kende  wrote:
> Daniel,
>
> The easiest way to do what you need is:
>
>  class CategoriesController extends AppController {
>
> public function index($id = null) {
> $posts = $this->Category->Post->find('all', array(
> 'conditions' => array('Category.id' => $id),
> ));
> // print_r($posts); to debug...
> $this->set(compact('posts'));
>
> }
> }
>
> This will just do a single query with 2 left joins..
> Just make sure all 3 models has the relationships setup correctly..
>
> Andras Kende

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


ACL Helper?

2011-11-05 Thread Eric Blanpied
Hello,

I'm trying to work out a good system to get at ACL data in my views,
and while the net & list archives have a handful of tips and partial
solutions, I haven't found anything conclusively helpful.

The most promising approaches I've seen add code to the login function
to compile a list of the user's permissions to store in a session var,
and then incorporate a helper to check against this when needed on the
front end. However, that lookup code all uses lots of digging into the
actual acl->aco->etc. hierarchy, or deals directly with the tree
behavior, and feels overwrought in compared to the ease of
$this->Acl->check( $aro, $aco, $action = '*') in a controller action.

So, my questions:

a) What's the overhead of the ACL Component's check() method? ie:
would calling it in a controller action for a page a few times mean
lots of db thrash, or is there some smart caching involved?

b) Does anyone have a working solution they're pleased with? A clean
method to stash a users permissions would be super-useful!

thanks!

-e

-- 
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: Problem Auth Component | CakePHP 2.0.2

2011-11-05 Thread Serkan Sipahi
Hi,
I really need help. What is my cake mistake?




Von: Serkan Sipahi 
An: "cake-php@googlegroups.com" 
Gesendet: 16:59 Donnerstag, 3.November 2011 
Betreff: Problem Auth Component | CakePHP 2.0.2


hi Cake Community,

CakePHP 2.0.2
OS: Windows7
Configure::write('debug', 2);


Problem:
My Auth Component is not working and i dont know why. Need Help.



User Controller:

request->is('post')) {

                /* $this->Auth->User('usr') or $this->Auth->User('pwd') 
also tried. Returns nothing. Dontknow why!?!?! */


    if ($this->Auth->Login()) {
    $this->redirect(array('controller' => 
'PricerobotStoreEngines', 'action' => 'index'));
    } else {
    $this->Session->setFlash(__('Username or password is 
incorrect'));
    $this->redirect(array('controller' => 'users', 'action' => 
'login'));
    }
    }
    
    }
    public function logout() {
    $this->redirect($this->Auth->logout());
    }
    

    /*
     * tried,too ! Returns nothing. 
     *  

    public function beforeFilter(){
 //$this->Auth->User('usr') or $this->Auth->User('pwd') also 
tried. Returns nothing. Dontknow why!?!?! 

}
     *
     *
     */  

}
?>

PricerobotStoreEnginesController Controller:

 array(
    'loginAction' => array(
    'controller' => 'users',
    'action' => 'login',
    )
    )
    );

   etc 

}
?>

Login View:

Form->create('');
    echo $this->Form->input('usr');   
    echo $this->Form->password('pwd');
    echo $this->Form->end('Login');
?>








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

-- 
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: Best approach to use GAPI class

2011-11-05 Thread Thiago Belem
I would like an answer to this question too.. *bump*

Probably I would use it as Vendor and create a Component, seems the fastest
way to do it.. But what do you guys think?

Regards,
--
***Thiago Belem*
Desenvolvedor
Rio de Janeiro - RJ - Brasil

+55 (21) 8865.9250
thiagobelem.net
cont...@thiagobelem.net

*Skype / gTalk **»* thiago.belem.web
*LinkedIn* *»* br.linkedin.com/in/thiagobelem/pt*
Assando Sites*, curso de CakePHP *»* assando-sites.com.br


2011/11/3 MetZ 

> Hi.
>
> I am looking to have a google analytics display in my admin panel..
>
> So I was thinking;
> http://code.google.com/p/gapi-google-analytics-php-interface/
>
> Now, since I have never added other classes to cake, I am wondering
> how I should approach this, and how to use the gapi_class in my
> controller(s).
>
> 1) Where to put it
> 2) how to load it in controller(s)
> 3) any example how you would use it? Or if you are using it, let me
> know best approach!
>
> Any and all help is, as always, greatly appreciated!!
>
> Thanks!!
> -Tom
>
> --
> 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
>

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