Re: Amazon simpledb

2011-11-15 Thread dtemes
Thanks, I did not know Lorenzos implementation.

The sdb datasource is already able to do some basic CRUD operations
and finds. Development is going slow as I spend a lot of time looking
at other datasources code, and also at the core libs.

I will make it available via a git repository within a few days.



On 13 nov, 07:31, Graham Weldon  wrote:
> If you want to look at some awesome MongoDB datasource implementations, I
> recommend the following:
>
> -https://github.com/ichikaway/cakephp-mongodb
> -https://github.com/lorenzo/MongoCake
>
> Both from highly reputable CakePHP developers.

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


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


Re: Cake 2.0 Auth Component login method

2011-11-15 Thread Serkan Sipahi
hi,

look at here: 
http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html -> 
Identifying users and logging them in -> read the notice: Warning -> In 2.0 
$this->Auth->login($this->request->data) will log the user in with whatever 
data is posted,
whereas in 1.3 $this->Auth->login($this->data) would try to identify the user 
first and only log in
when successful.



Von: huoxito 
An: cake-php@googlegroups.com
Gesendet: 1:48 Mittwoch, 16.November 2011 
Betreff: Cake 2.0 Auth Component login method


Hi there everybody!

Could anyone please tell me why 2.0 Auth Component login method logs in the 
user whatever data is posted, even if the user is not on the database? I mean 
is this really a good idea?
-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php

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


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


Re: UnitTests - The Real World

2011-11-15 Thread Thiago Belem
Thank you Jeremy... I've just started to write TestCases to my main models,
where's what I did:

   - Created fixtures based on database schema + provided data inside the
   fixture
   - Test the model object to see if it's an child of AppModel and Model
   - Test some finds
   - Test the new method that i create to run some special find conditions
   - Test if the model has the needed behavior
   - Test if the model has the related model on belongsTo/hasMany

What do you think about those testcases? Do you suggest anything different?
I just have the models and the tables now, didn't started to create the
controllers and etc.

I will use this post to ask future questions regarding this kind of tests ;)

Thanks for your help!

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

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

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


2011/11/15 jeremyharris 

> You may want to just browse around some plugins that you use to see what's
> tested, or even the core tests. They give you a good idea. Basically you
> want to test against certain scenarios to make sure your code can handle
> them properly. Sure, if you *just* use baked code there's not much to test
> (but it's still a good idea to write them to even make sure your db setup
> works w/ the baked code).
>
> For example, I have a method in my Group model that is a convenience for
> finding groups when compared to another group. For example, finding all
> groups of higher or equal permission to a certain group, finding groups
> less than a certain group, etc. I'm using ACL so the Groups are AROs and
> therefore a tree. My test case includes several assertions to make sure the
> method pulls the correct list of groups, as well as assertions that deal
> with handling missing parameters, etc.
>
> Basically when you're writing tests, you want to cover as many
> possibilities to be sure your code won't bug out. It's especially important
> when handling user input, for example, /posts/index/2 - what if the user
> types /posts/index/all ? How should your code handle it?
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

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


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


Cake 2.0 Auth Component login method

2011-11-15 Thread huoxito
Hi there everybody!

Could anyone please tell me why 2.0 Auth Component login method logs in the 
user whatever data is posted, even if the user is not on the database? I 
mean is this really a good idea?

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


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


Re: Singular controller name route

2011-11-15 Thread Sam Sherlock
Perhaps using a custom class to collect data from the app.

It could not rerun data unless it has a view action

- S
On 15 Nov 2011 18:43, "martinp"  wrote:

> Thanks for the reply Jeremy, but what I'm actually looking for is a
> way to do this automatically.
>
> In the same way that routes configuration is set up to
> handle /:controller/:action/*, I would like to set
> up /:controller_singular/* which would go to the view action.
>
> i.e. not naming individual controllers in the route config, have it
> happen automagically.
>
> On Nov 15, 4:28 pm, jeremyharris  wrote:
> > Check out:http://book.cakephp.org/view/945/Routes-Configuration
> >
> > There's examples for your very request about halfway through.
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

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


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


Troubleshooting the CakeDC TinyMCE helper plugin.

2011-11-15 Thread vaughany
Hi all. I am having some trouble with the abovementioned helper plugin. 
Following the instructions in the github repo readme results in error 
messages and I have attempted to troubleshoot the reasons myself but have 
achieved little in the way of success. There's little on Google for this 
helper for Cake 2 (I tried pretty hard to find stuff, trust me).

*Setup:*

   1. Freshly cloned the CakePHP repository, switched to the 2.0 branch 
   (2.0.3).
   2. Ran sudo chmod -R a+rwx app/tmp
   3. Modified Config/core.php to remove salt etc error messages.
   4. Created Config/database.php and supplied it with correct db details.
   5. Ran sudo chmod -R a+rwx app/tmp again (cake bake throws errors 
   otherwise).
   6. cake bake'd model, controller and views for a very simplistic user 
   schema:

CREATE TABLE `users` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
`desc` text COLLATE utf8_unicode_ci NOT NULL,
`created` datetime NOT NULL,
`modified` datetime NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
);

At this point I have a basic but perfectly working site.

*Installing TinyMCE Helper:*

   1. I ran:
   git submodule add https://github.com/CakeDC/TinyMCE.git 
   app/Plugin/TinyMCE
   ...then checked out the 2.0 branch.
   2. I add CakePlugin::loadAll(); to Config/bootstrap.php
   3. Added this to my controller:
   public $helpers = array('TinyMCE.TinyMCE');

Now going to /users results in the following:

TinyMCE.TinyMCEHelper could not be found.
Create the class TinyMCEHelper below in file: 
/var/www/caketest/app/Plugin/TinyMCE/View/Helper/TinyMCEHelper.php

Here I realised that TinyMCEHelper.php doesn't exist but TinyMceHelper.php 
does (note capitalisation of 'MCE'). Unsure which is the correct 
capitalisation, so:


   - Changed my UsersController.php to read:
   public $helpers = array('TinyMce.TinyMce');
   - ...and the plugin folder's name to:
   Plugin/TinyMce

...suddenly no more on-screen error messages, but this in Apache's 
error.log:

PHP Parse error:  syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in 
/var/www/caketest/app/Plugin/TinyMce/webroot/js/tiny_mce/tiny_mce.js on 
line 1, referer: http://192.168.0.3/caketest/users
PHP Stack trace:, referer: http://192.168.0.3/caketest/users
PHP   1. {main}() /var/www/caketest/app/webroot/index.php:0, referer: 
http://192.168.0.3/caketest/users
PHP   2. Dispatcher->dispatch() /var/www/caketest/app/webroot/index.php:96, 
referer: http://192.168.0.3/caketest/users
PHP   3. Dispatcher->asset() 
/var/www/caketest/lib/Cake/Routing/Dispatcher.php:74, referer: 
http://192.168.0.3/caketest/users
PHP   4. Dispatcher->_deliverAsset() 
/var/www/caketest/lib/Cake/Routing/Dispatcher.php:293, referer: 
http://192.168.0.3/caketest/users

Getting lost and realising I've probably tinkered too much (but enjoying 
the learning experience), I:

   - moved Plugins/TinyMce back to Plugins/TinyMCE
   - changed code in UsersController.php back to:
   public $helpers = array('TinyMCE.TinyMCE');
   - ...and renamed app/Plugin/TinyMCE/View/Helper/TinyMceHelper.php back 
   to:
   TinyMCEHelper.php
   
No on-screen errors, no errors in Apache's error.log, but Firefox's 
developer console FireBug shows:
"NetworkError: 404 Not Found - 
http://192.168.0.3/caketest/tiny_mce/js/tiny_mce/tiny_mce.js";

Using Firebug to find and open that file, I find the following:
"Missing Controller
Error: TinyMceController could not be found."

...at which point I kinda give up! Not sure, after all that, if any of it 
was particularly productive, and I know full well I could install TinyMCE 
manually, but really wanted to get a plugin of any kind up and running, and 
thought this one would be the simplest.

All help gratefully appreciated.

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


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


Inconsistency when loading libs?

2011-11-15 Thread euromark
This worked in 1.3:

a file called "icq_lib.php"
App::import('Vendor', 'Tools.icq/icq');

class IcqLib extends Icq {}

you could then App::import('Lib', 'IcqLib') and use the IcqLib class
right away

But in 2.0 most library classes are now in packages inside /Lib
In my example "/Lib/PackageName/IcqLib.php"
So 99% of all classes will be included using App::uses('IcqLib',
'PackageName');

But this will result in:
Fatal error: Class 'Icq' not found

So we would have to stick to the App::import() on this one.

The question is:
Why would we need to "know" if the class itself does extend vendor
files and why would we need to distinguish between different package
files.
This feels like an inconsistency. Loading some classes with App::uses
and some with App::import - although maybe in the same package inside /
Lib.
As soon as we do extend a vendor file we have to change all
occurrences of uses back to import etc. Quite annoying.

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


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


Re: IE hangs when loading a page

2011-11-15 Thread Yves S. Garret
Ok, one discovery.  I found the last line of code before my app goes out to
lunch.  I inserted this code at the line #83:

die("The output of having a : ".print_r($provider));

http://bin.cakephp.org/view/2137152307

As a result, I get this output.

*Notice* (8) 
:
Undefined variable: provider
[*APP\views\providers\view_admit_lookup.ctp*, line *83*]
Code 

| Context 


 "Admit Lookup"
)
$loadHelpers=   true
$cached =   false
$form   =   FormHelper
FormHelper::$helpers = array
FormHelper::$fieldset = array
FormHelper::$__options = array
FormHelper::$fields = array
FormHelper::$requestType = "post"
FormHelper::$defaultModel = NULL
FormHelper::$_inputDefaults = array
FormHelper::$base = "/pythia-admit-lookup"
FormHelper::$webroot = "/pythia-admit-lookup/"
FormHelper::$theme = NULL
FormHelper::$here = "/pythia-admit-lookup/providers/view_admit_lookup"
FormHelper::$params = array
FormHelper::$action = "view_admit_lookup"
FormHelper::$plugin = NULL
FormHelper::$data = NULL
FormHelper::$namedArgs = NULL
FormHelper::$argSeparator = NULL
FormHelper::$validationErrors = NULL
FormHelper::$tags = array
FormHelper::$__tainted = NULL
FormHelper::$__cleaned = NULL
FormHelper::$Html = HtmlHelper object
$html   =   HtmlHelper
HtmlHelper::$tags = array
HtmlHelper::$_crumbs = array
HtmlHelper::$__includedScripts = array
HtmlHelper::$_scriptBlockOptions = array
HtmlHelper::$__docTypes = array
HtmlHelper::$helpers = NULL
HtmlHelper::$base = "/pythia-admit-lookup"
HtmlHelper::$webroot = "/pythia-admit-lookup/"
HtmlHelper::$theme = NULL
HtmlHelper::$here = "/pythia-admit-lookup/providers/view_admit_lookup"
HtmlHelper::$params = array
HtmlHelper::$action = "view_admit_lookup"
HtmlHelper::$plugin = NULL
HtmlHelper::$data = NULL
HtmlHelper::$namedArgs = NULL
HtmlHelper::$argSeparator = NULL
HtmlHelper::$validationErrors = NULL
HtmlHelper::$__tainted = NULL
HtmlHelper::$__cleaned = NULL
$session=   SessionHelper
SessionHelper::$helpers = array
SessionHelper::$__active = true
SessionHelper::$valid = false
SessionHelper::$error = false
SessionHelper::$_userAgent = "32ea6aeb0d8455f12965881e8b7bbba4"
SessionHelper::$path = "/"
SessionHelper::$lastError = NULL
SessionHelper::$security = NULL
SessionHelper::$time = 1321391434
SessionHelper::$sessionTime = false
SessionHelper::$cookieLifeTime = 72
SessionHelper::$watchKeys = array
SessionHelper::$id = NULL
SessionHelper::$host = NULL
SessionHelper::$timeout = NULL
SessionHelper::$base = "/pythia-admit-lookup"
SessionHelper::$webroot = "/pythia-admit-lookup/"
SessionHelper::$here = "/pythia-admit-lookup/providers/view_admit_lookup"
SessionHelper::$params = array
SessionHelper::$action = "view_admit_lookup"
SessionHelper::$data = NULL
SessionHelper::$theme = NULL
SessionHelper::$plugin = NULL
$title_for_layout   =   "Admit Lookup"
$alphabet   =   array(
"A",
"B",
"C",
"D",
"E",
"F",
"G",
"H",
"I",
"J",
"K",
"L",
"M",
"N",
"O",
"P",
"Q",
"R",
"S",
"T",
"U",
"V",
"W",
"X",
"Y",
"Z"
)
$letter =   "Z"

include - APP\views\providers\view_admit_lookup.ctp, line 83
View::_render() - CORE\cake\libs\view\view.php, line 731
View::render() - CORE\cake\libs\view\view.php, line 426
Controller::render() - CORE\cake\libs\controller\controller.php, line 909
Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 207
Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 171
[main] - APP\webroot\index.php, line 83

The output of having a : 1

Now, I can understand that $provider is undefined.  It shouldn't be.
 That's what the empty method is checking for, right?

Next I proceeded to add this code to view_admit_lookup in the controller:

$this->set('provider', NULL);

How the code looks like now.

http://bin.cakephp.org/view/1006272725

I figured that by setting provider to nothing pre-emptively it would get
rid of the issue that I had... but IE 9 is still not loading...

Gonna go to the gym, I need to give my brain a rest and my body some work.

On Tue, Nov 15, 2011 at 3:05 PM, Yves S. Garret
wrote:

> Oh yeah, one more thing, this is what I did with developer tools for IE
> (this problem exists for IE 9 as well):
>
> * Opened up my browser, which went to my homepage, bing.com.
> * Opened up Developer Tools by hitting F12.
> * Entered the URL of the site I'm working on and hit Enter.
> * The Developer Tools window vanished and I get a blank page without as
> much as an indication of what could possible be wrong.
>
> I did notice a torn document icon in the URL bar.
>

Re: IE hangs when loading a page

2011-11-15 Thread Yves S. Garret
Oh yeah, one more thing, this is what I did with developer tools for IE
(this problem exists for IE 9 as well):

* Opened up my browser, which went to my homepage, bing.com.
* Opened up Developer Tools by hitting F12.
* Entered the URL of the site I'm working on and hit Enter.
* The Developer Tools window vanished and I get a blank page without as
much as an indication of what could possible be wrong.

I did notice a torn document icon in the URL bar.

On Tue, Nov 15, 2011 at 2:52 PM, Yves S. Garret
wrote:

> Just tried disabling Javascript, no dice.
>
>
> On Tue, Nov 15, 2011 at 1:07 PM, Yves S. Garret <
> yoursurrogate...@gmail.com> wrote:
>
>> Tried it, the dev tools hung with IE when I ran it and looked at the
>> script tab lol.
>>
>> I'll keep poking at it.  I've never seen this before...
>>
>>
>> On Tue, Nov 15, 2011 at 10:41 AM, Mike Karthauser <
>> mi...@brightstorm.co.uk> wrote:
>>
>>> hi yves
>>>
>>> On 15 Nov 2011, at 15:11, Yves S. Garret wrote:
>>>
>>> I know that this is IE only, since I tried it in Chrome and it worked.
>>>  Basically, I go to the page that I'm developing and the browser just
>>> hangs.  Very weird.  In Chrome, it loads without an issue.  Has anyone seen
>>> IE do this before?  How did you get around it?
>>>
>>> I can post the code if you want, but not sure just how much value that
>>> has since it works just fine in one browser, but not the other.
>>>
>>>
>>> i suggest you try disabling any javascript and then try loading ie
>>> again. It could be a script error which is causing your page to
>>> whitescreen.
>>>
>>> using internet explorer developer tools should also be a useful exercise
>>>
>>> http://en.wikipedia.org/wiki/Internet_Explorer_Developer_Tools
>>>
>>> hth
>>> mikek
>>>
>>>  
>>> Mike Karthäuser
>>> Director, Brightstorm Ltd.
>>>
>>> 1, Brewery Court
>>> North Street
>>> Bristol
>>> BS3 1JS
>>>
>>> mi...@brightstorm.co.uk 
>>> www.brightstorm.co.uk
>>> +44(0) 7939252144
>>> 
>>>
>>>
>>>
>>>
>>>
>>>  --
>>> Our newest site for the community: CakePHP Video Tutorials
>>> http://tv.cakephp.org
>>> Check out the new CakePHP Questions site http://ask.cakephp.org and
>>> help others with their CakePHP related questions.
>>>
>>>
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.com For more options, visit this
>>> group at http://groups.google.com/group/cake-php
>>>
>>
>>
>

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


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


Re: IE hangs when loading a page

2011-11-15 Thread Yves S. Garret
Just tried disabling Javascript, no dice.

On Tue, Nov 15, 2011 at 1:07 PM, Yves S. Garret
wrote:

> Tried it, the dev tools hung with IE when I ran it and looked at the
> script tab lol.
>
> I'll keep poking at it.  I've never seen this before...
>
>
> On Tue, Nov 15, 2011 at 10:41 AM, Mike Karthauser  > wrote:
>
>> hi yves
>>
>> On 15 Nov 2011, at 15:11, Yves S. Garret wrote:
>>
>> I know that this is IE only, since I tried it in Chrome and it worked.
>>  Basically, I go to the page that I'm developing and the browser just
>> hangs.  Very weird.  In Chrome, it loads without an issue.  Has anyone seen
>> IE do this before?  How did you get around it?
>>
>> I can post the code if you want, but not sure just how much value that
>> has since it works just fine in one browser, but not the other.
>>
>>
>> i suggest you try disabling any javascript and then try loading ie again.
>> It could be a script error which is causing your page to whitescreen.
>>
>> using internet explorer developer tools should also be a useful exercise
>>
>> http://en.wikipedia.org/wiki/Internet_Explorer_Developer_Tools
>>
>> hth
>> mikek
>>
>>  
>> Mike Karthäuser
>> Director, Brightstorm Ltd.
>>
>> 1, Brewery Court
>> North Street
>> Bristol
>> BS3 1JS
>>
>> mi...@brightstorm.co.uk 
>> www.brightstorm.co.uk
>> +44(0) 7939252144
>> 
>>
>>
>>
>>
>>
>>  --
>> Our newest site for the community: CakePHP Video Tutorials
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help
>> others with their CakePHP related questions.
>>
>>
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group
>> at http://groups.google.com/group/cake-php
>>
>
>

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


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


Re: Singular controller name route

2011-11-15 Thread martinp
Thanks for the reply Jeremy, but what I'm actually looking for is a
way to do this automatically.

In the same way that routes configuration is set up to
handle /:controller/:action/*, I would like to set
up /:controller_singular/* which would go to the view action.

i.e. not naming individual controllers in the route config, have it
happen automagically.

On Nov 15, 4:28 pm, jeremyharris  wrote:
> Check out:http://book.cakephp.org/view/945/Routes-Configuration
>
> There's examples for your very request about halfway through.

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


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


Re: IE hangs when loading a page

2011-11-15 Thread Yves S. Garret
Tried it, the dev tools hung with IE when I ran it and looked at the script
tab lol.

I'll keep poking at it.  I've never seen this before...

On Tue, Nov 15, 2011 at 10:41 AM, Mike Karthauser
wrote:

> hi yves
>
> On 15 Nov 2011, at 15:11, Yves S. Garret wrote:
>
> I know that this is IE only, since I tried it in Chrome and it worked.
>  Basically, I go to the page that I'm developing and the browser just
> hangs.  Very weird.  In Chrome, it loads without an issue.  Has anyone seen
> IE do this before?  How did you get around it?
>
> I can post the code if you want, but not sure just how much value that has
> since it works just fine in one browser, but not the other.
>
>
> i suggest you try disabling any javascript and then try loading ie again.
> It could be a script error which is causing your page to whitescreen.
>
> using internet explorer developer tools should also be a useful exercise
>
> http://en.wikipedia.org/wiki/Internet_Explorer_Developer_Tools
>
> hth
> mikek
>
> 
> Mike Karthäuser
> Director, Brightstorm Ltd.
>
> 1, Brewery Court
> North Street
> Bristol
> BS3 1JS
>
> mi...@brightstorm.co.uk 
> www.brightstorm.co.uk
> +44(0) 7939252144
> 
>
>
>
>
>
>  --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

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


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


Re: Permission erros when following ACL 2.0 tutorials

2011-11-15 Thread Paul Vaughan
I often find that when I change something in the code (although I am unsure
what, exactly), the permissions change in app/tmp and I get the same error
as you. Also I get errors when cake baking.  What I do is run:

sudo chmod -R a+rwx /var/www/cakephp/app/tmp (your path may be different,
the important bit is /tmp)

This sets the tmp folder to be fully readable, writable, and executable,
and my problems go away.  I've seen statements here to the effect that this
is only an issue in development (but can't put my finger on one just now.

Cheers,

Paul.


On 15 November 2011 09:41, bigjimmi  wrote:

> Hi all,
>
> I'm being plagued with permission errors when trying to follow the ACL
> 2.0 tutorial.
>
> I've made my tmp directory and all contents NOT read only.
>
> Warning (512): SplFileInfo::openFile(C:\wamp\www\CakeAclTest\app\tmp
> \cache\models\cake_model_default_aros_acos) [splfileinfo.openfile]:
> failed to open stream: Permission denied [CORE\Cake\Cache\Engine
> \FileEngine.php, line 293]
>
> Please help. Thanks in advance.
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

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


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


Re: Concurrency control

2011-11-15 Thread 0x20h
Am 14.11.2011 17:14, schrieb phpMagpie:
> Not sure if there is an existing behaviour, but if you create a
> created and modified field Cake will automagically update them.  Check
> these to see if they have been updated since form load et voila.
Looking at the modified date does guarantee mutual exclusion (e.g. data
is modified between your select and your update).
Have a look at SELECT ... FOR UPDATE or mysqls GET_LOCK().

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


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


Re: Using REST In CakePHP 2.0

2011-11-15 Thread Matteo Landi
--
http://www.matteolandi.net
On Nov 15, 2011 6:09 PM, "Will" <000w.s.s@gmail.com> wrote:

> For the benefit of anyone else reading this, you can format the result
> of a call to $this->Model->find('all) with the following function:
>
> /** function _get_xml_array
>   *
>   *  This function takes in an input from $this->Model->find() and
> reutrns an array
>   *  that is properly strucutred so that CakePHP's Xml Utility can
> format it.
>   *
>   *  @author Will Simpson
>   *  @access private
>   *  @param $input -- An array from $this->Model->find()
>   *  @return $output -- An array in the following format:
>   *  array(
>   *   'tags' => array(
>   *   'tag' => array(
>   *array(
>   *   'id' => '1',
>   *   'name' => 'defect'
>   *   ),
>   *   array(
>   *   'id' => '2',
>   *   'name' => 'enhancement'
>   *   )
>   *   )
>   *   )
>   *   );
>   *
>   */
>  private function _get_xml_array($input,$plural=NULL,$singular=NULL)
> {
>$output = array();
>
>if(count($input) == 0)
>  return $output;
>
>if($plural == NULL)
>  $plural = $this->name;
>
>if($singular == NULL)
>  $singular = key($input[0]);
>
>
>foreach($input as $i){
>  $output[] = $i[$singular];
>}
>$output = array($plural=>array($singular=>$output));
>return $output;
>  }
>
> Basically, the Xml Utility is expecting an array with one element that
> contains another array of one element that contains an array of many
> elements.  Using my Employee model as an example, the correct
> structure would be:
>
> Array
> (
>[Employees] => Array
>(
>[Employee] => Array
>(
>[0] => Array
>(
>[id] => 1
>[emp_name] => Will Simpson
>[emp_job] => Web Developer
>)
>
>[1] => Array
>(
>[id] => 2
>[emp_name] => Joey Vickers
>[emp_job] => Random Guy
>)
>
>)
>
>)
>
> )
>
> If you use this structure, you don't need to be any "plural" tags in
> your xml view like to book describes.  The view would simply be:
>
> 
>  $xml = Xml::build($employees_xml);
>  echo $xml->saveXML();
> ?>
>
>
> With no additional tags around it.  Also make sure that you have the
> latest version of CakePHP (2.0.3).  I think there is a hiccup in the
> RequestHandler in earlier versions that is causing the top-level xml
> tag to be repeated.
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>
>

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


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


