API document change request.

2013-02-09 Thread Mathew
Hi,

I'm not sure where to post this, but if someone could please make this very 
simple change. Maybe it will help someone else in the future.

I just spent a lot of time debugging Cake to try and understand what 
Model::associations() does. The phpDoc says 'Get associations' which sounds 
like it would return an array of all the associations for a model. 
Basically the same thing as Model::getAssociated().

I'd like the phpDoc to be more clear. Maybe read something like

Gets an array all the association types support by this model.

It's not clear that the array return is NOT the actual associations of the 
models. You can see $this-_associations constantly used in the Model so it 
can be temping to this this is where those things are stored. The reason I 
was confused and didn't use getAssociated() is that the descriptions reads.

Gets all the models with which this model is associated.

That implies that it returns the Model objects. The description should read.

Gets the name of all the models with this model is associated.

I'd just like those docs to be less ambiguous. 

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Router::parse($string) adding prefix when prefix not set.

2013-02-07 Thread Mathew
Hi,

I have a problem. When I call Router::parse('/something/index') it returns 
an array which contains the prefix (i.e. 'admin'=1) when called during a 
request that has a prefix set.

That's a problem, because the string '/something/index' doesn't have the 
prefix set. It should return it if '/admin/something/index' was used.

Is this a bug or by design, and if by design, please explain why.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Router::parse($string) adding prefix when prefix not set.

2013-02-07 Thread Mathew
Thanks for replying.

I have only 1 route defined.

Router::connect('/',array('controller'='pages','action'='display','home'));
require CAKE . 'Config' . DS . 'routes.php';

If I run Router::parse('/') from an admin prefix then I get this URL back 
'http://cgtag.local/admin/pages/display/home' which doesn't exist.

It's actually the part of the website that calculates the exit URL for the 
admin section. In this example it's to just the homepage, but in other 
cases it might not be.

On Thursday, 7 February 2013 21:38:05 UTC-5, cricket wrote:

 Do you have a route defined for /admin/something/index but not for 
 /something/index? 

 On Thu, Feb 7, 2013 at 4:06 PM, Mathew nfosc...@yahoo.com javascript: 
 wrote: 
  Hi, 
  
  I have a problem. When I call Router::parse('/something/index') it 
 returns 
  an array which contains the prefix (i.e. 'admin'=1) when called during 
 a 
  request that has a prefix set. 
  
  That's a problem, because the string '/something/index' doesn't have the 
  prefix set. It should return it if '/admin/something/index' was used. 
  
  Is this a bug or by design, and if by design, please explain why. 
  
  -- 
  Like Us on FaceBook https://www.facebook.com/CakePHP 
  Find us on Twitter http://twitter.com/CakePHP 
  
  --- 
  You received this message because you are subscribed to the Google 
 Groups 
  CakePHP group. 
  To unsubscribe from this group and stop receiving emails from it, send 
 an 
  email to cake-php+u...@googlegroups.com javascript:. 
  To post to this group, send email to cake...@googlegroups.comjavascript:. 

  Visit this group at http://groups.google.com/group/cake-php?hl=en. 
  For more options, visit https://groups.google.com/groups/opt_out. 
  
  


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Router::parse($string) adding prefix when prefix not set.

2013-02-07 Thread Mathew
Even if I change the Router to this.

Router::connect('/',array('admin'=false,'controller'='pages','action'='display','home'));

It still doesn't work.

On Thursday, 7 February 2013 21:38:05 UTC-5, cricket wrote:

 Do you have a route defined for /admin/something/index but not for 
 /something/index? 

 On Thu, Feb 7, 2013 at 4:06 PM, Mathew nfosc...@yahoo.com javascript: 
 wrote: 
  Hi, 
  
  I have a problem. When I call Router::parse('/something/index') it 
 returns 
  an array which contains the prefix (i.e. 'admin'=1) when called during 
 a 
  request that has a prefix set. 
  
  That's a problem, because the string '/something/index' doesn't have the 
  prefix set. It should return it if '/admin/something/index' was used. 
  
  Is this a bug or by design, and if by design, please explain why. 
  
  -- 
  Like Us on FaceBook https://www.facebook.com/CakePHP 
  Find us on Twitter http://twitter.com/CakePHP 
  
  --- 
  You received this message because you are subscribed to the Google 
 Groups 
  CakePHP group. 
  To unsubscribe from this group and stop receiving emails from it, send 
 an 
  email to cake-php+u...@googlegroups.com javascript:. 
  To post to this group, send email to cake...@googlegroups.comjavascript:. 

  Visit this group at http://groups.google.com/group/cake-php?hl=en. 
  For more options, visit https://groups.google.com/groups/opt_out. 
  
  


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Problem running CakeTestSuite in CakePHP 2.2.5 with PHPUnit 3.6.12

2013-01-17 Thread Mathew
Hi,

I'm unable to run a CakeTestSuite, but I can run a CakeTestCase just fine 
on the CLI.

When I run the CakeTestSuite I get the following error.

Warning: is_file() expects parameter 1 to be string, array given in 
C:\Program Files (x86)\PHP\PEAR\PHPUnit\Util\Skeleton\Test.php on line 109

Call Stack:
0.0004 335536   1. {main}() 
C:\work\zend\cake\Cake\Console\cake.php:0
0.0049 452272   2. ShellDispatcher::run($argv = array (0 = 
'C:\\work\\zend\\cake\\Cake\\Console\\cake.php', 1 = '-working', 2 = 
'C:\\work\\zend\\cgtag\\cgtag\\app ', 3 =
 'test', 4 = 'agg', 5 = 'Models')) 
