Sent mail to a gmail.com address and a different domain received.

2013-02-21 Thread philip kearney
Hi, I had a funny problem with sending an email using cakephp.  I actually 
use PHPMailer. 

My problem is that I sent an email to lets say test...@gmail.com but it 
didn't go to that email address it went to an address test...@different.com 
( both the same username both different domain names)

I made sure that the address I first sent it to was correct and it was.

How could this of happened. There are no forwarding settings on the gmail 
account or nothing. These were two completly different people.

Thanks for any 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 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: URL rewriting issue with cakephp 1.3.11

2011-09-22 Thread philip onkware
is that you shankar.did u once work for flsmidth in kenya?

On Thu, Sep 22, 2011 at 8:10 AM, Shiv Shankar  wrote:

> I have configured cakephp on WINDOWS SERVER 2008 using WAMP
> combination. I had worked a lot on cakephp using LAMP combination and
> did'n get any problem in the post. But now i am getting the following
> error. when i use the url http://localhost/cakephp/
>
>
> URL rewriting is not properly configured on your server.
>
>   1. Help me configure it
>   2. I don't / can't use URL rewriting
>
>
> I had gone through a number of tutorials to solve this but none proves
> to be perfect. Please help!!
>
> --
> 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: Multiple homepages

2011-06-14 Thread Philip Thompson
Seems pretty correct to me. Here's a piece of logic to determine if a user
is visiting an admin page and if they're an actual admin. It's in the
app_controller file.

public function beforeFilter ()
{
parent::beforeFilter();
$this->isAdmin = $this->Session->read('isAdmin');

if (isset ($this->params['admin']) && $this->params['admin'] &&
!$this->isAdmin) {
$this->redirect('/');
}
}

I know this isn't exactly what you're doing... but you could have something
similar to detect a logged in user and what their user type is, and then
redirect them accordingly. I think your logic is sound though. Others can
set me straight if I'm also off... =D

Happy coding,

~Philip


On Tue, Jun 14, 2011 at 9:23 AM, chris wrote:

> Just wanted to know what the best way is to acheive what I am doing.
>
> My requirement, to show a different home page to the user dependant on
> 2 things.
>
> 1) If they are logged in
> 2) What 'user level' they are (A custom variable in my users table,
> which I use to identify different user types)
>
> From looking around, I've created a 'myindex' controller, which one
> action 'index'. Then I set the route as follows:-
>
> Router::connect('/', array('controller' => 'myindex', 'action' =>
> 'index'));
> replacing the previous
> Router::connect('/', array('controller' => 'pages', 'action' =>
> 'display', 'home'));
>
> then the index action is something like
>
> if($this->Auth->User('accounttype_id')==ACCOUNTTYPE_ADMIN)
>$this-
> >redirect(array('controller'=>'dashboard','action'=>'index','admin'=>1));
>
> etc..
>
> with a default for not logged in users of
>
> $this-
> >redirect(array('controller'=>'pages','action'=>'display','home'));
>
> but then I wanted the default home page url to be just www.mydomain.com
>
> So I created myindex/index.ctp and put the static HTML from pages/
> home.ctp into this.
>
> This all seems to work, but I just wanted to know if there are better
> ways to handle this?
>
>
-- 
http://lonestarlightandsound.com/

-- 
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: vps vs dedicated server

