Re: executing shell scripts

2008-10-07 Thread [EMAIL PROTECTED]

Another basic thing to double-check is the filename. It should be
cloud.php in your case.

/Martin

On Oct 7, 2:54 am, Ryan [EMAIL PROTECTED] wrote:
 Sorry, it is in ~/vendors/shells

 On Oct 6, 1:41 pm, dr. Hannibal Lecter [EMAIL PROTECTED] wrote:

  Is it in ~/vendors or ~/vendors/shells ?

  On Oct 6, 7:30 pm, Ryan [EMAIL PROTECTED] wrote:

   I am trying to create my first shell script. The shell script is in /
   vendors and when I run, I get this:

   class CloudShell extends Shell {
          var $uses = array('Item');
          function main() {
            $this-out(test\n);
          }

   }Error: Class CloudShell could not be loaded

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



Re: Getting global variables from Database in cakePHP

2008-10-07 Thread dr. Hannibal Lecter

Maybe something like this would help you:

http://dsi.vozibrale.com/articles/view/simple-db-based-configuration-for-cakephp-apps

There is also a working (and slightly improved) example in my CMS
project (same site).

Hope that helps!

On Oct 7, 6:58 am, Jipson [EMAIL PROTECTED] wrote:
 Hi,
      Thank you Jitka and mark.
  I tried with jitka's solution but,as a new developer to cakephp I
 couldn't obtain the solutions. I searched the tutorials also but I
 didn't got it.Can you please explain it with some examples please

 Thanks,
 Jipson.
 On Oct 6, 8:09 pm, jitka (poLK) [EMAIL PROTECTED] wrote:

  For example, you can
  - load necessary settings from db when you need them
  - load all settings once and use Configure::store() (also called from
  afterSave callback of this model), Configure::load() (called from
  bootstrap) and then Configure::read() where necessary
  - same approach as 2nd one, but with Cache::write()/read()


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



Re: more problems with RC3 and tests

2008-10-07 Thread [EMAIL PROTECTED]

I am sure the docs do not contain the recent changes yet.

My Model-tests work with fixtures. Here is a mini-example. Maybe you
can see some detail that you have done differently.

in phone.test.php

App::import('Model', 'Phone');

class PhoneTest extends Phone {
var $name = 'PhoneTest';
var $useDbConfig = 'test_suite';
}

class PhoneTestCase extends CakeTestCase {
var $fixtures = array( 'app.phone_test' );

function testStorage() {
$this-PhoneTest = new PhoneTest();

$all = $this-PhoneTest-findAll();

$this-assertEqual(4, count($all));
}
}


ideas:
I have changed useDbConfig = test to test_suite
I have added app. to my fixtures for identification.
Your should maybe use the callbacks startCase(), endCase(),
startTest(), endTest() to make a shared connection to the database.

hope it helps
/Martin


On Oct 7, 11:56 am, Christof Damian [EMAIL PROTECTED] wrote:
 Now that I fixed the connection problems with fixtures I have another
 problem. All my tests which uses fixtures show this error:

   Unexpected PHP error [Trying to get property of non-object] severity
 [E_NOTICE] in [.../cake/libs/class_registry.php line 295]
   .../tests/cases/models/product.test.php - ProductTestCase - start

 This is triggered by the start method, which looks like this:

    function start() {
       parent::start();
       $this-Product = new TestProductModel ();
    }

 Has the way to do this changed? I am still doing it as the documentation 
 shows.
--~--~-~--~~~---~--~~
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: Release: CakePHP RC3 - The RC of Triumph!

2008-10-07 Thread 703designs

Like I said,
  Just a thought.

On Oct 7, 6:03 am, Marcin Domanski [EMAIL PROTECTED] wrote:
 its not a 'poll' problem. Cake uses tests and include them so people
 can contribute tests , adding another obstacle for them (downloading
 testsuite etc)  is not good. Why the tests are a problem for you ?
 can't you rm them if you dont need them ? i can't see where is the
 problem.
 --
 Marcin Domanskihttp://kabturek.info

 On Tue, Oct 7, 2008 at 6:45 AM, 703designs [EMAIL PROTECTED] wrote:

  Just a thought. You should run a poll of Cake developers (those who
  develop with Cake, not core developers) and see how many people use
  these extra parts. Can't hurt to know which extras are the most
  popular.

  On Oct 6, 4:18 pm, Yodiaditya [EMAIL PROTECTED] wrote:
  I'm agree with you nate. Actually, i never using testing cause don't know
  how to use it.
  But, in another cases, testing is needed not only for test your sweet cake
  before product it. But also give us test the cake for bugs...

  On 10/7/08, Nate [EMAIL PROTECTED] wrote:

   The tweet was just me venting my frustration over an unrelated issue,
   I happened to think the timeliness was funny though.

   Anyway, as far as the wasted bandwidth argument, I have to say that
   seems a bit silly.  Even the largest of the packages weighs in at less
   than 1.2mb.  Anyway, the tests are included for lots of reasons, not
   the least of which being that it helps us as core developers, but also
   the fact that it promotes visibility of testing within the community,
   as well as the ability for people to verify (or more commonly to
   verify the absence of) bugs.

   On Oct 6, 2:05 pm, 703designs [EMAIL PROTECTED] wrote:
Ah, that makes sense. I'm pretty sure that Nate's suggestion was
uncalled for, but he's helped me enough with Cake stuff over the last
year that I know it's in good spirit.

Here's a question: Why are the tests included? Why not make them a
separate download? I mean, yes, if they're distributed together, you
know for sure that the test match the framework package. But you guys
are certainly wasting bandwidth on the test files.

Thomas

On Oct 6, 1:56 pm, Gwoo [EMAIL PROTECTED] wrote:

 Test cases account for at least two thirds of the overall package
 size. In my opinion, thats a good thing.


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



Re: more problems with RC3 and tests

2008-10-07 Thread Defranco

Same problem here.

The problem is that not only the documentation is suggesting this test
case layout, but also bake when generating test case files (I think).

rgds
--~--~-~--~~~---~--~~
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: Trouble with the HtmlHelper and $scripts_for_layout

2008-10-07 Thread Marc Campeau

Hi Michael,

thanks for looking at this problem. I know it works when calling $html-
css() from the view (see side notes in original post) but my problem
is it doesn't when calling $html-css() or $javascript-link from an
element (/views/elements/menu.ctp for instance).

Thanks,

Marc

On Oct 6, 6:45 pm, Michael [EMAIL PROTECTED] wrote:
 Marc,
 I'm using RC3.

 In my view I'm calling $html-css() with array() as the third
 parameter instead of null.  The LINK) is correctly located in the
 head section.

 Michael

 On Oct 6, 2:41 pm, Marc Campeau [EMAIL PROTECTED] wrote:

  Thanks for taking the time. t least now I know I'm not alone! ;-)

  On Oct 6, 3:38 pm, hydra12 [EMAIL PROTECTED] wrote:

   Oops!  You're right.  Sorry.  I can't get it to work either.

   On Oct 6, 2:00 pm, Marc Campeau [EMAIL PROTECTED] wrote:

Thanks for your input.

I beg to differ though, the manual says:

   http://manual.cakephp.org/view/96/Layouts
When using $html-css() or $javascript-link() in view files, specify
'false' for the 'in-line' argument to place the html source in
$scripts_for_layout. (See API for more details on usage).

   http://manual.cakephp.org/view/206/Inserting-Well-Formatted-elements
css(mixed $path, string $rel = null, array $htmlAttributes, boolean
$inline = true)

Creates a link(s) to a CSS style-sheet. If $inline is set to false,
the link tags are added to the $scripts_for_layout variable which you
can print inside the head tag of the document.

   http://api.cakephp.org/class_html_helper.html
HtmlHelper::css($path, $rel = null, $htmlAttributes = array(), $inline 
= true)

Creates a link element for CSS stylesheets.

Parameters:
        mixed   $path The name of a CSS style sheet in /app/webroot/css,
or an array containing names of CSS stylesheets in that directory.
        string  $rel Rel attribute. Defaults to stylesheet.
        array   $htmlAttributes Array of HTML attributes.
        boolean         $inline If set to false, the generated tag 
appears in
the head tag of the layout.

   http://api.cakephp.org/class_javascript_helper.html
JavascriptHelper::link( $url, $inline = true)                  

Returns a JavaScript include tag (SCRIPT element). If the filename is
prefixed with /, the path will be relative to the base path of your
application. Otherwise, the path will be relative to your JavaScript
path, usually webroot/js.

Parameters:
        mixed   $url String URL to JavaScript file, or an array of URLs.
        boolean         $inline If true, the script tag will be 
printed
inline, otherwise it will be printed in the head, using
$scripts_for_layout

On top of which, when looking at the actual HtmlHelper::css method,
the last few lines read like this:
                if ($inline) {
                        return $out;
                } else {
                        $view = ClassRegistry::getObject('view');
                        $view-addScript($out);
                }

Other Side note:
Using the JavascriptHelper::link method yields the same result, ie the
method calls don't generate the HTML to include an external JS file.

Thanks,

Marc
--~--~-~--~~~---~--~~
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: Error: RedirectController could not be found.

2008-10-07 Thread mattocrocop

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



Discussion on listed-websites-on-custom-google-search-engine-for-cakephp

2008-10-07 Thread Primeminister

Only search in the CakePHP.org domain (api, tests,book,trac)
http://www.google.com/coop/cse?cx=010821733709469541955:xmlzkbwlgaq
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Scaffold in RC3

2008-10-07 Thread Chen

Hello there,
  Recently I upgrade my cake lib to 1.2 rc3, then I can visit the
pages which don't exist exactly but in scaffold name array like
'index', 'edit' and so on.
  For example in 1.2 rc2, if you visit http://mysite.com/users/ or
http://mysite.com/users/index, you will get an error message with 404
not found. But in rc3, you can see the page which generate by
scaffold.
  Does anyone has met the same with me?
  Thank you.

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



tree and translate behaviours (same model), delete problem

2008-10-07 Thread wowfka

Hello all,

Currently i am using cakephp 1.2 RC 3, i have no problems with using
both behaviours it transaltes it correctly, but when i trying to
delete parent tree node it also delete child's it is ok, the problem
is translate behaviour only deletes parent node in i18n table and
leaves all childs. How can i solve this issue ?

thank you

--~--~-~--~~~---~--~~
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: integrate paypal

2008-10-07 Thread json

Hi i got how to get the values using REQUEST use 'requesthandler' in
component  using this component we can get the value from url values

for example u want to get a value http://www.example.com?val=100

In ur controller add requesthandler componter then user
$_REQUEST['val'] its work

On Sep 20, 5:52 pm, Adam Royle [EMAIL PROTECTED] wrote:
 I don't see why $_REQUEST shouldn't work as normal... but cake
 automatically puts these vars into:

 $this-params['form']; // from $_POST

 or

 $this-params['url']; // from $_GET

 Hope that helps.
 Adam

 On Sep 19, 11:18 pm, json [EMAIL PROTECTED] wrote:

  Hi,

  I am new to here

  I want to help how tointegrateapaypalin cake php

  i dont know how tointegrateit

  normally i willintegratepaypalusing html code then

  i will get value from notify file

  using $_REQUEST['payment_status']=completed

  if completed received i will update my database

  but in cake php REQUEST method is not work

  any idea please send.

  thanks

  json

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



Easy to implement global search

2008-10-07 Thread [EMAIL PROTECTED]

Hi,

After trying to find the best way to have a global search function, I
decided to implement the following solution ... and it works
brilliantly.

Create a search table:


CREATE TABLE `search` (
  `id` int(11) NOT NULL auto_increment,
  `model` varchar(300) default NULL,
  `rel_id` int(11) default NULL,
  `name` varchar(300) default NULL,
  `description` text,
  `active` int(1) default '1',
  `modified` datetime NOT NULL,
  `created` datetime NOT NULL,
  PRIMARY KEY  (`id`),
  FULLTEXT KEY `search_index` (`name`,`description`)
) ENGINE=MyISAM;


The model points the the table, ie news, and the rel_id to the id, ie.
news.id

For each table you want to search, setup a 3 MYSQL triggers ie.

INSERT TRIGGER:


DELIMITER $$
CREATE
TRIGGER `News Insert to Search` AFTER INSERT ON `news`
FOR EACH ROW BEGIN
   INSERT INTO `search` SET `model` = 'News', `active` =
New.active, `name` = NEW.name, `description` = NEW.body, `rel_id` =
NEW.id;
   END;
$$
DELIMITER ;


UPDATE TRIGGER:


DELIMITER $$
CREATE
TRIGGER `News Update to Search` AFTER UPDATE ON `news`
FOR EACH ROW BEGIN
DELETE FROM `search` WHERE `model` = 'News' AND `rel_id` = OLD.id;
INSERT INTO `search` SET `model` = 'News', `name` = NEW.name,
`description` = NEW.body, `rel_id` = NEW.id, `active` = New.active;
   END;
$$
DELIMITER ;


DELETE TRIGGER:


DELIMITER $$
CREATE
TRIGGER `News Delete to Search` AFTER DELETE ON `news`
FOR EACH ROW BEGIN
 DELETE FROM `search` WHERE `model` = 'News' AND `rel_id` =
OLD.id;
END;
$$
DELIMITER ;


The trigger will be executed as soon as you add a new news story, or
update a news story or delete a news story.

So when you run a global search, you simply search through the search
table, with one query ...

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



Auth and parseExtensions

2008-10-07 Thread Danne