C:\work\zend\cake\Cake\Console\cake.php:43
0.17242600904   3. ShellDispatcher-dispatch() 
C:\work\zend\cake\Cake\Console\ShellDispatcher.php:69
0.23643349648   4. Shell-runCommand($command = 'agg', $argv = 
array (0 = 'agg', 1 = 'Models')) 
C:\work\zend\cake\Cake\Console\ShellDispatcher.php:201
0.29984215400   5. TestShell-main() 
C:\work\zend\cake\Cake\Console\Shell.php:395
0.30024216112   6. TestShell-_run($runnerArgs = array ('core' = 
FALSE, 'app' = FALSE, 'plugin' = 'agg', 'output' = 'text', 'case' = 
'Models'), $options = array (0 =
'--colors')) C:\work\zend\cake\Cake\Console\Command\TestShell.php:259
0.31694540880   7. CakeTestSuiteCommand-run($argv = array (0 = 
'--colors'), $exit = ???) 
C:\work\zend\cake\Cake\Console\Command\TestShell.php:274
0.39606485384   8. 
PHPUnit_Util_Skeleton_Test-__construct($inClassName = 'All model tests', 
$inSourceFile = array ('core' = FALSE, 'app' = FALSE, 'plugin' = 'agg', 
'out
put' = 'text', 'case' = 'Models'), $outClassName = ???, $outSourceFile = 
???) C:\work\zend\cake\Cake\TestSuite\CakeTestSuiteCommand.php:80
0.39626485512   9. is_file(array ('core' = FALSE, 'app' = FALSE, 
'plugin' = 'agg', 'output' = 'text', 'case' = 'Models')) C:\Program 
Files (x86)\PHP\PEAR\PHPUnit\Util\
Skeleton\Test.php:109


Variables in local scope (#8):
  $inClassName = 'All model tests'
  $inSourceFile = array ('core' = FALSE, 'app' = FALSE, 'plugin' = 
'agg', 'output' = 'text', 'case' = 'Models')
  $outClassName = ''
  $outSourceFile = ''
  $possibleFilename = *uninitialized*
  $possibleFilenames = *uninitialized*
  $reflector = *uninitialized*

Error: Array could not be opened.
#0 C:\work\zend\cake\Cake\TestSuite\CakeTestSuiteCommand.php(80): 
PHPUnit_Util_Skeleton_Test-__construct('All model tests', Array)
#1 C:\work\zend\cake\Cake\Console\Command\TestShell.php(274): 
CakeTestSuiteCommand-run(Array)
#2 C:\work\zend\cake\Cake\Console\Command\TestShell.php(259): 
TestShell-_run(Array, Array)
#3 C:\work\zend\cake\Cake\Console\Shell.php(395): TestShell-main()
#4 C:\work\zend\cake\Cake\Console\ShellDispatcher.php(201): 
Shell-runCommand('agg', Array)
#5 C:\work\zend\cake\Cake\Console\ShellDispatcher.php(69): 
ShellDispatcher-dispatch()
#6 C:\work\zend\cake\Cake\Console\cake.php(43): ShellDispatcher::run(Array)
#7 {main}

--

Now I ran this under the debugger and found that the problem appears to be 
in CakeTestSuiteCommand on line 77.

$skeleton = new PHPUnit_Util_Skeleton_Test(
$suite-getName(),
$this-arguments['testFile']
);

PHPUnit_Util_Skeleton_Test is expecting the second parameter to be a 
string, but Cake is using an array.

Here's what the array holds.

$this-arguments['testFile'] = array(
  'core'=false,
  'app'=false,
  'plugin'='agg',
  'output'='text',
  'case'='Models'
)

I don't know what to do to fix this. Is this a bug in Cake, or am I not 
configuring the test correctly.

I also tried to run this Suite via the Web but get the same error message.

Please help.


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: Problem running CakeTestSuite in CakePHP 2.2.5 with PHPUnit 3.6.12

2013-01-17 Thread Mathew
Here is the test suite for my Agg plugin.

class ModelsTest extends CakeTestSuite
{
public static function suite()
{
$suite = new CakeTestSuite('All the models');
$suite-addTestDirectory(TESTS . 'Case' . DS . 'Model');
return $suite;
}
}

I've looked at the test cases from the Cake core. I can't see anything that 
I did wrong.

Also, I've gone threw GIT for both CakePHP and PHPUnit. Nothing has changed 
that would have introduced this.

So it has to be a problem with how I'm running  the tests.

On Thursday, 17 January 2013 13:37:36 UTC-5, Mathew wrote:

 Hi,

 I'm unable to run a CakeTestSuite, but I can run a CakeTestCase just fine 
 on the CLI.

 When I run the CakeTestSuite I get the following error.

 Warning: is_file() expects parameter 1 to be string, array given in 
 C:\Program Files (x86)\PHP\PEAR\PHPUnit\Util\Skeleton\Test.php on line 109

 Call Stack:
 0.0004 335536   1. {main}() 
 C:\work\zend\cake\Cake\Console\cake.php:0
 0.0049 452272   2. ShellDispatcher::run($argv = array (0 = 
 'C:\\work\\zend\\cake\\Cake\\Console\\cake.php', 1 = '-working', 2 = 
 'C:\\work\\zend\\cgtag\\cgtag\\app ', 3 =
  'test', 4 = 'agg', 5 = 'Models')) 
 C:\work\zend\cake\Cake\Console\cake.php:43
 0.17242600904   3. ShellDispatcher-dispatch() 
 C:\work\zend\cake\Cake\Console\ShellDispatcher.php:69
 0.23643349648   4. Shell-runCommand($command = 'agg', $argv = 
 array (0 = 'agg', 1 = 'Models')) 
 C:\work\zend\cake\Cake\Console\ShellDispatcher.php:201
 0.29984215400   5. TestShell-main() 
 C:\work\zend\cake\Cake\Console\Shell.php:395
 0.30024216112   6. TestShell-_run($runnerArgs = array ('core' = 
 FALSE, 'app' = FALSE, 'plugin' = 'agg', 'output' = 'text', 'case' = 
 'Models'), $options = array (0 =
 '--colors')) C:\work\zend\cake\Cake\Console\Command\TestShell.php:259
 0.31694540880   7. CakeTestSuiteCommand-run($argv = array (0 = 
 '--colors'), $exit = ???) 
 C:\work\zend\cake\Cake\Console\Command\TestShell.php:274
 0.39606485384   8. 
 PHPUnit_Util_Skeleton_Test-__construct($inClassName = 'All model tests', 
 $inSourceFile = array ('core' = FALSE, 'app' = FALSE, 'plugin' = 'agg', 
 'out
 put' = 'text', 'case' = 'Models'), $outClassName = ???, $outSourceFile = 
 ???) C:\work\zend\cake\Cake\TestSuite\CakeTestSuiteCommand.php:80
 0.39626485512   9. is_file(array ('core' = FALSE, 'app' = FALSE, 
 'plugin' = 'agg', 'output' = 'text', 'case' = 'Models')) C:\Program 
 Files (x86)\PHP\PEAR\PHPUnit\Util\
 Skeleton\Test.php:109


 Variables in local scope (#8):
   $inClassName = 'All model tests'
   $inSourceFile = array ('core' = FALSE, 'app' = FALSE, 'plugin' = 
 'agg', 'output' = 'text', 'case' = 'Models')
   $outClassName = ''
   $outSourceFile = ''
   $possibleFilename = *uninitialized*
   $possibleFilenames = *uninitialized*
   $reflector = *uninitialized*

 Error: Array could not be opened.
 #0 C:\work\zend\cake\Cake\TestSuite\CakeTestSuiteCommand.php(80): 
 PHPUnit_Util_Skeleton_Test-__construct('All model tests', Array)
 #1 C:\work\zend\cake\Cake\Console\Command\TestShell.php(274): 
 CakeTestSuiteCommand-run(Array)
 #2 C:\work\zend\cake\Cake\Console\Command\TestShell.php(259): 
 TestShell-_run(Array, Array)
 #3 C:\work\zend\cake\Cake\Console\Shell.php(395): TestShell-main()
 #4 C:\work\zend\cake\Cake\Console\ShellDispatcher.php(201): 
 Shell-runCommand('agg', Array)
 #5 C:\work\zend\cake\Cake\Console\ShellDispatcher.php(69): 
 ShellDispatcher-dispatch()
 #6 C:\work\zend\cake\Cake\Console\cake.php(43): ShellDispatcher::run(Array)
 #7 {main}

 --

 Now I ran this under the debugger and found that the problem appears to be 
 in CakeTestSuiteCommand on line 77.

 $skeleton = new PHPUnit_Util_Skeleton_Test(
 $suite-getName(),
 $this-arguments['testFile']
 );

 PHPUnit_Util_Skeleton_Test is expecting the second parameter to be a 
 string, but Cake is using an array.

 Here's what the array holds.

 $this-arguments['testFile'] = array(
   'core'=false,
   'app'=false,
   'plugin'='agg',
   'output'='text',
   'case'='Models'
 )

 I don't know what to do to fix this. Is this a bug in Cake, or am I not 
 configuring the test correctly.

 I also tried to run this Suite via the Web but get the same error message.

 Please help.




-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: Routing help

2013-01-17 Thread Mathew
I don't think cakes routing can handle subdomain changes. For that you 
would have to write your own customer router in CakePHP 2.

I don't recommend using subdomains to view user profiles. It introduces a 
lot of issues for SEO, SSL, cookies and sessions.

On Wednesday, 16 January 2013 16:51:02 UTC-5, gonzela2006 wrote:

 Hello,

 I need your help to make this routing
 http://domain.com/members/users/view/username/posttitle
 to be
 http://username.domain.com/posttitle
 Where
 domain.com - My domain
 members - Routing prefix
 users - Controller
 view - Action
 username - Member username(First variable for view() action)
 posttitle- Member post title(Second variable for view() action)

 Please help me

 Thanks


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: Migration from 1.3 to 2.1 = Some questions

2013-01-17 Thread Mathew
Did you add the default routing for Cake to your app's routes.php file? 
That was something I had to do when migrating from 1.3

Add this to the bottom of your routes.php

/**
 * Load the CakePHP default routes. Only remove this if you do not want to 
use
 * the built-in default routes.
 */
require CAKE . 'Config' . DS . 'routes.php';


On Thursday, 17 January 2013 06:05:08 UTC-5, heohni wrote:

 Hi, 

 I used the update script and I get the following error message:

 MissingControllerException] Controller class Controller could not be found.

 ...flags.ctp(8): Object-requestAction('sprachen/getLan...')


 The code within the mentioned file is:

 $flags = $this-requestAction('sprachen/getLanguages');


 I have a Model named Sprachen.php and a Controller called 
 SprachenController.php

 class SprachenController extends AppController{


 I also checked the AppController to have

 App::uses('Controller', 'Controller');

 class AppController extends Controller {


 What do I have to do now?

 Please advice!!


 Thanks

 Heidi




-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: Problem running CakeTestSuite in CakePHP 2.2.5 with PHPUnit 3.6.12

2013-01-17 Thread Mathew
This appears to be only an issue with plugins.

I am able to run a CakeTestSuite from the App just fine.

On Thursday, 17 January 2013 13:37:36 UTC-5, Mathew wrote:

 Hi,

 I'm unable to run a CakeTestSuite, but I can run a CakeTestCase just fine 
 on the CLI.

 When I run the CakeTestSuite I get the following error.

 Warning: is_file() expects parameter 1 to be string, array given in 
 C:\Program Files (x86)\PHP\PEAR\PHPUnit\Util\Skeleton\Test.php on line 109

 Call Stack:
 0.0004 335536   1. {main}() 
 C:\work\zend\cake\Cake\Console\cake.php:0
 0.0049 452272   2. ShellDispatcher::run($argv = array (0 = 
 'C:\\work\\zend\\cake\\Cake\\Console\\cake.php', 1 = '-working', 2 = 
 'C:\\work\\zend\\cgtag\\cgtag\\app ', 3 =
  'test', 4 = 'agg', 5 = 'Models')) 
 C:\work\zend\cake\Cake\Console\cake.php:43
 0.17242600904   3. ShellDispatcher-dispatch() 
 C:\work\zend\cake\Cake\Console\ShellDispatcher.php:69
 0.23643349648   4. Shell-runCommand($command = 'agg', $argv = 
 array (0 = 'agg', 1 = 'Models')) 
 C:\work\zend\cake\Cake\Console\ShellDispatcher.php:201
 0.29984215400   5. TestShell-main() 
 C:\work\zend\cake\Cake\Console\Shell.php:395
 0.30024216112   6. TestShell-_run($runnerArgs = array ('core' = 
 FALSE, 'app' = FALSE, 'plugin' = 'agg', 'output' = 'text', 'case' = 
 'Models'), $options = array (0 =
 '--colors')) C:\work\zend\cake\Cake\Console\Command\TestShell.php:259
 0.31694540880   7. CakeTestSuiteCommand-run($argv = array (0 = 
 '--colors'), $exit = ???) 
 C:\work\zend\cake\Cake\Console\Command\TestShell.php:274
 0.39606485384   8. 
 PHPUnit_Util_Skeleton_Test-__construct($inClassName = 'All model tests', 
 $inSourceFile = array ('core' = FALSE, 'app' = FALSE, 'plugin' = 'agg', 
 'out
 put' = 'text', 'case' = 'Models'), $outClassName = ???, $outSourceFile = 
 ???) C:\work\zend\cake\Cake\TestSuite\CakeTestSuiteCommand.php:80
 0.39626485512   9. is_file(array ('core' = FALSE, 'app' = FALSE, 
 'plugin' = 'agg', 'output' = 'text', 'case' = 'Models')) C:\Program 
 Files (x86)\PHP\PEAR\PHPUnit\Util\
 Skeleton\Test.php:109


 Variables in local scope (#8):
   $inClassName = 'All model tests'
   $inSourceFile = array ('core' = FALSE, 'app' = FALSE, 'plugin' = 
 'agg', 'output' = 'text', 'case' = 'Models')
   $outClassName = ''
   $outSourceFile = ''
   $possibleFilename = *uninitialized*
   $possibleFilenames = *uninitialized*
   $reflector = *uninitialized*

 Error: Array could not be opened.
 #0 C:\work\zend\cake\Cake\TestSuite\CakeTestSuiteCommand.php(80): 
 PHPUnit_Util_Skeleton_Test-__construct('All model tests', Array)
 #1 C:\work\zend\cake\Cake\Console\Command\TestShell.php(274): 
 CakeTestSuiteCommand-run(Array)
 #2 C:\work\zend\cake\Cake\Console\Command\TestShell.php(259): 
 TestShell-_run(Array, Array)
 #3 C:\work\zend\cake\Cake\Console\Shell.php(395): TestShell-main()
 #4 C:\work\zend\cake\Cake\Console\ShellDispatcher.php(201): 
 Shell-runCommand('agg', Array)
 #5 C:\work\zend\cake\Cake\Console\ShellDispatcher.php(69): 
 ShellDispatcher-dispatch()
 #6 C:\work\zend\cake\Cake\Console\cake.php(43): ShellDispatcher::run(Array)
 #7 {main}

 --

 Now I ran this under the debugger and found that the problem appears to be 
 in CakeTestSuiteCommand on line 77.

 $skeleton = new PHPUnit_Util_Skeleton_Test(
 $suite-getName(),
 $this-arguments['testFile']
 );

 PHPUnit_Util_Skeleton_Test is expecting the second parameter to be a 
 string, but Cake is using an array.

 Here's what the array holds.

 $this-arguments['testFile'] = array(
   'core'=false,
   'app'=false,
   'plugin'='agg',
   'output'='text',
   'case'='Models'
 )

 I don't know what to do to fix this. Is this a bug in Cake, or am I not 
 configuring the test correctly.

 I also tried to run this Suite via the Web but get the same error message.

 Please help.




-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: Problem running CakeTestSuite in CakePHP 2.2.5 with PHPUnit 3.6.12

2013-01-17 Thread Mathew
I got it working, but this is very strange.

IF there are NO tests in the App and you try to run a test suite for a 
plugin, then it will cause this error.

IF there are tests in the App then this error goes away.

Looks like Cake can't find the test suite for the plugin when the App 
doesn't have any tests. Adding some dummy tests solved this.

It's only by fluke that I found this.

On Thursday, 17 January 2013 13:37:36 UTC-5, Mathew wrote:

 Hi,

 I'm unable to run a CakeTestSuite, but I can run a CakeTestCase just fine 
 on the CLI.

 When I run the CakeTestSuite I get the following error.

 Warning: is_file() expects parameter 1 to be string, array given in 
 C:\Program Files (x86)\PHP\PEAR\PHPUnit\Util\Skeleton\Test.php on line 109

 Call Stack:
 0.0004 335536   1. {main}() 
 C:\work\zend\cake\Cake\Console\cake.php:0
 0.0049 452272   2. ShellDispatcher::run($argv = array (0 = 
 'C:\\work\\zend\\cake\\Cake\\Console\\cake.php', 1 = '-working', 2 = 
 'C:\\work\\zend\\cgtag\\cgtag\\app ', 3 =
  'test', 4 = 'agg', 5 = 'Models')) 
 C:\work\zend\cake\Cake\Console\cake.php:43
 0.17242600904   3. ShellDispatcher-dispatch() 
 C:\work\zend\cake\Cake\Console\ShellDispatcher.php:69
 0.23643349648   4. Shell-runCommand($command = 'agg', $argv = 
 array (0 = 'agg', 1 = 'Models')) 
 C:\work\zend\cake\Cake\Console\ShellDispatcher.php:201
 0.29984215400   5. TestShell-main() 
 C:\work\zend\cake\Cake\Console\Shell.php:395
 0.30024216112   6. TestShell-_run($runnerArgs = array ('core' = 
 FALSE, 'app' = FALSE, 'plugin' = 'agg', 'output' = 'text', 'case' = 
 'Models'), $options = array (0 =
 '--colors')) C:\work\zend\cake\Cake\Console\Command\TestShell.php:259
 0.31694540880   7. CakeTestSuiteCommand-run($argv = array (0 = 
 '--colors'), $exit = ???) 
 C:\work\zend\cake\Cake\Console\Command\TestShell.php:274
 0.39606485384   8. 
 PHPUnit_Util_Skeleton_Test-__construct($inClassName = 'All model tests', 
 $inSourceFile = array ('core' = FALSE, 'app' = FALSE, 'plugin' = 'agg', 
 'out
 put' = 'text', 'case' = 'Models'), $outClassName = ???, $outSourceFile = 
 ???) C:\work\zend\cake\Cake\TestSuite\CakeTestSuiteCommand.php:80
 0.39626485512   9. is_file(array ('core' = FALSE, 'app' = FALSE, 
 'plugin' = 'agg', 'output' = 'text', 'case' = 'Models')) C:\Program 
 Files (x86)\PHP\PEAR\PHPUnit\Util\
 Skeleton\Test.php:109


 Variables in local scope (#8):
   $inClassName = 'All model tests'
   $inSourceFile = array ('core' = FALSE, 'app' = FALSE, 'plugin' = 
 'agg', 'output' = 'text', 'case' = 'Models')
   $outClassName = ''
   $outSourceFile = ''
   $possibleFilename = *uninitialized*
   $possibleFilenames = *uninitialized*
   $reflector = *uninitialized*

 Error: Array could not be opened.
 #0 C:\work\zend\cake\Cake\TestSuite\CakeTestSuiteCommand.php(80): 
 PHPUnit_Util_Skeleton_Test-__construct('All model tests', Array)
 #1 C:\work\zend\cake\Cake\Console\Command\TestShell.php(274): 
 CakeTestSuiteCommand-run(Array)
 #2 C:\work\zend\cake\Cake\Console\Command\TestShell.php(259): 
 TestShell-_run(Array, Array)
 #3 C:\work\zend\cake\Cake\Console\Shell.php(395): TestShell-main()
 #4 C:\work\zend\cake\Cake\Console\ShellDispatcher.php(201): 
 Shell-runCommand('agg', Array)
 #5 C:\work\zend\cake\Cake\Console\ShellDispatcher.php(69): 
 ShellDispatcher-dispatch()
 #6 C:\work\zend\cake\Cake\Console\cake.php(43): ShellDispatcher::run(Array)
 #7 {main}

 --

 Now I ran this under the debugger and found that the problem appears to be 
 in CakeTestSuiteCommand on line 77.

 $skeleton = new PHPUnit_Util_Skeleton_Test(
 $suite-getName(),
 $this-arguments['testFile']
 );

 PHPUnit_Util_Skeleton_Test is expecting the second parameter to be a 
 string, but Cake is using an array.

 Here's what the array holds.

 $this-arguments['testFile'] = array(
   'core'=false,
   'app'=false,
   'plugin'='agg',
   'output'='text',
   'case'='Models'
 )

 I don't know what to do to fix this. Is this a bug in Cake, or am I not 
 configuring the test correctly.

 I also tried to run this Suite via the Web but get the same error message.

 Please help.




-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Associated model object not linked during model test.

2013-01-17 Thread Mathew
Hi,

If I have a hasMany association for my plugin's model, then it's not being 
linked to the model during execution of a test.

class User extends AggAppModel
{ 
   public $name = 'User';
   public $hasMany=array('Agg.Profile');
   public function doSomething()
   {
   $this-Profile-find('all');
   }
}


The $this-Profilefind(..) will cause a member function find() on a 
non-object. In the debugger for $this it has no associated model object 
attached to it.

Why?

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: Associated model object not linked during model test.

2013-01-17 Thread Mathew
I got it to work.

Needed to use 'className' in the association options as 'Agg.Profile'.

On Thursday, 17 January 2013 18:19:18 UTC-5, Mathew wrote:

 Hi,

 If I have a hasMany association for my plugin's model, then it's not being 
 linked to the model during execution of a test.

 class User extends AggAppModel
 { 
public $name = 'User';
public $hasMany=array('Agg.Profile');
public function doSomething()
{
$this-Profile-find('all');
}
 }


 The $this-Profilefind(..) will cause a member function find() on a 
 non-object. In the debugger for $this it has no associated model object 
 attached to it.

 Why?


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: PHPUnit_Util_Skeleton_Test not found in CakePHP

2013-01-16 Thread Mathew
Is there any official information from CakePHP on what version of PHPUnit 
should be used with Cake 2.2.5?

On Wednesday, 16 January 2013 09:21:34 UTC-5, jsundquist wrote:

 Looks like you got your answer.


 http://stackoverflow.com/questions/14348318/phpunit-util-skeleton-test-not-found-in-cakephp


 On Tue, Jan 15, 2013 at 9:34 PM, Mathew nfosc...@yahoo.com 
 javascript:wrote:

 I'm able to run my individual tests for each model in a plugin called 
 Agg, but when I try to run a CakeTestSuite, then I get an error.

 class ModelsTest extends CakeTestSuite
 {
 public static function suite()
  {
 $suite = new CakeTestSuite('All model tests');
 $suite-addTestDirectory(TESTS . 'Case' . DS . 'Model');
  return $suite;
 }
 }

 Running that suite generates this error.

  Fatal error: Class 'PHPUnit_Util_Skeleton_Test' not found in 
 C:\work\zend\cake\Cake\TestSuite\CakeTestSuiteCommand.php on line 77

 I'm using PHP 5.3.15 and have PHPUnit 3.7.12 installed with CakePHP 2.2.5

 I get this error when running tests both via the web and the CLI.


 If I search for 'PHPUnit_Util_Skeleton_Test' in PEAR folder for PHPUnit 
 it's not found. This seems strange to me. Am I using the wrong version of 
 PHPUnit? When was this class introduced?

 It seems that this class is no longer used in PHPUnit 3.7.x, and I'm 
 wondering if CakePHP 2.2 will only work with PHPUnit 3.6. I tried to 
 uninstall the pear package, and then install the 3.6.x version but always 
 installs the newest version. Any ideas on how to downgrade PHPUnit?

 Downgrading using the --force to install older versions of PHPUnit didn't 
 resolve the problem. I tried 3.6.12, 3.6.5 and 3.5. With the 3.6.12 I got 
 an error with is_file() somewhere in the PHPUnit code.

 Any help would be appreciated.

 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
  
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To post to this group, send email to cake...@googlegroups.comjavascript:
 .
 To unsubscribe from this group, send email to 
 cake-php+u...@googlegroups.com javascript:.
 Visit this group at http://groups.google.com/group/cake-php?hl=en.
  
  




-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




PHPUnit_Util_Skeleton_Test not found in CakePHP

2013-01-15 Thread Mathew
I'm able to run my individual tests for each model in a plugin called Agg, 
but when I try to run a CakeTestSuite, then I get an error.

class ModelsTest extends CakeTestSuite
{
public static function suite()
{
$suite = new CakeTestSuite('All model tests');
$suite-addTestDirectory(TESTS . 'Case' . DS . 'Model');
return $suite;
}
}

Running that suite generates this error.

 Fatal error: Class 'PHPUnit_Util_Skeleton_Test' not found in 
C:\work\zend\cake\Cake\TestSuite\CakeTestSuiteCommand.php on line 77

I'm using PHP 5.3.15 and have PHPUnit 3.7.12 installed with CakePHP 2.2.5

I get this error when running tests both via the web and the CLI.


If I search for 'PHPUnit_Util_Skeleton_Test' in PEAR folder for PHPUnit 
it's not found. This seems strange to me. Am I using the wrong version of 
PHPUnit? When was this class introduced?

It seems that this class is no longer used in PHPUnit 3.7.x, and I'm 
wondering if CakePHP 2.2 will only work with PHPUnit 3.6. I tried to 
uninstall the pear package, and then install the 3.6.x version but always 
installs the newest version. Any ideas on how to downgrade PHPUnit?

Downgrading using the --force to install older versions of PHPUnit didn't 
resolve the problem. I tried 3.6.12, 3.6.5 and 3.5. With the 3.6.12 I got 
an error with is_file() somewhere in the PHPUnit code.

Any help would be appreciated.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: CakePHP TestSuite and ZendStudio v9

2013-01-14 Thread Mathew
I too am stuck on how to do this. Were you able to figure this out?

On Friday, October 26, 2012 7:32:28 AM UTC-4, Tokeiito wrote:

 Hello,

 I'm stuck on configuring phpUnit bootstrap for running cakephp unit test 
 in Zend Studio 9. Any advice on how to accomplish this is more than 
 welcome..

 ---

 Respectfully,

 Darius Tumas


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Auth not redirecting for scaffold admin pages

2009-08-20 Thread Mathew

Hi,

I have a major security problem with CakePHP. For some reason the Auth
component is not redirecting the browser to the login page for admin
pages when the page is rendered with scaffolding. Other admin pages
for controller actions are being redirected.

I am using CakePHP version 1.2.1.8004.

All my controllers allow access to admin routed pages, but I never
called Auth-allow(..) for those admin actions. Other custom admin
actions such as admin_myaction() are redirected to the login page.

Please help... I don't know where to look to fix this.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: Auth not redirecting for scaffold admin pages

2009-08-20 Thread Mathew

function startup($controller) {
$isErrorOrTests = (
strtolower($controller-name) == 'cakeerror' ||
(strtolower($controller-name) == 'tests'  
Configure::read()  0)
||
!in_array($controller-params['action'], 
$controller-methods)
);
if ($isErrorOrTests) {
return true;
}

What the hell???

This is from the Auth component. It skips auth startup if the action
is not a method in the controller.

Appears this is fixed in the latest version.

On Aug 20, 9:48 am, Mathew nfoscar...@yahoo.com wrote:
 Hi,

 I have a major security problem with CakePHP. For some reason the Auth
 component is not redirecting the browser to the login page for admin
 pages when the page is rendered with scaffolding. Other admin pages
 for controller actions are being redirected.

 I am using CakePHP version 1.2.1.8004.

 All my controllers allow access to admin routed pages, but I never
 called Auth-allow(..) for those admin actions. Other custom admin
 actions such as admin_myaction() are redirected to the login page.

 Please help... I don't know where to look to fix this.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: Is this a major bug in Cake 1.2.1 stable?

2009-02-23 Thread Mathew

 You don't say how the requestAction fails. What is the error you get?

I found that the requestAction method works if caching is disabled,
but when caching is enabled requestAction will return the contents of
the /tmp/cache/views/home.php rather then calling the controller's
action.

So there is no error but the view is rendered but has the contents of
home.php inserted into where the requestAction is called. This seems
to only work under these circumstances.

1) Caching must be enabled.
2) The /tmp/cache/views/home.php file must exist.
3) requestAction must be called with an array

When I debug the view I find that the call to the requestAction does
not return. Cake renders the contents of home.php and then exists.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Is this a major bug in Cake 1.2.1 stable?

2009-02-22 Thread Mathew

$categories = $this-requestAction(array
('controller'='documents','action'='request_categories'));
$categories = $this-requestAction('/documents/request_categories');

The first line will fail, but the second line will work.

Look in the dispatcher.php on line 111

if (is_array($url)) {
$url = $this-__extractParams($url, $additionalParams);
$parse = false;
}

Now look at the function __extractParams on line 270.

This function has no return failure. It has been commented out.

I found this in Cake 1.2.1.8004 build.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: Upgrade to Cake 1.2.1 stable problems

2009-02-01 Thread Mathew

Yes, its dynamic.

It seems that in the 1.2 stable that HABTM for a model will always
create a default model for the join table unless the join table is
listed first in the uses for the controller.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Upgrade to Cake 1.2.1 stable problems

2009-01-31 Thread Mathew

Hi,

I was running Cake 1.2.0.7692 RC3 with a model that has a $belongsTo
from the PortfolioTag table to the Portfolio table. I could run this
Find statement.

$count = $this-$documentsTagsModel-find('count',array
('conditions'=array('tag_id'=$tagRecord
['id'],'published'=1,'front_page'=1),'recursive'=2));

And it out generate this SQL statement.

SELECT COUNT(*) AS `count` FROM `portfolio_tags` AS `PortfolioTag`
LEFT JOIN `portfolio` AS `Portfolio` ON (`PortfolioTag`.`portfolio_id`
= `Portfolio`.`id`) LEFT JOIN `tags` AS `Tag` ON
(`PortfolioTag`.`tag_id` = `Tag`.`id`) WHERE `tag_id` = 1 AND
`published` = 1 AND `front_page` = 1

After upgrading to Cake 1.2.1 Stable the same Find generates this SQL
statement which missing the LEFT JOIN so it fails.

SELECT COUNT(*) AS `count` FROM `portfolio_tags` AS `PortfolioTag`
WHERE `tag_id` = 7 AND `published` = 1 AND `front_page` = 1

How do I fix this?

Changing the recursive value for the find doesn't seem to fix the
problem.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: Upgrade to Cake 1.2.1 stable problems

2009-01-31 Thread Mathew

Looks like they have changed HABTM so that it calls new AppModel for
the join table. Even if a model exists that is of the same name as the
join table. So if I list the HABTM table and the join table in my uses
for the controller, then it will not load the associations for the
join model.

Is this a bug?

I might be able to work around this by renaming my join model to
something else, but then it no longer follows the Cake naming
convention.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: Create html files dynamically

2009-01-24 Thread Mathew

CakePHP is a MVC framework for PHP developers.

You might be better off with something like Joomla. It has a pre-built
admin section, allows you to define categories and publish documents.

http://www.joomla.org

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: Can i compile the PHP webpage instead of leaving the source code on the server?

2009-01-05 Thread Mathew

Use the Zend Optimizer as it also makes your code run faster. It
converts your source code into byte code which is the same approach as
the Java compiler. There are decompilers that can revert the code back
into text, but the context of how everything works and all the source
code comments are lost.

If your trying to protect an algorithm then you could store the source
code for the algorithm in a text file that is encrypted with a key
from a license file. Design your license file to include the Mac
address. That should be good enough for most cases. They would have to
crack your encryption, the license file and decompile the source code.

As part of your sales agreement restrict users from using a
decompiler, and add a clause to recover personal damages if they
attempt to reverse engineer your software.

Also, there are more C decompilers out there then there are
decompilers for Zend Optimizer.

Even if you used Python, Java or .NET your going to have the same
challenges.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: new benchmarks of PHP frameworks

2009-01-02 Thread Mathew

 Benchmark testing should be done with non-trivial code, and given these
 frameworks abstract databases, and that abstraction can affect
 performance, it should probably include tests that include database access.

I agree.

We don't know if the tester tried a business application, then saw his
framework performed poorly and then changed the terms of the test so
that his framework would perform best.

A business application such as a blog would best represent the
performance people are looking for.

Also, with the cost of hardware dropping everyday. A framework
designed purely for performance will become outdated as other more
complex slower frameworks offer better features and return on
development costs.

A well designed framework no matter how slow its internals can be
improved without affecting the functionality of the application the
framework is driving. Something that the Cake team can address with
maintenance releases to address performance.

With all that said, I do believe Cake is one of the slower frameworks.
The extensive use of for/loops during dispatching and rendering of
views has to impact performance, but the level of performance impacted
depends on the implementation of the website.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: new benchmarks of PHP frameworks

2009-01-02 Thread Mathew

 For most people making such apps the speed of the dispatcher, template
 engine etc is unimportant. The parts slowing the app would be heavy
 SQL, SOAP/XML-RPC-request to other apps or huge batch ETLs.  For most
 people (including most public websites) the most important thing would
 be faster SQL/active records and a better implementation of HABTM
 joins, not the ability to serve x or y pages per sec.

Very well put.

Cake is a developers framework.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: new benchmarks of PHP frameworks

2009-01-02 Thread Mathew

I would love to develop my own website where performance was an
issue! :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



calling clearCache twice produces different results

2008-12-13 Thread Mathew

If I have view caching enabled and I have the following files.

news.php
news_find_something.php
news_find_something_page_2.php
element_news_something.php
documents_find_news_page_4.php

If I call clearCache('news') the news.php file is deleted but the
other files remain.

If I call it again a second time then all the files with the word news
are deleted.

The clearCache function should not produce different results when
called with the same parameters.

The other problems is that the clearCache will delete any cached file
with the word news in it, but only after being called a second time.
For example; documents_find_news_page_4.php was also deleted.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: Sanitize::html replacing newlines with literal \n

2008-12-04 Thread Mathew

Sanitize::html does not call stripWhitespace().

Sanitize::html replaces special characters with html escaped
characters, but I believe it leaves \n alone since the backslash does
not need escaping in html.

I am able to sanitize my data while retaining the new line character.
The only problem I've had is that the SQL cleaner adds an extra
backslash but otherwise it works fine for me.

$this-data['Document']['comments'] = $this-cleaner-html( $this-data
['Document']['comments'], true );
$this-data = $this-cleaner-clean( $this-data );
$this-data['Document']['comments'] = str_replace(\\n,br/,$this-
data['Document']['comments']);

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



Re: Adding https in $html-url

2008-12-04 Thread Mathew

Hi Jipson,

I'm not sure exactly but I think you can define the protocol to the
router in cake like this.

?=$html-url(array('base'='https://','url'='/carts/authorize'));?

You can also do this with cake controllers.

?=$html-url(array
('base'='https://','controller'='carts','action'=authorize'))?

I think base just tells the router that string should be at the
start of the URL. So you could also make it anything like base=/
beta which would return /beta/carts/authorize.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: session lost when switching from http to https, vice versa, in cakephp rc3

2008-12-04 Thread Mathew

Hi Robert,

I've never done what you have done, but I'm sure it's possible because
most people do shopping carts this way.

The problem might be that Cake is switching to secure cookies when it
finds the current URL is using HTTPS. The cookie is used to store the
session ID and when the switch to secure cookies happens maybe Cake
can't find the insecure cookie and starts a new session.

I'm not sure if Cake supports this? You might have come across a bug.

You might have to pass the session ID in the URL when switching from
HTTP to the HTTPS and then use that ID in the HTTPS session to recover
the old session.

Here are the methods for getting and setting the session ID.

$session-id() will return the current session ID.
$session-id($id) will set the session ID.

The other work around is to comment out the code in Cake that switches
to secure cookies.

if ($ini_set  env('HTTPS')) {
ini_set('session.cookie_secure', 1);
}

I only recommend this if you know for sure you don't need secure
cookies. I also don't know if this is a wise security thing to do.

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



Re: Sanitize::html replacing newlines with literal \n

2008-12-04 Thread Mathew

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



Re: Sanitize::html replacing newlines with literal \n

2008-12-04 Thread Mathew

That function is not called from Sanitize::html()

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



Re: Sanitize::html replacing newlines with literal \n

2008-12-04 Thread Mathew

If you read my post further up from today. I already posted the source
code that resolves your problem.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Parameter passing in URL

2008-11-25 Thread Mathew

Hi Daniel,

You need to then add the ID as a hidden input for the form. This way
the value of the ID is included in the posted data, and any validation
attempts.

After a successful form entry the controllers action would perform a
redirect to insert the ID back into the URL.

function post()
{
  if(!empty($this-data))
  {
 
 $this-redirect('/somewhere?id='.$this-data['Model']['id']);
  }
}

On Nov 25, 8:27 am, Daniel Süpke [EMAIL PROTECTED] wrote:
 Hi Mathew,

 thanks for the help (and sorry for the delay in answering). That's a
 good idea and I followed your advise, but still one problem persists:
 If, in step 3 there is something wrong in validation, cake will return
 to the form again. But now, the ID is no longer in the URL, so there is
 an error about that.

 I think, passing a parameter along the URL is a pretty common task,
 isn't it? There should be more support for that in cake. For example, if
 I add it to the form action (helper), cake gets all confused about it.
 Yet, that would be the simplest solution.

 Best Regards,
 Daniel Süpke

 Mathew wrote:
  Hi Daniel,

  You want to include the ID in the URL so that it persists when
  bookmarked, and using a session doesn't provide that feature.

  I understand what your trying to do, but the form action does not
  require the ID to be included, because posted form requests first
  require an HTML page to display the form.

  Let me example.

  1) User follows a link with the ID.
  2) HTML with the form is shown in the browser, with the ID in the URL.
  3) User enters form data, and submits the form.
  4) A response from the server is shown to the user.

  In step #2 when the form is displayed. You should take the ID from the
  URL and add it as a hidden field in the form.
  In step #3 the action that handles the form request does not need the
  ID in the URL because it will be in the posted data.
  In step #4 as part of the response you redirect the user to a URL that
  contains the ID.

  Also.

  I would create a simple Helper object for your views. Not one that
  creates an HTML link, because Cake comes with Form and Html helpers to
  do that. All you need to do is modified a Router array to include the
  ID

  for example;

  $html-link('Somewhere',$myhelper-
  id(array('controller'='documents','action'='show')));

  You create a helper called Myhelper, and add a function called id
  that injects your ID from the URL into the array. Now you can call all
  various helper objects that require routed links.

  I think you can inject the ID as a get request like this (I can't
  remember how to handle gets with params, but I think its like this)

  function id( $arr )
  {
    $arr['?'] = array('id'=$this-params['id']);
  }

  That should provide Html that looks like this in your view

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



Re: Display image, random -- not loading?

2008-11-21 Thread Mathew

Hi Louie,

If the URL pointing to the image remains the same then the web browser
will cache the image on the client side. Each time the page is
displayed the image will not change unless the client refreshes the
page or clears their cache.

You can fix this problem by adding a unique value to the URL. For
example; http://www/about/background/12345, where the 12345 is the
current time.

You have not stated the reason for your approach. If you are trying to
randomize the background image for a website your working on, then
this business logic should most likely be placed in the view. I don't
see any reason to create a controller?

Also, you should add $this-autoRender = false to your action.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: CakePHP: How to remove LEFT JOIN in updateAll()

2008-11-12 Thread Mathew

I've had the same problems with updateAll.

I can't remember if setting the recursive to -1 solved the problem.

$this-controller-FilesFolders-recursive = -1;

If that doesn't work you can call unBind.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: acess url only from email

2008-11-12 Thread Mathew

I'm a little confused as to what your really trying to do, but I think
I understand.

You want to do e-mail activation while preventing an intruder from
stealing the authentication URL which identifies the target user's e-
mail address that was used to authenticated.

I hope that makes some sense?

The only way to do this is to force the user to authenticate during
the duration of a session. When they request that their e-mail address
be authenticated you send them an e-mail, with the users ID in the
URL, when the user receives the e-mail they follow the URL, and
authentication is performed with data in the session, and not a hashed
key.

I've seen online Banks do things like this.

This only works for users who's e-mail will allow the delivery of the
e-mail within the duration of a session, and who are given clear
instructions that the session must be maintained to complete
authentication.

Any users who end the session during this process will have to request
a new activation e-mail.

This solves the problem of the intruder or the user sharing the e-mail.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Does Cake issue a HTTP 404 status code for missing pages.

2008-11-09 Thread Mathew

 Yeah it does.but does it matter if you are online or off?

It doesn't matter, if your connecting to localhost the response codes
will be the same.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Unable to disable serializing for view caching. Please help.

2008-11-07 Thread Mathew

I have configured my siting using the core.php options as follows:

Configure::write('Cache.disable', false);

Configure::write('Cache.check', true);

Cache::config('default', array('engine' = 'File','duration'= 3600,

'probability'= 100,'path' = '/cake_tmp','prefix' =
'mathew3d_','lock' = false,serialize' = false));

Caching works but not as I was expecting.

When I visit my website files are created in the /cake_tmp/cache/views
folder.

For the action home there is a file called home.php, but it does
not have the prefix mathew3d_ in the file name.

The file size for the home.php is very large and when I view the
contents it is clearly serializing all the variables at the top of the
cached file. Where as I have it disabled. If I edit the contents of
the file and delete all the php code at the top of the file. I reduce
the file size by 80% and the speed of viewing that page greatly
improves.

I need help fixing this.

How can I disable serializing for view caches? which is most
important.

The prefix name missing only concerns me that Cake isn't using my
configuration.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Unable to disable serializing for view caching. Please help.

2008-11-07 Thread Mathew

I am now completely confused as to what the Cache::config option in
the core.php file does, because I've been looking at how the views are
cached. It appears none of the Cache::config options are used. The
Cache.check is the only option the controls view caching.

Maybe someone can explain what the File caching engine does, why would
you want to use it and yes I have read the manual on caching.

I was able to reduce the size of the cached files, and improved the
load times of my pages by adding the following to the bottom of my
default layout.

?php
// reduce the size of cached views.
$this-helpers = array();
$cache-data = array();
$cache-params = array();
?

Now it will no longer try to load countless helpers not being used by
the view.
It won't load large amounts of serialized data that won't be used by
the view.
The params array was also a large chunk of data.

I could reduce the size of the cache more if it would remove html
comments, and compress the html.

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



Re: Search Engine Bots Generating Strange Queries

2008-11-06 Thread Mathew

Hi Mike,

If your using Apache it has some features in the htaccess file that
will allow you to disable access to your server for bots causing you
trouble.

In your Cake 404 display page keep track of the number of times a 404
is generated per IP address, and if it exceeds a threshold log that IP
address to a text file.

Humans browsing a website will not generate many 404 messages, even if
they have bad bookmarks, or follow old links from search engines. So
an IP address requesting more then one hundred 404 errors is likely a
problem bot. Each time a 404 page is display log the IP to a database
with a counter. When the counter reaches your limit add that IP
address to a text file.

In your .htaccess you can load this text file of IP addresses and
apply rules to those addresses. It's up to you if you wish to display
a static access denied Html page, or simply throw a connection
refused.

Sorry I don't remember the commands for the htaccess file.


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



Re: Search Engine Bots Generating Strange Queries

2008-11-06 Thread Mathew

 I'd actually say using a permanent redirect (301, I believe) to your
 root (or that controller's index), rather than to the 404 page might
 be a better solution.  If your users/visitors won't see it since
 you're not linking to it, it isn't really a bad solution, and I doubt
 you'd want any search engines indexing 404 errors in association with
 your site/domain.  If it was a hacker, I don't think I'd send them a
 404 message either, I'd just redirect them...if it was a Safari user,

You should not redirect unless the content has been moved. Sending the
wrong response codes to incorrect URIs makes it difficult for web
crawl operators to correctly crawl your site. Should a web crawl
operator come to the conclusion that your site provides incorrect
response codes, then they might choose to crawl it aggressively since
the server's responses can not be trusted.

Indexing bots will not index a 404 response code from the Http header.
That response code tells the bots the URI points to no content. Bots
will only index pages when the 404 error message is sent with a Http
200 response code and a text/html content-type in the header, which is
incorrect and more of an error on the server side then a problem with
the bot.

If you send a 301/302 response code you are telling the bot, this URI
is valid, it has been moved, now the source URI and the redirected URI
will continue to be processed by the bot. Where as if you tell the bot
404, then the bot knows this URI is invalid, the source page that URI
comes from is generating invalid URIs, and it can drop other URIs from
that source.

Sending a hacker a 301, 302 does nothing to change their behavior, and
provides them no extra information then a 404.

Blocking a remote computer from making to many invalid requests from
your server does change the behavior of that remote computer. It stops
it. Which is about all you can do at this point. A hacker will return
with a different IP address, and attack. So, hackers are a completely
different topic :)

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



Re: Search Engine Bots Generating Strange Queries

2008-11-06 Thread Mathew

Most web crawlers won't check a 404, because of the way servers send
Http responses.

When a crawler requests a page that is missing, it first receives the
header response from the request, and it can read the response code,
content-type, and other information. The web crawler can then stop the
download of the content after it has checked the response code,
reducing the bandwidth placed on the server, and reducing time the web
crawler is spending on missing content. If a redirect response is
sent, then the crawler must make another request to the server and
will download the entire content of a page that does not reflect the
source url. The web crawler will see a 200 response code on the new
URI, download all the content, and increase the time and bandwidth
spent crawling that domain.

But I understand what your saying Brendon about it being a design
choice. I'm just not sure traversing the URL path improves the
visitors usability of the website their visiting. Once they step up to
an invalid URI they will be redirected somewhere else, which would
stop the traversal of the URL.

Here's CNN as an example.

http://edition.cnn.com/2008/POLITICS/11/06/middle.east.peace.deal/index.html
http://edition.cnn.com/2008/POLITICS/11/06/middle.east.peace.deal
http://edition.cnn.com/2008/POLITICS/11/06
http://edition.cnn.com/2008/POLITICS/11
http://edition.cnn.com/2008/POLITICS
http://edition.cnn.com/2008

While these links will produce a 404 response and display Html. A web
crawler will not download the content after it has rejected the
response code in the header of the Http response. So the most
bandwidth load placed on the server is a few bytes per bad URI.

This makes your domain crawler friendly, but a friendly crawler would
not request phantom URIs.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Search Engine Bots Generating Strange Queries

2008-11-06 Thread Mathew

Another reason not to use redirects for missing URIs is that you could
mistakenly create what is called a crawler trap.

A crawler trap are URLs that keep changing but keep producing the same
content. The crawler gets stuck wasting its time download the same
page, because it can't tell by the URL that the content is the same.

While good crawlers have logic to prevent this problem from happening.
Your site could be flagged as poorly structured, and commercial
crawlers will avoid indexing your content.

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



Re: Parameter passing in URL

2008-11-05 Thread Mathew

Hi Daniel,

You want to include the ID in the URL so that it persists when
bookmarked, and using a session doesn't provide that feature.

I understand what your trying to do, but the form action does not
require the ID to be included, because posted form requests first
require an HTML page to display the form.

Let me example.

1) User follows a link with the ID.
2) HTML with the form is shown in the browser, with the ID in the URL.
3) User enters form data, and submits the form.
4) A response from the server is shown to the user.

In step #2 when the form is displayed. You should take the ID from the
URL and add it as a hidden field in the form.
In step #3 the action that handles the form request does not need the
ID in the URL because it will be in the posted data.
In step #4 as part of the response you redirect the user to a URL that
contains the ID.

Also.

I would create a simple Helper object for your views. Not one that
creates an HTML link, because Cake comes with Form and Html helpers to
do that. All you need to do is modified a Router array to include the
ID

for example;

$html-link('Somewhere',$myhelper-
id(array('controller'='documents','action'='show')));

You create a helper called Myhelper, and add a function called id
that injects your ID from the URL into the array. Now you can call all
various helper objects that require routed links.

I think you can inject the ID as a get request like this (I can't
remember how to handle gets with params, but I think its like this)

function id( $arr )
{
  $arr['?'] = array('id'=$this-params['id']);
}

That should provide Html that looks like this in your view

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



Re: media view with files on different server

2008-11-05 Thread Mathew

He's asking how to define the path to the file as absolute rather then
relative to the app folder.

Which you can't because the MediaView.php file is hard coded to
compute the path as follows.

$path = APP . $path . $id;

There are two ways to resolve this problem.

1) Change the MediaView.php file as you see fit.
2) Create link in your app folder to the other mounted server.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Returning a model variable

2008-11-04 Thread Mathew

class Document extens AppModel
{
  var $foo;

  function afterSave()
  {
.
$foo = something;
  }
}

in your controller

$this-Document-save($data);
echo $this-Document-foo;
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Another pagination problem

2008-11-03 Thread Mathew

You have to add the query to the pagination helper by calling
$paginator-options(...)

In your controller you're using a POST to get the search query. I
recommend changing this to a GET so that it can be passed to other
pages as part of the URI

I do paginated search using a get like this /controlller/action?
q=search_term

I can then pass this to the paginate helper like this inside the view.

$paginator-options(array('url' =array('?'='q='.$this-params['url']
['q'])));

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



Model-updateAll ignores ORDER and LIMIT

2008-11-01 Thread Mathew

Hi,

I'm having some troubles updating records. I need to be able to define
the ORDER and LIMIT for the update, but the method updateAll appears
to only accept conditions.

updateAll is created the LEFT JOIN statements for my other models, but
i need to only update the first 100 records ordered by field value.

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



Re: Named parameter routing does not work with pagination(bug or feature?)

2008-11-01 Thread Mathew

Hi Novice,

There are a couple of things here.

Router::connect('/users/:uid/friends/*', array('controller' =
'users','action' = 'friends'),array('pass'=array('uid')));

This is not a named parameter, because you are passing the argument
uid to the controller's action as a function argument.

The syntax :uid looks like a named parameter, but it is not a named
parameter. Named parameters must be registered with the Router using
the connectNamed method before defining your routes.

CakePHP comes with a collection of predefined named parameters. Such
as those found in the paginate helper.

Still, there is nothing wrong with your routing. To have paginate
generate router friendly URIs you need to tell it about the UID
arguments.

In your view add the following.

$paginator-options(array('url' =array('uid'=$this-
params['uid'])));

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



Re: Model-updateAll ignores ORDER and LIMIT

2008-11-01 Thread Mathew

Really, that's to bad. Good thing I'm using MySQL :)