2011-06-09 Thread Philip Thompson
Chat with a sales person at SoftLayer. Tell them what you're looking for and
they will help you determine what the best solution is for your company.
They won't try to under or over sell you - it's about finding the right
package that fits your needs. (I promise I'm not a sales person =P)

http://www.softlayer.com/

<http://www.softlayer.com/>Hope this helps,
~Philip


On Thu, Jun 9, 2011 at 12:13 PM, Jeremy Burns | Class Outfit <
jeremybu...@classoutfit.com> wrote:

> www.tdrnetworks.com - not a great looking website, but really good
> service, great products and really reasonable costs. They host some of my
> sites. $50-$100 per month will give you plenty of scale.
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.com
> http://www.classoutfit.com
>
> On 9 Jun 2011, at 17:40, Tan Cheng wrote:
>
> > Hi everyone,
> >
> > I don't know if this question belongs to here, but will ask it anyway.
> >
> > I wrote a video site for my company recently in cake, and for
> > demonstration purpose, I am now just hosting it on a shared hosting
> > with several bucks per month.
> >
> > However, my boss decides to start using it officially and I think I
> > should migrate it to a more secure and stable environment. The IT
> > department says that we need to purchase a dedicated host for about
> > $1-$15000. My boss thinks it's too expensive.
> >
> > I googled around and found the vps is a pretty pratical solution, I
> > will have root access plus I can get 24 7 tech support. But what other
> > aspects should I consider? My boss wants me to come up with a matrix
> > comparing dedicated server vs VPS.
> >
> > This site will need about 50gb to start with and the traffic won't be
> > very high, the videos are more educational than entertaining.
> >
> > I am just an amateur programmer, and know little about security
> > issues. So what should I do?
> >
> > Thanks in advance!
> >
> > -David
> >
>

-- 
http://lonestarlightandsound.com/

-- 
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: Tricking Validation

2011-06-08 Thread Philip Thompson
With client side, you can use javascript to grab the "text" from the
textarea and see how long that is. Something like Mootools (or whatever
framework) would provide:

document.id('mytextarea').get('text').trim().length > 50

Since it's only grabbing text and not any html characters, it will make sure
they have actually typed in 50 or more non-whitespace characters.

For server side, you could use strip_tags() to and get the "text":

trim (strip_tags ($this->data['mytextarea'])) > 50

Hope that helps,
~Philip

On Wed, Jun 8, 2011 at 12:28 PM, Krissy Masters
wrote:

> How can you prevent tricking validation to pass in a situation when your
> using an HTML editor. Example I have a textarea validation set to required
> /
> not empty / min 50 chars/
> But if a user simply hit enter a few times its actually creating  in
> the data that will end up being sent so after a few "enters" you have
> enough
> characters to pass validation.
> Has anyone defeated this?
>
> Thanks K


-- 
http://lonestarlightandsound.com/

-- 
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 PHP error message

2011-06-08 Thread Philip Thompson
First, add an index method to your class:
public function index () {}

Then, access the controllers the correct way:
http://localhost/Cake/Items
or
http://localhost/Cake/Items/index

This is assuming that "Cake" is a directory in your web root that contains
your whole cake project. Have you gone through the tutorial yet? You might
start there to get some basics down.

http://book.cakephp.org/view/1528/Blog

<http://book.cakephp.org/view/1528/Blog>Hope this helps,
~Philip

On Wed, Jun 8, 2011 at 12:56 PM, Magician wrote:

> Hello everyone,
>
> I am trying to write a cake php application and currently am having a
> problem with the controller for it.  The code is as follows:
>
> 
> class ItemsController extends AppController
>
> {
> var $name = 'Items';
> var $scaffold;
> }
>
> ?>
>
> It is saved in the controllers folder as items_controller.php.  I
> tried accessing it directly at
> http://localhost/Cake/app/controllers/items_controller.php
> and get this error message:
>
>
> ( ! ) Fatal error: Class 'AppController' not found in C:\wamp\www\Cake
> \app\controllers\items_controller.php on line 5
> Call Stack
> #   TimeMemory  FunctionLocation
> 1   0.0388  364216  {main}( )   ..\items_controller.php:0
>
> I need some help.  Does anyone know what I've done wrong?
>

-- 
http://lonestarlightandsound.com/

-- 
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: .ctp files

2011-06-05 Thread Philip Medes

I guess my mistake was getting a book on it.
 


Date: Tue, 31 May 2011 00:39:36 -0700
From: jdittr...@gmail.com
To: cake-php@googlegroups.com
Subject: Re: .ctp files

You did probably not understand the concept of the CakePHP framework. You never 
try to access the view files directly and you never access a model directly 
from the browser. You can read the basic principles of CakePHP here: 
http://book.cakephp.org/view/892/Basic-Principles-of-CakePHP



-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php
  

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


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


RE: Problem with default.ctp

2011-06-05 Thread Philip Medes

See below.
 

> Subject: Re: Problem with default.ctp
> From: google-2...@ryandesign.com> Date: Tue, 31 May 2011 02:37:10 -0500
> To: cake-php@googlegroups.com
> 
> 
> On May 30, 2011, at 09:28, Phil wrote:
> 
> > I created a sample app using the scaffolding, which worked very well,
> > thank you.
> > I went the next step and created a default.ctp file using the one that
> > comes with cakephp.
> 
> Where did you put your default.ctp? What's in it?
location: app/views/layouts
contents:

 
  My Cake Blog Application
  css('styles');?>
 
 
  
  
   
  
  
 


> 
> > I then created a style.css file with the following:
> 
> Where did you put your style.css?
app/webroot
> 
> > I then tried rerunning the application and the only output I got was:
> > css('styles');?>
> 
> 
> 
> -- 
> 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: Association between a httpget json datasource and a mysql datasource.

2011-06-02 Thread Philip Burrows
It looks like I will have to try it out. I will try and write up a
tutorial when finished.
Cheers
Phil

On Jun 1, 10:19 pm, Philip Burrows  wrote:
> Hi all,
> Just wanted to know if it is possible to create an association between
> a datasource that uses httpget to retrieve json and a mysql database.
> I will be usingwww.uk-postcodes.comto find out the ward for a
> particular postcode, then querying my database to list the councillors
> in the ward.
> Similar towww.writetothem.com.
> Cheers
> Phil

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


Association between a httpget json datasource and a mysql datasource.

2011-06-01 Thread Philip Burrows
Hi all,
Just wanted to know if it is possible to create an association between
a datasource that uses httpget to retrieve json and a mysql database.
I will be using www.uk-postcodes.com to find out the ward for a
particular postcode, then querying my database to list the councillors
in the ward.
Similar to www.writetothem.com.
Cheers
Phil

-- 
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: Simple AJAX pagination not working

2011-05-26 Thread Philip Thompson
Those durn multiple js libraries. Go with Mootools and be done with it!! ;)

~Philip

On Thu, May 26, 2011 at 4:05 PM, l4yercake  wrote:

> Philip, thank you for the reply. I had called writeBuffer at the
> bottom of the view, so that was not the issue.
>
> I actually figured out what the problem was late last night after many
> hours spent trying different things. I will post here incase anyone
> else is faced with this problem.
>
> The issue was that I was loading in multiple javascripts, mainly
> prototype and jquery, which will conflict unless you make a call to
> noConflict (if I understand this correctly, I still need to read more
> about this).
>
> Even though I had read this section in the cakephp manual (http://
> book.cakephp.org/view/1643/Using-jQuery-with-other-libraries) I did
> not realize at the time that that was my problem.
>
>
> On May 26, 8:15 am, Philip Thompson  wrote:
> > You should also have a writeBuffer() call at the end of your home.ctp...
> >
> > Don't know if that will solve all your problems, but it's something. Hope
> > that helps.
> >
> > ~Philip
> >
> > http://lonestarlightandsound.com/
> >
> >
> >
> >
> >
> >
> >
> > On Wed, May 25, 2011 at 5:16 PM, l4yercake 
> wrote:
> > > Hello all,
> >
> > > I followed the directions in the Cake 1.3 manual to implement ajax
> > > pagination (http://book.cakephp.org/view/1600/Ajax-Pagination) and I
> > > also tried the method posted by Mark Story (Thanks!) on his blog
> > > (
> http://mark-story.com/posts/view/creating-simple-ajax-pagination-with-
> > > cakephp-1-3-and-mootools).
> >
> > > I know from the comments that these two methods have worked for users,
> > > but I can't seem to figure out what the issue is with my code. Here is
> > > a link to my code:http://bin.cakephp.org/view/441618115
> >
> > > This is what I am encountering: I have set a limit of 10 results.
> > > These results show up correctly, however when I click on the "next"
> > > link to show the rest of the results, the entire page goes empty.
> > > Without AJAX, I am taken to page 2 and the results show up. With AJAX
> > > implemented as shown in my code, the entire page just goes empty/
> > > white.
> >
> > > I have tried searching for this particular scenario and what might be
> > > affecting it but I could not find anything. I would appreciate any
> > > help.
> >
> > > Thank you!
> >
> > > --
> > > Our newest site for the community: CakePHP Video Tutorials
> > >http://tv.cakephp.org
> > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> > > others with their CakePHP related questions.
> >
> > > To unsubscribe from this group, send email to
> > > cake-php+unsubscr...@googlegroups.com For more options, visit this
> group
> > > athttp://groups.google.com/group/cake-php
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

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


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


Re: Simple AJAX pagination not working

2011-05-26 Thread Philip Thompson
You should also have a writeBuffer() call at the end of your home.ctp...

Don't know if that will solve all your problems, but it's something. Hope
that helps.

~Philip

http://lonestarlightandsound.com/

On Wed, May 25, 2011 at 5:16 PM, l4yercake  wrote:

> Hello all,
>
> I followed the directions in the Cake 1.3 manual to implement ajax
> pagination (http://book.cakephp.org/view/1600/Ajax-Pagination) and I
> also tried the method posted by Mark Story (Thanks!) on his blog
> (http://mark-story.com/posts/view/creating-simple-ajax-pagination-with-
> cakephp-1-3-and-mootools).
>
> I know from the comments that these two methods have worked for users,
> but I can't seem to figure out what the issue is with my code. Here is
> a link to my code: http://bin.cakephp.org/view/441618115
>
> This is what I am encountering: I have set a limit of 10 results.
> These results show up correctly, however when I click on the "next"
> link to show the rest of the results, the entire page goes empty.
> Without AJAX, I am taken to page 2 and the results show up. With AJAX
> implemented as shown in my code, the entire page just goes empty/
> white.
>
> I have tried searching for this particular scenario and what might be
> affecting it but I could not find anything. I would appreciate any
> help.
>
> Thank you!
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

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


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


Re: Testing the Datasource

2011-05-05 Thread Philip Burrows
Any good tutorials on how to write schema for datasources? I can't
find any. Do I even need to write the schema or can I leave the
define() method blank?

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


Testing the Datasource

2011-05-03 Thread Philip Burrows
Hi there,
What is the best way to go about testing my datasource before building
the MV & C? Should I build a simple MVC that passes everything through
or shall I build the datasource independently and test it on its own?
I am having difficulty understanding how to build the schema for the
datasource->describe().
Cheers
Phil

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

2011-04-29 Thread Philip Thompson
Actually, I meant $this->Session->read('user'). To grab the full user record
and all associated data

$user = $this->User->read(...);
$this->Session->write('user', $user);

Because I found the default data for $this->Auth->user() was lacking. But if
$this->Auth->user() is needing to make a query each time it's called, I
don't want to go that direction - I want to pull the data w/o a database
call.

Sorry for the confusion... :)

Thanks,
~Philip

On Fri, Apr 29, 2011 at 5:11 PM, euromark wrote:

> you probably mean $this->Session->read('Auth.User') ...
> yes, so both is more or less the same :)
>
>
> On 30 Apr., 00:05, Philip Thompson  wrote:
> > Which is better practice...
> >
> > $user = $this->Auth->user();
> >
> > or
> >
> > $user = $this->Session->read('user'); // This was saved once logged in
> >
> > Does the "Auth" happen to pull from the Session anyway?
> >
> > Thanks,
> > ~Philip
>
> --
> 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


Standard

2011-04-29 Thread Philip Thompson
Which is better practice...

$user = $this->Auth->user();

or

$user = $this->Session->read('user'); // This was saved once logged in

Does the "Auth" happen to pull from the Session anyway?

Thanks,
~Philip

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


ODBC + Cake 1.3

2010-12-16 Thread Philip Thompson
Hi all.

Been doing some digging around google and haven't found much on the topic of
CakePHP 1.3 + ODBC support. From my understanding, 1.2 allowed ODBC
connections, but it doesn't appear as though 1.3 does. The listing of
datasources are found in /app/cake/libs/model/datasources/dbo/...

dbo_mssql.php, dbo_mysql.php, dbo_mysqli.php, dbo_oracle.php,
dbo_postgres.php, dbo_sqlite.php

The git repo
shows others:
https://github.com/cakephp/datasources/tree/master/models/datasources/dbo

So my question, is/will Cake support ODBC for 1.3 and/or later?

My initial setup shoots back an error:

*Fatal Error* (256): ConnectionManager::loadDataSource - Unable to
import DataSource class .DboOdbc
[*CORE/cake/libs/model/connection_manager.php*, line *185*]

Code  | Context 