Complex Field Conditions escaped

2011-11-15 Thread michaelf
When I use

Model.Field/100 as field I now get it represented as `Model.Field/100
as field` in my SQL query. When I take out the `` it works.

Cakephp never used to do that. What is going on? How do I fix this?

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


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


Permission erros when following ACL 2.0 tutorials

2011-11-15 Thread bigjimmi
Hi all,

I'm being plagued with permission errors when trying to follow the ACL
2.0 tutorial.

I've made my tmp directory and all contents NOT read only.

Warning (512): SplFileInfo::openFile(C:\wamp\www\CakeAclTest\app\tmp
\cache\models\cake_model_default_aros_acos) [splfileinfo.openfile]:
failed to open stream: Permission denied [CORE\Cake\Cache\Engine
\FileEngine.php, line 293]

Please help. Thanks in advance.

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


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


CakePHP creates wrong routes for reverse proxy

2011-11-15 Thread Steffen
Hello,

My CakePHP application is accesible through a mod_alias rule in the
apache config. Due to this fact its accesible on the root of the
apache folder.

For example: apps.example.com/app1/

The Application works without problems on this URL but it don't work
for a reverse proxy. The reverse proxy points on the apps.example.com/
app1/webroot/ folder. The index page is working but all CSS/JS
includes and all links use the "app1"-prefix.