Are there any helper classes for creating my own SQL statements?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Named parameter routing does not work with pagination(bug or feature?)

2008-11-01 Thread Mathew

Sorry, my mistake.

I forgot to tell you to remove the array('pass'=array('uid')) from
your routes, and then read the UID parameter from the $this-
params['uid'] in your Users controller Friends action.

function friends()
{
  $uid = $this-params['uid'];
}

You'll need to check if isset($this-params['uid']), because /users/
friends unless routed to a 404 will still call the same action without
a UID.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Model-updateAll ignores ORDER and LIMIT

2008-11-01 Thread Mathew

Thanks guys,

I figured out that MySQL doesn't allow order by and limit on an update
when there is a join. So I had to find another way.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Search Engine Bots Generating Strange Queries

2008-10-31 Thread Mathew

Hi Mike,

Disallowing that in your robots.txt is a waste of time.

The robots.txt file was started by Google, and is not an officially
supported feature of all crawlers. So they don't have to follow it,
and I can tell you this doesn't sound like the google bot anyway,
because that bot doesn't generate phantom URIs.

Web crawlers can extract URIs from many different sources, and they
can generate URIs as they see fit. URIs can come from HTML, CSS, SWF,
JavaScript, and form post/get actions. I've even seen crawlers submit
post requests to generate more URIs to crawl.