if (!App::import('Datasource', $class,
!is_null($conn['plugin']))) {
trigger_error(sprintf(__('ConnectionManager::loadDataSource - Unable
to import DataSource class %s', true), $class), E_USER_ERROR);

$connName   =   "ws"
$_this  =   ConnectionManager
ConnectionManager::$config = DATABASE_CONFIG object
ConnectionManager::$_dataSources = array
ConnectionManager::$_connectionsEnum = array
$conn   =   array(
"plugin" => null,
"classname" => "DboOdbc",
"parent" => array(
"filename" => "dbo_source",
"classname" => "DboSource",
"parent" => null,
"plugin" => null
),
"filename" => "dbo/dbo_odbc"
)
$class  =   ".DboOdbc"

ConnectionManager::loadDataSource() -
CORE/cake/libs/model/connection_manager.php, line 185
ConnectionManager::getDataSource() -
CORE/cake/libs/model/connection_manager.php, line 109
Model::setDataSource() - CORE/cake/libs/model/model.php, line 2833
Model::__construct() - CORE/cake/libs/model/model.php, line 469
ClassRegistry::init() - CORE/cake/libs/class_registry.php, line 141
Controller::loadModel() - CORE/cake/libs/controller/controller.php, line 641
Controller::constructClasses() -
CORE/cake/libs/controller/controller.php, line 497
Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 186
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 171
[main] - APP/webroot/index.php, line 83

My configuration is like so:

class DATABASE_CONFIG {
var $ws = array(
'driver' => 'odbc',
'connect' => 'odbc_connect',
'persistent' => false,
'host' => 'localhost',
'port' => '',
'login' => 'pizza',
'password' => 'pizza',
'database' => 'theDataSource',
'schema' => '',
'prefix' => '',
'encoding' => ''
);
}

Any thoughts or guidance would be greatly appreciated.

Thanks,
~Philip

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Saving data in many tables in CakePHP

2010-11-15 Thread Rey Philip
I a newbie question. This is how can I save data in many tables. Heres
a scenario, example I have a Profiles controller, then I have a
register method/action. Lets say I have 2 tables involved the users
table and emails table, this is only for the sake of the
demonstration. In my view in the register method there are two input
boxes name which resides in the users table and email textbox for the
emails table. Now what I want to do is that, when I press the submit
button I want the name to be saved in the names table and the email to
the emails table..

Here is the schema:

users table:
id
name

emails table:
id
user_id
email

I wonder what the view for register method would look like, since the
form->create() methods 1st paramter is the name of the model.. And
also how do I saved the data on two different tables.

Again, thanks in advance.

Philip

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


CakePHP Two Step View Pattern

2010-11-15 Thread Rey Philip
Hi guys I'm new here in CakePHP. How can I implement a two step view
pattern in CakePHP? Example I have a layout there are two content divs
namely content1 and content2. The code is like this



My Cake Blog Application
css('styles');?>





















Can I do this in CakePHP? Cause in CodeIgniter we setup a layout and
then in the layout we could display many views. How can I do that here
in CakePHP?

Thanks in advance..

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Populating a parent field when adding new rows

2010-10-21 Thread Philip
Hi,

I'm sorry if this has been answered elsewhere but I've done a bit of
googling and can't seem to find this situation.

I've got a table which refers back to itself. It's  a table of
geographical locations (territories) and each territory may have a
parent territory which it is a part of.

I've got a parent_id field in the territory table and I  used bake to
generate my view, model and controller.

However, while  I can add a territory, when doing so the Parent drop-
down menu doesn't seem to populate with the other territories.

I'm using PHP 5, Cake 1.3.4 running locally in MAMP.

These are, I believe, the relevant sections of code and (as one would
expect from auto-generated code) they seem to match the other examples
I can find online:

>From territory.php

var $belongsTo = array(
'ParentTerritory' => array(
'className' => 'Territory',
'foreignKey' => 'parent_id',
'conditions' => '',
'fields' => '',
'order' => ''
),


and

var $hasMany = array(
'ChildTerritory' => array(
'className' => 'Territory',
'foreignKey' => 'parent_id',
'dependent' => false,
'conditions' => '',
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
'exclusive' => '',
'finderQuery' => '',
'counterQuery' => ''
)


from territories_controller.php

$parentTerritories = $this->Territory->ParentTerritory->find('list');

and from the add.ctp view:

echo $this->Form->input('parent_id');

Does anyone have any idea why the Parent  field in the add view
doesn't seem to contain anything given that I have added a few
territories without parents?

It doesn't even show the parent if I manually edit the DB to give a
territory a parent, although the parent will still be displayed on the
"view territories" page.

Thanks for your help

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Helper or Element?

2010-09-19 Thread Philip Thompson
Hi all.

I'm wanting to create a simple helper or element which displays a menu. I've 
read around and have seen that others have created helpers which create 
dynamic, database-driven, nested menus. This seems to be too much for my needs. 
I also tend to think that the creation of a menu should be in an element 
just cuz it seems "more appropriate" - wish I had more justification.

element('menu', array(
'items' => array(
'First' => array('attr'=>'...'),
'Second' => array('attr'=>'...'),
'Third' => array('attr'=>'...'),
),
));
?>

Then in the element just loop through the items and display them in an 
unordered list.

So, which would be more appropriate for this functionality - an element or a 
helper? And why?

Thanks!
~Philip

http://lonestarlightandsound.com

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

2010-08-24 Thread Philip Thompson
On Aug 24, 2010, at 6:03 PM, cricket wrote:

> On Tue, Aug 24, 2010 at 2:31 PM, Philip Thompson  
> wrote:
>> Hi all.
>> 
>> Sorry for all these newb questions... trying to learn this stuff. Here's the 
>> relationships and tables I have:
>> 
>> Relationships:
>> Hardware HABTM Configuration
>> Configuration belongsTo ConfigurationType
>> 
>> Tables:
>> configurations
>>- configuration_type_id
>> configurations_hardwares
>>- configuration_id
>>- hardware_id
>> configuration_types
>> hardwares
>> 
>> When pulling the information for a specific Hardware record, I'm 
>> successfully getting the Configurations associated with it, but I'm not 
>> getting the information from the configuration_types table. How do I get 
>> info from this other table?
>> 
>> > $options['conditions'] = array('Hardware.id'=>$id);
>> $this->Hardware->find('first', $options);
>> ?>
>> 
>> produces...
>> 
>> Array
>> (
>>[Hardware] => Array
>>(
>>[id] => 3
>>[hardware_type_id] => 2
>>[name] => w-irv-win7dev
>>[description] => Philip Thompson's Windows 7 machine
>>[location_id] => 1
>>)
>> 
>>[Configuration] => Array
>>(
>>[0] => Array
>>(
>>[id] => 1
>>[configuration_type_id] => 1
>>[configuration] => Windows 7 Professional
>>[description] =>
>>[ConfigurationsHardware] => Array
>>(
>>[id] => 1
>>[configuration_id] => 1
>>[hardware_id] => 3
>>)
>>)
>> 
>>[1] => Array
>>(
>>[id] => 3
>>[configuration_type_id] => 5
>>[configuration] => Yes
>>[description] =>
>>[ConfigurationsHardware] => Array
>>(
>>[id] => 2
>>[configuration_id] => 3
>>    [hardware_id] => 3
>>)
>>)
>>)
>> )
>> 
>> I get the configuration_type_id result, but I want other fields from 
>> configuration_type. Any help would be greatly appreciated on how to 
>> accomplish this!
>> 
> 
> You need to increase the "recursive" value:
> 
> $options['recursive'] = 2;
> 
> I recommend you take a look at ContainableBehavior, though. It gives
> one much more control (recursive == 2 can fetch too much data).

Excellent! Thanks for your help. It worked!

~Philip

http://lonestarlightandsound.com/

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Relationships

2010-08-24 Thread Philip Thompson
Hi all.

Sorry for all these newb questions... trying to learn this stuff. Here's the 
relationships and tables I have:

Relationships:
Hardware HABTM Configuration
Configuration belongsTo ConfigurationType

Tables:
configurations
- configuration_type_id
configurations_hardwares
- configuration_id
- hardware_id
configuration_types
hardwares

When pulling the information for a specific Hardware record, I'm successfully 
getting the Configurations associated with it, but I'm not getting the 
information from the configuration_types table. How do I get info from this 
other table?

$id);
$this->Hardware->find('first', $options);
?>

produces...

Array
(
[Hardware] => Array
(
[id] => 3
[hardware_type_id] => 2
[name] => w-irv-win7dev
[description] => Philip Thompson's Windows 7 machine
[location_id] => 1
)

[Configuration] => Array
(
[0] => Array
(
[id] => 1
[configuration_type_id] => 1
[configuration] => Windows 7 Professional
[description] => 
[ConfigurationsHardware] => Array
(
[id] => 1
[configuration_id] => 1
[hardware_id] => 3
)
)

[1] => Array
(
[id] => 3
[configuration_type_id] => 5
[configuration] => Yes
[description] => 
[ConfigurationsHardware] => Array
(
[id] => 2
[configuration_id] => 3
[hardware_id] => 3
)
)
)
)

I get the configuration_type_id result, but I want other fields from 
configuration_type. Any help would be greatly appreciated on how to accomplish 
this!

Thanks in advance,

~Philip

http://lonestarlightandsound.com/

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

2010-08-24 Thread Philip Thompson
On Aug 23, 2010, at 3:39 PM, Philip Thompson wrote:

> Hi all.
> 
> I'm using MooTools 1.2.4 and CakePHP 1.3. I'm attempting to get 
> Autocompleter.Ajax.Json() working, but I'm not seeing the result list. 
> Firebug is letting me know that the query is returning the correct results, 
> but still not seeing anything. From the Cake side of things, am I approaching 
> this the correct way?
> 
>  // /app/controllers/hardwares_controller.php
> class HardwaresController extends AppController {
>public function config () {
>$options = array(
>'conditions' => array(
>'ConfigurationType.name LIKE' => '%'.$_POST['q'].'%',
>),
>);
>$configType = $this->import('ConfigurationType', 'Model');
>$types = $configType->find('list', $options);
>$this->set('output', json_encode ($types));
>$this->render('/elements/ajax');
>}
> }
> 
> // /app/views/elements/ajax.ctp
> if (isset ($output)) {
>echo $output;
> }
> ?>
> 
> 
> new Autocompleter.Ajax.Json(document.id(input), url, {
>postVar: 'q',
>postData: {},
>ajaxOptions: {},
>minLength: 1,
>delay: 100,
>filterSubset: true,
>filterCase: false,
>relative: false,
>selectedMode: true,
>zIndex: 1,
>evalScripts: true,
>selectFirst: true
> });
> 
> 
> Again, the result is being returned, but the javascript seems to not be 
> picking up on it. Not sure if it's how I'm rendering the result or what? Any 
> thoughts would be appreciated!
> 
> http://clientcide.com/docs/3rdParty/Autocompleter.Remote
> http://www.clientcide.com/wiki/cnet-libraries/11-3rdparty/03-autocompleter.remote
> 
> Thanks in advance,
> ~Philip
> 
> http://lonestarlightandsound.com/

Figured out what the issue was. The autocomplete was working properly, however, 
the CSS was preventing the list from being shown in the correct spot (not below 
the input box). To fix it, I gave the surrounding div and ul a position of 
relative.

div.config div, 
div.config ul {
position: relative;
}

Thanks.

~Philip

http://lonestarlightandsound.com/

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Autocomplete

2010-08-23 Thread Philip Thompson
Hi all.

I'm using MooTools 1.2.4 and CakePHP 1.3. I'm attempting to get 
Autocompleter.Ajax.Json() working, but I'm not seeing the result list. Firebug 
is letting me know that the query is returning the correct results, but still 
not seeing anything. From the Cake side of things, am I approaching this the 
correct way?

 array(
'ConfigurationType.name LIKE' => '%'.$_POST['q'].'%',
),
);
$configType = $this->import('ConfigurationType', 'Model');
$types = $configType->find('list', $options);
$this->set('output', json_encode ($types));
$this->render('/elements/ajax');
}
}

// /app/views/elements/ajax.ctp
if (isset ($output)) {
echo $output;
}
?>


new Autocompleter.Ajax.Json(document.id(input), url, {
postVar: 'q',
postData: {},
ajaxOptions: {},
minLength: 1,
delay: 100,
filterSubset: true,
filterCase: false,
relative: false,
selectedMode: true,
zIndex: 1,
evalScripts: true,
selectFirst: true
});


Again, the result is being returned, but the javascript seems to not be picking 
up on it. Not sure if it's how I'm rendering the result or what? Any thoughts 
would be appreciated!

http://clientcide.com/docs/3rdParty/Autocompleter.Remote
http://www.clientcide.com/wiki/cnet-libraries/11-3rdparty/03-autocompleter.remote

Thanks in advance,
~Philip

http://lonestarlightandsound.com/

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: cakephp and Ajax pagination (mootools)

2010-08-23 Thread Philip Thompson
On Aug 21, 2010, at 3:13 AM, Mariano C. wrote:

> I have followed perfectly this guide (
> http://mark-story.com/posts/view/creating-simple-ajax-pagination-with-cakephp-1-3-and-mootools
> ) but it only works at 50%.
> 
> I just have two link for pagination: 1 & 2. If I go to:
> htp://my_web.com/items/user/page:1 the link to second page is active,
> thus if I click this link the second page will be opened in ajax
> style. OK!
> 
> Now, link for page 2 is disabled and link to the first page is active,
> but, if I click this link the page will be reloaded entirely as normal
> call.
> 
> Viceversa happen if I call htp://my_web.com/items/mariano/page:2.
> Clicking on link 1 will load new page in AJAX, successivly clicking on
> page 2 will happen with classic call.
> 
> Why?

I ran into this same issue. You *must* include your call to $js->writeBuffer() 
within the view that gets rendered with each ajax request. Otherwise, after 
your first click of an ajax link, the new set of links that get loaded from the 
ajax request don't get updated with the custom onclick events.

So, for example, I have a table element that has the option to be shown on each 
ajax request. At the bottom of the element file, I have the appropriate call

writeBuffer(array('onDomReady'=>false));
}
?>

Now, each time the new ajax page loads, the links get updated.

Hope that helps.
~Philip

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Pagination across controllers

2010-08-20 Thread Philip Thompson
Hi all.

I've done plenty of searching and been unable to find a solution yet. I'm also 
fairly new to Cake, but not to PHP. I have ajax pagination working from the 
currently-view controller/model. However, if I attempt to paginate a list that 
comes from a different model/controller, I only get 1 result.

>From Hardware, I get a properly paginated list of hardware items. Hardware has 
>a belongsTo relationship to HardwareType and Location. From Location, I want 
>to include a paginated list of hardware items. If I call the same method from 
>LocationsController as I do in HardwaresController, I only get 1 result.

array('Mootools'));
public $paginate = array(
'Hardware' => array(
'limit' => 3,
'order' => array(
'Hardware.name' => 'ASC'
),
),
);