I'm creating an app which logs in via a REST-service, and therefore i
think i need to turn off the automation of Auth, so that when i call
Auth-login() it doesn't call any other action, just checks the user
against the db and adds it to the session, or will i have to do this
manually (check against db and add to session) then?

Also, are there any known interference between Auth and
Router::parseExtensions() ? Because when action users/login.json is
called, it looks for views/users/login.ctp and not views/users/json/
login.ctp.
I have looked at this ticket: https://trac.cakephp.org/ticket/3914 so
i have $components = array('Auth', 'RequestHandler');

--~--~-~--~~~---~--~~
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: fixture var $import not working on 1.2.RC3 anymore.

2008-10-07 Thread mark_story

This has been fixed in the latest SVN, seems there was a conflict with
the changes in ClassRegistry::init().  Anyways, a quick fix if you
don't want to upgrade the a nightly for the next while is to specify a
connection on all your fixtures.

-Mark

On Oct 6, 4:41 pm, Defranco [EMAIL PROTECTED] wrote:
 On Oct 6, 5:38 pm, [EMAIL PROTECTED]

 [EMAIL PROTECTED] wrote:
  I had that. Thought the problem was all me. I am still a bit fuzzy on
  a lot of the testing stuff.
  Try this:
  var $import = array('model' = 'Foo', 'connection' = 'default');

  I noticed that one of the examples in the Cookbook had a 'connection'
  property set. I have had to add this to each of my fixtures to make
  them work again.

  /Martin

 Hi Martin,

 It worked!

 Thanks for your help!

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



Form returned by ajax response

2008-10-07 Thread nightfallvt

My index tables have a form below the heading to allow users to filter
data. When using ajax pagination the form disappears after the first
request. Normal pagination works fine. The form does show up in the
html returned by ajax but it almost seems as if its getting rendered
off the screen. I have even tried standard and ajax forms for the
filtering. Snippet of my pagination, heading and filter form ($columns
is an array of key-value pairs for the fields to display):

tr
  ?php if($this-params['action'] == 'index'): ?
?php $paginator-
options(array('update'='centerColumn','indicator' = 'loading'));?
  ?php foreach($columns as $column): ?
th
  ?php
if(array_key_exists('sort',$paginator-params['named'])){
  if($paginator-params['named']['sort'] ==
$column['field']){
echo $paginator-sort($column['title'],
$column['field'],array('class'=$paginator-sortDir()));
  }
 else{
   echo $paginator-sort($column['title'],
$column['field']);
  }
}
else{
  echo $paginator-sort($column['title'],
$column['field']);
}
  ?
/th
?php endforeach; ?
  ?php else: ?
?php foreach($columns as $column): ?
  th?php echo $column['title'];?/th
?php endforeach; ?
  ?php endif; ?
  th class=actionsActions/th
/tr

tr
  ?php //echo $form-create(null, array('action'='/index')); ?
  ?php echo $ajax-form('/
index','post',array('update'='centerColumn','indicator' =
'loading')); ?
?php foreach($columns as $column): ?
  td style=text-align:center;margin:0;padding:0;width:auto;
 ?php echo $form-
input($column['field'],array('div'=false,'label'=''));?
  /td
?php endforeach; ?
td class=actions
  ?php echo $form-
end(array('label'='filter','id'='filter_submit','style'='display:none;'));?

/td
/tr
--~--~-~--~~~---~--~~
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: Release: CakePHP RC3 - The RC of Triumph!

2008-10-07 Thread mark_story

As for not knowing how to use the tests, you should really correct
that ;)  Unit Testing will make your life easier in the long run.

-Mark

On Oct 7, 8:47 am, 703designs [EMAIL PROTECTED] wrote:
 Like I said,

   Just a thought.

 On Oct 7, 6:03 am, Marcin Domanski [EMAIL PROTECTED] wrote:

  its not a 'poll' problem. Cake uses tests and include them so people
  can contribute tests , adding another obstacle for them (downloading
  testsuite etc)  is not good. Why the tests are a problem for you ?
  can't you rm them if you dont need them ? i can't see where is the
  problem.
  --
  Marcin Domanskihttp://kabturek.info

  On Tue, Oct 7, 2008 at 6:45 AM, 703designs [EMAIL PROTECTED] wrote:

   Just a thought. You should run a poll of Cake developers (those who
   develop with Cake, not core developers) and see how many people use
   these extra parts. Can't hurt to know which extras are the most
   popular.

   On Oct 6, 4:18 pm, Yodiaditya [EMAIL PROTECTED] wrote:
   I'm agree with you nate. Actually, i never using testing cause don't know
   how to use it.
   But, in another cases, testing is needed not only for test your sweet 
   cake
   before product it. But also give us test the cake for bugs...

   On 10/7/08, Nate [EMAIL PROTECTED] wrote:

The tweet was just me venting my frustration over an unrelated issue,
I happened to think the timeliness was funny though.

Anyway, as far as the wasted bandwidth argument, I have to say that
seems a bit silly.  Even the largest of the packages weighs in at less
than 1.2mb.  Anyway, the tests are included for lots of reasons, not
the least of which being that it helps us as core developers, but also
the fact that it promotes visibility of testing within the community,
as well as the ability for people to verify (or more commonly to
verify the absence of) bugs.

On Oct 6, 2:05 pm, 703designs [EMAIL PROTECTED] wrote:
 Ah, that makes sense. I'm pretty sure that Nate's suggestion was
 uncalled for, but he's helped me enough with Cake stuff over the last
 year that I know it's in good spirit.

 Here's a question: Why are the tests included? Why not make them a
 separate download? I mean, yes, if they're distributed together, you
 know for sure that the test match the framework package. But you guys
 are certainly wasting bandwidth on the test files.

 Thomas

 On Oct 6, 1:56 pm, Gwoo [EMAIL PROTECTED] wrote:

  Test cases account for at least two thirds of the overall package
  size. In my opinion, thats a good thing.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Which MVC is right for our corp?

2008-10-07 Thread majna

http://groups.google.com/group/cake-php/browse_thread/thread/58ea010f930fab6c/fdff3040db8f9cf6


On Oct 7, 7:18 am, Dr. Tarique Sani [EMAIL PROTECTED] wrote:
 On Tue, Oct 7, 2008 at 10:42 AM, mrconfused [EMAIL PROTECTED] wrote:
  Is cake flexible in allow only reads to occur from db A and writes
  only to db B ?

 Yes.

  I know that in the model layer, we can specify useDBConfig flag but
  not sure how to work out the above case of it writing to db B and read
  only from db A

 Use the beforeSave, beforeDelete and beforeFind callbacks in your
 app_model to switch the DB

 It is trivial to code it ;)

 Tarique

 --
 =
 Cheesecake-Photoblog:http://cheesecake-photoblog.org
 PHP for E-Biz:http://sanisoft.com
 =
--~--~-~--~~~---~--~~
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: Trouble with the HtmlHelper and $scripts_for_layout

2008-10-07 Thread Marc Campeau

Hi all,

still haven't found a solution for this. Does anyone know whom I might
contact to know if this is a bug or expected behavior, ie using $html-
css() within elements doesn't work the same as in views? Should I
submit this to the bug tracker?

Thanks for helping a new baker.

Marc

On Oct 7, 8:50 am, Marc Campeau [EMAIL PROTECTED] wrote:
 Hi Michael,

 thanks for looking at this problem. I know it works when calling $html-css() 
 from the view (see side notes in original post) but my problem

 is it doesn't when calling $html-css() or $javascript-link from an
 element (/views/elements/menu.ctp for instance).

 Thanks,

 Marc

 On Oct 6, 6:45 pm, Michael [EMAIL PROTECTED] wrote:

  Marc,
  I'm using RC3.

  In my view I'm calling $html-css() with array() as the third
  parameter instead of null.  The LINK) is correctly located in the
  head section.

  Michael

  On Oct 6, 2:41 pm, Marc Campeau [EMAIL PROTECTED] wrote:

   Thanks for taking the time. t least now I know I'm not alone! ;-)

   On Oct 6, 3:38 pm, hydra12 [EMAIL PROTECTED] wrote:

Oops!  You're right.  Sorry.  I can't get it to work either.

On Oct 6, 2:00 pm, Marc Campeau [EMAIL PROTECTED] wrote:

 Thanks for your input.

 I beg to differ though, the manual says:

http://manual.cakephp.org/view/96/Layouts
 When using $html-css() or $javascript-link() in view files, specify
 'false' for the 'in-line' argument to place the html source in
 $scripts_for_layout. (See API for more details on usage).

http://manual.cakephp.org/view/206/Inserting-Well-Formatted-elements
 css(mixed $path, string $rel = null, array $htmlAttributes, boolean
 $inline = true)

 Creates a link(s) to a CSS style-sheet. If $inline is set to false,
 the link tags are added to the $scripts_for_layout variable which you
 can print inside the head tag of the document.

http://api.cakephp.org/class_html_helper.html
 HtmlHelper::css($path, $rel = null, $htmlAttributes = array(), 
 $inline = true)

 Creates a link element for CSS stylesheets.

 Parameters:
         mixed   $path The name of a CSS style sheet in 
 /app/webroot/css,
 or an array containing names of CSS stylesheets in that directory.
         string  $rel Rel attribute. Defaults to stylesheet.
         array   $htmlAttributes Array of HTML attributes.
         boolean         $inline If set to false, the generated tag 
 appears in
 the head tag of the layout.

http://api.cakephp.org/class_javascript_helper.html
 JavascriptHelper::link( $url, $inline = true)                  

 Returns a JavaScript include tag (SCRIPT element). If the filename is
 prefixed with /, the path will be relative to the base path of your
 application. Otherwise, the path will be relative to your JavaScript
 path, usually webroot/js.

 Parameters:
         mixed   $url String URL to JavaScript file, or an array of 
 URLs.
         boolean         $inline If true, the script tag will be 
 printed
 inline, otherwise it will be printed in the head, using
 $scripts_for_layout

 On top of which, when looking at the actual HtmlHelper::css method,
 the last few lines read like this:
                 if ($inline) {
                         return $out;
                 } else {
                         $view = ClassRegistry::getObject('view');
                         $view-addScript($out);
                 }

 Other Side note:
 Using the JavascriptHelper::link method yields the same result, ie the
 method calls don't generate the HTML to include an external JS file.

 Thanks,

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



Re: Model imports inexistent class Behavior

2008-10-07 Thread majna

Report ticket.

On Oct 7, 10:07 am, kAtremer [EMAIL PROTECTED] wrote:
 Hello.

 In cake/libs/model/model.php:

 App::import('Core', array('ClassRegistry', 'Overloadable', 'Validation',
 'Behavior', 'ConnectionManager', 'Set', 'String'));

 I guess 'Behavior' shouldn't be there since I coundn't find such class
 anywhere in Cake libs, only ModelBehavior is there.

 Simple pr() after !class_exists() in App::import() shows that import()
 tries to load this class several dozens times a page on a moderate-size
 project!

 --
 kAtremer
 [EMAIL PROTECTED]
--~--~-~--~~~---~--~~
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: more problems with RC3 and tests

2008-10-07 Thread Christof Damian

I found the changeset which introduced the problem anyway:

https://trac.cakephp.org/changeset/7596#file6

if (is_a($model, $class) || $model-alias == $class) {
$duplicate = $model;
}

Remove the || $model-alias == $class and the warnings are gone. Is
this maybe supposed to be:  $model-alias == $class ?

2008/10/7 Defranco [EMAIL PROTECTED]:

 Same problem here.

 The problem is that not only the documentation is suggesting this test
 case layout, but also bake when generating test case files (I think).

 rgds
 


--~--~-~--~~~---~--~~
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: Release: CakePHP RC3 - The RC of Triumph!

2008-10-07 Thread Marcin Domanski

its not a 'poll' problem. Cake uses tests and include them so people
can contribute tests , adding another obstacle for them (downloading
testsuite etc)  is not good. Why the tests are a problem for you ?
can't you rm them if you dont need them ? i can't see where is the
problem.
--
Marcin Domanski
http://kabturek.info



On Tue, Oct 7, 2008 at 6:45 AM, 703designs [EMAIL PROTECTED] wrote:

 Just a thought. You should run a poll of Cake developers (those who
 develop with Cake, not core developers) and see how many people use
 these extra parts. Can't hurt to know which extras are the most
 popular.

 On Oct 6, 4:18 pm, Yodiaditya [EMAIL PROTECTED] wrote:
 I'm agree with you nate. Actually, i never using testing cause don't know
 how to use it.
 But, in another cases, testing is needed not only for test your sweet cake
 before product it. But also give us test the cake for bugs...

 On 10/7/08, Nate [EMAIL PROTECTED] wrote:



  The tweet was just me venting my frustration over an unrelated issue,
  I happened to think the timeliness was funny though.

  Anyway, as far as the wasted bandwidth argument, I have to say that
  seems a bit silly.  Even the largest of the packages weighs in at less
  than 1.2mb.  Anyway, the tests are included for lots of reasons, not
  the least of which being that it helps us as core developers, but also
  the fact that it promotes visibility of testing within the community,
  as well as the ability for people to verify (or more commonly to
  verify the absence of) bugs.

  On Oct 6, 2:05 pm, 703designs [EMAIL PROTECTED] wrote:
   Ah, that makes sense. I'm pretty sure that Nate's suggestion was
   uncalled for, but he's helped me enough with Cake stuff over the last
   year that I know it's in good spirit.

   Here's a question: Why are the tests included? Why not make them a
   separate download? I mean, yes, if they're distributed together, you
   know for sure that the test match the framework package. But you guys
   are certainly wasting bandwidth on the test files.

   Thomas

   On Oct 6, 1:56 pm, Gwoo [EMAIL PROTECTED] wrote:

Test cases account for at least two thirds of the overall package
size. In my opinion, thats a good thing.
 


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



How to do a migration? Database schemas are driving me mad.

2008-10-07 Thread [EMAIL PROTECTED]

Hi,
I am about to go grey-haired from trying to migrate our database
schema. How on earth can this be done without screwing it all up
royally? A part from tedious, manual creation of many many alter
statements, what do you use? How do you do it?
That is the short question...

...here is the longer explaining rant:

The problem is character sets and collations. They can be ignored for
smaller, english applications but are a necessity for larger and
especially non-english language applications.

Typical affected parts of my data:
Any character-field used as a keyword or as a unique index. Things
of that sort MUST bave the correct collation to work.
Any list of names that should be sorted. Names of files, folders,
people... whatever. Without the correct collation a portion of the
data will be sorted the wrong way.
Any texts that should be searchable. The wrong collation means the
search feature will find too many or too few results in some cases.

So what's the problem?
Cake's schema support ignores these thing completely. (which is better
than partial support IMHO)
mysqldiff.org and most reasonably priced software I have tried for
creating diffs or migrations have only partial support. Ignoring field-
level settings while altering table-level defaults... but keeping all
settings when creating new tables.
MySQL (at least v5) applies the current default table-level settings
to any field without its own specification. Which makes the support of
the software I have tried even more treacherous to use. They will
implement a new table default but that will have no effect on any
existing field.

All this makes for a high-risk situation where a migration is almost
more likely to cause problems than not.

Leaving character set and collation out will write the current
defaults (of a higher level) to the created table or field. That
means that the only level where a migration tool absolutely must
support this is on the fields. Any change to anything else will have
no effect at all on existing fields or tables... I have found no
software that support this. :)

My problem is finding a way of modifying my schema this once so that
the next time I can use an automated diff or migration.

Martin - feeling screwier than sql
--~--~-~--~~~---~--~~
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: executing shell scripts

2008-10-07 Thread Ryan McKillen
I am using cloud.php as the filename. And just to be safe, I changed to var
$uses = array(); in case there was a problem with my model. Am I executing
the shell properly?

cd ~/cake/console
./cake cloud

class CloudShell extends Shell {
var $uses = array();
function main() {
  $this-out(test\n);
}
}Error: Class CloudShell could not be loaded




On Tue, Oct 7, 2008 at 2:16 AM, [EMAIL PROTECTED] 
[EMAIL PROTECTED] wrote:


 Another basic thing to double-check is the filename. It should be
 cloud.php in your case.

 /Martin

 On Oct 7, 2:54 am, Ryan [EMAIL PROTECTED] wrote:
  Sorry, it is in ~/vendors/shells
 
  On Oct 6, 1:41 pm, dr. Hannibal Lecter [EMAIL PROTECTED] wrote:
 
   Is it in ~/vendors or ~/vendors/shells ?
 
   On Oct 6, 7:30 pm, Ryan [EMAIL PROTECTED] wrote:
 
I am trying to create my first shell script. The shell script is in /
vendors and when I run, I get this:
 
class CloudShell extends Shell {
   var $uses = array('Item');
   function main() {
 $this-out(test\n);
   }
 
}Error: Class CloudShell could not be loaded
 
What am I missing? Thanks!
 


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



Re: Model imports inexistent class Behavior

2008-10-07 Thread kAtremer

OK. It will take some time to get used to the testing, so anybody more 
familiar with the process and methodics is welcome to pick up the bug 
and report.

majna wrote:
 Report ticket.
 
 On Oct 7, 10:07 am, kAtremer [EMAIL PROTECTED] wrote:
 In cake/libs/model/model.php:

 App::import('Core', array('ClassRegistry', 'Overloadable', 'Validation',
 'Behavior', 'ConnectionManager', 'Set', 'String'));

 I guess 'Behavior' shouldn't be there since I coundn't find such class
 anywhere in Cake libs, only ModelBehavior is there.

 Simple pr() after !class_exists() in App::import() shows that import()
 tries to load this class several dozens times a page on a moderate-size
 project!

-- 
kAtremer
[EMAIL PROTECTED]

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



view caching and progressive enhancement/ajax

2008-10-07 Thread the_woodsman

Hi guys,

It took me a while to work out why my conventional links were
returning ajax style, layout-less pages!

- I have a page (in views/pages/) that has tabs, each of these tabs
causes a page refresh
- I use JQuery to hijack the links to make them ajax, so Cake returns
the view without the layout
- Other pages of the site link directly to specific tabs

So, If the request that triggers a view cache refresh happens to be an
ajax one, then the cache doesn't include the layout.
That means that my conventional direct links to these pages will
returned the cached, ajax optimised versions!!!

Is there an elegant way to deal with this?

Cheers!


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



Cakephp Sort() ignore the id parametre passed befor

2008-10-07 Thread Elmaho

hi, i need help (i think i'm not using the sort() methode
correctly!!!)

this is my code:

CONTROLLER
   function salaryhome($id = null)
   {
   //...

   $this-set('demands', $this-
paginate('Absence',array('Absence.user_id'=$id)));

  //...
   }


 VIEW

   //...

  th?php echo $paginator-sort('Demand's Date','date');?/th
  th?php echo $paginator-sort('Absence
Type','absencetype_id');?

  //...
here you see i'm filtring my request by user_id get from the URL, so
if i try to reorder my table by clicking on any
table header (ex: the 'Absence Type') i loose the filtring and all
data.

have any idea to solve this???,,

thanks a lot

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



loose params in sort() methode

2008-10-07 Thread Elmaho

hi, everyone;

i've used a condition in the Paginate like so;
$this-set('demands', $this-
paginate('Absence',array('Absence.user_id'=$id)));

and the $id is gat as parametre in the action. If i execute the code
for the fist time it worked perfectly, but if i click on the header of
the table (which is sortable) i loose all data and filtring.

thanks ahead.

--~--~-~--~~~---~--~~
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: Release: CakePHP RC3 - The RC of Triumph!

2008-10-07 Thread LunarDraco

I use the core test for many things.

As examples of how to write my own test when I'm starting a new piece
of functionality.
As examples of how a class/function in the core could/should be used.
Can't tell you how many times this has helped.
I run the Core test at least once for each new project to verify the
structure is setup correctly.

You guys keep asking for some core examples, they've been there all
the time, learn to use and write test. It will increase your global
understanding of the core.

I've learned a lot of techniques and of new features just by watching
the breadth of the test cases increase.
Don't separate them from the core this makes no sense, I'll separate
it when I deploy a live site.

LunarDraco
Morgan Cook

On Oct 6, 12:36 pm, Nate [EMAIL PROTECTED] wrote:
 The tweet was just me venting my frustration over an unrelated issue,
 I happened to think the timeliness was funny though.

 Anyway, as far as the wasted bandwidth argument, I have to say that
 seems a bit silly.  Even the largest of the packages weighs in at less
 than 1.2mb.  Anyway, the tests are included for lots of reasons, not
 the least of which being that it helps us as core developers, but also
 the fact that it promotes visibility of testing within the community,
 as well as the ability for people to verify (or more commonly to
 verify the absence of) bugs.

 On Oct 6, 2:05 pm, 703designs [EMAIL PROTECTED] wrote:

  Ah, that makes sense. I'm pretty sure that Nate's suggestion was
  uncalled for, but he's helped me enough with Cake stuff over the last
  year that I know it's in good spirit.

  Here's a question: Why are the tests included? Why not make them a
  separate download? I mean, yes, if they're distributed together, you
  know for sure that the test match the framework package. But you guys
  are certainly wasting bandwidth on the test files.

  Thomas

  On Oct 6, 1:56 pm, Gwoo [EMAIL PROTECTED] wrote:

   Test cases account for at least two thirds of the overall package
   size. In my opinion, thats a good thing.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Model imports inexistent class Behavior

2008-10-07 Thread kAtremer

Hello.

In cake/libs/model/model.php:

App::import('Core', array('ClassRegistry', 'Overloadable', 'Validation', 
'Behavior', 'ConnectionManager', 'Set', 'String'));

I guess 'Behavior' shouldn't be there since I coundn't find such class 
anywhere in Cake libs, only ModelBehavior is there.

Simple pr() after !class_exists() in App::import() shows that import() 
tries to load this class several dozens times a page on a moderate-size 
project!

-- 
kAtremer
[EMAIL PROTECTED]

--~--~-~--~~~---~--~~
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: admin routing in rc3

2008-10-07 Thread stefanski

I have no trouble using the default routing:
Configure::write('Routing.admin', 'admin');


On Oct 6, 9:47 am, . [EMAIL PROTECTED] wrote:
 i just upgraded to rc3 (from rc2), why does the admin routing break? i have
 a :1 at the end of the urls...
--~--~-~--~~~---~--~~
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: Promlems with Fixtures using $import in RC3

2008-10-07 Thread Christof Damian

Yes, the connection seems to be the problem. I also saw this in
another thread, which did the trick.

var $import = array('model' = 'Foo', 'connection' = 'default');

2008/10/3 mark_story [EMAIL PROTECTED]:

 There were a number of problems with fixture importing in RC2, which
 were corrected.  Perhaps one of these corrections broke your tests?.
 For examples on fixture use check the fixture test. You can also try
 specifying which connection you want to use so connection = default

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



more problems with RC3 and tests

2008-10-07 Thread Christof Damian

Now that I fixed the connection problems with fixtures I have another
problem. All my tests which uses fixtures show this error:

  Unexpected PHP error [Trying to get property of non-object] severity
[E_NOTICE] in [.../cake/libs/class_registry.php line 295]
  .../tests/cases/models/product.test.php - ProductTestCase - start

This is triggered by the start method, which looks like this:

   function start() {
  parent::start();
  $this-Product = new TestProductModel ();
   }

Has the way to do this changed? I am still doing it as the documentation shows.

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



How we can impliment shipping method calculator and payment options in cakephp

2008-10-07 Thread Jipson

Hi All,
   I searched in Google and cake tutorial to find how we can integrate
ups shipping calculator and payment methods like pay pal,
authorize.net but I couldn't  find a solution. any one please help me.

Thanks,
Jipson
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Discussion on listed-websites-on-custom-google-search-engine-for-cakephp

2008-10-07 Thread Primeminister

Would be nice to have some refinements so that the links to sites as
API, Book, tests, etc are easily accessable. Look at refinements in
the CSE control panel.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Another HABTM issue : row with same Id getting over-written

2008-10-07 Thread Brenton B

Ok, so the root where all this non-unique stuff occurs seems to be
in dbo_source.php, line 841:

if ($type == 'hasAndBelongsToMany') {
$uniqueIds = $merge = array();

foreach($fetch as $j = $data) {
if (

(isset($data[$with])  $data[$with][$foreignKey] ===
$row[$model-alias][$model-primaryKey]) 

(!in_array($data[$with][$joinKeys[1]], $uniqueIds))
) {
$uniqueIds[] = 
$data[$with][$joinKeys[1]];

if 
($habtmFieldsCount = 2) {

unset($data[$with]);
}
$merge[] = 
$data;
}
}
if (empty($merge)  
!isset($row[$association])) {
$row[$association] = 
$merge;
} else {

$this-__mergeAssociation($resultSet[$i], $merge, $association,
$type);
}
}



Fair enough ... but why?? So this kills any possibility of showing
duplicates, that might be good, but shouldn't it bring back
everything, thus revealing any possibility of screwiness in app code?

Since it's a HABTM relationship, shouldn't the whole has and belongs
to many retrieve all that it has and belongs to?

There's obviously something I'm missing and confused about ...
unfortunately no comments in code to shed light.

(Note: to recap, I've got a user HABTM webpage_types in users-
webpage_types  with extra fields where a user could multiple of the
same webpage_type)



On Oct 6, 1:41 pm, Brenton B [EMAIL PROTECTED] wrote:
 So, moving to the solution nachopitt suggested works ... however,
 because of this, for saving, I have to use `saveAll()` instead of
 `save()` ... which works; however, for the User model, there's also
 another HABTM which doesn't work for `saveAll()` ... doh!!

 Best solution?

 On Oct 6, 11:03 am, Brenton B [EMAIL PROTECTED] wrote:

  Well, the table looks more like this:

  user_id | web_page_type_id | url
  ---
  7  |  6 | firstdomain.com
  7  |  6 | second.com

  So the two are unique, but I see what you're saying.

  I did originally have it setup in such a way that it wasn't a typical
  join table (as nachopitt suggested); however, was running into
  problems with saving in one fell swoop and wanted to give the HABTM
  save setup a try (as described everywhere).

  Might have to go back to the previous method.

  On Oct 4, 7:33 am, nachopitt [EMAIL PROTECTED] wrote:

   Yeah, teknoid has a point. Your relation/association is not supposed
   to work in that way. Normally, in a non CakePHP enviroment, a
   joinTable has the 2 foreign keys and they set as the primary key
   column. You don´t have the id column that CakePHP expects to have
   and then the foreign keys... thats why the uniqueness of the
   records.

   Personally i would change the schema of you database for something
   like

   users
   web_pages (holding the url, title, etc)
   web_page_types (holding the name of the webpage type)

   And the associations

   user hasMany webpages
   webpage belongsTo user
   webpage belongsTo webpageType

   On Oct 3, 6:37 pm, teknoid [EMAIL PROTECTED] wrote:

Goes to show I should read more carefully :)
I guess the title of the post made me jump the gun...

You say an user has 2 of the same webpage_type

Does it mean that in your join table you have something like: ?
user_id | web_page_type_id
-
7  |  6
7  |  6

On Oct 3, 6:27 pm, Brenton B [EMAIL PROTECTED] wrote:

 Well, assuming the Docs are correct (and I understand it properly),
 that should only apply to updates (If true (default value) cake will
 first delete existing relationship records in the foreign keys table
 before inserting new ones, when updating a record. So existing
 associations need to be passed again when updating).

 However, in my circumstance, I'm just retrieving information ...

 Debug SQL shows the (as expected) query 

Re: Getting global variables from Database in cakePHP

2008-10-07 Thread Jipson

Thank you all.Thanks a lot. Dr. Hannibal Lecter's suggestion
helped me. Now my problem is solved. Once again thank you all.

On Oct 7, 1:06 pm, dr. Hannibal Lecter [EMAIL PROTECTED] wrote:
 Maybe something like this would help you:

 http://dsi.vozibrale.com/articles/view/simple-db-based-configuration-...

 There is also a working (and slightly improved) example in my CMS
 project (same site).

 Hope that helps!

 On Oct 7, 6:58 am, Jipson [EMAIL PROTECTED] wrote:

  Hi,
       Thank you Jitka and mark.
   I tried with jitka's solution but,as a new developer to cakephp I
  couldn't obtain the solutions. I searched the tutorials also but I
  didn't got it.Can you please explain it with some examples please

  Thanks,
  Jipson.
  On Oct 6, 8:09 pm, jitka (poLK) [EMAIL PROTECTED] wrote:

   For example, you can
   - load necessary settings from db when you need them
   - load all settings once and use Configure::store() (also called from
   afterSave callback of this model), Configure::load() (called from
   bootstrap) and then Configure::read() where necessary
   - same approach as 2nd one, but with Cache::write()/read()
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: reduction in db queries + view pagination

2008-10-07 Thread Joe

Look into Containable and determine if you could work with a lower
level of recursion. Perhaps you could make use of unbindModel to
remove associations you don't need. Off topic a bit, but worth noting,
your nested in-line ternary conditionals are just absurd. Some
developer down the road is going to despise you if you leave those in.

Also. !empty($var) will do the work of isset($var) and $var != '', in
one swoop.

On Oct 6, 3:36 pm, wmshay06 [EMAIL PROTECTED] wrote:
 We have a customer using what was supposed to be a production system
 based upon cakephp 1.1.18 - which really isn't.  That aside there are
 very signficiant issues that need urgent resolution, whcih we just
 can't find a way to solve readily.

 1. the number of db queries is absolutley astounding - example
 constructing a left hand submenu and overview display of roughly 20-25
 table rows of data leads (with about 10 elements in  each row) to
 roughly 49000+ queries.  This appears to be 'contructed' using a few
 findAll queries.  There has got to be a better way - and faster.

 2. In some portion of the system there is a need to display a large
 list of items - some approachign 1500+ long.  This obviously begs for
 pagination - but for the life of me the various examples I've found
 don't really seem to work for what needs to be done.

 For reference the main view code at issue looks like  this:

                 $this-set('curtickets', 
 $this-Ticket-findAll((isset($this-params['url']['num'])  
 $this-params['url']['num'] != '' ? ($this-
 params['url']['num2'] != '' ? ticket_number = '{$this-params['url']

 ['num']}' AND ticket_number = '{$this-params['url']['num2']}' AND
  : ticket_number = '{$this-params['url']['num']}' AND ) : '').
 ($type ? type = '{$type}' AND  : '').($sub ? subcontractor_id =
 '{$sub}' AND  : '') . Ticket.job_id = '{$this-params['job_id']}'));

                 $subs = 
 $this-Ticket-Job-JobSubCombination-findAll(JobSubCombination.job_id = 
 {$this-
 params['job_id']},'Subcontractor.id, Subcontractor.legal_name');

                 $sublist = array();
                 foreach ($subs as $s) {
                         $sublist[$s['Subcontractor']['id']] = 
 $s['Subcontractor']
 ['legal_name'];
                 }
                 $this-set('sublist', $sublist);
                 $this-set('typelist', $this-typelist);
                 $this-set('chosentype', $type);
                 $this-set('chosensub', $sub);

 Open to thoughts...