Crawlers will also clean URIs removing ids, changing queries, fake
cookies, and sometimes rotate their IP address.

There are no rules about crawlers, no guidelines they have to follow,
or limits on how long they will crawl or how aggressively they will
request URIs from your server.

You should modify your Routes to point to a 404 if they request paths
that you don't want them to see.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: PHPShop v2 is a cake app!

2008-10-29 Thread Mathew

 Mathew, your font blockiness appears to be a resolution dependent
 issue.  If you're not using your monitor's native maximum resolution,
 try setting it to that and see if the problem persists.  If it does
 not, there's probably little that Pablo could do; if it does, I'm not
 entirely sure...  :P

I think I understand what your trying to say, but the problem is
limited to the HTML page and no other windows or fonts give me this
problem.

I'm using this monitor

http://www.viewsonic.com/products/lcddisplays/xseries/VX2640w/

Running at the native 1920x1200 res.

It's also isolated to Firefox. I don't have the problem with other
browsers.

Is anyone else using Firefox, but getting different results then the
image I posted?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: PHPShop v2 is a cake app!

2008-10-29 Thread Mathew

Hi Brendon,

I think I might have an answer to what is happening with the font.

It appears that Windows does not come with the Lucida Grande font,
and that font is a standard Apple's font found on the Mac OS.