public function index () {
$this->set('hardware', $this->listing()); // This works as expected
}

public function listing () {
return $this->paginate('Hardware');
}
}

class LocationsController extends AppController
{
...
public function view ($id) {
...
App::import('Controller', 'Hardwares');
$Hardwares = new HardwaresController;
$Hardwares->constructClasses();
$this->set('hardwares', $Hardwares->listing()); // This is only 1 result
}
}

class Hardware extends AppModel
{
public $name = 'Hardware';
public $belongsTo = array('HardwareType', 'Location');
public $order = array('Hardware.name ASC');
...
}
?>

Can anyone explain why I'm only getting a single result (which is the actual 
first result) and/or please provide some assistance on how to resolve the issue?

Thanks in advance.

~Philip

http://lonestarlightandsound.com/

"innerHTML is a string. The DOM is not a string, it's a hierarchal object 
structure. Shoving a string into an object is impure and similar to wrapping a 
spaghetti noodle around an orange and calling it lunch."

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Validation problem wtih "required" flag set

2009-12-23 Thread Philip


Hi all,

I have been reading posts on the confusion over "required" flag and I
think I understand it pretty well.

However I am having problem trying to make it work.

For example, here is my call:

$this->User->validate(array('User'=>array('username'=>'test')));

And for the model, I have just one rule, which is "notEmpty" with
"required" set to "true".