For example the Link to the controller->view should be

http://web.example2.co.uk/controller/view

atm cakephp creates links like http://web.example2.co.uk/app1/controller/view
which don't work.

I tried to fix it with mod_rewrite but I can't remove the directory
name (app1) from the created links.

How can I change/extend CakePHP to fix this?

Thanks,

Steffen

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


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


Re: Using REST In CakePHP 2.0

2011-11-15 Thread Will
For the benefit of anyone else reading this, you can format the result
of a call to $this->Model->find('all) with the following function:

/** function _get_xml_array
   *
   *  This function takes in an input from $this->Model->find() and
reutrns an array
   *  that is properly strucutred so that CakePHP's Xml Utility can
format it.
   *
   *  @author Will Simpson
   *  @access private
   *  @param $input -- An array from $this->Model->find()
   *  @return $output -- An array in the following format:
   *  array(
   *   'tags' => array(
   *   'tag' => array(
   *array(
   *   'id' => '1',
   *   'name' => 'defect'
   *   ),
   *   array(
   *   'id' => '2',
   *   'name' => 'enhancement'
   *   )
   *   )
   *   )
   *   );
   *
   */
  private function _get_xml_array($input,$plural=NULL,$singular=NULL)
{
$output = array();

if(count($input) == 0)
  return $output;

if($plural == NULL)
  $plural = $this->name;

if($singular == NULL)
  $singular = key($input[0]);


foreach($input as $i){
  $output[] = $i[$singular];
}
$output = array($plural=>array($singular=>$output));
return $output;
  }

Basically, the Xml Utility is expecting an array with one element that
contains another array of one element that contains an array of many
elements.  Using my Employee model as an example, the correct
structure would be:

Array
(
[Employees] => Array
(
[Employee] => Array
(
[0] => Array
(
[id] => 1
[emp_name] => Will Simpson
[emp_job] => Web Developer
)

[1] => Array
(
[id] => 2
[emp_name] => Joey Vickers
[emp_job] => Random Guy
)

)

)

)

If you use this structure, you don't need to be any "plural" tags in
your xml view like to book describes.  The view would simply be:

saveXML();
?>


With no additional tags around it.  Also make sure that you have the
latest version of CakePHP (2.0.3).  I think there is a hiccup in the
RequestHandler in earlier versions that is causing the top-level xml
tag to be repeated.

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


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


Re: paginated comments not showing up in view

2011-11-15 Thread Daniel
I got it working I used:
foreach ($comments as $comment):

... and then:
$comment['Comment']['id']
$comment['Comment']['post_id'] etc.

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


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


step loops in WizardComponent

2011-11-15 Thread Ernesto
hi all.

i'm trying to code a multi-page form using WizardComponent.

here's my step array
$this->Wizard->steps = array(
"order" //here the user selects the customer, the shipping type etc
"article" => array(
"code" //the article.id is selected
"color" //colors are loaded based on the article_id
"optionals" //same as colors
),
"review" //this step just shows the added articles
)

i want my customers to be able to add more than one article per order.
How can i force WizardComponent to go back to the "code" step, if the 
button "add another article" is pressed in the "review" step?

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


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


Re: paginated comments not showing up in view

2011-11-15 Thread Daniel
On Nov 15, 12:00 pm, phpMagpie  wrote:
> try echo debug($comments); in your view to see if the array does contain
> any data.
>
> HTH, Paul.

I found the problem, an if statement in the view was stopping the code
for the table from executing:

I changed it to:


Now I have a new error related to the index in $comments:
Undefined index: Comment

...here is the line in question:
foreach ($comments['Comment'] as $comment):

Here is a dump of the array $comments:

Array
(
[0] => Array
(
[Comment] => Array
(
[id] => 7
[post_id] => 27
[name] => some comment
[content] => hello
[created] => 2011-11-14 18:58:52
[modified] => 2011-11-14 18:58:52
)

)

)

What am I doing wrong?

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


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


Re: Custom Datasource

2011-11-15 Thread RhythmicDevil
I got it working finally. This is what I ended up with:

database.php

public $gti = array(
'datasource' => 'GtiSource',
'url' => 'http://swright-dev:1337/'
);


Model

public $useDbConfig = 'gti';

Datasource
filename: GtiSource.php
class : GtiSource

Although the filename: gti_source also works.





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


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


Re: CakePHP 2.0.3 out of the oven

2011-11-15 Thread Thiago Belem
http://bakery.cakephp.org/articles/lorenzo/2011/10/16/cakephp_2_0_released

Embraced the *PSR-0* recommendation for file naming. Now all your classes
map to a file with the same name. Less things to remember!


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

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

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


2011/11/15 RhythmicDevil 

> What drove the decision to change the naming conventions?
>
>
> On Nov 13, 8:28 pm, José Lorenzo  wrote:
> > The CakePHP core team is proud to announce the immediate availability of
> > CakePHP 2.0.3 [1]. A lot has happened in the PHP world since our last
> > release, this new version incorporates all needed changes needed to adapt
> > to the ever evolving world of PHP frameworks.
> >
> > One of the big changes out there was PHPUnit 3.6 being marked as stable
> and
> > becoming the default version available through the PEAR installer. This
> > change caught many developers by surprise. They could not easily run
> > CakePHP's built-in test suite due to the major changes in PHPUnit. We
> have
> > made the required changes to make sure 2.0.3 runs with no issues in both
> > 3.5 and 3.6 versions of PHPUnit.
> >
> > A big difference people will notice when writing unit tests is that all
> > output is swallowed by PHPUnit and not presented in either the web tester
> > page nor in the CLI tester. To overcome this annoyance use the--debug
> modifier
> > if you are using the CLI interface.
> >
> > The second bit of good news is the availability of PHP 5.4-rc1. We have
> > taken the time to test our framework against this PHP version and fixed
> > many of the few notices and issues that discovered while running our
> > automated tests. If you are early jumping on the 5.4 bandwagon, you can
> > consider CakePHP one of the frameworks to be running smoothly on it.
> >
> > In total, there were 66 commits and 32 issues have been resolved for
> 2.0.3.
> > A complete list of the changes can be viewed in the changelogs page [2],
> > here is a quick summary of changes that made it into 2.0.3:
> >
> >- Runs smoothly in php 5.4
> >- Easier to test controllers using REST
> >- Correct manipulation of boolean values in DboSource::insertMulti()
> >- Full compatibility with PHPUnit 3.6
> >- Fixed several minor issues with the command line bake utility
> >- Fixed Content-Length calculation when there is buffered output that
> >will be sent before the response body
> >- Various improvements in the UpgradeShell
> >- DboSource::lastAffected() now returns correct integer
> >
> > Thanks for ever-growing interest in CakePHP, we have received many pull
> > requests for both the code and documentation, we are excited about the
> all
> > the buzz we are creating with this new version, without all your
> > contributions there would not be CakePHP
> >
> >- Download a packaged release [1]
> >- View the changelog [2]
> >
> > Links
> >
> >- [1]http://github.com/cakephp/cakephp
> >- [2]http://cakephp.org/changelogs/2.0.3
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

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


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


Re: Custom Datasource

2011-11-15 Thread RhythmicDevil
So I was using the wrong model method. I was using Model::read()
instead of Model::find(). Read did not throw an error. But Find()
does.

Now I get this: Datasource class gti could not be found.


On Nov 15, 10:26 am, RhythmicDevil  wrote:
> Hi All,
> I am having some issues understanding the naming conventions for a
> custom datasource.
>
> datasource file name: gti_api_source.php
> class name GtiApiSource
>
> Database Config
>
>         var $gti_api = array(
>             'driver' => 'gti_api',
>             'url' => 'http://swright-dev:1337/',
>         );
>
> Model
>
>     public $useDbConfig = 'gti_api';
>     public $useTable = false;
>
> This is giving me errors. I did a var dump in
> ConnectionManager::loadDataSource to see what it was asking for. I get
> this:
>
> array
>   'filename' => string 'dbo/dbo_gti_api' (length=15)
>   'classname' => string 'DboGtiApi' (length=9)
>   'parent' =>
>     array
>       'filename' => string 'dbo_source' (length=10)
>       'classname' => string 'DboSource' (length=9)
>       'parent' => null
>       'plugin' => null
>   'plugin' => null
> array
>   'filename' => string 'dbo_source' (length=10)
>   'classname' => string 'DboSource' (length=9)
>   'parent' => null
>   'plugin' => null
> Fatal Error (256): ConnectionManager::loadDataSource - Unable to
> import DataSource class .DboGtiApi [CORE/cake/libs/model/
> connection_manager.php, line 185
>
> I believe the problem is that I am defining a driver so the connection
> tacks on the Dbo string to my class names and then looks for a driver.
> This does not exist so it dies. I removed the driver definition from
> the database def:
>
>         var $gti_api = array(
>             'url' => 'http://swright-dev:1337/',
>         );
>
> And now I get this error:
>
> array
>   'filename' => string 'dbo_source' (length=10)
>   'classname' => string 'DboSource' (length=9)
>   'parent' => null
>   'plugin' => null
>
> ( ! ) Fatal error: Call to undefined method DboSource::connect() in /
> var/www/html/_libraries/cake_1_3/cake/libs/model/datasources/
> dbo_source.php on line 143
>
> So its still apparently wrong. The examples on the Cake 
> sitehttp://book.cakephp.org/view/1077/An-Exampledont really speak to
> this.
>
> Does anyone know where I am going wrong?
>
> Thanks
> Steve

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


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


Re: IE hangs when loading a page

2011-11-15 Thread Mike Karthauser
hi yves

On 15 Nov 2011, at 15:11, Yves S. Garret wrote:

> I know that this is IE only, since I tried it in Chrome and it worked.  
> Basically, I go to the page that I'm developing and the browser just hangs.  
> Very weird.  In Chrome, it loads without an issue.  Has anyone seen IE do 
> this before?  How did you get around it?
> 
> I can post the code if you want, but not sure just how much value that has 
> since it works just fine in one browser, but not the other.

i suggest you try disabling any javascript and then try loading ie again. It 
could be a script error which is causing your page to whitescreen. 

using internet explorer developer tools should also be a useful exercise 

http://en.wikipedia.org/wiki/Internet_Explorer_Developer_Tools

hth
mikek


Mike Karthäuser
Director, Brightstorm Ltd.

1, Brewery Court
North Street
Bristol
BS3 1JS

mi...@brightstorm.co.uk
www.brightstorm.co.uk
+44(0) 7939252144






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


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


Re: Singular controller name route

2011-11-15 Thread jeremyharris
Check out: http://book.cakephp.org/view/945/Routes-Configuration

There's examples for your very request about halfway through.

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


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


Re: UnitTests - The Real World

2011-11-15 Thread jeremyharris
You may want to just browse around some plugins that you use to see what's 
tested, or even the core tests. They give you a good idea. Basically you 
want to test against certain scenarios to make sure your code can handle 
them properly. Sure, if you *just* use baked code there's not much to test 
(but it's still a good idea to write them to even make sure your db setup 
works w/ the baked code).

For example, I have a method in my Group model that is a convenience for 
finding groups when compared to another group. For example, finding all 
groups of higher or equal permission to a certain group, finding groups 
less than a certain group, etc. I'm using ACL so the Groups are AROs and 
therefore a tree. My test case includes several assertions to make sure the 
method pulls the correct list of groups, as well as assertions that deal 
with handling missing parameters, etc.

Basically when you're writing tests, you want to cover as many 
possibilities to be sure your code won't bug out. It's especially important 
when handling user input, for example, /posts/index/2 - what if the user 
types /posts/index/all ? How should your code handle it?

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


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


Custom Datasource

2011-11-15 Thread RhythmicDevil
Hi All,
I am having some issues understanding the naming conventions for a
custom datasource.

datasource file name: gti_api_source.php
class name GtiApiSource


Database Config

var $gti_api = array(
'driver' => 'gti_api',
'url' => 'http://swright-dev:1337/',
);


Model

public $useDbConfig = 'gti_api';
public $useTable = false;


This is giving me errors. I did a var dump in
ConnectionManager::loadDataSource to see what it was asking for. I get
this:

array
  'filename' => string 'dbo/dbo_gti_api' (length=15)
  'classname' => string 'DboGtiApi' (length=9)
  'parent' =>
array
  'filename' => string 'dbo_source' (length=10)
  'classname' => string 'DboSource' (length=9)
  'parent' => null
  'plugin' => null
  'plugin' => null
array
  'filename' => string 'dbo_source' (length=10)
  'classname' => string 'DboSource' (length=9)
  'parent' => null
  'plugin' => null
Fatal Error (256): ConnectionManager::loadDataSource - Unable to
import DataSource class .DboGtiApi [CORE/cake/libs/model/
connection_manager.php, line 185


I believe the problem is that I am defining a driver so the connection
tacks on the Dbo string to my class names and then looks for a driver.
This does not exist so it dies. I removed the driver definition from
the database def:

var $gti_api = array(
'url' => 'http://swright-dev:1337/',
);

And now I get this error:

array
  'filename' => string 'dbo_source' (length=10)
  'classname' => string 'DboSource' (length=9)
  'parent' => null
  'plugin' => null

( ! ) Fatal error: Call to undefined method DboSource::connect() in /
var/www/html/_libraries/cake_1_3/cake/libs/model/datasources/
dbo_source.php on line 143

So its still apparently wrong. The examples on the Cake site
http://book.cakephp.org/view/1077/An-Example dont really speak to
this.

Does anyone know where I am going wrong?

Thanks
Steve

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


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


Re: Using REST In CakePHP 2.0

2011-11-15 Thread jeremyharris
The docs on the cake website are built from the github repo.

If you browse around the github repo, you'll see all the docs in there. In 
particular, this one speaks about contributing: 
https://github.com/cakephp/docs/blob/master/en/contributing/documentation.rst

As you can see, you can edit right in github and send a pull request. Easy! 
:)

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


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


IE hangs when loading a page

2011-11-15 Thread Yves S. Garret
I know that this is IE only, since I tried it in Chrome and it worked.
 Basically, I go to the page that I'm developing and the browser just
hangs.  Very weird.  In Chrome, it loads without an issue.  Has anyone seen
IE do this before?  How did you get around it?

I can post the code if you want, but not sure just how much value that has
since it works just fine in one browser, but not the other.

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


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


Lib Package names in 2.0

2011-11-15 Thread euromark
I was wondering how you manage your Lib classes now in cake2.0
Seems like putting them in /Lib directly is kind of deprecated. They
should belong to a package so to speak.

/Lib/ZodiacLib.php
becomes then (using Misc Package)
/Lib/Misc/ZodiacLib.php

and instead of using
App::import('Lib', 'PluginName.ZodiacLib'):
it is now
App::uses('ZodiacLib', 'Tools.Misc')

But how do you define package names. I find it quite difficult. Some
(like GoogleWeather) could belong in all kinds of packages
(Webservice, Google, Network, ...)
Are there some "basic package names" we should follow? I think it
makes sense to use as less packages as possible to avoid the above
problem.

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


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


Re: CakePHP 2.0.3 out of the oven

2011-11-15 Thread RhythmicDevil
What drove the decision to change the naming conventions?


On Nov 13, 8:28 pm, José Lorenzo  wrote:
> The CakePHP core team is proud to announce the immediate availability of
> CakePHP 2.0.3 [1]. A lot has happened in the PHP world since our last
> release, this new version incorporates all needed changes needed to adapt
> to the ever evolving world of PHP frameworks.
>
> One of the big changes out there was PHPUnit 3.6 being marked as stable and
> becoming the default version available through the PEAR installer. This
> change caught many developers by surprise. They could not easily run
> CakePHP's built-in test suite due to the major changes in PHPUnit. We have
> made the required changes to make sure 2.0.3 runs with no issues in both
> 3.5 and 3.6 versions of PHPUnit.
>
> A big difference people will notice when writing unit tests is that all
> output is swallowed by PHPUnit and not presented in either the web tester
> page nor in the CLI tester. To overcome this annoyance use the--debug modifier
> if you are using the CLI interface.
>
> The second bit of good news is the availability of PHP 5.4-rc1. We have
> taken the time to test our framework against this PHP version and fixed
> many of the few notices and issues that discovered while running our
> automated tests. If you are early jumping on the 5.4 bandwagon, you can
> consider CakePHP one of the frameworks to be running smoothly on it.
>
> In total, there were 66 commits and 32 issues have been resolved for 2.0.3.
> A complete list of the changes can be viewed in the changelogs page [2],
> here is a quick summary of changes that made it into 2.0.3:
>
>    - Runs smoothly in php 5.4
>    - Easier to test controllers using REST
>    - Correct manipulation of boolean values in DboSource::insertMulti()
>    - Full compatibility with PHPUnit 3.6
>    - Fixed several minor issues with the command line bake utility
>    - Fixed Content-Length calculation when there is buffered output that
>    will be sent before the response body
>    - Various improvements in the UpgradeShell
>    - DboSource::lastAffected() now returns correct integer
>
> Thanks for ever-growing interest in CakePHP, we have received many pull
> requests for both the code and documentation, we are excited about the all
> the buzz we are creating with this new version, without all your
> contributions there would not be CakePHP
>
>    - Download a packaged release [1]
>    - View the changelog [2]
>
> Links
>
>    - [1]http://github.com/cakephp/cakephp
>    - [2]http://cakephp.org/changelogs/2.0.3

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


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


Re: How to paginate "subtable" in a view?

2011-11-15 Thread phpMagpie
Use contain:
$this->paginate = array( 
  'Post'=> array( 
'limit'=> 2, 
'page'=> 1, 
'order'=> array('Post.created'=> 'desc'), 
'conditions' => array('Post.category_id' => $id),
'contain'=>array() // 
  ) 
); 
$this->set('posts', $this->paginate('Post')); 

Or set recursive = -1 on your models so by default it only ever pulls the 
current model's data and you then use contain to include only the data you 
want.

HTH, Paul.

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


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


Re: paginated comments not showing up in view

2011-11-15 Thread phpMagpie
try echo debug($comments); in your view to see if the array does contain 
any data.

HTH, Paul.

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


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


Singular controller name route

2011-11-15 Thread martinp
Has anyone seen or achieved routing whereby all controller view
actions can be accessed via the singular name of the controller?

e.g. /pages/view/1 can be accessed by page/1; posts/view/1 by post/1;
etc

I know route classes are possible, I know it's possible to use the
inflector, but I haven't been able to work out how to put it all
together, so that it works for any controller (named following the
conventions) you throw at it. Has anyone done this already?

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


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


Re: onClick in button

2011-11-15 Thread phpMagpie
> but it doesn't work why??

   - How does it not work, what actually happens? 
   - Are you running FireBug or something so you can debug what is 
   happening, or if the event is being fired at all?  

HTH, Paul


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


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


Re: How to Calculate time differences in the modal class?

2011-11-15 Thread Graham Weldon
$virtualFields = array(
'difference' => 'HOUR(TIMEDIFF(end, start))'
); 

Cheers,
Graham Weldon
http://grahamweldon.com
e. gra...@grahamweldon.com
p. (+61) 0407 017 293
Skype: grahamweldon


On Tuesday, 15 November 2011 at 8:13 PM, Gerrit wrote:

> Hello,
> 
> I've start and end field as datetime in my database. Now I want to
> calculate the difference in hours as a virtual field. Is that
> possible??
> 
> Thx!
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php
> 
> 


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


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


How to Calculate time differences in the modal class?

2011-11-15 Thread Gerrit
Hello,

I've start and end field as datetime in my database. Now I want to
calculate the difference in hours as a virtual field. Is that
possible??

Thx!

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


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


Re: Concurrency control

2011-11-15 Thread Ernesto
that's exactly what i'm doing. :)

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


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