When I installed Safari from Apple on my Windows XP computer. That
browser installed the Lucida Grande font but there appears to be
compatibility problems with the font. While it renders fine in Safari
and IE it does not render correctly in Firefox.

Windows users who have Firefox and visit that page will see one of the
other fonts from the CSS, unless like me, they have installed Safari
from Apple on their computer, then it will render with the Lucida
Grande which is handled poorly on Windows.

I found some links that support my idea that this is a problem caused
by installing Safari, and not really a problem with the http://www.phpshop.org
website.

http://www.annehelmond.nl/2007/06/14/thoughts-on-safari-beta-for-windows-and-the-lucida-grande-font/

http://www.silverspider.com/2007/safari-font-rendering-on-windows/

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



How to filter a model that is using a hasMany?

2008-10-27 Thread Mathew

Hi,

Let's say I have the following models.

class User extends AppModel {
   var $name=User;
   var $hasMany=array('Document');
}

class Document extends AppModel {
   var $name=Document;
}

Now some Users have published documents, and some Users have not. So I
want to create a SQL condition that will only find all the Users who
have some Documents, but ignore Users who have none.

I can't figure out the condition for this. Everything I try produces a
SQL error.

$data = $this-User-find('all',array('conditions'=array()));
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to filter a model that is using a hasMany?