Odd thing is that if I use a html FORM to post ($this->User->validate
($_POST['data']), then it works, but not when I invoke it directly.

I am wondering if this has anything to do with the way I structure the
data array?

Any ideas would be appreciated, many thanks in advance.

Philip

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Creating DatabaseTables (cakephp way)

2008-11-06 Thread Rey Philip

By the way thnks for the responseActually what I want to do is the
"HasOne" relationship, the problem is that I can't implement it. The
problem is like this

I have a users table:
id integer auto increment primary
firstname varchar(45)
lastname varchar(45)

also I have a userinformations table
id integer auto increment primary
sss_number varchar(45)
birthday datetime
user_id integer

I want this to have a one to one relationship

so what I did in the userinformations_controller.php

class UserinformationsController extends AppController
{
var $name = 'Userinformations';
var $scaffold;
}

in the userinformation.php

class Userinformation extends AppModel
{
var $ame = 'Userinformation';
var $belongsTo = array('User');
}

in the users_controller.php

class UsersController extends AppController
{
var $name = 'User';
var $scaffold;
}

in the user.php

class User extends AppModel
{
var $name = 'User';
var $hasOne = array('Userinformation');
}

After doing that, I add new users to my users table and its
doneThe problem now is when I insert records on the
userinformations table, I cant insert 2 or more user_id in the
userinformations table. So I think the problem is on my table cause my
userinformations table has an auto_increment id  and also the primary
key. So what I want to do is to delete the id in the userinformations
table and then make the user_id a primary key so, it will have a one
to one relationship with the user table.

Am I right? Give me some advice on how to do it correctly.

Good day.

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



Creating DatabaseTables (cakephp way)

2008-11-05 Thread Rey Philip

hi guys,

   I just would like to ask about creating tables. I have read a book
"Apress Beginning CakePHP" in chapter 2 it says there that

"Giving each record a unique id value is essential for Cake to
function without trouble.
This application is simple, so you may be able to get by without
creating an id field set to
auto_increment. However, it’s good practice to make sure that all your
records in the database
can be identified by a unique value and that it’s named id, because
then Cake can generate
scaffolding around your table without any code on your part. Once you
begin creating associated
tables, then it will be mandatory to include an id field."

My question is, I want to change the id field into another name, let's
say category_id. Example I have a category table like this.

category_table
fields: category_id, name, description

Will this work in the scaffolding feature?

Here's my entire problemSample I have  a not real world example
haha...

products has one to one relationship with category.

product has one category
category has one product

product
fields: id, name, description

category
fields category_id, name, description, product_id

can this be possible using cake's scaffolding feature?
if possible how?

Good day.

--~--~-~--~~~---~--~~
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: Bakery article on "Testing Models" -- Missing Database Table

2007-12-20 Thread Philip

Thanks, I appreciate the suggestions.

Along the way I found a simple naming issue that was screwing up my
fixtures: I had named my file tournament_games_test_fixture.php
instead of the singular, tournament_game_test_fixture.php.

I also am finding that if I try to load the "...Test" model in the
setUp, the Missing Database Table resurfaces:

function setUp() {
$this->TestObject = new TournamentGameTest();
}


But if I instead don't use TournamentGameTest until the test, we're
fine:

  function testFindAll() {
  $this->TournamentGameTest =& new TournamentGameTest();
  $result = $this->TournamentGameTest->findAll();
//...
  }

Thanks again for your help!

- Philip


On Dec 19, 11:59 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Look at example:
> 1) App::import instead of loadModel
> 2) in model declaration add useTable and clean unnecessery
> associations.
>   If you need some association from real model you should redeclare
> all models in this test case.
> 3) If test case declaration - need to declare fixture.
> 4) Fixture possible to create based on "cake scema generate" script
> result.
>
> App::import("Model", 'Flag');
> class FlagTest extends Flag {
> var $name = 'Flag';
> var $useTable = 'flag_tests';
> var $useDbConfig = 'test_suite';
> var $cacheSources = false;
> var $belongsTo = array();
> var $hasOne = array();
> var $hasMany = array();
> var $hasAndBelongsToMany = array();
>
> }
>
> class FlagTestCase extends CakeTestCase {
> var $TestObject = null;
> var $fixtures = array('flag_test',  );
>
> function testItShouldGroupFlags() {
> $this->Flag = new FlagTest();
> }
>
> }
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Bakery article on "Testing Models" -- Missing Database Table

2007-12-19 Thread Philip

I'm attempting to apply the Bakery article "Testing Models with
CakePHP 1.2 test suite" <http://bakery.cakephp.org/articles/view/
testing-models-with-cakephp-1-2-test-suite> by Mariano Iglesias to my
own testing, but I'm getting Missing Database Table for my *Test
class.

Is anyone successfully using these techniques and willing to volunteer
to answer questions?   Technical details of my specific issue follow.

=
I'm try to adapt Mariano's examples to a test for the TournamentGame
model, so my derived class should be this, right?:


loadModel('TournamentGame');

class TournamentGameTest extends TournamentGame {
var $name = 'TournamentGameTest';
var $useDbConfig = 'test_suite';
}


But I get this error:


Missing Database Table

No Database table for model TournamentGameTest (expected
test_suite_tournament_game_tests), create it first.

Notice: If you want to customize this error message, create app\views
\errors\missing_table.ctp