--~--~-~--~~~---~--~~
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: loose params in sort() methode

2008-10-07 Thread teknoid

http://book.cakephp.org/view/166/Pagination-in-Views

See all the way at the bottom about passing the parameters to the
paginator.

On Oct 7, 10:08 am, Elmaho [EMAIL PROTECTED] wrote:
 hi, everyone;

 i've used a condition in the Paginate like so;
 $this-set('demands', $this-

 paginate('Absence',array('Absence.user_id'=$id)));

 and the $id is gat as parametre in the action. If i execute the code
 for the fist time it worked perfectly, but if i click on the header of
 the table (which is sortable) i loose all data and filtring.

 thanks ahead.
--~--~-~--~~~---~--~~
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: Release: CakePHP RC3 - The RC of Triumph!

2008-10-07 Thread Nate

Hi Thomas,

As Marcin said, it isn't really a matter of anyone's opinion, other
than that of the core team.  We actively encourage test-driven
development, and we actively encourage people to contribute to the
framework, particularly in the form of test cases.  Therefore, we
include the tests.

Generally speaking (and directed at no one in particular), I really
don't see the point of getting all worked up over stuff like this.
Disk space is measured in the dozens or hundreds of gigabytes, and
bandwidth is measured in the dozens or hundreds of megabits per
second.  Does having fewer files in a tarball somehow just make people
feel better for no rational reason?

On Oct 7, 12:45 am, 703designs [EMAIL PROTECTED] wrote:
 Just a thought. You should run a poll of Cake developers (those who
 develop with Cake, not core developers) and see how many people use
 these extra parts. Can't hurt to know which extras are the most
 popular.

 On Oct 6, 4:18 pm, Yodiaditya [EMAIL PROTECTED] wrote:

  I'm agree with you nate. Actually, i never using testing cause don't know
  how to use it.
  But, in another cases, testing is needed not only for test your sweet cake
  before product it. But also give us test the cake for bugs...

  On 10/7/08, Nate [EMAIL PROTECTED] wrote:

   The tweet was just me venting my frustration over an unrelated issue,
   I happened to think the timeliness was funny though.

   Anyway, as far as the wasted bandwidth argument, I have to say that
   seems a bit silly.  Even the largest of the packages weighs in at less
   than 1.2mb.  Anyway, the tests are included for lots of reasons, not
   the least of which being that it helps us as core developers, but also
   the fact that it promotes visibility of testing within the community,
   as well as the ability for people to verify (or more commonly to
   verify the absence of) bugs.

   On Oct 6, 2:05 pm, 703designs [EMAIL PROTECTED] wrote:
Ah, that makes sense. I'm pretty sure that Nate's suggestion was
uncalled for, but he's helped me enough with Cake stuff over the last
year that I know it's in good spirit.

Here's a question: Why are the tests included? Why not make them a
separate download? I mean, yes, if they're distributed together, you
know for sure that the test match the framework package. But you guys
are certainly wasting bandwidth on the test files.

Thomas

On Oct 6, 1:56 pm, Gwoo [EMAIL PROTECTED] wrote:

 Test cases account for at least two thirds of the overall package
 size. In my opinion, thats a good thing.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Model imports inexistent class Behavior

2008-10-07 Thread AD7six



On Oct 7, 4:51 pm, kAtremer [EMAIL PROTECTED] wrote:
 OK. It will take some time to get used to the testing, so anybody more
 familiar with the process and methodics is welcome to pick up the bug
 and report.

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



Re: Ajax Form complete = not working with functions

2008-10-07 Thread CG

not sure of your problem... but try to put the java function BEFORE
the ajax calling and give it a try. Javascripts always mess with me in
this kind of way... maybe it helps you.

script type='javascript'
function testCall() { alert('[EMAIL PROTECTED]');}
/script
?
echo $ajax-form('addComment', 'post', array(
'model' = 'Comment',
'url' = array('controller' = 'comments', 'action' ='add'),
'update' = 'pureGenius',
'complete' = 'testCall();'));
?
..



On Oct 6, 3:55 pm, Chez17 [EMAIL PROTECTED] wrote:
 The complete option works fine if I put the javascript directly into
 the array. However if I try to put it in a function in the array it
 doesn't work. Take the following example:

 ?
 echo $ajax-form('addComment', 'post', array(
         'model' = 'Comment',
         'url' = array('controller' = 'comments', 'action' ='add'),
         'update' = 'pureGenius',
         'complete' = 'testCall();'));
 ?

 script type='javascript'
 function testCall()
 {
     alert('[EMAIL PROTECTED]');}

 /script

 If I put the alert in the ajax array, it works fine. Doesn't work as
 it stands. Any ideas?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[que] same element in different controllers

2008-10-07 Thread magnetism

Hi!

I have a Category controller that uses the TreeHelper and the Tree
behaviour
I also have an element for this controller that constructs a css menu.
These are the contents of the element:

echo $tree-generate($menu, array('type' = 'ul', 'id'='suckertree1',
'element'='menulink', 'model'='Category'));

The element is called from the views for the Category controller and
the tree menu is constructed.

How can I use the same element for another action of a different
controller, so that I will present the same menu in different parts of
the site?

Thanks,
Mike


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



Non-Test Fixtures

2008-10-07 Thread Keith

Is there anyway to package a non-test fixture that can be executed by
CakePHP 1.2?

I know how to do it for fixtures in unit testing, but I thought it
might be cool to use something like that to load some dummy data into
my app.

I'm sure there are a number of ways to tackle this issue.

Anyone doing something similar and doesn't mind sharing?
--~--~-~--~~~---~--~~
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: Trouble with the HtmlHelper and $scripts_for_layout

2008-10-07 Thread Marc Campeau

Me again,

so I think I figured some of it out.

It seems like the call to render the default.ctp doesn't defer the
output of the header until the end of all other element rendering.
Hence, if echo $scripts_for_layout is processed before in-page element
(inside the page's body), which are output using echo $this-
element(...) then they're not found in the header.

If you echo $scripts_for_layout later on, let's say after your
element() call, then it does contain the link tags that the elements
added. So I guess the it works but not as expected.

My question now is:
Was I right to expect that the echo $scripts_for_layout would be
delayed until all sub-elements are rendered?

Should I submit this as a bug/confusion/whatever?

Marc

On Oct 7, 10:33 am, Marc Campeau [EMAIL PROTECTED] wrote:
 Hi all,

 still haven't found a solution for this. Does anyone know whom I might
 contact to know if this is a bug or expected behavior, ie using $html-css() 
 within elements doesn't work the same as in views? Should I

 submit this to the bug tracker?

 Thanks for helping a new baker.

 Marc

 On Oct 7, 8:50 am, Marc Campeau [EMAIL PROTECTED] wrote:

  Hi Michael,

  thanks for looking at this problem. I know it works when calling 
  $html-css() from the view (see side notes in original post) but my problem

  is it doesn't when calling $html-css() or $javascript-link from an
  element (/views/elements/menu.ctp for instance).

  Thanks,

  Marc

  On Oct 6, 6:45 pm, Michael [EMAIL PROTECTED] wrote:

   Marc,
   I'm using RC3.

   In my view I'm calling $html-css() with array() as the third
   parameter instead of null.  The LINK) is correctly located in the
   head section.

   Michael

   On Oct 6, 2:41 pm, Marc Campeau [EMAIL PROTECTED] wrote:

Thanks for taking the time. t least now I know I'm not alone! ;-)

On Oct 6, 3:38 pm, hydra12 [EMAIL PROTECTED] wrote:

 Oops!  You're right.  Sorry.  I can't get it to work either.

 On Oct 6, 2:00 pm, Marc Campeau [EMAIL PROTECTED] wrote:

  Thanks for your input.

  I beg to differ though, the manual says:

 http://manual.cakephp.org/view/96/Layouts
  When using $html-css() or $javascript-link() in view files, 
  specify
  'false' for the 'in-line' argument to place the html source in
  $scripts_for_layout. (See API for more details on usage).

 http://manual.cakephp.org/view/206/Inserting-Well-Formatted-elements
  css(mixed $path, string $rel = null, array $htmlAttributes, boolean
  $inline = true)

  Creates a link(s) to a CSS style-sheet. If $inline is set to false,
  the link tags are added to the $scripts_for_layout variable which 
  you
  can print inside the head tag of the document.

 http://api.cakephp.org/class_html_helper.html
  HtmlHelper::css($path, $rel = null, $htmlAttributes = array(), 
  $inline = true)

  Creates a link element for CSS stylesheets.

  Parameters:
          mixed   $path The name of a CSS style sheet in 
  /app/webroot/css,
  or an array containing names of CSS stylesheets in that directory.
          string  $rel Rel attribute. Defaults to stylesheet.
          array   $htmlAttributes Array of HTML attributes.
          boolean         $inline If set to false, the generated tag 
  appears in
  the head tag of the layout.

 http://api.cakephp.org/class_javascript_helper.html
  JavascriptHelper::link( $url, $inline = true)                  

  Returns a JavaScript include tag (SCRIPT element). If the filename 
  is
  prefixed with /, the path will be relative to the base path of 
  your
  application. Otherwise, the path will be relative to your JavaScript
  path, usually webroot/js.

  Parameters:
          mixed   $url String URL to JavaScript file, or an array of 
  URLs.
          boolean         $inline If true, the script tag will be 
  printed
  inline, otherwise it will be printed in the head, using
  $scripts_for_layout

  On top of which, when looking at the actual HtmlHelper::css method,
  the last few lines read like this:
                  if ($inline) {
                          return $out;
                  } else {
                          $view = ClassRegistry::getObject('view');
                          $view-addScript($out);
                  }

  Other Side note:
  Using the JavascriptHelper::link method yields the same result, ie 
  the
  method calls don't generate the HTML to include an external JS file.

  Thanks,

  Marc