2008-10-27 Thread Mathew

The only thing I can think of is to have a field in User that I update
when adding Documents, and then filter on that field.

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



Re: How to filter a model that is using a hasMany?

2008-10-27 Thread Mathew

wow, thanks so much for the help!

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



Re: Model-cacheQueries should clear cache after updates.

2008-10-26 Thread Mathew

The caching that is controlled by the AppModel-cacheQueries setting.

If you perform a find, and then update or insert records, and perform
the same find again. You get the old outdated results.

I think all the cached queries for a model should be cleared if the
model is updated.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Does Cake issue a HTTP 404 status code for missing pages.

2008-10-26 Thread Mathew

Hi,

When Cake produces the 404 error page for missing pages. Does it send
a http/1.1 404 Not Found response code or does it send a http/1.1
200 OK response code?

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



Re: Does Cake issue a HTTP 404 status code for missing pages.

2008-10-26 Thread Mathew

Great, thanks.

I've seen some websites issue a 200 for missing pages, but say 404
in the HTML text.

So I thought I would just check if Cake was working correctly.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Disabling Cake's error handling for CLI commands.

2008-10-25 Thread Mathew

Hi,

I am working on some controller actions that can only be run from the
command line, and if there is a PHP error then cake dumps out error
messages wrapped in HTML. When you try to read these error message
from the command line it's impossible to see what the error was.