I was under the impression from the article that CakePHP automagically
knows that the *Test derived class corresponds to the model, but
perhaps I'm misunderstanding something, or perhaps it's changed in
present versions.

I notice that it's correctly applying the test_suite prefix, but I was
under the impression that those needed tables are automatically
created during the execution of the test.   Am I missing something
here?

I'm on SVN revision 6123, by the way.

=

Thanks,

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



Re: Dumb newbie question: Are baked sample tests supposed to pass?

2007-10-02 Thread Philip

Hmmm Anyone out there using baked tests in their testing
infrastructure?   Or am I just overestimating the number of tests that
get written in "in the wild"?   Or underestimating the need to write
terser posts? :-)

If anyone is effectively using the 1.2 testing structure, or the
predecessor standalone Test Suite <http://cakeforge.org/docman/?
group_id=62>, I'd love to hear war stories.

Thanks,

Philip

On Sep 28, 12:04 pm, Philip <[EMAIL PROTECTED]> wrote:
> I'm just getting started with the testing infrastructure in CakePHP
> 1.2.It was a little rough getting started, because few people
> seemed to be able to point me to any sort of canonical documentation,
> but thanks 
> tohttp://cakebaker.42dh.com/2007/03/23/how-to-use-the-official-cakephp-...
> andhttp://bakery.cakephp.org/articles/view/testing-models-with-cakephp-1...
> I'm getting up to speed now.   Also this recent 
> thread:http://groups.google.com/group/cake-php/browse_thread/thread/b4e784c3...
> will be helpful when I start testing controllers.
>
> (To the powers that be: Is there any way these articles could be
> featured more prominently, say as part of some sort of testing portal
> page on cakephp.org?   I've had problems with the search there so I'm
> not sure I would have found the bakery article if it weren't linked on
> CakeBaker.   I really lament that there's no longer an official wiki.)
>
> When I baked a few models I also requested tests even though I didn't
> know what I was doing.  I got, for example, a GameTestCase class that
> I'm trying to build out now.
>
> Two questions:
>
> == Should it pass? ==
> My baked test file included the following commented method:
>
> function testMe() {
> $result = $this->TestObject->findAll();
> $expected = 1;
> $this->assertEqual($result, $expected);
> }
>
> Of course this fails because findAll() returns a nested array, not an
> integer.   Is this supposed to pass? Did something change in the
> return type of findAll()?Or was it merely intended that the user
> would replace the expected 1 with something more substantial?
>
> == Necessary to subclass the model under test? ==
>
> The Bakery article above makes a point of deriving a model from the
> model under test:
>
> class ArticleTest extends Article {
> var $name = 'ArticleTest';
> var $useDbConfig = 'test_suite';
>
> }
>
> It also names the fixture ArticleTest.   Is this an essential step to
> use fixtures?Because bake did some of the other "plumbing"
> mentioned in that article (e.g. loadModel), it made me wonder whether
> I need to add another class or not.   I was able to add the fixture so
> it didn't appear to break my test, but perhaps I'm setting myself up
> wrong for the future.
>
> Forgive my curiosity if these questions are just nitpicking -- I try
> to err on the side of asking too many questions, because they say
> there may be other curious people who just haven't gotten around to
> asking. ;-)
>
> Regards,
>
> Philiphttp://www.bulldogs.com/


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



Dumb newbie question: Are baked sample tests supposed to pass?

2007-09-28 Thread Philip

I'm just getting started with the testing infrastructure in CakePHP
1.2.It was a little rough getting started, because few people
seemed to be able to point me to any sort of canonical documentation,
but thanks to 
http://cakebaker.42dh.com/2007/03/23/how-to-use-the-official-cakephp-test-suite/
and 
http://bakery.cakephp.org/articles/view/testing-models-with-cakephp-1-2-test-suite
I'm getting up to speed now.   Also this recent thread:
http://groups.google.com/group/cake-php/browse_thread/thread/b4e784c39cf87a4f/b117c946daf3554b
will be helpful when I start testing controllers.

(To the powers that be: Is there any way these articles could be
featured more prominently, say as part of some sort of testing portal
page on cakephp.org?   I've had problems with the search there so I'm
not sure I would have found the bakery article if it weren't linked on
CakeBaker.   I really lament that there's no longer an official wiki.)

When I baked a few models I also requested tests even though I didn't
know what I was doing.  I got, for example, a GameTestCase class that
I'm trying to build out now.

Two questions:

== Should it pass? ==
My baked test file included the following commented method:

function testMe() {
$result = $this->TestObject->findAll();
$expected = 1;
$this->assertEqual($result, $expected);
}

Of course this fails because findAll() returns a nested array, not an
integer.   Is this supposed to pass? Did something change in the
return type of findAll()?Or was it merely intended that the user
would replace the expected 1 with something more substantial?


== Necessary to subclass the model under test? ==

The Bakery article above makes a point of deriving a model from the
model under test:


class ArticleTest extends Article {
var $name = 'ArticleTest';
var $useDbConfig = 'test_suite';
}


It also names the fixture ArticleTest.   Is this an essential step to
use fixtures?Because bake did some of the other "plumbing"
mentioned in that article (e.g. loadModel), it made me wonder whether
I need to add another class or not.   I was able to add the fixture so
it didn't appear to break my test, but perhaps I'm setting myself up
wrong for the future.




Forgive my curiosity if these questions are just nitpicking -- I try
to err on the side of asking too many questions, because they say
there may be other curious people who just haven't gotten around to
asking. ;-)

Regards,

Philip
http://www.bulldogs.com/


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



Re: Integrating authentication from legacy CMS - put data in the CAKEPHP session?

2007-09-26 Thread Philip

H. I thought that might work, but no dice.

In a PHP file pulled into my CMS, I tried this:


//This is just to trick webroot/index.php so it doesn't output
anything
$old_url = isset($_GET['url']) ? $_GET['url'] : NULL;
$_GET['url'] = 'favicon.ico';
require_once 'test/cake/app/webroot/index.php';
$_GET['url'] = $old_url;

require_once 'test/cake/cake/libs/session.php';
chdir ('test/cake/app/controllers');

$cakeSession = new CakeSession();
var_dump($cakeSession);
$cakeSession->write('ee_member', 123);
echo "Session name - ".session_name();


But it still doesn't show up when accessed from Cake:

$this->Session->write('user', 'XYZ');
echo $this->Session->read('user');  //this works
echo "\n\n";
echo "ee_member: ".$this->Session->read('ee_member');   //ouputs
empty string for the session var