--~--~-~--~~~---~--~~
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: Trouble with the HtmlHelper and $scripts_for_layout

2008-10-07 Thread AD7six



On Oct 7, 7:57 pm, Marc Campeau [EMAIL PROTECTED] wrote:
 Me again,

 so I think I figured some of it out.

 It seems like the call to render the default.ctp doesn't defer the
 output of the header until the end of all other element rendering.
 Hence, if echo $scripts_for_layout is processed before in-page element
 (inside the page's body), which are output using echo $this-

 element(...) then they're not found in the header.

 If you echo $scripts_for_layout later on, let's say after your
 element() call, then it does contain the link tags that the elements
 added. So I guess the it works but not as expected.

 My question now is:
 Was I right to expect that the echo $scripts_for_layout would be
 delayed until all sub-elements are rendered?

$scripts_for_layout is not a marker, when you echo it in the layout
you echo what it contains . If you are calling your element from the
layout, then no, that's not going to and isn't expected to work:
anything it does wrt this variable won't have any effect - it's
contents have already been constructed.

hth,

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



Re: Another HABTM issue : row with same Id getting over-written

2008-10-07 Thread Brenton B

Ok, so I can kind of understand the use of `$foreignKey` as something
to compare on, but that still doesn't explain why we're limiting to
unique Ids.

Quite frustrating without an explanation.

On Oct 7, 2:28 am, Brenton B [EMAIL PROTECTED] wrote:
 Ok, so the root where all this non-unique stuff occurs seems to be
 in dbo_source.php, line 841:

 if ($type == 'hasAndBelongsToMany') {
 $uniqueIds = $merge = array();

 foreach($fetch as $j = 
 $data) {
 if (
 
 (isset($data[$with])  $data[$with][$foreignKey] ===
 $row[$model-alias][$model-primaryKey]) 
 
 (!in_array($data[$with][$joinKeys[1]], $uniqueIds))
 ) {
 $uniqueIds[] 
 = $data[$with][$joinKeys[1]];

 if 
 ($habtmFieldsCount = 2) {
 
 unset($data[$with]);
 }
 $merge[] = 
 $data;
 }
 }
 if (empty($merge)  
 !isset($row[$association])) {
 $row[$association] = 
 $merge;
 } else {
 
 $this-__mergeAssociation($resultSet[$i], $merge, $association,
 $type);
 }
 }

 Fair enough ... but why?? So this kills any possibility of showing
 duplicates, that might be good, but shouldn't it bring back
 everything, thus revealing any possibility of screwiness in app code?

 Since it's a HABTM relationship, shouldn't the whole has and belongs
 to many retrieve all that it has and belongs to?

 There's obviously something I'm missing and confused about ...
 unfortunately no comments in code to shed light.

 (Note: to recap, I've got a user HABTM webpage_types in users-
 webpage_types  with extra fields where a user could multiple of the
 same webpage_type)

 On Oct 6, 1:41 pm, Brenton B [EMAIL PROTECTED] wrote:

  So, moving to the solution nachopitt suggested works ... however,
  because of this, for saving, I have to use `saveAll()` instead of
  `save()` ... which works; however, for the User model, there's also
  another HABTM which doesn't work for `saveAll()` ... doh!!

  Best solution?

  On Oct 6, 11:03 am, Brenton B [EMAIL PROTECTED] wrote:

   Well, the table looks more like this:

   user_id | web_page_type_id | url
   ---
   7  |  6 | firstdomain.com
   7  |  6 | second.com

   So the two are unique, but I see what you're saying.

   I did originally have it setup in such a way that it wasn't a typical
   join table (as nachopitt suggested); however, was running into
   problems with saving in one fell swoop and wanted to give the HABTM
   save setup a try (as described everywhere).

   Might have to go back to the previous method.

   On Oct 4, 7:33 am, nachopitt [EMAIL PROTECTED] wrote:

Yeah, teknoid has a point. Your relation/association is not supposed
to work in that way. Normally, in a non CakePHP enviroment, a
joinTable has the 2 foreign keys and they set as the primary key
column. You don´t have the id column that CakePHP expects to have
and then the foreign keys... thats why the uniqueness of the
records.

Personally i would change the schema of you database for something
like

users
web_pages (holding the url, title, etc)
web_page_types (holding the name of the webpage type)

And the associations

user hasMany webpages
webpage belongsTo user
webpage belongsTo webpageType

On Oct 3, 6:37 pm, teknoid [EMAIL PROTECTED] wrote:

 Goes to show I should read more carefully :)
 I guess the title of the post made me jump the gun...

 You say an user has 2 of the same webpage_type

 Does it mean that in your join table you have something like: ?
 user_id | web_page_type_id
 -
 7  |  6
 7  |  6

 On Oct 3, 6:27 pm, Brenton B [EMAIL PROTECTED] wrote:

  Well, assuming the Docs are correct (and I understand it properly),
  that should only apply to updates (If true (default 

Ajax Login using Jquery and Auth component

2008-10-07 Thread bookme

Hi,

I am new to cakephp. I have no idea how to use ajax login using Jquery
and Auth.
It would be great for me if  anybody tell me any tutorial or steps to
do this.

Thanks a lot you!!
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Resolved - How to deploy cake on home.pl shared hosting

2008-10-07 Thread 3lancer.eu

Hi there,

Might be applicable also for other hosting companies maybe...

The problem was described by me here:
http://groups.google.com/group/cake-php/browse_thread/thread/d4fc8f8bfcb2bf6d/fb02bb3a89ce5cfb?lnk=gstq=please+help#fb02bb3a89ce5cfb

The fix is to add the php.ini file in / dir containing:
include_path = .:/app/..:/app

And that's all, your Dispatcher should now be found and it's high time
you go to optimization :-)

Hope that saves someone from painful debugging.

Applied to RC2, didn't install RC3 yet.

Regards,
Piotr
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Share the webroot folder ( multiple app folders )

2008-10-07 Thread Shackadoodl

Hi guys

I've seen the wildflower cms posted recently on the site, and it dit
one thing that i have been trying to do for a long time with cake:
have a seperate app folder ( named wildflower in this case ), and let
it connect to the webroot folder in the normal app folder.

When i was in spain I was trying to make a cms, but since i couldn't
figure out how this was done I had to abandon the idea and build in a
cms using admin routing.

So my questions are:
1- how to i make a seperate app folder connect to the main app
folders' webroot?
2- how to i redirect /admin to this other app folder?

I've been searching the docs, googling, and even after a month I still
haven'th found it. Maybe the info I need doesn't exist, or else I've
been looking in the wrong way all the time.

Can somebody point me in the right direction?

Best regards
Gregory

--~--~-~--~~~---~--~~
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: Resolved - How to deploy cake on home.pl shared hosting

2008-10-07 Thread 3lancer.eu

Forgot to mention, leave app/webroot/index.php alone, I mean use the
one from tar, zip, whatever. The ini solution is far cleaner then
messing around with index.php.

Regards,
Piotr
--~--~-~--~~~---~--~~
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: Trouble with the HtmlHelper and $scripts_for_layout

2008-10-07 Thread Marc Campeau

Thanks for clarifying this.

On a side note, there's something fishy about the fact that the
following doesn't yield what I expected:

In the head tag section of default.ctp:
?php $html-css(array('general'), null, null, false); ?
?php echo $scripts_for_layout ?

The output doesn't contain the Link tag.

Could it be because the render method is run statically
(View::_render) when rendering templates? See view.php ~line 370

Marc

On Oct 7, 2:25 pm, AD7six [EMAIL PROTECTED] wrote:
 On Oct 7, 7:57 pm, Marc Campeau [EMAIL PROTECTED] wrote:



  Me again,

  so I think I figured some of it out.

  It seems like the call to render the default.ctp doesn't defer the
  output of the header until the end of all other element rendering.
  Hence, if echo $scripts_for_layout is processed before in-page element
  (inside the page's body), which are output using echo $this-

  element(...) then they're not found in the header.

  If you echo $scripts_for_layout later on, let's say after your
  element() call, then it does contain the link tags that the elements
  added. So I guess the it works but not as expected.

  My question now is:
  Was I right to expect that the echo $scripts_for_layout would be
  delayed until all sub-elements are rendered?

 $scripts_for_layout is not a marker, when you echo it in the layout
 you echo what it contains . If you are calling your element from the
 layout, then no, that's not going to and isn't expected to work:
 anything it does wrt this variable won't have any effect - it's
 contents have already been constructed.

 hth,

 AD
--~--~-~--~~~---~--~~
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: Share the webroot folder ( multiple app folders )

2008-10-07 Thread hydra12

Have you looked at the advanced install options in the
documentation?

http://book.cakephp.org/view/35/Advanced-Installation

You can define where the webroot folder, the app folder, and the cake
folder are.

On Oct 7, 2:15 pm, Shackadoodl [EMAIL PROTECTED] wrote:
 Hi guys

 I've seen the wildflower cms posted recently on the site, and it dit
 one thing that i have been trying to do for a long time with cake:
 have a seperate app folder ( named wildflower in this case ), and let
 it connect to the webroot folder in the normal app folder.

 When i was in spain I was trying to make a cms, but since i couldn't
 figure out how this was done I had to abandon the idea and build in a
 cms using admin routing.

 So my questions are:
 1- how to i make a seperate app folder connect to the main app
 folders' webroot?
 2- how to i redirect /admin to this other app folder?

 I've been searching the docs, googling, and even after a month I still
 haven'th found it. Maybe the info I need doesn't exist, or else I've
 been looking in the wrong way all the time.

 Can somebody point me in the right direction?

 Best regards
 Gregory
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Helpers specific to certain themes

2008-10-07 Thread martinp

Hello.
Question:
If using themes to control layouts, views etc. is there a way of
calling a helper specifically for that theme's view without naming it
in the controller?

For example, my theme may need to use a helper that all other themes,
or indeed the default view, don't require.

I'm also trying to make my themes plugin-able, i.e. so that you can
add them to the application without changing other parts of the code,
such as the controller.

Any tips?

--~--~-~--~~~---~--~~
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: Ajax Form complete = not working with functions

2008-10-07 Thread Chez17

I figured it out! It took a couple of days, but here it is. I am not
expert but here is what did it for me. For some reason, it doesn't
work when you put the javascript on the page itself. It won't
recognize the functions. But if you put it in an external file, it can
see it. I don't know why, but it works. The solutions is to create an
external .js file and link to it in your layout. Thanks for your time
CG.

On Oct 7, 12:50 pm, CG [EMAIL PROTECTED] wrote:
 not sure of your problem... but try to put the java function BEFORE
 the ajax calling and give it a try. Javascripts always mess with me in
 this kind of way... maybe it helps you.

 script type='javascript'
 function testCall() { alert('[EMAIL PROTECTED]');}
 /script
 ?
 echo $ajax-form('addComment', 'post', array(
         'model' = 'Comment',
         'url' = array('controller' = 'comments', 'action' ='add'),
         'update' = 'pureGenius',
         'complete' = 'testCall();'));
 ?
 ..

 On Oct 6, 3:55 pm, Chez17 [EMAIL PROTECTED] wrote:

  The complete option works fine if I put the javascript directly into
  the array. However if I try to put it in a function in the array it
  doesn't work. Take the following example:

  ?
  echo $ajax-form('addComment', 'post', array(
          'model' = 'Comment',
          'url' = array('controller' = 'comments', 'action' ='add'),
          'update' = 'pureGenius',
          'complete' = 'testCall();'));
  ?

  script type='javascript'
  function testCall()
  {
      alert('[EMAIL PROTECTED]');}

  /script

  If I put the alert in the ajax array, it works fine. Doesn't work as
  it stands. Any ideas?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Bi-directional HABTM edits getting deleted.

2008-10-07 Thread Brenton B

Setup: Categories HABTM Tags ... and consequently Tags HABTM
Categories .. join table: categories_tags.

I've got the forms setup working for both ways: Categories has a list
of Tags; and Tags has a list of Categories.

Unfortunately, since the way to update one or the other is to do a
complete DELETE on the corresponding foreign key, then add anything
that's new. So if I go and create a Category and select a bunch of
Tags ... then I go into one of the Tags and edit something in there,
it wipes 'em all and adds 'em (as expected), but information is lost.

Now, if I add an `id` on the `categories_tags` table, then everything
that needs to be is retained; however, since it's still doing a DELETE
then INSERT, my `id` goes up every time I do save an edit ... thus
possibly resulting in a really high `id`.

So I guess there's no way around it. doh!!


(This is mostly an info blurb for any other newbies who are confused).
--~--~-~--~~~---~--~~
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: Trouble with the HtmlHelper and $scripts_for_layout

2008-10-07 Thread AD7six



On Oct 7, 10:02 pm, Marc Campeau [EMAIL PROTECTED] wrote:
 Thanks for clarifying this.

 On a side note, there's something fishy about the fact that the
 following doesn't yield what I expected:

 In the head tag section of default.ctp:
         ?php $html-css(array('general'), null, null, false); ?
         ?php echo $scripts_for_layout ?

Think about when in terms of processing order $scripts_for_layout is
calculated.

In what way is that result surprising, and in what way is it be
logical to do that.


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



Re: Share the webroot folder ( multiple app folders )

2008-10-07 Thread Shackadoodl

Yes, but how can i tell in the normal app that when i go to /admin
that it redirects to the other app folder?

On Oct 7, 10:11 pm, hydra12 [EMAIL PROTECTED] wrote:
 Have you looked at the advanced install options in the
 documentation?

 http://book.cakephp.org/view/35/Advanced-Installation

 You can define where the webroot folder, the app folder, and the cake
 folder are.

 On Oct 7, 2:15 pm, Shackadoodl [EMAIL PROTECTED] wrote:

  Hi guys

  I've seen the wildflower cms posted recently on the site, and it dit
  one thing that i have been trying to do for a long time with cake:
  have a seperate app folder ( named wildflower in this case ), and let
  it connect to the webroot folder in the normal app folder.

  When i was in spain I was trying to make a cms, but since i couldn't
  figure out how this was done I had to abandon the idea and build in a
  cms using admin routing.

  So my questions are:
  1- how to i make a seperate app folder connect to the main app
  folders' webroot?
  2- how to i redirect /admin to this other app folder?

  I've been searching the docs, googling, and even after a month I still
  haven'th found it. Maybe the info I need doesn't exist, or else I've
  been looking in the wrong way all the time.

  Can somebody point me in the right direction?

  Best regards
  Gregory

--~--~-~--~~~---~--~~
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: Share the webroot folder ( multiple app folders )

2008-10-07 Thread Shackadoodl

Yes, i looked into that, but it still doesn't delve in how i can let
the
admin from the first app be rerouted to the other app.

eg when i use /admin for the normal app folder i want to be
redirected to the admin.

is this possible?

On Oct 7, 10:11 pm, hydra12 [EMAIL PROTECTED] wrote:
 Have you looked at the advanced install options in the
 documentation?

 http://book.cakephp.org/view/35/Advanced-Installation

 You can define where the webroot folder, the app folder, and the cake
 folder are.

 On Oct 7, 2:15 pm, Shackadoodl [EMAIL PROTECTED] wrote:

  Hi guys

  I've seen the wildflower cms posted recently on the site, and it dit
  one thing that i have been trying to do for a long time with cake:
  have a seperate app folder ( named wildflower in this case ), and let
  it connect to the webroot folder in the normal app folder.

  When i was in spain I was trying to make a cms, but since i couldn't
  figure out how this was done I had to abandon the idea and build in a
  cms using admin routing.

  So my questions are:
  1- how to i make a seperate app folder connect to the main app
  folders' webroot?
  2- how to i redirect /admin to this other app folder?

  I've been searching the docs, googling, and even after a month I still
  haven'th found it. Maybe the info I need doesn't exist, or else I've
  been looking in the wrong way all the time.

  Can somebody point me in the right direction?

  Best regards
  Gregory

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



Cake php Controller Structure

2008-10-07 Thread Ahmed

I am trying to make an action that involves using several models for
example:

There is a ticket and an order.
I want to create a controller that creates a ticket then it creates an
order for that ticket.

Should i create a new controller for this action or should the action
be included in the tickets_controller.php file  or the
orders_controller.php

What is the conventional way to creating custom controller actions
that do tasks that involve several models.

--~--~-~--~~~---~--~~
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: Multiple table conditions HABTM

2008-10-07 Thread jmmg77

Okay,

Whenever I have a hasOne or belongsTo association, those models are
included in the query whenever I do a find('all');

But, when I have any other type of association, find('all' only
generates a query with the model I'm searching.
This keeps me from filtering by fields in the related models.

ex:
$funnypeople = $this-Individual-find('all', array('conditions' =
array('Personality.type' = 3)));

This example works find if a person only has one Personality Type.
But what about this.

$racecardrivers = $this-Individual-find('all', array('conditions' =
array('Vehicle.type' = 2)));

The problem here is a person could own multiple vehicles, so belongsTo
 hasOne don't work here.
I would need hasMany or hasAndBelongsToMany, which makes those model
inaccessible using find.

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



Difference between modified and updated?

2008-10-07 Thread powtac

I'm wondering what is the difference between the two automagic model
fields modified and updated?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Model imports inexistent class Behavior

2008-10-07 Thread mark_story

Hate to burst the ticket bubble.   But if after App::import('Core',
'Behavior'); the ModelBehavior class from model/behavior.php doesn't
exist, then something is broken.  But seeing as how all the core tests
are passing, and the syntax is the same everywhere, I think you might
have a dud.  But I love being wrong, and this wouldn't be the first
time ;)

-Mark

On Oct 7, 12:39 pm, AD7six [EMAIL PROTECTED] wrote:
 On Oct 7, 4:51 pm, kAtremer [EMAIL PROTECTED] wrote:

  OK. It will take some time to get used to the testing, so anybody more
  familiar with the process and methodics is welcome to pick up the bug
  and report.

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



Re: same element in different controllers

2008-10-07 Thread powtac

You could use cakePHP elements (http://book.cakephp.org/view/97/
Elements) this are small view helpers. It is also possible to pass
parameters to this elements, in your case I think: $menu.
--~--~-~--~~~---~--~~
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: Helpers specific to certain themes

2008-10-07 Thread jitka (poLK)

App::import('View', 'Theme');
class AdvancedThemeView extends ThemeView {
function __construct($controller) {
parent::__construct($controller);
switch ($this-theme) {
...
$this-helpers[] = ...
--~--~-~--~~~---~--~~
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: Helpers specific to certain themes

2008-10-07 Thread martinp

Thanks. That helps. I was thinking along those lines and I've got
something closer to what I want.

With this code, however, the helper file still needs to be in the
generic helpers folder. What I'd ideally like is a way to read the
helpers from the current theme and include them... something like:

$HLFolder = new Folder();

$HLFolder-cd(APP.'plugins'.DS.'cms'.DS.'views'.DS.'themed'.DS.
$this-theme.DS.'helpers');
$HelpersList = $HLFolder-read();
foreach($HelpersList[1] as $Helper) {
$this-helpers[ucfirst(substr($Helper, 0, -4))] 
= array('search'
= array(APP.'plugins'.DS.'cms'.DS.'views'.DS.'themed'.DS.$this-
theme.DS.'helpers'), 'file' = $Helper);
}

But I've figured out that the $options variable on in the
_loadHelpers function in the View class doesn't work in this way.
Is there a way of specifying a particular directory to load the helper
from?

I also tried in my foreach loop:
App::import('Helpers', $Helper, true,
array(APP.'plugins'.DS.'cms'.DS.'views'.DS.'themed'.DS.$this-
theme.DS.'helpers'), $Helper);

But I think this doesn't work because it's loading this helper before
it's got around to loading the helpers in general.

Any more tips?

On Oct 7, 11:27 pm, jitka (poLK) [EMAIL PROTECTED] wrote:
 App::import('View', 'Theme');
 class AdvancedThemeView extends ThemeView {
     function __construct($controller) {
         parent::__construct($controller);
         switch ($this-theme) {
             ...
             $this-helpers[] = ...
--~--~-~--~~~---~--~~
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: Difference between modified and updated?

2008-10-07 Thread villas

No difference,  I believe they are equivalent.

Re:  Firebird DB.  Use 'modified' because using 'updated' always seems
to break the SQL.  In fact I'll make a ticket on trac about this
because it has been like this for ages.

On Oct 7, 10:15 pm, powtac [EMAIL PROTECTED] wrote:
 I'm wondering what is the difference between the two automagic model
 fields modified and updated?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Is there ANY way to insert page-specific code in to $scripts_for_layout??

2008-10-07 Thread teknoid

To me it seems that you've shut down the best option (creating a
separate CSS file)... why not create one?

On the other hand you could try something like that in the layout:
if(isset($additional_css)) { echo $additional_css; }

in the view:
$this-set('additional_css', 'style //your css code /style');

On Oct 7, 5:48 pm, BrendonKoz [EMAIL PROTECTED] wrote:
 I have some page-specific code (CSS in this case) that I would like to
 use on a form.  This code will *not* be used anywhere else in my
 application, and if replicated, only portions of it will be.  I'd
 rather not have to create separate CSS files to use this.  I looked at
 $html-css() and $html-style() without success.  Is there another
 method to input *whatever* code I'd like directly in to
 $scripts_for_layout?

 The specific code I need to insert can be found at the following
 pastebin address:http://pastebin.com/m28c87fd2

 I do plan on reusing the layout I created for this, for other forms,
 but the CSS is specific to this individual form (a recreation of a
 paper form, and must retain the same look for legal reasons).

 Although I could use $html-css for two of the three CSS sections (I'd
 prefer not to however), that specific class method is not made to
 handle IE conditional CSS statements for insertion.  Has anyone come
 up with any solutions to this in their own projects, or have any ideas
 on a possible solution?

 Note: The linked CSS file has not yet been converted for use within
 Cake, but that's not the issue here.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to exclude a field from inserts and updates

2008-10-07 Thread teknoid

Is the field in the data array?
Cake also has a white list of fields param you can (and should) pass
to save().

On Oct 7, 7:00 pm, R. Davila [EMAIL PROTECTED] wrote:
 Hi,
 I have a table with a timestamp field which is managed by MySQL.
 This is the definition of the field:
     `fieldname` timestamp NOT NULL default CURRENT_TIMESTAMP on update 
 CURRENT_TIMESTAMP
 When a new record is inserted, MySQL fills in the default value for the field.
 When the record is updated, MySQL updates the field value accordingly.
 I need to tell CakePHPnot to include that fieldin the inserts and updates, 
 otherwise MySQL does not assign the values it should.
 The timestamp field is just an example since the behavior I'm looking for 
 would be needed for any computed field in the table.
 Thanks in advance
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How do you make line breaks appear in views?

2008-10-07 Thread Cody Sortore

Okay, I know I sound like a complete n00b right now, and that's fine
because I am.  I've really only made applications for myself so far so
putting in br / tags is no problem... but now that I'm trying to
make something for other people to use how to I make it so that when
they hit enter it will automatically put in a br / tag for me?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to exclude a field from inserts and updates

2008-10-07 Thread R. Davila

I'm passing $this-data to the save() function.
The controller is the default made by cake bake which includes the
following in the add() function:

 function add() {
  if (!empty ($this-data)) {
   $this-Status-create();
   if ($this-Status-save($this-data)) {
   ...

If I take a field param out of the $this-data array, will it be
excluded from the insert or update?


teknoid wrote:
 Is the field in the data array?
 Cake also has a white list of fields param you can (and should) pass
 to save().

 On Oct 7, 7:00 pm, R. Davila [EMAIL PROTECTED] wrote:
   
 Hi,
 I have a table with a timestamp field which is managed by MySQL.
 This is the definition of the field:
 `fieldname` timestamp NOT NULL default CURRENT_TIMESTAMP on update 
 CURRENT_TIMESTAMP
 When a new record is inserted, MySQL fills in the default value for the 
 field.
 When the record is updated, MySQL updates the field value accordingly.
 I need to tell CakePHPnot to include that fieldin the inserts and updates, 
 otherwise MySQL does not assign the values it should.
 The timestamp field is just an example since the behavior I'm looking for 
 would be needed for any computed field in the table.
 Thanks in advance
 

 


 No virus found in this incoming message.
 Checked by AVG - http://www.avg.com 
 Version: 8.0.173 / Virus Database: 270.7.6/1713 - Release Date: 10/7/2008 
 6:40 PM

   

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



Re: How to exclude a field from inserts and updates

2008-10-07 Thread R. Davila

The answer was to pass an array of field names to save().

save($this-data, true, array('field_a', 'field_b'));

That way field_c is excluded from the save.

Thanks!

teknoid wrote:
 Is the field in the data array?
 Cake also has a white list of fields param you can (and should) pass
 to save().
 
 On Oct 7, 7:00 pm, R. Davila [EMAIL PROTECTED] wrote:
 Hi,
 I have a table with a timestamp field which is managed by MySQL.
 This is the definition of the field:
 `fieldname` timestamp NOT NULL default CURRENT_TIMESTAMP on update 
 CURRENT_TIMESTAMP
 When a new record is inserted, MySQL fills in the default value for the 
 field.
 When the record is updated, MySQL updates the field value accordingly.
 I need to tell CakePHPnot to include that fieldin the inserts and updates, 
 otherwise MySQL does not assign the values it should.
 The timestamp field is just an example since the behavior I'm looking for 
 would be needed for any computed field in the table.
 Thanks in advance
  
 
 
 
 
 No virus found in this incoming message.
 Checked by AVG - http://www.avg.com 
 Version: 8.0.173 / Virus Database: 270.7.6/1713 - Release Date: 10/7/2008 
 6:40 PM
 

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



Session id appearing in plugin view links but not main app view links

2008-10-07 Thread westaussie

Hi all ... have an odd issue with link urls using 1.2 RC2.

I have a simple cms that handles the pages for the site and a plugin
that handle simple news. All was fine on the original server ie links/
urls appeared as they should ie http://www.domain.com/some/path/to/page.
I've since moved the site to a subdomain of the final domain where it
will be permanently located ie dev.domain.com.

Accessing the site in the new location works as it should for the main
pages ... links to other pages/areas of the site appear fine.

The issue I have noticed is that when within the section of the site
that is controlled by the plugin News all links within and even to
other pages have the session id appended to them ie
http://www.domain.com/some/path/to/page?CAKEPHP=a7513b07a498aabd167b68039bc82e84
or 
http://www.domain.com/news/view/some-slug?CAKEPHP=a7513b07a498aabd167b68039bc82e84.

Clicking any of these links works as it should ie functionally no
issues ... really just a aesthetic one when within News ... would
really like consistency.

I'm using standard $html-link(); everywhere within the plugin and
within the main app. I've dug through the api but can't seem to find
anything that I can understand or that leads me to how the session id
gets appended.

Can anyone shed any light or have some ideas as to where I should be
looking for a solution?

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



How to exclude a field from inserts and updates

2008-10-07 Thread R. Davila





Hi,

I have a table with a timestamp field which is managed by MySQL.
This is the definition of the field:
 `fieldname` timestamp NOT NULL default CURRENT_TIMESTAMP on update
CURRENT_TIMESTAMP

When a new record is inserted, MySQL fills in the default value for the
field.
When the record is updated, MySQL updates the field value accordingly.

I need to tell CakePHP not to include that field in the inserts
and updates, otherwise MySQL does not assign the values it should.

The timestamp field is just an example since the behavior I'm looking
for would be needed for any computed field in the table.

Thanks in advance

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





Re: How do you make line breaks appear in views?

2008-10-07 Thread David C. Zentgraf

http://jp2.php.net/nl2br

Or use pre or CSS white-space: pre.

On 8 Oct 2008, at 08:33, Cody Sortore wrote:


 Okay, I know I sound like a complete n00b right now, and that's fine
 because I am.  I've really only made applications for myself so far so
 putting in br / tags is no problem... but now that I'm trying to
 make something for other people to use how to I make it so that when
 they hit enter it will automatically put in a br / tag for me?
 


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



Re: Cake php Controller Structure

2008-10-07 Thread David C. Zentgraf

Think of the controllers/actions as pages on your website.
If it makes sense to do everything on one page (i.e. in one action)  
than do that.
Just because models and controllers of the same name are automatically  
linked doesn't mean you shouldn't or can't use other models as well.

On 8 Oct 2008, at 05:53, Ahmed wrote:


 I am trying to make an action that involves using several models for
 example:

 There is a ticket and an order.
 I want to create a controller that creates a ticket then it creates an
 order for that ticket.

 Should i create a new controller for this action or should the action
 be included in the tickets_controller.php file  or the
 orders_controller.php

 What is the conventional way to creating custom controller actions
 that do tasks that involve several models.

 


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



Email Validation after registration

2008-10-07 Thread phpcurious

okay, I already did the user registration, but now, I want the user to
validate the email address the user is registered with. The user will
be sent an email for the validation link. now my concern here is that
link to my cakephp web app will be accessible for a limited time only.
because of that, the registered user pending email validation has to
resend that email validation link. I have some ideas, but I just want
to know from the community what is best to do this.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cake php Controller Structure

2008-10-07 Thread teknoid

This could help:
http://teknoid.wordpress.com/2008/08/01/practical-use-of-saveall-part-1-working-with-multiple-models/

I've also added a shortened version of this in the manual

On Oct 7, 4:53 pm, Ahmed [EMAIL PROTECTED] wrote:
 I am trying to make an action that involves using several models for
 example:

 There is a ticket and an order.
 I want to create a controller that creates a ticket then it creates an
 order for that ticket.

 Should i create a new controller for this action or should the action
 be included in the tickets_controller.php file  or the
 orders_controller.php

 What is the conventional way to creating custom controller actions
 that do tasks that involve several models.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to exclude a field from inserts and updates

2008-10-07 Thread teknoid

While this works fine, and makes your app more secure... the real
question is why are you passing fields that do not need saving to the
controller? or why do you even have them in the form?


On Oct 7, 7:50 pm, R. Davila [EMAIL PROTECTED] wrote:
 The answer was to pass an array of field names to save().

         save($this-data, true, array('field_a', 'field_b'));

 That way field_c is excluded from the save.

 Thanks!

 teknoid wrote:
  Is the field in the data array?
  Cake also has a white list of fields param you can (and should) pass
  to save().

  On Oct 7, 7:00 pm, R. Davila [EMAIL PROTECTED] wrote:
  Hi,
  I have a table with a timestamp field which is managed by MySQL.
  This is the definition of the field:
      `fieldname` timestamp NOT NULL default CURRENT_TIMESTAMP on update 
  CURRENT_TIMESTAMP
  When a new record is inserted, MySQL fills in the default value for the 
  field.
  When the record is updated, MySQL updates the field value accordingly.
  I need to tell CakePHPnot to include that fieldin the inserts and updates, 
  otherwise MySQL does not assign the values it should.
  The timestamp field is just an example since the behavior I'm looking for 
  would be needed for any computed field in the table.
  Thanks in advance

  

  No virus found in this incoming message.
  Checked by AVG -http://www.avg.com
  Version: 8.0.173 / Virus Database: 270.7.6/1713 - Release Date: 10/7/2008 
  6:40 PM
--~--~-~--~~~---~--~~
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: Is there ANY way to insert page-specific code in to $scripts_for_layout??

2008-10-07 Thread BrendonKoz

Ah, teknoid...  I've seen that solution before, albeit with different
variable names, but that would be the exact solution I was looking
for.  Thanks.

The reason I don't want to create separate CSS files (usually the best
solution) is two-fold.
1. I can't think of a way to apply IE conditional styling with Cake's
built in $html-css() method unless I create a layout specifically for
this purpose - but without the additional variable in the layout that
you suggested, I probably wouldn't have figured out how to do that
properly anyway.
2. I'd rather not have multiple stylesheets specific to a single web
address on the server - that can add up rather quickly.  I foresee
administration wanting other forms recreated on the web, and with just
30 forms, that approximately 90 CSS files unrelated to core CSS styles
for regular layout.

I've used the default.ctp layout supplied by Cake's core so often to
recreate functionality, I completely forgot I could add my own
variables to it, and that they would be accessible from my views.
Thanks again.


On Oct 7, 7:02 pm, teknoid [EMAIL PROTECTED] wrote:
 To me it seems that you've shut down the best option (creating a
 separate CSS file)... why not create one?

 On the other hand you could try something like that in the layout:
 if(isset($additional_css)) { echo $additional_css; }

 in the view:
 $this-set('additional_css', 'style //your css code /style');

 On Oct 7, 5:48 pm, BrendonKoz [EMAIL PROTECTED] wrote:



  I have some page-specific code (CSS in this case) that I would like to
  use on a form.  This code will *not* be used anywhere else in my
  application, and if replicated, only portions of it will be.  I'd
  rather not have to create separate CSS files to use this.  I looked at
  $html-css() and $html-style() without success.  Is there another
  method to input *whatever* code I'd like directly in to
  $scripts_for_layout?

  The specific code I need to insert can be found at the following
  pastebin address:http://pastebin.com/m28c87fd2

  I do plan on reusing the layout I created for this, for other forms,
  but the CSS is specific to this individual form (a recreation of a
  paper form, and must retain the same look for legal reasons).

  Although I could use $html-css for two of the three CSS sections (I'd
  prefer not to however), that specific class method is not made to
  handle IE conditional CSS statements for insertion.  Has anyone come
  up with any solutions to this in their own projects, or have any ideas
  on a possible solution?

  Note: The linked CSS file has not yet been converted for use within
  Cake, but that's not the issue here.- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
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: Is there ANY way to insert page-specific code in to $scripts_for_layout??

2008-10-07 Thread David C. Zentgraf

I'm using the HeadHelper to do exactly what you want to do.
http://rossoft.wordpress.com/2006/03/28/register-head-tags-from-helpers-2/

On 8 Oct 2008, at 11:16, BrendonKoz wrote:


 Ah, teknoid...  I've seen that solution before, albeit with different
 variable names, but that would be the exact solution I was looking
 for.  Thanks.

 The reason I don't want to create separate CSS files (usually the best
 solution) is two-fold.
 1. I can't think of a way to apply IE conditional styling with Cake's
 built in $html-css() method unless I create a layout specifically for
 this purpose - but without the additional variable in the layout that
 you suggested, I probably wouldn't have figured out how to do that
 properly anyway.
 2. I'd rather not have multiple stylesheets specific to a single web
 address on the server - that can add up rather quickly.  I foresee
 administration wanting other forms recreated on the web, and with just
 30 forms, that approximately 90 CSS files unrelated to core CSS styles
 for regular layout.

 I've used the default.ctp layout supplied by Cake's core so often to
 recreate functionality, I completely forgot I could add my own
 variables to it, and that they would be accessible from my views.
 Thanks again.


 On Oct 7, 7:02 pm, teknoid [EMAIL PROTECTED] wrote:
 To me it seems that you've shut down the best option (creating a
 separate CSS file)... why not create one?

 On the other hand you could try something like that in the layout:
 if(isset($additional_css)) { echo $additional_css; }

 in the view:
 $this-set('additional_css', 'style //your css code /style');

 On Oct 7, 5:48 pm, BrendonKoz [EMAIL PROTECTED] wrote:



 I have some page-specific code (CSS in this case) that I would  
 like to
 use on a form.  This code will *not* be used anywhere else in my
 application, and if replicated, only portions of it will be.  I'd
 rather not have to create separate CSS files to use this.  I  
 looked at
 $html-css() and $html-style() without success.  Is there another
 method to input *whatever* code I'd like directly in to
 $scripts_for_layout?

 The specific code I need to insert can be found at the following
 pastebin address:http://pastebin.com/m28c87fd2

 I do plan on reusing the layout I created for this, for other forms,
 but the CSS is specific to this individual form (a recreation of a
 paper form, and must retain the same look for legal reasons).

 Although I could use $html-css for two of the three CSS sections  
 (I'd
 prefer not to however), that specific class method is not made to
 handle IE conditional CSS statements for insertion.  Has anyone come
 up with any solutions to this in their own projects, or have any  
 ideas
 on a possible solution?

 Note: The linked CSS file has not yet been converted for use within
 Cake, but that's not the issue here.- Hide quoted text -

 - Show quoted text -
 


--~--~-~--~~~---~--~~
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: Scaffold in RC3

2008-10-07 Thread Chen

sorry, I found that I used the old version dispather.php. And now is
OK

On Oct 7, 8:40 pm, Chen [EMAIL PROTECTED] wrote:
 Hello there,
   Recently I upgrade my cake lib to 1.2rc3, then I can visit the
 pages which don't exist exactly but inscaffoldname array like
 'index', 'edit' and so on.
   For example in 1.2 rc2, if you 
 visithttp://mysite.com/users/orhttp://mysite.com/users/index, you will get an 
 error message with 404
 not found. But inrc3, you can see the page which generate byscaffold.
   Does anyone has met the same with me?
   Thank you.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How do you make line breaks appear in views?

2008-10-07 Thread BrendonKoz

Via PHP code, you could also process the data through PHP's nl2br()
function, which inserts br / tags prior to the newline (the newline
is not removed).  Hopefully you're already processing and filtering
the user data anyway.

On Oct 7, 7:33 pm, Cody Sortore [EMAIL PROTECTED] wrote:
 Okay, I know I sound like a complete n00b right now, and that's fine
 because I am.  I've really only made applications for myself so far so
 putting in br / tags is no problem... but now that I'm trying to
 make something for other people to use how to I make it so that when
 they hit enter it will automatically put in a br / tag for me?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Email Validation after registration

2008-10-07 Thread Joel Perras

Store a timestamp with the token that you send to have your user
validate their email address. If the user validates their email
address after the expiry indicated by the timestamp... well do
whatever you want with that, and delete the associated token from the
database. Routinely remove expired tokens from database through some
functionality, most likely a cron job or a manual task that an
administrator can run once in a while.

-J.


On Oct 7, 9:04 pm, phpcurious [EMAIL PROTECTED] wrote:
 okay, I already did the user registration, but now, I want the user to
 validate the email address the user is registered with. The user will
 be sent an email for the validation link. now my concern here is that
 link to my cakephp web app will be accessible for a limited time only.
 because of that, the registered user pending email validation has to
 resend that email validation link. I have some ideas, but I just want
 to know from the community what is best to do this.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Bi-directional HABTM edits getting deleted.

2008-10-07 Thread Joel Perras

What''s the problem with 'really high id' values? Do you not have
enough of 4 294 967 294 integers? If so, you can always use UUIDs,
which are, in most respects, inexhaustible, since you'll run into far
greater problems before you start worrying about UUID collisions (like
the entropic death of the universe).

-J.

On Oct 7, 4:28 pm, Brenton B [EMAIL PROTECTED] wrote:
 Setup: Categories HABTM Tags ... and consequently Tags HABTM
 Categories .. join table: categories_tags.

 I've got the forms setup working for both ways: Categories has a list
 of Tags; and Tags has a list of Categories.

 Unfortunately, since the way to update one or the other is to do a
 complete DELETE on the corresponding foreign key, then add anything
 that's new. So if I go and create a Category and select a bunch of
 Tags ... then I go into one of the Tags and edit something in there,
 it wipes 'em all and adds 'em (as expected), but information is lost.

 Now, if I add an `id` on the `categories_tags` table, then everything
 that needs to be is retained; however, since it's still doing a DELETE
 then INSERT, my `id` goes up every time I do save an edit ... thus
 possibly resulting in a really high `id`.

 So I guess there's no way around it. doh!!

 (This is mostly an info blurb for any other newbies who are confused).
--~--~-~--~~~---~--~~
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: Encryption/Decryption of data

2008-10-07 Thread Joel Perras

Simple solution: Generate a pseudo-random string of characters (or let
him choose his own passphrase), and use this as a salt to encrypt your
data before saving to your database. The passphrase must then be used
to retrieve any information from the database.

Of course, all of this is completely useless if you don't use SSL for
the entire request/response process.

-J.

On Oct 7, 3:50 am, titang [EMAIL PROTECTED] wrote:
 Hi,
 I would like to encrypt/decrypt data in my application regarding the
 following requirements:
 - The data will be decrypted by many users.
 - I dont want to keep the secret password for decrypting the data of
 each users in my application.

 Does someone have any idea about how can I do this ? And if there is
 something already implemented for the cakephp framework?

 There is something pretty good, it is the gnupg project.http://www.gnupg.org/
 I did my first test by command line on Linux, and it seems really
 good.
 1. First i have to generate one public key per users (from an uid and
 a passphrase).
 2. Then i encrypt  the data and specify which users can access the
 data (by specifying the uid).
 3. And the authorized users can decrypt the data with their own
 passphrase

 An extension gnupg is available for php.
 What about a cakephp behavior using this extension? I think it could
 be very useful.

 Any suggestions or helps are welcome !

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



Re: more problems with RC3 and tests

2008-10-07 Thread Joel Perras



On Oct 7, 6:10 am, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
 I am sure the docs do not contain the recent changes yet.

 My Model-tests work with fixtures. Here is a mini-example. Maybe you
 can see some detail that you have done differently.

 in phone.test.php

 App::import('Model', 'Phone');

 class PhoneTest extends Phone {
     var $name = 'PhoneTest';
     var $useDbConfig = 'test_suite';

 }

 class PhoneTestCase extends CakeTestCase {
     var $fixtures = array( 'app.phone_test' );

     function testStorage() {
         $this-PhoneTest = new PhoneTest();

         $all = $this-PhoneTest-findAll();

         $this-assertEqual(4, count($all));
     }

 }

Actually, you can now instantiate your test models using
ClassRegistry::init('NameOfModel'); no need to riddle your tests with
fake Model classes, whose only purpose is to link model associations
and use a different database configuration. Your complete code snippet
above can be reduced to:

class PhoneTestCase extends CakeTestCase {
 var $fixtures = array( 'app.phone_test' );

function testStorage() {
 $this-PhoneTest = ClassRegistry::init('PhoneTest');
 $all = $this-PhoneTest-findAll();
 $this-assertEqual(4, count($all));
}
}

--~--~-~--~~~---~--~~
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: 2 column layout for $form-input() ?

2008-10-07 Thread Malcolm Krugger

Here is a small example of a view file which shows one text box and 2
horizontal pull down menus in a form in a single horizontal line

div 

?php echo $form-create('DataForm' );?
fieldset
legend?php __('Add Stuff');?/legend
?php
echo div id=div5;
echo $form-input('numberone' , array('label' = false ,
'type'='text','size' = '7',
'maxlength'='7' , 'div' = '' , 'error' = false));
echo $form-input('dropdown1' , array('label' = false, 'div' =
'' , 'options' = array(
 'option1' ='option1',
 'option2' ='option2',
 'option3' ='option3',
 'option4' ='option4',

 )));
echo $form-input('dropdown2' , array('label' = false , 'div' 
=
'', 'options' = array(
 'option1' ='option1',
 'option2' ='option2',
 'option3' ='option3',
 'option4' ='option4') ));
echo /div;
?

/fieldset

?php
echo $form-error('numberone');
echo $form-error('dropdown1');
echo $form-error('dropdown2');
echo $form-end('Send');
?
/div

--~--~-~--~~~---~--~~
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: Encryption/Decryption of data

2008-10-07 Thread titang

It sounds good, but what about if the data must be accessible by many
users.
For example I want to let 2 users to access the same datas with their
own passphrase...

Is there a simple way to do that ?

Titang

On Oct 8, 11:03 am, Joel Perras [EMAIL PROTECTED] wrote:
 Simple solution: Generate a pseudo-random string of characters (or let
 him choose his own passphrase), and use this as a salt to encrypt your
 data before saving to your database. The passphrase must then be used
 to retrieve any information from the database.

 Of course, all of this is completely useless if you don't use SSL for
 the entire request/response process.

 -J.

 On Oct 7, 3:50 am, titang [EMAIL PROTECTED] wrote:

  Hi,
  I would like to encrypt/decrypt data in my application regarding the
  following requirements:
  - The data will be decrypted by many users.
  - I dont want to keep the secret password for decrypting the data of
  each users in my application.

  Does someone have any idea about how can I do this ? And if there is
  something already implemented for the cakephp framework?

  There is something pretty good, it is the gnupg 
  project.http://www.gnupg.org/
  I did my first test by command line on Linux, and it seems really
  good.
  1. First i have to generate one public key per users (from an uid and
  a passphrase).
  2. Then i encrypt  the data and specify which users can access the
  data (by specifying the uid).
  3. And the authorized users can decrypt the data with their own
  passphrase

  An extension gnupg is available for php.
  What about a cakephp behavior using this extension? I think it could
  be very useful.

  Any suggestions or helps are welcome !

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



Re: Encryption/Decryption of data

2008-10-07 Thread David C. Zentgraf

I'm very interested in this topic.

I have an application that by it's nature shares objects between  
multiple participants, each object having different participants.  
Since those objects contain sensitive data, I was looking into ways to  
encrypt those, so that not even the database admin could see the  
content.

With traditional encryption schemes this is very difficult to  
realize though, as there's always only one key that can decrypt the  
data (would be pointless otherwise). That means for every object a  
user is participating in you'd need to store an additional key with  
the user's data, which is pointless.

I haven't yet, in my limited research, found a meaningful way to  
encrypt data in a way that allows it to be decrypted with any one of  
multiple keys (i.e. the user's password). But I'm no cryptographer by  
any means. Are public/private keys a way to do this?

Chrs,
Dav

On 8 Oct 2008, at 12:37, titang wrote:


 It sounds good, but what about if the data must be accessible by many
 users.
 For example I want to let 2 users to access the same datas with their
 own passphrase...

 Is there a simple way to do that ?

 Titang

 On Oct 8, 11:03 am, Joel Perras [EMAIL PROTECTED] wrote:
 Simple solution: Generate a pseudo-random string of characters (or  
 let
 him choose his own passphrase), and use this as a salt to encrypt  
 your
 data before saving to your database. The passphrase must then be used
 to retrieve any information from the database.

 Of course, all of this is completely useless if you don't use SSL for
 the entire request/response process.

 -J.

 On Oct 7, 3:50 am, titang [EMAIL PROTECTED] wrote:

 Hi,
 I would like to encrypt/decrypt data in my application regarding the
 following requirements:
 - The data will be decrypted by many users.
 - I dont want to keep the secret password for decrypting the data of
 each users in my application.

 Does someone have any idea about how can I do this ? And if there is
 something already implemented for the cakephp framework?

 There is something pretty good, it is the gnupg 
 project.http://www.gnupg.org/
 I did my first test by command line on Linux, and it seems really
 good.
 1. First i have to generate one public key per users (from an uid  
 and
 a passphrase).
 2. Then i encrypt  the data and specify which users can access the
 data (by specifying the uid).
 3. And the authorized users can decrypt the data with their own
 passphrase

 An extension gnupg is available for php.
 What about a cakephp behavior using this extension? I think it could
 be very useful.

 Any suggestions or helps are welcome !

 Thanks
 


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



Re: more problems with RC3 and tests

2008-10-07 Thread Joel Perras

err, change that to ClassRegistry::init('Phone'), assuming Phone is
the model you are attempting to test.

-J.

On Oct 7, 11:11 pm, Joel Perras [EMAIL PROTECTED] wrote:
 On Oct 7, 6:10 am, [EMAIL PROTECTED]



 [EMAIL PROTECTED] wrote:
  I am sure the docs do not contain the recent changes yet.

  My Model-tests work with fixtures. Here is a mini-example. Maybe you
  can see some detail that you have done differently.

  in phone.test.php

  App::import('Model', 'Phone');

  class PhoneTest extends Phone {
      var $name = 'PhoneTest';
      var $useDbConfig = 'test_suite';

  }

  class PhoneTestCase extends CakeTestCase {
      var $fixtures = array( 'app.phone_test' );

      function testStorage() {
          $this-PhoneTest = new PhoneTest();

          $all = $this-PhoneTest-findAll();

          $this-assertEqual(4, count($all));
      }

  }

 Actually, you can now instantiate your test models using
 ClassRegistry::init('NameOfModel'); no need to riddle your tests with
 fake Model classes, whose only purpose is to link model associations
 and use a different database configuration. Your complete code snippet
 above can be reduced to:

 class PhoneTestCase extends CakeTestCase {
      var $fixtures = array( 'app.phone_test' );

     function testStorage() {
          $this-PhoneTest = ClassRegistry::init('PhoneTest');
          $all = $this-PhoneTest-findAll();
          $this-assertEqual(4, count($all));
     }

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



Re: How to exclude a field from inserts and updates

2008-10-07 Thread Paolo Stancato

Maybe you're not passing those fileds but someone else.
It's quiete easy to inject new fields in a form.

Cheers

2008/10/7 teknoid [EMAIL PROTECTED]:

 While this works fine, and makes your app more secure... the real
 question is why are you passing fields that do not need saving to the
 controller? or why do you even have them in the form?

--~--~-~--~~~---~--~~
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: Encryption/Decryption of data

2008-10-07 Thread Bernhard J. M. Grün
Hi!

Here are some of my ideas for that problem:
 - public key encryption (Algorithms: RSA, ElGamal, ...)
   read: http://en.wikipedia.org/wiki/Public-key_cryptography
   You should combine those algorithms with traditional cryptography (i.e.
AES) - called hybrid cryptography
 - secret sharing (Algorithm: Shamir, ...)
   read: http://en.wikipedia.org/wiki/Secret_sharing ,
http://en.wikipedia.org/wiki/Shamir's_Secret_Sharing

Idea:
Just save your data more than once for every user but with its own (public)
key.

This mail is short because I am short in time at the moment. Anyway I hope
this helps.

-- Bernhard J. M. Grün


2008/10/8 David C. Zentgraf [EMAIL PROTECTED]


 I'm very interested in this topic.

 I have an application that by it's nature shares objects between
 multiple participants, each object having different participants.
 Since those objects contain sensitive data, I was looking into ways to
 encrypt those, so that not even the database admin could see the
 content.

 With traditional encryption schemes this is very difficult to
 realize though, as there's always only one key that can decrypt the
 data (would be pointless otherwise). That means for every object a
 user is participating in you'd need to store an additional key with
 the user's data, which is pointless.

 I haven't yet, in my limited research, found a meaningful way to
 encrypt data in a way that allows it to be decrypted with any one of
 multiple keys (i.e. the user's password). But I'm no cryptographer by
 any means. Are public/private keys a way to do this?

 Chrs,
 Dav

 On 8 Oct 2008, at 12:37, titang wrote:

 
  It sounds good, but what about if the data must be accessible by many
  users.
  For example I want to let 2 users to access the same datas with their
  own passphrase...
 
  Is there a simple way to do that ?
 
  Titang
 
  On Oct 8, 11:03 am, Joel Perras [EMAIL PROTECTED] wrote:
  Simple solution: Generate a pseudo-random string of characters (or
  let
  him choose his own passphrase), and use this as a salt to encrypt
  your
  data before saving to your database. The passphrase must then be used
  to retrieve any information from the database.
 
  Of course, all of this is completely useless if you don't use SSL for
  the entire request/response process.
 
  -J.
 
  On Oct 7, 3:50 am, titang [EMAIL PROTECTED] wrote:
 
  Hi,
  I would like to encrypt/decrypt data in my application regarding the
  following requirements:
  - The data will be decrypted by many users.
  - I dont want to keep the secret password for decrypting the data of
  each users in my application.
 
  Does someone have any idea about how can I do this ? And if there is
  something already implemented for the cakephp framework?
 
  There is something pretty good, it is the gnupg project.
 http://www.gnupg.org/
  I did my first test by command line on Linux, and it seems really
  good.
  1. First i have to generate one public key per users (from an uid
  and
  a passphrase).
  2. Then i encrypt  the data and specify which users can access the
  data (by specifying the uid).
  3. And the authorized users can decrypt the data with their own
  passphrase
 
  An extension gnupg is available for php.
  What about a cakephp behavior using this extension? I think it could
  be very useful.
 
  Any suggestions or helps are welcome !
 
  Thanks
  


 


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



Re: How do you make line breaks appear in views?

2008-10-07 Thread Cody Sortore

Thanks, I like the nl2br solution.

When you say processing and filtering you do mean like data validation
in the model right?  If so yes... if you're talking about something
else... uh probably not.  Well I do have some $paginate restrictions
in the controller (including a function that only displays approved
comments).

On Oct 7, 9:20 pm, BrendonKoz [EMAIL PROTECTED] wrote:
 Via PHP code, you could also process the data through PHP's nl2br()
 function, which inserts br / tags prior to the newline (the newline
 is not removed).  Hopefully you're already processing and filtering
 the user data anyway.

 On Oct 7, 7:33 pm, Cody Sortore [EMAIL PROTECTED] wrote:

  Okay, I know I sound like a complete n00b right now, and that's fine
  because I am.  I've really only made applications for myself so far so
  putting in br / tags is no problem... but now that I'm trying to
  make something for other people to use how to I make it so that when
  they hit enter it will automatically put in a br / tag for me?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---