Is there a way to disable Cake's error handling, and just allow the
regular PHP error to be thrown?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Disabling Cake's error handling for CLI commands.

2008-10-25 Thread Mathew

I think I figured it out.

Adding the following to my Cake loader seems to work.

define('DISABLE_DEFAULT_ERROR_HANDLING', true);
define('CAKEPHP_SHELL', true);

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



Re: Hosting

2008-10-24 Thread Mathew

http://www.lunarpages.com

http://www.godaddy.com

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



Model-cacheQueries should clear cache after updates.

2008-10-24 Thread Mathew

Hi,

I am thinking that there should be an improvement in Cake so that
Model caches are cleared when ever an update or insert is performed.

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



Having problems with a model named Keyword

2008-10-24 Thread Mathew

It looks like Cake RC3 does not like models named Keyword.

class KeywordsController extends AppController {
var $name = 'Keywords';
var $scaffold;
}

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

Make a table named keyword, and then go to the URL 
http://www.example/keywords/index

You should see the scaffolding for that view, but it complains that
the variable $keywords doesn't exist and shows no data from the table.

If you renamed everything to Keyphrases it works just fine!

Here is another example of Keyword model problems in Cake RC3.

If your create try to use $hasAndBelongsToMany with a model named
Keyword then scaffolding will not show any records in the list of
Keywords for that record. The multi select editor will be empty.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Having problems with a model named Keyword

2008-10-24 Thread Mathew

You know, this is my fault.

Sorry guys, I didn't realize my that app_controller was setting a view
variable called keywords for use in the meta tags.

I wrote it so many months ago I guess I forgot about it.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: PHPShop v2 is a cake app!

2008-10-23 Thread Mathew

 I have honestly not given that idea much thought.  I mostly approached
 the development as if phpShop were the base application and that it
 would have it's own set of plugins to expand its functionality.  I
 would have to see how a plugin can have plugins...  Or how to have a
 similar ability to extend functionality.  If you have ideas or can
 point me in the right direction, please let me know.

If you redesign it to be a CakePHP plug-in then your addressing a much
smaller market, and that isn't healthy for the project.

What you should do is continue with what your doing, but add a
phpShopAPI and then develop a CakePHP plugin that uses that
phpShopAPI.

Now PHP developers can use your phpShopAPI, and Cake developers can
use the phpShopAPI plugin. While regular phpShop users can just use
the standalone application.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Render speed difference between 1.1 and 1.2

2008-10-23 Thread Mathew

On Oct 23, 10:30 am, Mark [EMAIL PROTECTED] wrote:
 But, I think we can agree that the welcome page taking 20 seconds to
 first render is not normal.

Why is it not normal?

The landing page is not there for performance testing, but to validate
your configuration of Cake. The fact that it takes long should imply
that it's doing more checks then the older 1.1, and that's a good
thing!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Does CakePHP support PDF as a view?

2008-10-23 Thread Mathew

I know there are PHP libraries out there that can convert HTML to PDF,
but I was wondering if it's possible to use Cake to convert rendered
views to PDFs?

I have a database that holds contents for documents, and a view that
renders those documents with customized options, but I need to archive
all the documents as PDF files.

I've had thoughts about a component that would take the output buffer
and convert that to a PDF, but I was wondering if this had already
been done somewhere with Cake before?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Render speed difference between 1.1 and 1.2

2008-10-23 Thread Mathew

Hi Mark,

http://dev.fortunecookieprojects.net/

I can't reproduce your problem of 20s load times, but my results are
as follows.

!-- 0.0856s --
!-- 0.5064s --
!-- 0.2641s --
!-- 0.556s --

I am wondering if you have a DNS problem for that domain. The first
time I requested the page it did take about 10 seconds to come up, but
HTML showed it rendered quickly. You might want to use nslookup to
query your DNS server, and see how it's resolving the IP address.

Also, can you put up a phpinfo() page so we can see which PHP
optimizers you have installed. My ISP runs with Zend and a few other
optimizers. I'm also wondering if your running it on a Windows server
(yuck!).

It's kind of a pain because you'll only get the reeeally long load
time after 15 minutes or so of the server being idle. You'll just have
to take my word for it!

Do you have SSH access to the server? Can you compare the results of
running TOP before and after.

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



Re: Render speed difference between 1.1 and 1.2

2008-10-23 Thread Mathew

 @Mathew
 Its not a windows server issue, as far as I'm aware the machines are
 running debian

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



Re: PHPShop v2 is a cake app!

2008-10-22 Thread Mathew

Hi Pablo,

http://fxwars.mathew3d.com/images/webpage.jpg

That's how the page renders for me. You can see the smaller text on
the side menu, and footers is hard to read. The rest is kind of
blocky.

I'm using Firefox 3.0.3 on Windows XP.

When I render the page using IE 7.0, and Safari 3.1.2 it looks fine.
Maybe the font your using doesn't come with Firefox.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: CakePHP performance issue.

2008-10-22 Thread Mathew

Just because the CPU is running at a 100% does not at all mean the CPU
is overloaded.

All it means is that there is one or more threads executing
continuously on all CPUs.

You have no way of know what that means for HTTP response times.

100% CPU usage for any Linux daemon is perfectly normal if that daemon
is busy. Since your hitting the server hard running automated tests
one would expect to see 100% CPU usage.

CPU usages and server load are not the same thing.

You need to make judgments based upon the HTTP response times, and not
worry about thread activity, because visitors will only know how long
it takes their browsers to get an HTTP response.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: PHPShop v2 is a cake app!

2008-10-21 Thread Mathew

Anyone else have problems reading their font? I'm using Firefox 3.0,
and the font on their site is terrible. It's blocky and hard to read.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Using Plugin Helpers in Regular Controllers

2008-10-21 Thread Mathew

 var $helpers = array('Monkey.island');

I think it's case sensitive.

var $helpers = array('Monkey.Island');

And your file path /app/plugins/monkey/island.php should be all
lower case.

I've not had problems with Cake loading helpers from plugins. It works
for me.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: App::Import and Model

2008-10-21 Thread Mathew

 Also, regarding using $uses.  There is no model for the controller,
 therefore $uses=null.  I'm of the understanding that if I add even
 one model to the $uses list, I must add all, including the
 controller's model, which there isn't one.  That is the reason for
 keeping uses as null, and App::Import to bring in an external model.

There are no rules that says a Controller must have a Model of the
same name, or rules that says a Controller has to have models either.

var $uses=array('Category');

That line saves you time, because you don't have to do what your
doing.


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



Re: Pagination link URL doesn't work with extra variable

2008-10-19 Thread Mathew

 Router::connect('/:location/spots/:page', array('controller' =
 'spots', 'action' = 'index'), array('pass' = array('location'),
 'location' = '[a-z]+'));

Your router should be like this.

Router::connect('/:location/spots/*, array('controller' ='spots',
'action' = 'index'), array('pass' = array('location'),'location' =
'[a-z]+'));

You also need to add the location as an option for pagination in your
view. So that it includes it when creating the URLs.