I see that in session.php, there are three calls to session_start(),
two in  __regenerateId() and one in the constructor.   I'll hack
around a bit more and see when those are getting called (if at all),
and if I can find a reasonable way to suppress them.

Thanks,

Philip


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



Re: Integrating authentication from legacy CMS - put data in the CAKEPHP session?

2007-09-26 Thread Philip

Jeff,

I appreciate the reply.I've reread the thread you linked, and
fortunately the Justkez.com tutorial that was down yesterday has come
back up, so I skimmed through that too.

But I don't understand what you're suggesting.   When you say,

> I wouldn't suggest trying to set cookies "behind-cake's back" as it
> were.  Use the cake interface.

it makes me think I haven't explained the problem well.How can I
use the Cake interface from within a totally separate CMS?
(Likewise, the Justkez tutorial is very useful but appears to be about
how do stuff within CakePHP, not outside of it.)

I've had some success with hacking together some includes to access my
CakePHP controller from a totally foreign PHP script, so perhaps
trying that from the CMS will work (since the CMS accepts PHP).   In
fact, I think I may try that next.  I'm not sure if that's what you
mean by using the Cake interface.

In any case, we have a lot of functionality in the legacy CMS that's
not going to get reimplemented immediately in Cake, so for now I'm
stuck with the CMS.

Thanks,

Philip


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



Integrating authentication from legacy CMS - put data in the CAKEPHP session?

2007-09-26 Thread Philip

TASK: My organization uses a CMS called Expression Engine for some
legacy functionality.   I would like to build a user interface to some
new functionality in CakePHP.I want the authentication from EE to
be somewhat integrated so that the user need not log in twice.I
can execute arbitrary PHP conditionally on whether the user is logged
into EE and can access the user's ID, so that side of things isn't
difficult.

The tricky part is setting something so that Cake knows the user is
logged in.   I've thought of three different approaches, but the most
promising one isn't working for me.   I'm hopeful it's because of my
lack of understanding of sessions in CakePHP, rather than the inherent
impossibility of the approach.

== Approach 1: Store session data, retrieve it in CakePHP ==

Figuring that there out to be some way to store session data, I got as
far as this in the CMS:



{if logged_in} 

THE MEMBER ID IS {member_id} 
\n";
echo "session name is ".session_name()."\n";

?>


OK, I can see this working -- for example, the $_SESSION['count']
thing works and the session name is CAKEPHP.

However, in my Cake controller when I try to retrieve the session
data:

echo $this->Session->read('ee_member');
echo "\n\n";
echo "Count is: ".$this->Session->read('count');
echo "\n\n";


None of that shows up, so I infer that the session must be getting
restarted by CakePHP or somehow my data put in there is getting
clobbered.   Is this a correct inference?

Is there any way to make this approach work that I'm just missing?

== Approach 2: Store non-session cookie; retrieve it in Cake ==

I haven't tried this yet because I've been trying to get #1 working.
But it seems plausible.   Any feedback?

== Approach 3: Store the client IP address in the database for a given
user ID; retrieve it in Cake ==

This is my least favorite approach because my understanding  is that
there could be some way for a user to simulate an IP address and hence
impersonate the client who logged in.   And of course IP addresses
aren't always stable so this would need to be a very short-term thing
that expires quickly.


In any case I may be missing the forest for the trees (e.g. maybe
there's some way to do easy authentication in Cake and have the CMS
authenticate based on that, i.e. vice versa) and I feel like I'm being
naive about authentication here so I wanted a second opinion.

Thanks,

Philip


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



Cake PHP and templates

2006-08-01 Thread philip

Hi,

I wanted to use a PHP template system with CakePHP but I don't know how
to get started.

In fact I also had a different idea which was to use TrimPath
Javascript templates
http://trimpath.com/project/wiki/JavaScriptTemplates

My idea was to convert the PHP variables to Javascript using JSON (but
didn't work out how to do this successfully). Then to use these
variables in Javascript to be passed through the Javascript template as
above.

Any ideas? Has anyone had any success with using a template with
CakePHP?
One problem I have is how can you get things like the HTML from.
$ajax->link('Home', '/pages/cms', array('update' => 'maincontent'));
to the template?

Thanks, Philip


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



Re: Error installing CakePHP

2006-07-15 Thread philip

Hi,

I tell you what happened. After I went to the cake URL as you said, I
got lots of warnings at the top of the screen. To get rid of the
warnings I had to manually create a folder in cake/app/ called models.
After createing models folder the CakePHP home page didn't give any
warnings, just said database file not configured.
But I keep getting warnings for different things.  Mostly only when I
bake, when I get the warnings I find I have to create directories
myself manually then I go through the bake process again and it works.

So the problem is with the bake.php now. Is it unable to create
directories? Is this due to some file/folder permission problem?

Thanks, Philip


ryanb006 wrote:
> After the Blog Tutorial, follow it by example in building your own
> application.  For reference to all Cake functions, visit the API at
> [1].  Also, you can check out the screencasts at [2].
>
> Good luck with Cake! I haven't gone back to my old ways since I found
> it.
>
> --
> [1] http://api.cakephp.org/
> [2] http://cakephp.org/screencasts
> --
> 
> Ryan


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



Error installing CakePHP

2006-07-14 Thread philip

Hello,

I put cakephp in the root. I am using Xampp on Windows XP.

C:\Program Files\xampp\htdocs\cake\scripts>"c:\program
files\xampp\php\php.exe"
bake.php -project "\program files\xampp\htdocs\testcake10"

...

Creating file \program
files\xampp\htdocs\testcake10\views\pages\home.thtml

Warning: fopen(\program
files\xampp\htdocs\testcake10\views\pages\home.thtml): f
ailed to open stream: No such file or directory in C:\Program
Files\xampp\htdocs
\cake\scripts\bake.php on line 1464
Error! Couldn't open \program
files\xampp\htdocs\testcake10\views\pages\home.tht
ml for writing.
Welcome page created

Warning: chmod(): No such file or directory in C:\Program
Files\xampp\htdocs\cak
e\basics.php on line 1005
Could not set permissions on \program
files\xampp\htdocs\testcake10\tmp\*
You must manually check that these directories can be wrote to by the
server

C:\Program Files\xampp\htdocs\cake\scripts>

Any ideas please?

I followed instructions for install and it doesn't work, sad.

Thanks, Philip


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