$paginator-options(array('url' =array('location'=$this-
params['location])));

If you don't have the location added as an option, then the Router
will not match it to your URL pattern, and you need to have the wild
character at the end of your connect URL, because pagination generates
many types of parameters. Such as page, sorting, and field.

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



Nested belongsTo doesn't work for plugins.

2008-10-18 Thread Mathew

Hi,

Can anyone else reproduce this problem? I'm thinking of reporting it
as a bug.

Assuming that these three models exist in a plugin called Gems. I
get an error of Database table servey_questions for model
ServeyQuestion was not found. when trying to find a SurveyContact
record. But it should be looking for servey_questions it should be
looking for gems_servey_questions.

Looks to me that Cake is ignore the plugin path for the belongsTo
reference, but it sees the plugin path for the hasMany. So I'm
thinking its a nesting problem.

class SurveyContact extends GemsAppModel
{
var $name='SurveyContact';
var $useTable=gems_survey_contacts;
var $order='SurveyContact.created ASC';

var $hasMany=array('Gems.SurveyAnswer');
}

class SurveyAnswer extends GemsAppModel
{
var $name='SurveyAnswer';
var $useTable=gems_survey_answers;
var $order='SurveyAnswer.created ASC';

var $belongsTo=array('Gems.ServeyQuestion');
}

class SurveyQuestion extends GemsAppModel
{
var $name='SurveyQuestion';
var $useTable=gems_survey_questions;
var $order='SurveyQuestion.order ASC';
}
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Nested belongsTo doesn't work for plugins.

2008-10-18 Thread Mathew

stupid me.

I just figured out that I spelled SurveyQuestion wrong.

Sometimes the auto model creation can be more of a pain, because I
never work on a site where I don't create model classes.

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



Re: Auth: deleted user still logged in

2008-10-17 Thread Mathew

This is a security issue, and not an identity authentication issue.

The Auth component is designed to make it easy to confirm someone's
identity, but not to manage security or permissions for a website. You
could use ACL or do it yourself.

Anytime a user does something that requires a level of security you
should always perform a security check to see if that user has
permissions, and not rely on session data or cookies to cache those
permission rights.

Deleting a user from the Auth database is nothing more then erasing
all history of that user's identity and every association will be
broken. If they created documents, comments, or tasks that are linked.
How will you know that user xxx was deleted?

I would recommend adding a field to your user table called role, and
changing that role field to disabled. Every action a user can
perform should be verified that their role hasn't changed.

In your AppController in the beforeFilter method you should do the
following.

$this-Auth-authorize = 'controller'

This will tell the Auth component to call isAuthorized for every
request to see if the user can perform the current action in a
controller.

It's in this method that you should look up the current user's role
from the database, and make sure it's not equal to disabled. If it
is then you should perform a redirect to a message page explain their
access has been restricted, and include information about why and who
they should contact.

For example, in my controller only users with the role of
administrator can access admin pages.

/**
 * Called by the Auth component to check if the user has access to
the
 * current action.
 */
function isAuthorized()
{
// Check if the params contains the key admin
if (isset($this-params[Configure::read('Routing.admin')]))
{
if ($this-Auth-user('role') !== 'admin')
{
return false;
}
}
return true;
}

Now, my method uses the session information to validate the role.
Which is fine for my website, but if you want real time status you can
perform a simple find on the User table yourself.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Move existing app to Subversion

2008-10-15 Thread Mathew

 I found a decent document online and did an import and it's working
 great now.  Not having any luck with Eclipse Tasks (it's not recognizing
 my todo tags).  You using tags?  It shows all of the Cake project todos,
 just not mine in my application project.

I don't know? I've never used the TODO tags.

I have Eclipse PDT 1.0 installed (maybe I need to update)
I also have Subclipse plug-in installed for Eclipse.

If you want to track tasks, and bugs from inside Eclipse. I strongly
recommend installing Bugzilla on your server, and then installing
Mylyn plug-in for Eclipse. This will allow you to track bug
assignments, and history from inside Eclipse. It's very handy!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: App::import broken in RC3

2008-10-15 Thread Mathew

JS files are related to views.

You need to add them to your meta tags in the HTML header. You can use
the HTML helper for this I think?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: App::import broken in RC3

2008-10-15 Thread Mathew

When I run the test case for configure.test.php I get the following
results.

2/2 test cases complete: 86 passes, 12 fails and 0 exceptions.

12 have failed.

Can anyone else confirm these are expected failures for RC3? Is anyone
else having all the tests pass for configure.test.php?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: App::import broken in RC3

2008-10-15 Thread Mathew

* Failed
  at [D:\work\TRUNK\php\cake_1.2.0\cake\tests\cases\libs
\configure.test.php line 440]
  \work\TRUNK\php\cake_1.2.0\cake\tests\cases\libs
\configure.test.php - AppImportTest - testLoadingWithSearch
* Failed
  at [D:\work\TRUNK\php\cake_1.2.0\cake\tests\cases\libs
\configure.test.php line 454]
  \work\TRUNK\php\cake_1.2.0\cake\tests\cases\libs
\configure.test.php - AppImportTest - testLoadingWithSearchArray
* Failed
  at [D:\work\TRUNK\php\cake_1.2.0\cake\tests\cases\libs
\configure.test.php line 516]
  \work\TRUNK\php\cake_1.2.0\cake\tests\cases\libs
\configure.test.php - AppImportTest - testLoadingVendor
* Failed
  Equal expectation fails at character 0 with [] and [this is the
test plugin asset css file] at [D:\work\TRUNK\php\cake_1.2.0\cake\tests
\cases\libs\configure.test.php line 517]
  \work\TRUNK\php\cake_1.2.0\cake\tests\cases\libs
\configure.test.php - AppImportTest - testLoadingVendor
* Failed
  at [D:\work\TRUNK\php\cake_1.2.0\cake\tests\cases\libs
\configure.test.php line 522]
  \work\TRUNK\php\cake_1.2.0\cake\tests\cases\libs
\configure.test.php - AppImportTest - testLoadingVendor
* Failed
  Equal expectation fails at character 0 with [] and [this is the
test asset css file] at [D:\work\TRUNK\php\cake_1.2.0\cake\tests\cases
\libs\configure.test.php line 523]
  \work\TRUNK\php\cake_1.2.0\cake\tests\cases\libs
\configure.test.php - AppImportTest - testLoadingVendor
* Failed
  at [D:\work\TRUNK\php\cake_1.2.0\cake\tests\cases\libs
\configure.test.php line 526]
  \work\TRUNK\php\cake_1.2.0\cake\tests\cases\libs
\configure.test.php - AppImportTest - testLoadingVendor
* Failed
  at [D:\work\TRUNK\php\cake_1.2.0\cake\tests\cases\libs
\configure.test.php line 527]
  \work\TRUNK\php\cake_1.2.0\cake\tests\cases\libs
\configure.test.php - AppImportTest - testLoadingVendor
* Failed
  at [D:\work\TRUNK\php\cake_1.2.0\cake\tests\cases\libs
\configure.test.php line 530]
  \work\TRUNK\php\cake_1.2.0\cake\tests\cases\libs
\configure.test.php - AppImportTest - testLoadingVendor
* Failed
  at [D:\work\TRUNK\php\cake_1.2.0\cake\tests\cases\libs
\configure.test.php line 531]
  \work\TRUNK\php\cake_1.2.0\cake\tests\cases\libs
\configure.test.php - AppImportTest - testLoadingVendor
* Failed
  at [D:\work\TRUNK\php\cake_1.2.0\cake\tests\cases\libs
\configure.test.php line 536]
  \work\TRUNK\php\cake_1.2.0\cake\tests\cases\libs
\configure.test.php - AppImportTest - testLoadingVendor
* Failed
  Equal expectation fails at character 0 with [] and [This is a
file with dot in file name] at [D:\work\TRUNK\php\cake_1.2.0\cake\tests
\cases\libs\configure.test.php line 537]
  \work\TRUNK\php\cake_1.2.0\cake\tests\cases\libs
\configure.test.php - AppImportTest - testLoadingVendor

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



Re: App::import broken in RC3

2008-10-15 Thread Mathew

Thanks mark, I was afraid you were going to say that.

I'm going to try doing a difference check between my source code, and
the RC3 zip file. Maybe I failed to merge the code correctly.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Move existing app to Subversion

2008-10-15 Thread Mathew

 I want to be able to get the latest working copy of the central server
 for specific projects on live productions webservers without all
 hidden subversion files etc... Call it a 'clean' copy. How can I do
 this?

svn export

That will get all the files from SVN without connecting it to SVN. So
there will be no .svn hidden folders, but you will not be able to
track history.

I use svn export into a temp folder to build my install package for
the website.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Move existing app to Subversion

2008-10-15 Thread Mathew

 I found a decent document online and did an import and it's working
 great now.  Not having any luck with Eclipse Tasks (it's not recognizing
 my todo tags).  You using tags?  It shows all of the Cake project todos,
 just not mine in my application project.

I don't know? I've never used the TODO tags.

I have Eclipse PDT 1.0 installed (maybe I need to update)
I also have Subclipse plug-in installed for Eclipse.

If you want to track tasks, and bugs from inside Eclipse. I strongly
recommend installing Bugzilla on your server, and then installing
Mylyn plug-in for Eclipse. This will allow you to track bug
assignments, and history from inside Eclipse. It's very handy!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Delayed redirect by Auth sends user to wrong page.

2008-10-15 Thread Mathew

Hi,

I'm using the Auth component to handle logins, and I've noticed
problem.

If a user tries to access an area that requires a login, then they are
automatically redirected to /user/login. If the user then browses away
from this page, and then later returns to this page and logs in. They
are redirected back to the original referral page.

For example;

http://www.example.com/members - requires a login, so it redirects to
http://www.example.com/users/login - the user ignores the login
request, and goes to this page
http://www.example.com/documents - the user then returns to the login
from a menu
http://www.example.com/users/login - the user completes the login
http://www.example.com/members - the user is redirect back to here.

The user did not login from the members section, but they are redirect
back there.

I only want the user to be redirect back to the members page if that
is the referral, otherwise I want the user's profile to be the
default.

Any ideas how to control this?

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



Re: App::import broken in RC3

2008-10-15 Thread Mathew

Thanks Martin,

I've tried all those variations, but my problems appears when trying
to import something from a plugin's vendor folder, and also trying to
define the file name.

All my other imports for vendors in the same plugins folder work fine.
It's just when I tried to define the file name that it's broken.

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



Re: App::import broken in RC3

2008-10-15 Thread Mathew

I'm trying now to run the test case for configure.test.php, but it
fails. All the other core unit tests are failing as well.

There must be some requirements need in place before you can run the
core unit tests. Is there a document anywhere talking about to get
these running?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



App::import broken in RC3

2008-10-14 Thread Mathew

Hi,

While using RC2 the following import worked.

App::import(array('type'='Vendor','name'='gems.magpierss','file'='rss_fetch.inc'));

Now under RC3 App::import is return false.

This should load the file rss_fetch.inc from the \plugins\gems\vendors
\magpierss folder in my gems plugin.

Has the convention for the array changed in RC3, or is this a bug?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Please explain scaffolding changes in RC3

2008-10-14 Thread Mathew

I guess I should log in, and try to update the documentation.

I assume this is possible right? Can the documentation be edited by
the public?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Bug or API change in Model in RC3: 'dependent' can delete ALL records for associated model

2008-10-14 Thread Mathew

Is it possible to see all the changesets for RC3 on a specific file?

For example; How can I browse the history of changes to the model.php
file?

I've been looking around the Cake website, I can see the SVN urls, the
source code browser, but I'm looking for something like WebSVN.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Please explain scaffolding changes in RC3

2008-10-14 Thread Mathew

Thanks mark!

Streamlining is always good!

I got my templates working, and have to admit editing 1 view for both
add/edit is a lot less work.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: App::import broken in RC3

2008-10-14 Thread Mathew

I'm a little confused how this got broken in RC3.

I've looked at the changes from RC2 to RC3 in this url.

https://trac.cakephp.org/changeset?new=trunk%2Fcake%2F1.2.x.x%2Fcake%2Flibs%2Fconfigure.php%407690old=trunk%2Fcake%2F1.2.x.x%2Fcake%2Flibs%2Fconfigure.php%407296

I don't see anything that should have broken my import statement, but
when debugging the code I can see that it's not working.

I got to line 837 in configure.php where is says $directory = $_this-
__find($find, true);, and that returns null. I'm not sure it's
suppose that have gotten that far.

$find is equal to rss_fetch.inc which is my file, but the __find()
method only checks the vendor folders. It appears to be ignoring the
subfolder magpierss defined in the name parameter.

Could I have been using the wrong parameters?

How would I import this file from my plugins vendor folder?

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



Re: Move existing app to Subversion

2008-10-14 Thread Mathew

I've been using SVN with CakePHP for 2 years now, and it works great
together.

I run Eclipse as my IDE on Windows, and use TortoiseSVN as my desktop
client. I also have the SVN plugin for Eclipse.

My repository setup is simple.

/svn/trunk/website_name/...
/svn/branch/branch_version/website_name/...

I do all my work off the trunk, and then move files to branches as I
reach milestones. Some people do it the reverse, working off a branch
and then merging with the trunk as they reach milestones. It's up to
you to figure out which is best.

I found that TortoiseSVN allows me to quickly add files to the ignore
list of SVN. Things like the cake temp folder for example.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Behaviors called for COUNT queries in RC3

2008-10-12 Thread Mathew

Behaviors are now called after each COUNT query. The afterFind
method is called with data like this.

Array
(
  [0] = Array
  (
[count] = 14
  )
)

Should behaviors have a new method called afterCount.

How can you tell the difference between a COUNT query and a table that
has a field called count.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



  1   2   >