Re: addons.mozilla.org soon will leave CakePHP..

2009-11-17 Thread Braindead
I use Cake alot in more or less big projects and personally I don't
see a problem with the future of CakePHP.

The only thing that will happen in case the Cake development is
stopped is that there will be no new releases / features. Well that's
a pitty, but if you can live with the current release there is
actually no need for new features otherwise your decision to use Cake
was the wrong one. :-)

--

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




Re: addons.mozilla.org soon will leave CakePHP..

2009-11-17 Thread Okto Silaban
I'm with you.. :(

We're about to launch our web now.. But everyday I'm becoming more
curious about the future of CakePHP..

labanux,
http://okto.silaban.net

On Wed, Nov 18, 2009 at 1:17 PM, jburns  wrote:
> Am I the only one who feels as if they have just joined a party that
> everyone else is leaving? I've invested a lot of learning time
> adopting CakePHP for a pretty big project. It's not been easy and the
> project is too pregnant to change now. I hoped this would be a growing
> and dynamic development area, but right now I am not so sure.
>
> On Nov 18, 4:07 am, Okto Silaban  wrote:
>> Maybe some of you haven't heard about this..
>>
>> Just FYI, AMO (addons.mozilla.org) now still using cakephp 1.1. But
>> they've planned to migrate to Django.
>>
>> Link :http://micropipes.com/blog/2009/11/17/amo-development-changes-in-2010/
>>
>> labanux,http://okto.silaban.net
>
> --
>
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-...@googlegroups.com.
> To unsubscribe from this group, send email to 
> cake-php+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=.
>
>
>

--

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




Re: To Sanitize or not? :: Public Opinion

2009-11-17 Thread Erik Nedwidek
The big problem really is accepting input and displaying it without encoding
or stripping the html. If you want to accept html, you need to strip out all
javascript, intrinsic events, and even scripts hidden in styles. For the
most part Cake will construct the SQL queries in a protected manner. You
will also want to scan for Base64 encoded data as people are hiding their
scripts in there too.

Erik Nedwidek
Project Manager
Lighthouse I.T. Consulting, Inc.


On Tue, Nov 17, 2009 at 10:57 PM, Dr. Loboto  wrote:

> When data is saved to DB Cake properly escape it so no problem with
> SQL Injection and no need to sanitize before.
>
> When data is displayed using of h() function will "secure" it enough.
>
> With such approach you face problems only when allow users post HTML
> (for example, with WYSIWYG editor). In this case nor h() nor Sanitize
> can save you as both of them cannot be used in such case.
>
> On Nov 18, 4:07 am, "Dave"  wrote:
> > I have asked a few questions about data sanitization and got different
> > responses.
> > Some people say just don't sanitize and use echo h() other say always
> > sanitize.
> > Books say never trust what the user enters so always clean data before
> > saving.
> >
> > I know every app has different requirements but as a general rule what do
> > you do?
> >
> > Just looking for feedback as to different methods for each baker.
> >
> > Thanks
> >
> > Dave
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-...@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/cake-php?hl=.
>
>
>

--

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




Re: beforeSave?

2009-11-17 Thread Erik Nedwidek
Dave,

No need to call the beforeSave method as it is a callback.

function beforeSave() {
  App::import('Sanitize');
  $this->data = Sanitize::clean($this->data);

  return true;
}

That should be all you need to do. Throw a couple of $this->log() statements
in there to verify the method is being called by Cake if you're not sure.

Erik Nedwidek
Project Manager
Lighthouse I.T. Consulting, Inc.


On Tue, Nov 17, 2009 at 10:37 PM, Dave  wrote:

> Do you manually have to call beforeSave();
>
> I have
> function beforeSave()
>  {
>$clean = new Sanitize();
>$this->data = $clean->clean($this->data);
> return true;
>
>  }
>
> But it does nothing to the data.
>
> What am I doing wrong?
>
> Dave
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-...@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/cake-php?hl=.
>
>
>

--

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




Re: addons.mozilla.org soon will leave CakePHP..

2009-11-17 Thread jburns
Am I the only one who feels as if they have just joined a party that
everyone else is leaving? I've invested a lot of learning time
adopting CakePHP for a pretty big project. It's not been easy and the
project is too pregnant to change now. I hoped this would be a growing
and dynamic development area, but right now I am not so sure.

On Nov 18, 4:07 am, Okto Silaban  wrote:
> Maybe some of you haven't heard about this..
>
> Just FYI, AMO (addons.mozilla.org) now still using cakephp 1.1. But
> they've planned to migrate to Django.
>
> Link :http://micropipes.com/blog/2009/11/17/amo-development-changes-in-2010/
>
> labanux,http://okto.silaban.net

--

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




Re: saveall and getLastInsertId or return all last inserted ids ?

2009-11-17 Thread Dr. Loboto
Create pack of users with saveAll(), then extract unique user
identifiers from initial data (commonly username) and retrieve IDs by
find('all') with this condition.

Reasons:
1. Multi-save cannot return all new IDs created.
2. Queries in a loop are much worse then single query for all.

On Nov 18, 8:15 am, Jas  wrote:
> Hi,
> would it be possible to create a number of users using saveAll and get
> the new id of each user as an array?
>
> Or would I be better off looping through each user and using save and
> getLastInsertId?

--

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




addons.mozilla.org soon will leave CakePHP..

2009-11-17 Thread Okto Silaban
Maybe some of you haven't heard about this..

Just FYI, AMO (addons.mozilla.org) now still using cakephp 1.1. But
they've planned to migrate to Django.

Link : http://micropipes.com/blog/2009/11/17/amo-development-changes-in-2010/

labanux,
http://okto.silaban.net

--

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




Re: $this->model->find() results not correct

2009-11-17 Thread Dr. Loboto
One more case when in one env code works and in other not - different
MySQL versions and their different bugs. If it is, you can try install
same version as on prod into your test env and check (but it is a hard
way, I know).

On Nov 17, 8:18 pm, Thiago Elias  wrote:
> Thanks for the answer Dr. Loboto.
>
> I'm really using Views for some tables, bacause we have another schema that
> my application depends on, and I didn't fetch associated results in cake for
> different schemas so far. (cake doesn't make the joins with tables in
> different schemas (eg: using the prefix of the another schema), so I've
> decided to use views instead. If is there some way to do this, my life will
> be easier.. =)
>
> By the way, my views are working fine in the test environment, and the
> database is the same (when we've finished the project, we've cleaned the
> database and executed the sql script to create). About the permissions, I've
> tried with root, but I've got the same problem, (I'll try again to be sure).
>
> Thanks for the help.
>
> Atenciosamente,
> Thiago Elias Rezende Silva
> Programador Portal CidadãoPGwww.cidadaopg.sp.gov.br
>
> Stephen 
> Leacock
> - "I detest life-insurance agents: they always argue that I shall some
> day
> die, which is not so."
>
> 2009/11/17 Dr. Loboto 
>
>
>
> > It is definitely not Apache problem. Are databases same in both
> > environments? Wrong model key may sometimes appear when you use MySQL
> > views instead of tables. Also there may be not enough DB access rights
> > to get tables structure.
>
> > On Nov 16, 8:20 pm, Thiago Elias  wrote:
> > > Hey guys.
>
> > > I'm experiencing an strange problem these days:
>
> > > I have 3 environments for cakePHP:
>
> > > - Development (my machine and the other programmers machines) (Windows
> > > XP/SP3 Apache 2 via xammp)
> > > - Test Environment (Debian Linux 5 Lenny Apache 2)
> > > - Production Environment (Debian Linux 4 Etch Apache 1.3)
>
> > > Unfortunatelly, I'm not able to change Apache 1.3 to 2.x on Production
> > > Environment right now (We have another server that may be configured in
> > next
> > > days with 2.x)
>
> > > The matter is:
>
> > > On Development and Test Environments, When I made some
> > $this->model->find(),
> > > the resultant array is normal like this:
>
> > > [0] => array(
> > >     [Person] => array(
> > >         [person_name] => Person name
> > >         [created] => 2009-09-10
> > >     )
> > >     [Access] => array(
> > >         [login] => some_login_username
> > >         [pass] => some_password
> > >     )
> > > )
>
> > > [1] => array(
> > >     [Person] => array(
> > >         [person_name] => Person name
> > >         [created] => 2009-09-10
> > >     )
> > >     [Access] => array(
> > >         [login] => some_login_username
> > >         [pass] => some_password
> > >     )
> > > )
>
> > > This is normal. I get the array index as the Model name, but when I
> > upload
> > > to my Production Environment, these arrays comes absolutely different, as
> > > below:
>
> > > [0] => array(
> > >     [0] => array(
> > >         [person_name] => Person name
> > >         [created] => 2009-09-10
> > >         [login] => some_login_username
> > >         [pass] => some_password
> > >     )
> > > )
>
> > > [1] => array(
> > >     [0] => array(
> > >         [person_name] => Person name
> > >         [created] => 2009-09-10
> > >         [login] => some_login_username
> > >         [pass] => some_password
> > >     )
> > > )
>
> > > The resultant array is strange. Cake is joining Person and Access, and
> > > instead the model name, he's just naming as 0.
>
> > > Anyone here knows something to correct this, or even has experienced this
> > > problem before ?!
>
> > > I'm using *cakePHP 1.2.5* in all environments.
>
> > > Thanks for the help and patience. (and sorry for my bad english).
>
> > > Atenciosamente,
> > > Thiago Elias Rezende Silva
> > > Programador Portal 
> > > CidadãoPGwww.cidadaopg.sp.gov.br
>
> > > Samuel Goldwyn<
> >http://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html>
> > > - "I'm willing to admit that I may not always be right, but I am never
> > > wrong."
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "CakePHP" group.
> > To post to this group, send email to cake-...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com > om>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=.

--

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




Re: To Sanitize or not? :: Public Opinion

2009-11-17 Thread Dr. Loboto
When data is saved to DB Cake properly escape it so no problem with
SQL Injection and no need to sanitize before.

When data is displayed using of h() function will "secure" it enough.

With such approach you face problems only when allow users post HTML
(for example, with WYSIWYG editor). In this case nor h() nor Sanitize
can save you as both of them cannot be used in such case.

On Nov 18, 4:07 am, "Dave"  wrote:
> I have asked a few questions about data sanitization and got different
> responses.
> Some people say just don't sanitize and use echo h() other say always
> sanitize.
> Books say never trust what the user enters so always clean data before
> saving.
>
> I know every app has different requirements but as a general rule what do
> you do?
>
> Just looking for feedback as to different methods for each baker.
>
> Thanks
>
> Dave

--

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




beforeSave?

2009-11-17 Thread Dave
Do you manually have to call beforeSave();
 
I have 
function beforeSave()
  {
$clean = new Sanitize();
$this->data = $clean->clean($this->data);
return true;
   
  }

But it does nothing to the data.

What am I doing wrong?
 
Dave

--

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




Re: Problem creating a function in CakePHP

2009-11-17 Thread genji
yeah the employee has a hasMany relationship with my Mistake table

On Nov 16, 6:10 pm, Asmud  wrote:
> Do you set-up the 'Employee' model, to have 'hasMany' association to
> "Mistake" ...? If not, just set-up first then you won't need the
> 'getMistakes' mistake.
> And this to retrieve the mistake data by employee : $mistakes = 
> $this->Employee->Mistake->find('count'), just add array condition if you
>
> would like to retrieve mistake from specific employee. Hope this
> help
>
> === Asmud ===
>
> On Nov 17, 12:25 am, David Roda  wrote:
>
>
>
> > This ought to do it
>
> > function index(){
> >     $employees = $this->paginate('Employee');
> >     foreach ($employees as $employee) {
> >         $employee['Employee']['total_mistakes'] =
> > $this->Employee->getMistakes($employee['Employee']['id'];
> >     }
> >     $this->set('employees', $employees);
>
> > }
>
> > I'm not exactly sure how your data is formed so you may have to modify the
> > array indexes a bit.
>
> > hth,
>
> > Dave
>
> > On Mon, Nov 16, 2009 at 11:30 AM, genji  wrote:
> > > Hey guys I have somewhat of a sticky situation here that I can't seem
> > > to wrap my hands around.
>
> > > Here's the situation: At my job we've created a point of sale system
> > > that the employees of the shops keep making mistakes at.
> > > I am trying to create a a very simple application where we keep track
> > > of the mistakes every employee make so we can make a bonus/punishment
> > > system.
> > > Here's where I'm stuck: I need to count the mistakes per employee and
> > > display them(this should be done in the loop ofc).
>
> > > My tables:
> > > employees
> > > mistakes
> > > shops
>
> > > The employee table only has the names of the employees and their
> > > bonus.
> > > The mistake table consists of the following:
> > > id, date, description, employee_id, shop_id
>
> > > My employee model:
> > > function getMistakes($employee){
> > >  $total = $this->Mistake->find('count', array('conditions' => array(
> > >  'Mistake.employee_id' => '2')));
> > >  return $total;
> > > }
>
> > > My employee controller:
> > > function index(){
> > >  $this->set('employees', $this->Employee->find('all'));
> > >  $this->set('employees', $this->paginate('Employee'));
> > >  $total = $this->Employee->getMistakes($employee);
> > >  $this->set('total_mistakes',$total);
> > > }
>
> > > In my index.ctp the loop will go through each row in my employee table
> > > and display the rows.
>
> > > I don't know how to achieve to count the mistakes WHERE
> > > Mistake.empoyee_id == employee.id in my index.ctp
>
> > > Can anyone please help me?
> > > 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-...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > cake-php+unsubscr...@googlegroups.com > >  om>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/cake-php?hl=.

--

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




Re: Problem creating a function in CakePHP

2009-11-17 Thread genji
Thanks allot for replying David!

I tried the code you created for me but it still isn't working :(
Do you by any chance have msn so we could chat there? Would be allot
faster to resolve my problem :D

By the way guys, here's my new code of my mvc

model:
function getMistakes($employee){
$total = $this->Mistake->find('count', array('conditions' => 
array(
'Mistake.employee_id' => $employee)));
return $total;
}



controller:
function index(){
$employees = $this->paginate('Employee');
foreach ($employees as $employee) {
$employee['Employee']['mistakes'] =

$this->Employee->getMistakes($employee['Employee']['id']);
}
$this->set('employees', $employees);
}



view:




On Nov 16, 1:25 pm, David Roda  wrote:
> This ought to do it
>
> function index(){
>     $employees = $this->paginate('Employee');
>     foreach ($employees as $employee) {
>         $employee['Employee']['total_mistakes'] =
> $this->Employee->getMistakes($employee['Employee']['id'];
>     }
>     $this->set('employees', $employees);
>
> }
>
> I'm not exactly sure how your data is formed so you may have to modify the
> array indexes a bit.
>
> hth,
>
> Dave
>
>
>
> On Mon, Nov 16, 2009 at 11:30 AM, genji  wrote:
> > Hey guys I have somewhat of a sticky situation here that I can't seem
> > to wrap my hands around.
>
> > Here's the situation: At my job we've created a point of sale system
> > that the employees of the shops keep making mistakes at.
> > I am trying to create a a very simple application where we keep track
> > of the mistakes every employee make so we can make a bonus/punishment
> > system.
> > Here's where I'm stuck: I need to count the mistakes per employee and
> > display them(this should be done in the loop ofc).
>
> > My tables:
> > employees
> > mistakes
> > shops
>
> > The employee table only has the names of the employees and their
> > bonus.
> > The mistake table consists of the following:
> > id, date, description, employee_id, shop_id
>
> > My employee model:
> > function getMistakes($employee){
> >  $total = $this->Mistake->find('count', array('conditions' => array(
> >  'Mistake.employee_id' => '2')));
> >  return $total;
> > }
>
> > My employee controller:
> > function index(){
> >  $this->set('employees', $this->Employee->find('all'));
> >  $this->set('employees', $this->paginate('Employee'));
> >  $total = $this->Employee->getMistakes($employee);
> >  $this->set('total_mistakes',$total);
> > }
>
> > In my index.ctp the loop will go through each row in my employee table
> > and display the rows.
>
> > I don't know how to achieve to count the mistakes WHERE
> > Mistake.empoyee_id == employee.id in my index.ctp
>
> > Can anyone please help me?
> > 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-...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com > om>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=.

--

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




Re: HOW TO CREATE DATABASE WITH PHP-CLI ?

2009-11-17 Thread O.J. Tibi
Hi,

I think your question is out of context with the CakePHP group. I
suggest you write this up on the comp.lang.php group. This group only
serves discussions for CakePHP related issues.

Thanks,
OJ

On Nov 18, 5:26 am, big tekno  wrote:
> Hello,
>
> firstly, i am a beginner, 2nd , Thank you google translate ;-). it's
> URGENT Thank you.i want to write a handler for relational database.
> This handler will load a database and provide an opportunity for the
> user to perform read operations, additions and deletions (see list of
> commands). The user can then enter a number of commands that will be
> interpreted by the manager.
> The file format of the database is free. It has you find the format
> easier to manage. In other words, we do not require a loader file
> database made by another group.
> Program Synopsis:
>
> Program Synopsis:
>
> $> Php. / db.php
> Usage:. / db.php [-i inputfile] [-o outputfile] dbfile
> $>
>
>     * Mandatory Parameter:
>           o 'dbfile': path to the file that contains the database on
> which to work.
>     * Options:
>           o-i 'filename': specifies standard input program. If this
> option is not enabled, standard input program is the system (stdin).
>           o-o 'filename': specifies the standard output of the
> program. If this option is not enabled, standard output of the program
> is that the system (stdout).
>
> Once the program starts, it waits on its standard input commands that
> execute if they sound good. The program ends when it encounters the
> QUIT command or if the input stream reaches EOF.
> Orders:
>
> All orders are delineated by a semicolon ';'. An order can be multiple
> lines. If a syntax error is detected, the program displays the message
> 'syntax error' and continues to await further orders.
> QUIT
> 
>
> Exits the program.
> Synopsis:
>
> QUIT;
>
> CREATE TABLE
>
> CREATE TABLE creates a table in the database.
> Synopsis:
>
> CREATE TABLE table_name
> (
> name_col_1 type [OPTIONS]
> name_col_2 type [OPTIONS]
> ...
> );
>
>     * 'Table_name': table name to create.
>     * 'name_col_1': column name to create.
>     * 'Type': data type of column.
>       Possible types:
>           o integer
>           o float
>           o bool
>           o string
>     * [Options]: Optional.
>           o primary_key: defines the primary key of the table. (It can
> not have one)
>           o not_null: Defines a field as being necessarily different
> from NULL
>
> The name, type and different options are separated by one or more
> tabs.
>
> In our database, a table should always have a single primary key.
>
> Example:
>
> CREATE TABLE customers
> (
> id integer primary_key,
> name not_null string,
> surname string,
> age integer
> );
> -> Table 'customers' created.
>
> The program should display a message informing the user if the
> instruction went well.
> If the table already exists, the command will display an error.
> DESC
>
> Used to describe a table in the database.
>
> Synopsis
>
> DESC table_name;
>
>     * 'Table_name': table name to describe.
>
> Example:
>
> ...
> DESC customers;
> --- TABLE 'customers' ---
> 'id' integer primary_key
> 'name' string not_null
> 'surname' string
> 'age' integer
> --- TABLE 'customers' ---
>
> ...
>
> INSERT
> 
>
> The INSERT command adds a record in a table.
> Synopsis:
>
> INSERT table_name
> (
> name_col = val [...]
> );
>
>     * 'Table_name': name of the table or insert data
>     * 'Col_name': name of the column.
>     * 'Val': value of the column.
>
> If during an insert a column has no assigned value, NULL is written.
> If this column can be NULL, an error is generated.
> If a primary key is duplicated, the program displays an error and does
> not realize the recording. Examples:
>
> INSERT Customers
> (
> id = 1
> name = dupond,
> surname = jeans
> age = 24
> );
> -> Insert done.
>
> INSERT Customers
> (
> id = 42
> name = "name with spaces"
> surname = jeans
> age = 24
> );
> -> Insert done.
>
> INSERT Customers
> (
> id = 2
> surname = stone
> );
> -> Error: Column 'name' can not be null.
>
> INSERT Customers
> (
> id = 1
> name = smith,
> surname = stone
> );
> -> Error: duplicate primary key 'id'.
>
> TRUNCATE
> 
> The TRUNCATE command erases all records in a table (ie the drain).
> Synopsis:
>
> TRUNCATE table_name;
>
>     * 'Table_name': table name is empty.
>
> Example:
>
> TRUNCATE customers;
> -> Table 'customers' is truncate.
>
> If the table does not exist, the statement displays an error.
> DROP
>
> The DROP can destroy a table and thus all his recordings.
> Synopsis:
>
> DROP tablename;
>
>     * 'Table_name': table name was erased.
>
> If the table does not exist, the statement displays an error.
> DELETE
>
> The DELETE command can delete records from

saveall and getLastInsertId or return all last inserted ids ?

2009-11-17 Thread Jas
Hi,
would it be possible to create a number of users using saveAll and get
the new id of each user as an array?

Or would I be better off looping through each user and using save and
getLastInsertId?

--

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




Modal possible problem solution

2009-11-17 Thread Ahmed Sharifi
Hey guys,

I solved the problem by just including the effects.js file again.

--

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




Re: invalidFields isUnique return existing id?

2009-11-17 Thread Jas
yeah, I thought that was the case.

Thanks!

On Nov 18, 12:32 pm, Graham Weldon  wrote:
> On 18/11/2009, at 12:07 PM, Jas wrote:
>
> > Is it possible when using isUnique Validation to return the id of the
> > existing field, so that it can be used instead of asking the user to
> > create something unique?
>
> > --
>
> > You received this message because you are subscribed to the Google Groups 
> > "CakePHP" group.
> > To post to this group, send email to cake-...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > cake-php+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/cake-php?hl=.
>
> Sounds like you want to edit, if the user enters in the same ID as an 
> existing entry.
> This is a somewhat special case.
>
> 1) Disable your validation. At the moment its operating like an add, since 
> there is no ID in the form submission and your isUnique is screwing things up.
> 2) You are going to have to do some in-controller processing to deal with the 
> data submitted:
>
> - Check the ID supplied
> - if it exists, load the data, overwrite with supplied data, and save
> - if it didnt exist, save new record.
>
> I would be ensuring validation on the fields you need with the exception of 
> the ID.
>
> Cheers,
>
> Graham Weldon
> e. gra...@grahamweldon.com
> p. +61 407 017 293
> w.http://grahamweldon.com

--

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




Re: invalidFields isUnique return existing id?

2009-11-17 Thread Graham Weldon

On 18/11/2009, at 12:07 PM, Jas wrote:

> Is it possible when using isUnique Validation to return the id of the
> existing field, so that it can be used instead of asking the user to
> create something unique?
> 
> --
> 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-...@googlegroups.com.
> To unsubscribe from this group, send email to 
> cake-php+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=.
> 
> 


Sounds like you want to edit, if the user enters in the same ID as an existing 
entry.
This is a somewhat special case.

1) Disable your validation. At the moment its operating like an add, since 
there is no ID in the form submission and your isUnique is screwing things up.
2) You are going to have to do some in-controller processing to deal with the 
data submitted:

- Check the ID supplied
- if it exists, load the data, overwrite with supplied data, and save
- if it didnt exist, save new record.

I would be ensuring validation on the fields you need with the exception of the 
ID.

Cheers,

Graham Weldon
e. gra...@grahamweldon.com
p. +61 407 017 293
w. http://grahamweldon.com

--

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




invalidFields isUnique return existing id?

2009-11-17 Thread Jas
Is it possible when using isUnique Validation to return the id of the
existing field, so that it can be used instead of asking the user to
create something unique?

--

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




Re: To Sanitize or not? :: Public Opinion

2009-11-17 Thread Miles J
If you filter and validate the data before saving it to the database,
then theres no need for Sanitization... unless you allow them to use
HTML.

On Nov 17, 3:00 pm, Marcelo Andrade  wrote:
> On Tue, Nov 17, 2009 at 7:07 PM, Dave  wrote:
> > I have asked a few questions about data sanitization and got different
> > responses.
> > Some people say just don't sanitize and use echo h() other say always
> > sanitize.
> > Books say never trust what the user enters so always clean data before
> > saving.
>
> I think you said all.  Never trust data from the user.  I vote for always
> sanitize.  You never know when you'll face a "Bobby Tables" user.
>
> http://xkcd.com/327/
>
> Best regards.
>
> --
> MARCELO DE F. ANDRADE
> Belem, PA, Amazonia, Brazil
> Linux User #221105

--

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




Re: To Sanitize or not? :: Public Opinion

2009-11-17 Thread Marcelo Andrade
On Tue, Nov 17, 2009 at 7:07 PM, Dave  wrote:
> I have asked a few questions about data sanitization and got different
> responses.
> Some people say just don't sanitize and use echo h() other say always
> sanitize.
> Books say never trust what the user enters so always clean data before
> saving.

I think you said all.  Never trust data from the user.  I vote for always
sanitize.  You never know when you'll face a "Bobby Tables" user.

http://xkcd.com/327/

Best regards.

--
MARCELO DE F. ANDRADE
Belem, PA, Amazonia, Brazil
Linux User #221105

--

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




HOW TO CREATE DATABASE WITH PHP-CLI ?

2009-11-17 Thread big tekno
Hello,

firstly, i am a beginner, 2nd , Thank you google translate ;-). it's
URGENT Thank you.i want to write a handler for relational database.
This handler will load a database and provide an opportunity for the
user to perform read operations, additions and deletions (see list of
commands). The user can then enter a number of commands that will be
interpreted by the manager.
The file format of the database is free. It has you find the format
easier to manage. In other words, we do not require a loader file
database made by another group.
Program Synopsis:

Program Synopsis:

$> Php. / db.php
Usage:. / db.php [-i inputfile] [-o outputfile] dbfile
$>

* Mandatory Parameter:
  o 'dbfile': path to the file that contains the database on
which to work.
* Options:
  o-i 'filename': specifies standard input program. If this
option is not enabled, standard input program is the system (stdin).
  o-o 'filename': specifies the standard output of the
program. If this option is not enabled, standard output of the program
is that the system (stdout).


Once the program starts, it waits on its standard input commands that
execute if they sound good. The program ends when it encounters the
QUIT command or if the input stream reaches EOF.
Orders:

All orders are delineated by a semicolon ';'. An order can be multiple
lines. If a syntax error is detected, the program displays the message
'syntax error' and continues to await further orders.
QUIT


Exits the program.
Synopsis:

QUIT;

CREATE TABLE

CREATE TABLE creates a table in the database.
Synopsis:

CREATE TABLE table_name
(
name_col_1 type [OPTIONS]
name_col_2 type [OPTIONS]
...
);

* 'Table_name': table name to create.
* 'name_col_1': column name to create.
* 'Type': data type of column.
  Possible types:
  o integer
  o float
  o bool
  o string
* [Options]: Optional.
  o primary_key: defines the primary key of the table. (It can
not have one)
  o not_null: Defines a field as being necessarily different
from NULL

The name, type and different options are separated by one or more
tabs.

In our database, a table should always have a single primary key.

Example:

CREATE TABLE customers
(
id integer primary_key,
name not_null string,
surname string,
age integer
);
-> Table 'customers' created.

The program should display a message informing the user if the
instruction went well.
If the table already exists, the command will display an error.
DESC

Used to describe a table in the database.

Synopsis

DESC table_name;

* 'Table_name': table name to describe.

Example:

...
DESC customers;
--- TABLE 'customers' ---
'id' integer primary_key
'name' string not_null
'surname' string
'age' integer
--- TABLE 'customers' ---


...

INSERT


The INSERT command adds a record in a table.
Synopsis:

INSERT table_name
(
name_col = val [...]
);



* 'Table_name': name of the table or insert data
* 'Col_name': name of the column.
* 'Val': value of the column.

If during an insert a column has no assigned value, NULL is written.
If this column can be NULL, an error is generated.
If a primary key is duplicated, the program displays an error and does
not realize the recording. Examples:

INSERT Customers
(
id = 1
name = dupond,
surname = jeans
age = 24
);
-> Insert done.

INSERT Customers
(
id = 42
name = "name with spaces"
surname = jeans
age = 24
);
-> Insert done.

INSERT Customers
(
id = 2
surname = stone
);
-> Error: Column 'name' can not be null.

INSERT Customers
(
id = 1
name = smith,
surname = stone
);
-> Error: duplicate primary key 'id'.


TRUNCATE

The TRUNCATE command erases all records in a table (ie the drain).
Synopsis:

TRUNCATE table_name;




* 'Table_name': table name is empty.

Example:

TRUNCATE customers;
-> Table 'customers' is truncate.


If the table does not exist, the statement displays an error.
DROP

The DROP can destroy a table and thus all his recordings.
Synopsis:

DROP tablename;



* 'Table_name': table name was erased.

If the table does not exist, the statement displays an error.
DELETE

The DELETE command can delete records from a table that match one or
more conditions.
Synopsis:

DELETE
FROM table_name
WHERE condition
[AND condition2 ...];



* 'Table_name': table name on which to perform the treatment.
* 'Condition': a condition for the selection of elements (see the
conditions.)

Examples:

DELETE
FROM customers
WHERE id = 1;
-> 1 row (s) deleted.

DELETE
FROM customers
WHERE name LIKE '% to'
AND Pname = 'john';
-> 0 row (s) deleted.

If the table does not exist, the statement displays an error.

SELECT
---

To Sanitize or not? :: Public Opinion

2009-11-17 Thread Dave
I have asked a few questions about data sanitization and got different
responses. 
Some people say just don't sanitize and use echo h() other say always
sanitize. 
Books say never trust what the user enters so always clean data before
saving.
 
I know every app has different requirements but as a general rule what do
you do?
 
Just looking for feedback as to different methods for each baker.
 
Thanks
 
Dave

--

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




Re: How I can integrate cakephp into Joomla.

2009-11-17 Thread David Roda
if you read that article, it tells you how to pull views from cake pages
into pages not associated with the installation (ie., a joomla module)...
i'm not sure what you are talking about coupling them.

On Tue, Nov 17, 2009 at 4:41 PM, www.landed.at wrote:

> Hi
>
> No I just thought that the most simple way was to not couple things
> that did not need coupling ! The frameworks should not need to use
> each other, that could be real messy. I just wanted to know what the
> best folder structure could be for security etc..
> I would create a custom module or component in joomla so using their
> frameowrk convention here and somehow include the cake framework for
> doing the special thing within this joomla component or module. Maybe
> someone could shed some light for us both here.
>
> On Nov 17, 10:14 am, fabio <3bi...@gmail.com> wrote:
> > Hello Landed.at,
> >
> > I like your vision of intengration between CakePHP and Joomla, not as
> > a bridging like Jake was supposed, but as two separate entities:
> > Joomla as good website administrable, CakePHP as a good webapp to
> > manage additional databases totally separated from Joomla database (ie
> > database of properties in a Real Estate Website).
> >
> > Did you came up with any working experiment using this model ?
> >
> > cheers
> >
> > fabio
> >
> > On 22 Ott, 12:37, "www.landed.at"  wrote:
> >
> > > I was thinking that it was also useful to know how one might have both
> > > frameworks working in the same folder structure but no bridge so to
> > > speak.
> > > Advantages could be thatjoomlaprovides a very good looking easy to
> > > administer website.then cakephp provides some really cool bespoke
> > > applications that it is hard to do withjoomla.
> > > The support forjoomlaseems to be dropping off in my opinion and the
> > > framework isnt really easy to pick up on to do something specific.
> >
> > > But what would the folder structure be
> >
> > > /root/cake
> > > /root/joomla
> >
> > > or
> >
> > > /root/cake/...vendors/joomla
> >
> > > or
> >
> > > /root/joomla/cake
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-...@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/cake-php?hl=.
>
>
>

--

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




Re: How I can integrate cakephp into Joomla.

2009-11-17 Thread www.landed.at
Hi

No I just thought that the most simple way was to not couple things
that did not need coupling ! The frameworks should not need to use
each other, that could be real messy. I just wanted to know what the
best folder structure could be for security etc..
I would create a custom module or component in joomla so using their
frameowrk convention here and somehow include the cake framework for
doing the special thing within this joomla component or module. Maybe
someone could shed some light for us both here.

On Nov 17, 10:14 am, fabio <3bi...@gmail.com> wrote:
> Hello Landed.at,
>
> I like your vision of intengration between CakePHP and Joomla, not as
> a bridging like Jake was supposed, but as two separate entities:
> Joomla as good website administrable, CakePHP as a good webapp to
> manage additional databases totally separated from Joomla database (ie
> database of properties in a Real Estate Website).
>
> Did you came up with any working experiment using this model ?
>
> cheers
>
> fabio
>
> On 22 Ott, 12:37, "www.landed.at"  wrote:
>
> > I was thinking that it was also useful to know how one might have both
> > frameworks working in the same folder structure but no bridge so to
> > speak.
> > Advantages could be thatjoomlaprovides a very good looking easy to
> > administer website.then cakephp provides some really cool bespoke
> > applications that it is hard to do withjoomla.
> > The support forjoomlaseems to be dropping off in my opinion and the
> > framework isnt really easy to pick up on to do something specific.
>
> > But what would the folder structure be
>
> > /root/cake
> > /root/joomla
>
> > or
>
> > /root/cake/...vendors/joomla
>
> > or
>
> > /root/joomla/cake

--

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




Re: Base URL with Query String

2009-11-17 Thread Miles J
So first off, why are you even doing this? Secondly, you can just
append it in the .htaccess.

On Nov 17, 11:00 am, Robert  wrote:
> Hello,
>
> I'm having an issue with one of my cake apps. It's actually pretty
> custom, so I'm not surprised Cake isn't handling this very special
> case gracefully.
>
> I want my application to have a baseUrl = 'addonmodules.php?
> module=phusion'
>
> I've tried a few variations of the change in my config.php:
>
> Configure::write('App.baseUrl', env('SCRIPT_NAME').'?module=phusion');
> Configure::write('App.baseUrl', env('SCRIPT_NAME').'?
> module=phusion&url=');
> Configure::write('App.baseUrl', env
> ('SCRIPT_NAME').'?module=phusion');
> Configure::write('App.baseUrl', env
> ('SCRIPT_NAME').'?module=phusion&url=');
>
> but I can't seem to be able to get this to work. Any assistance with
> this would be much appreciated.
>
> If you need more information I'd be happy to provide it.

--

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




Re: BEdita 3.0 a semantic content management framework based on CakePHP released

2009-11-17 Thread mufti ali
Great news, congrats for this release,  another great CakePHP CMS :D

On Tue, Nov 17, 2009 at 11:23 PM, bato  wrote:
> Hi,
>
> I'm Alberto Pagliarini a developer of BEdita (http://www.bedita.com) a
> content management framework based on CakePHP. Today we have released
> the stable version of BEdita 3.0 and we want to thank the CakePHP team
> for the excellent work done and everyone involved in the  CakePHP
> community. Follow a brief press release, for more info www.bedita.com,
> demo.bedita.com, forum.bedita.com
>
>
> ChannelWeb Srl and Chia Lab Srl today announce the general
> availability of
> BEdita 3, code name "betula"(*).
> BEdita (http://www.bedita.com) is both a development framework for
> web
> applications and a full featured Content Management System, released
> under
> the open-source license Affero General Public License version 3
> (AGPL3).
>
> The project was started and is currently developed by ChannelWeb srl
> (http://www.channelweb.it) and Chia Lab srl (http://www.chialab.it),
> two
> Italian companies based in Bologna.
>
> BEdita 3 is completely brand new: its release follows more than two
> years of
> hard work and research.
> BEdita 3 is the ideal platform for Web2/Semantic applications, since
> it
> supports all typical paradigms of the new generation of web
> development &
> design: de-centralization and interoperability, user-centered design,
> crowd-sourcing, dynamic contents, Software as a Service (SAAS), Rich
> Internet
> Application e Rich User Experience. Furthermore it may be used as an
> advanced
> Web Marketing tool as well.
>
> A number of online resources are available:
>  * www.bedita.com  - official main site
>  * forum.bedita.com - official discussion forum
>  * api.bedita.com - API documentation
>  * demo.bedita.com - official demo websites
>  * www.channelweb.it - www.chialab.it - ChannelWeb and Chialab
> websites
>
> (*) “betula”: [pronounced /'bεtula/ Bé-tu-la ] aka birch, tree of the
> Betulaceae family.
>
> --
>
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-...@googlegroups.com.
> To unsubscribe from this group, send email to 
> cake-php+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=.
>
>
>



-- 
Mufti Ali
087831163105
http://wordtaps.com
http://blogfreakz.com

--

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




CakePHP and Oracle (status of compatibility)

2009-11-17 Thread kemikTc
After using CakePHP and MySQL for a few project.  I have a new project
where I am forced to use Oracle.

I am looking for feedback from anyone who has tried CakePHP and Oracle
in the past.

My main concerns would be
- ability to use bind variable
- record id insertion using sequences
- reserved keywords
- record joins

This project is quite robust, and I will be including Auth and ACL
components (which I was able to implement in MySQL)

Any other potential issues you guys can mention would be great.

--

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




Re: Javascript libraries with images/css inside Cake Plugins

2009-11-17 Thread haimke
Hi, did you find any solution to this problem ?
It seems like a bug in CakePHP

--

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




Base URL with Query String

2009-11-17 Thread Robert
Hello,

I'm having an issue with one of my cake apps. It's actually pretty
custom, so I'm not surprised Cake isn't handling this very special
case gracefully.

I want my application to have a baseUrl = 'addonmodules.php?
module=phusion'

I've tried a few variations of the change in my config.php:

Configure::write('App.baseUrl', env('SCRIPT_NAME').'?module=phusion');
Configure::write('App.baseUrl', env('SCRIPT_NAME').'?
module=phusion&url=');
Configure::write('App.baseUrl', env
('SCRIPT_NAME').'?module=phusion');
Configure::write('App.baseUrl', env
('SCRIPT_NAME').'?module=phusion&url=');

but I can't seem to be able to get this to work. Any assistance with
this would be much appreciated.

If you need more information I'd be happy to provide it.

--

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




Re: Plugin views vs. plugin layouts - inconsistencies in folder paths?

2009-11-17 Thread Jamie
Oops - I guess I need to retract this. It looks like the layout file
is working within the plugin's folder (I got some bad info from
another developer working on the same project). But the error message
for a missing layout is still misleading. :)

On Nov 17, 10:53 am, Jamie  wrote:
> View files for plugin controller actions are within each plugin's
> directory. Right? For example, the view file for the 'details' action
> of a products plugin might be here:
>
> /app/plugins/products/views/products/details.ctp
>
> One would expect that layout files for a plugin would also be within /
> app/plugins/[plugin name]/. However, Cake expects plugin layouts to
> look something like this:
>
> /app/views/plugins/[plugin name]/layouts/
>
> This strikes me as pretty silly. Why should the layout files for a
> plugin lie outside of that plugin's directory? Plugin files should be
> self-contained, shouldn't they? The layouts should be here:
>
> /app/plugins/[plugin name]/views/layouts/
>
> Is this a problem, or am I just missing something (quite possible)?

--

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




Plugin views vs. plugin layouts - inconsistencies in folder paths?

2009-11-17 Thread Jamie
View files for plugin controller actions are within each plugin's
directory. Right? For example, the view file for the 'details' action
of a products plugin might be here:

/app/plugins/products/views/products/details.ctp

One would expect that layout files for a plugin would also be within /
app/plugins/[plugin name]/. However, Cake expects plugin layouts to
look something like this:

/app/views/plugins/[plugin name]/layouts/

This strikes me as pretty silly. Why should the layout files for a
plugin lie outside of that plugin's directory? Plugin files should be
self-contained, shouldn't they? The layouts should be here:

/app/plugins/[plugin name]/views/layouts/

Is this a problem, or am I just missing something (quite possible)?

--

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




Re: Problem with multiple memcached configs

2009-11-17 Thread mehodgson
Never mind answered my own question. Looks like it's a bug in the
Cache class.

I Added the following line to the Cache::read() function

$_this->_Engine[$engine]->settings = $settings;


just before the call to the engine to read.

Everything works as it should now.



On Nov 17, 10:06 am, mehodgson  wrote:
> I am trying to set up multiple configurations for the Memcache engine
> to allow for varying caching periods in CakePHP 1.2.5. I have set up
> the following:
>
> Cache::config(
>         'long',
>         array(
>                 'engine' => 'Memcache',
>                 'duration'=> 100800,
>                 'probability'=> 100,
>                 'prefix' => Inflector::slug(APP_DIR) . '_',
>                 'servers' => array(
>                         '127.0.0.1:11211'
>                 ),
>                 'compress' => false,
>         )
>  );
>
>  Cache::config(
>         'short',
>         array(
>                 'engine' => 'Memcache',
>                 'duration'=> 60,
>                 'probability'=> 100,
>                 'prefix' => Inflector::slug(APP_DIR) . '_',
>                 'servers' => array(
>                         '127.0.0.1:11211'
>                 ),
>                 'compress' => false,
>         )
>  );
>
>  Cache::config(
>         'mid',
>         array(
>                 'engine' => 'Memcache',
>                 'duration'=> 3600,
>                 'probability'=> 100,
>                 'prefix' => Inflector::slug(APP_DIR) . '_',
>                 'servers' => array(
>                         '127.0.0.1:11211'
>                 ),
>                 'compress' => false,
>         )
>  );
>
> The problem I am running into is that when I try to access cached data
> with Cache::read('key', 'long') or Cache::read('key', 'short') it
> defaults to the settings for 'mid', the last defined Cache::config, so
> I am unable to access the data.
>
> Anyone see anything I am doing wrong here, or is this a bug in the
> core here?

--

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




Problem with multiple memcached configs

2009-11-17 Thread mehodgson
I am trying to set up multiple configurations for the Memcache engine
to allow for varying caching periods in CakePHP 1.2.5. I have set up
the following:

Cache::config(
'long',
array(
'engine' => 'Memcache',
'duration'=> 100800,
'probability'=> 100,
'prefix' => Inflector::slug(APP_DIR) . '_',
'servers' => array(
'127.0.0.1:11211'
),
'compress' => false,
)
 );

 Cache::config(
'short',
array(
'engine' => 'Memcache',
'duration'=> 60,
'probability'=> 100,
'prefix' => Inflector::slug(APP_DIR) . '_',
'servers' => array(
'127.0.0.1:11211'
),
'compress' => false,
)
 );

 Cache::config(
'mid',
array(
'engine' => 'Memcache',
'duration'=> 3600,
'probability'=> 100,
'prefix' => Inflector::slug(APP_DIR) . '_',
'servers' => array(
'127.0.0.1:11211'
),
'compress' => false,
)
 );

The problem I am running into is that when I try to access cached data
with Cache::read('key', 'long') or Cache::read('key', 'short') it
defaults to the settings for 'mid', the last defined Cache::config, so
I am unable to access the data.

Anyone see anything I am doing wrong here, or is this a bug in the
core here?

--

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




Re: Partial transaction rollback when performing multiple saveAll() calls within a single transaction

2009-11-17 Thread bigbakedbean
In case anyone stumbles on this and has the same problem, I determined
that it was the inner save's validation that was breaking the
transaction and committing the outer save prematurely.  None of the
find calls inside the validation in question should themselves break
the transaction, so this is most certainly a bug.

Calling saveAll($data, array('validate' => 'only')) on each save, and
then saving with saveAll($data, array('validate' => false)) is a
sufficient workaround.

--

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




Re: help on a textarea in edit.ctp

2009-11-17 Thread fabio
Hello is me again :-)

I feel a bit stupid, but happy because I've solved the thing.
I had just to change the type of the relative field in the database
table: from TEXT to LONGTEXT
Now the text limit is wide enough to be always rendere inside the text
area when i call the edit.ctp view.

I hope this tip will save time to other people in the future...

cheers

fabiox

--

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




Re: Displaying data from unrelated models

2009-11-17 Thread jburns
How about this:

$var = 'User';
$this->loadModel($var);
$user = $this->{$var}->read(null, 2);
$this->set(compact('user'));

On Nov 17, 4:50 pm, pharus  wrote:
> Yes ok, thanks for your answer. But for me it is important to get
> $this->loadModel('User', 2);  working, because at coding time I do not
> know which model i will use.
>
> I am using it this way:
> $this->loadModel($var, 2);
>
> $var changes and it is possible to write is like above, but $id
> doesn't work.
>
> In my case $this->$var->read(null,2); does not work.
>
> On 17 Nov., 16:40, jburns  wrote:
>
>
>
> > I am using it this way:
>
> > $this->loadModel('User');
> > $user = $this->User->read(null, 2);
> > $this->set(compact('user'));
>
> > ...and it seems to work fine.
>
> > On Nov 17, 3:03 pm, pharus  wrote:
>
> > > I am usingloadModelas described 
> > > here:http://book.cakephp.org/view/845/loadModel
>
> > > $this->loadModel('User', 2);
> > > $user = $this->User->read();
>
> > > But the id parameter doesn't work. The above code always returns the
> > > first user in the database and ignores my $id.
>
> > > Do I have to configure something special to getloadModelwith $id
> > > working?
>
> > > On Nov 14, 1:36 pm, "j0n4s.h4rtm...@googlemail.com"
>
> > >  wrote:
> > > > Try ClassRegistry::init('Post');
>
> > > > On Nov 14, 7:55 am, "Dr. Loboto"  wrote:
>
> > > > > Marcelo is wrong totally. App::import only include model file but not
> > > > > create and initialize model for you asloadModelwill do.
>
> > > > > On Nov 14, 6:10 am, Scott Dahl  wrote:
>
> > > > > > Marcelo,
>
> > > > > > Thanks for the update.  I was unaware of that.  I will stop using 
> > > > > > that and
> > > > > > update my methods.  Thanks again.
>
> > > > > > Scott
>
> > > > > > On Fri, Nov 13, 2009 at 12:11 PM, Marcelo Andrade 
> > > > > > wrote:
>
> > > > > > > On Fri, Nov 13, 2009 at 3:06 PM, Scott Dahl 
> > > > > > >  wrote:
> > > > > > > > $this->loadModel('ModelName');
> > > > > > > > $results = $this->ModelName->find('list');
>
> > > > > > > "loadModel" is deprecated.  Use
> > > > > > > App::import('model', 'ModelName');
> > > > > > > instead.
>
> > > > > > > Best regards.
>
> > > > > > > --
> > > > > > > MARCELO DE F. ANDRADE
> > > > > > > Belem, PA, Amazonia, Brazil
> > > > > > > Linux User #221105
>
> > > > > > > --
>
> > > > > > > You received this message because you are subscribed to the 
> > > > > > > Google Groups
> > > > > > > "CakePHP" group.
> > > > > > > To post to this group, send email to cake-...@googlegroups.com.
> > > > > > > To unsubscribe from this group, send email to
> > > > > > > cake-php+unsubscr...@googlegroups.com > > > > > >  om>
> > > > > > > .
> > > > > > > For more options, visit this group at
> > > > > > >http://groups.google.com/group/cake-php?hl=.-Zitierten Text 
> > > > > > >ausblenden -
>
> > - Zitierten Text anzeigen -

--

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




Re: Simple Multiple File upload

2009-11-17 Thread fabio
I also suggest you this component that I've succesfully tried... by
the way it has recently been updated to handle multiple uploads:

http://www.webtechnick.com/blogs/view/221/CakePHP_File_Upload_Plugin

On 17 Nov, 09:21, Jeremy Burns  wrote:
> Try 
> this:http://bakery.cakephp.org/articles/view/file-upload-component-w-autom...

--

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




Re: Displaying data from unrelated models

2009-11-17 Thread pharus
Yes ok, thanks for your answer. But for me it is important to get
$this->loadModel('User', 2);  working, because at coding time I do not
know which model i will use.

I am using it this way:
$this->loadModel($var, 2);

$var changes and it is possible to write is like above, but $id
doesn't work.

In my case $this->$var->read(null,2); does not work.

On 17 Nov., 16:40, jburns  wrote:
> I am using it this way:
>
> $this->loadModel('User');
> $user = $this->User->read(null, 2);
> $this->set(compact('user'));
>
> ...and it seems to work fine.
>
> On Nov 17, 3:03 pm, pharus  wrote:
>
>
>
> > I am usingloadModelas described 
> > here:http://book.cakephp.org/view/845/loadModel
>
> > $this->loadModel('User', 2);
> > $user = $this->User->read();
>
> > But the id parameter doesn't work. The above code always returns the
> > first user in the database and ignores my $id.
>
> > Do I have to configure something special to getloadModelwith $id
> > working?
>
> > On Nov 14, 1:36 pm, "j0n4s.h4rtm...@googlemail.com"
>
> >  wrote:
> > > Try ClassRegistry::init('Post');
>
> > > On Nov 14, 7:55 am, "Dr. Loboto"  wrote:
>
> > > > Marcelo is wrong totally. App::import only include model file but not
> > > > create and initialize model for you asloadModelwill do.
>
> > > > On Nov 14, 6:10 am, Scott Dahl  wrote:
>
> > > > > Marcelo,
>
> > > > > Thanks for the update.  I was unaware of that.  I will stop using 
> > > > > that and
> > > > > update my methods.  Thanks again.
>
> > > > > Scott
>
> > > > > On Fri, Nov 13, 2009 at 12:11 PM, Marcelo Andrade 
> > > > > wrote:
>
> > > > > > On Fri, Nov 13, 2009 at 3:06 PM, Scott Dahl  
> > > > > > wrote:
> > > > > > > $this->loadModel('ModelName');
> > > > > > > $results = $this->ModelName->find('list');
>
> > > > > > "loadModel" is deprecated.  Use
> > > > > > App::import('model', 'ModelName');
> > > > > > instead.
>
> > > > > > Best regards.
>
> > > > > > --
> > > > > > MARCELO DE F. ANDRADE
> > > > > > Belem, PA, Amazonia, Brazil
> > > > > > Linux User #221105
>
> > > > > > --
>
> > > > > > You received this message because you are subscribed to the Google 
> > > > > > Groups
> > > > > > "CakePHP" group.
> > > > > > To post to this group, send email to cake-...@googlegroups.com.
> > > > > > To unsubscribe from this group, send email to
> > > > > > cake-php+unsubscr...@googlegroups.com > > > > >  om>
> > > > > > .
> > > > > > For more options, visit this group at
> > > > > >http://groups.google.com/group/cake-php?hl=.- Zitierten Text 
> > > > > >ausblenden -
>
> - Zitierten Text anzeigen -

--

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




help on a textarea in edit.ctp

2009-11-17 Thread fabio
Dear Cakers,

I'm experimenting a strange behaviour on a baked edit.ctp view...

Basicly in the edit.ctp there's a textarea (included by Form Helper)
that when it's filled and the Submit button is press everything seems
to work fine... and even the whole text inserted is correctly saved in
the proper mysql table. The problem is that if i re-edit the same
record recalling (edit.ctp) the textarea appears to be empty so it's
not possible to apply any further changes (moreover you have to be
aware that if you push the Submit button you're going to overwrite all
the current content in the database field).

Now the thing is even more strange because all this happens only if i
fill the textarea with a long text, while if the text is short, it
will correctly be rendered in when i re-open the edit.ctp view.

How is this possible since I haven't specified any limit on the
textarea's lenght?

Is it possible that when you bake a edit.ctp view it has a limit on
textareas lenght by default ?

I'm totally stucked with this thing  :-(
...and I hope someone could suggest me something to check to handle
this thing...

Thaks a lot for any little advice...

fabiox

--

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




BEdita 3.0 a semantic content management framework based on CakePHP released

2009-11-17 Thread bato
Hi,

I'm Alberto Pagliarini a developer of BEdita (http://www.bedita.com) a
content management framework based on CakePHP. Today we have released
the stable version of BEdita 3.0 and we want to thank the CakePHP team
for the excellent work done and everyone involved in the  CakePHP
community. Follow a brief press release, for more info www.bedita.com,
demo.bedita.com, forum.bedita.com


ChannelWeb Srl and Chia Lab Srl today announce the general
availability of
BEdita 3, code name "betula"(*).
BEdita (http://www.bedita.com) is both a development framework for
web
applications and a full featured Content Management System, released
under
the open-source license Affero General Public License version 3
(AGPL3).

The project was started and is currently developed by ChannelWeb srl
(http://www.channelweb.it) and Chia Lab srl (http://www.chialab.it),
two
Italian companies based in Bologna.

BEdita 3 is completely brand new: its release follows more than two
years of
hard work and research.
BEdita 3 is the ideal platform for Web2/Semantic applications, since
it
supports all typical paradigms of the new generation of web
development &
design: de-centralization and interoperability, user-centered design,
crowd-sourcing, dynamic contents, Software as a Service (SAAS), Rich
Internet
Application e Rich User Experience. Furthermore it may be used as an
advanced
Web Marketing tool as well.

A number of online resources are available:
 * www.bedita.com  - official main site
 * forum.bedita.com - official discussion forum
 * api.bedita.com - API documentation
 * demo.bedita.com - official demo websites
 * www.channelweb.it - www.chialab.it - ChannelWeb and Chialab
websites

(*) “betula”: [pronounced /'bεtula/ Bé-tu-la ] aka birch, tree of the
Betulaceae family.

--

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




Re: CakeFest IV - America - Help us pick a location!

2009-11-17 Thread Sourav
In my view San Jose, California would be the ideal location. It is the
heart of Silicon Valley, nice weather & one of the safest cities in
America.


On Nov 13, 8:43 am, Graham Weldon  wrote:
> Hi all,
>
> The CakePHP team has been considering the location for the next  
> upcoming CakeFest.
> We've decided to bring it back home to the United Sates of America.
> Thus far we haven't chosen a location for the event, but to ensure we  
> reach as many people as possible, we'd like your opinion on where we  
> should host the event.
>
> Essentially, our choices are:
> - USA East Coast
> - USA West Coast
> - USA Central
>
> If I have missed another location that you feel might be more popular  
> or accessible to interested attendees, feel free to suggest it.
> We're keen to hear peoples thoughts on it.
>
> Cheers,
>
> Graham Weldon (AKA: Predominant)
>
> e. gra...@grahamweldon.com
> w.http://grahamweldon.com

--

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




Re: Displaying data from unrelated models

2009-11-17 Thread jburns
I am using it this way:

$this->loadModel('User');
$user = $this->User->read(null, 2);
$this->set(compact('user'));

...and it seems to work fine.

On Nov 17, 3:03 pm, pharus  wrote:
> I am using loadModel as described 
> here:http://book.cakephp.org/view/845/loadModel
>
> $this->loadModel('User', 2);
> $user = $this->User->read();
>
> But the id parameter doesn't work. The above code always returns the
> first user in the database and ignores my $id.
>
> Do I have to configure something special to get loadModel with $id
> working?
>
> On Nov 14, 1:36 pm, "j0n4s.h4rtm...@googlemail.com"
>
>
>
>  wrote:
> > Try ClassRegistry::init('Post');
>
> > On Nov 14, 7:55 am, "Dr. Loboto"  wrote:
>
> > > Marcelo is wrong totally. App::import only include model file but not
> > > create and initialize model for you asloadModelwill do.
>
> > > On Nov 14, 6:10 am, Scott Dahl  wrote:
>
> > > > Marcelo,
>
> > > > Thanks for the update.  I was unaware of that.  I will stop using that 
> > > > and
> > > > update my methods.  Thanks again.
>
> > > > Scott
>
> > > > On Fri, Nov 13, 2009 at 12:11 PM, Marcelo Andrade 
> > > > wrote:
>
> > > > > On Fri, Nov 13, 2009 at 3:06 PM, Scott Dahl  
> > > > > wrote:
> > > > > > $this->loadModel('ModelName');
> > > > > > $results = $this->ModelName->find('list');
>
> > > > > "loadModel" is deprecated.  Use
> > > > > App::import('model', 'ModelName');
> > > > > instead.
>
> > > > > Best regards.
>
> > > > > --
> > > > > MARCELO DE F. ANDRADE
> > > > > Belem, PA, Amazonia, Brazil
> > > > > Linux User #221105
>
> > > > > --
>
> > > > > You received this message because you are subscribed to the Google 
> > > > > Groups
> > > > > "CakePHP" group.
> > > > > To post to this group, send email to cake-...@googlegroups.com.
> > > > > To unsubscribe from this group, send email to
> > > > > cake-php+unsubscr...@googlegroups.com > > > >  om>
> > > > > .
> > > > > For more options, visit this group at
> > > > >http://groups.google.com/group/cake-php?hl=.

--

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




Re: Displaying data from unrelated models

2009-11-17 Thread pharus
I am using loadModel as described here: 
http://book.cakephp.org/view/845/loadModel

$this->loadModel('User', 2);
$user = $this->User->read();

But the id parameter doesn't work. The above code always returns the
first user in the database and ignores my $id.

Do I have to configure something special to get loadModel with $id
working?


On Nov 14, 1:36 pm, "j0n4s.h4rtm...@googlemail.com"
 wrote:
> Try ClassRegistry::init('Post');
>
> On Nov 14, 7:55 am, "Dr. Loboto"  wrote:
>
> > Marcelo is wrong totally. App::import only include model file but not
> > create and initialize model for you asloadModelwill do.
>
> > On Nov 14, 6:10 am, Scott Dahl  wrote:
>
> > > Marcelo,
>
> > > Thanks for the update.  I was unaware of that.  I will stop using that and
> > > update my methods.  Thanks again.
>
> > > Scott
>
> > > On Fri, Nov 13, 2009 at 12:11 PM, Marcelo Andrade 
> > > wrote:
>
> > > > On Fri, Nov 13, 2009 at 3:06 PM, Scott Dahl  
> > > > wrote:
> > > > > $this->loadModel('ModelName');
> > > > > $results = $this->ModelName->find('list');
>
> > > > "loadModel" is deprecated.  Use
> > > > App::import('model', 'ModelName');
> > > > instead.
>
> > > > Best regards.
>
> > > > --
> > > > MARCELO DE F. ANDRADE
> > > > Belem, PA, Amazonia, Brazil
> > > > Linux User #221105
>
> > > > --
>
> > > > You received this message because you are subscribed to the Google 
> > > > Groups
> > > > "CakePHP" group.
> > > > To post to this group, send email to cake-...@googlegroups.com.
> > > > To unsubscribe from this group, send email to
> > > > cake-php+unsubscr...@googlegroups.com > > >  om>
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/cake-php?hl=.

--

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




Re: Displaying data from unrelated models

2009-11-17 Thread pharus
I am using loadModel in my Project as described here:
http://book.cakephp.org/view/845/loadModel

$this->loadModel('User', 2);
$user = $this->User->read();

But if give the function an id, nothing happens. The above code
results always the first user in the database.
do I have to configure something special, so that the id parameter
works?

thanks

--

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




Re: CakeFest IV - America - Help us pick a location!

2009-11-17 Thread pluriels
Maybe USA East Coast for european people :D

Nevermind, i won't be able to come

--

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




Re: $this->model->find() results not correct

2009-11-17 Thread Thiago Elias
Thanks for the answer Dr. Loboto.

I'm really using Views for some tables, bacause we have another schema that
my application depends on, and I didn't fetch associated results in cake for
different schemas so far. (cake doesn't make the joins with tables in
different schemas (eg: using the prefix of the another schema), so I've
decided to use views instead. If is there some way to do this, my life will
be easier.. =)

By the way, my views are working fine in the test environment, and the
database is the same (when we've finished the project, we've cleaned the
database and executed the sql script to create). About the permissions, I've
tried with root, but I've got the same problem, (I'll try again to be sure).

Thanks for the help.

Atenciosamente,
Thiago Elias Rezende Silva
Programador Portal CidadãoPG
www.cidadaopg.sp.gov.br



Stephen 
Leacock
- "I detest life-insurance agents: they always argue that I shall some
day
die, which is not so."

2009/11/17 Dr. Loboto 

> It is definitely not Apache problem. Are databases same in both
> environments? Wrong model key may sometimes appear when you use MySQL
> views instead of tables. Also there may be not enough DB access rights
> to get tables structure.
>
> On Nov 16, 8:20 pm, Thiago Elias  wrote:
> > Hey guys.
> >
> > I'm experiencing an strange problem these days:
> >
> > I have 3 environments for cakePHP:
> >
> > - Development (my machine and the other programmers machines) (Windows
> > XP/SP3 Apache 2 via xammp)
> > - Test Environment (Debian Linux 5 Lenny Apache 2)
> > - Production Environment (Debian Linux 4 Etch Apache 1.3)
> >
> > Unfortunatelly, I'm not able to change Apache 1.3 to 2.x on Production
> > Environment right now (We have another server that may be configured in
> next
> > days with 2.x)
> >
> > The matter is:
> >
> > On Development and Test Environments, When I made some
> $this->model->find(),
> > the resultant array is normal like this:
> >
> > [0] => array(
> > [Person] => array(
> > [person_name] => Person name
> > [created] => 2009-09-10
> > )
> > [Access] => array(
> > [login] => some_login_username
> > [pass] => some_password
> > )
> > )
> >
> > [1] => array(
> > [Person] => array(
> > [person_name] => Person name
> > [created] => 2009-09-10
> > )
> > [Access] => array(
> > [login] => some_login_username
> > [pass] => some_password
> > )
> > )
> >
> > This is normal. I get the array index as the Model name, but when I
> upload
> > to my Production Environment, these arrays comes absolutely different, as
> > below:
> >
> > [0] => array(
> > [0] => array(
> > [person_name] => Person name
> > [created] => 2009-09-10
> > [login] => some_login_username
> > [pass] => some_password
> > )
> > )
> >
> > [1] => array(
> > [0] => array(
> > [person_name] => Person name
> > [created] => 2009-09-10
> > [login] => some_login_username
> > [pass] => some_password
> > )
> > )
> >
> > The resultant array is strange. Cake is joining Person and Access, and
> > instead the model name, he's just naming as 0.
> >
> > Anyone here knows something to correct this, or even has experienced this
> > problem before ?!
> >
> > I'm using *cakePHP 1.2.5* in all environments.
> >
> > Thanks for the help and patience. (and sorry for my bad english).
> >
> > Atenciosamente,
> > Thiago Elias Rezende Silva
> > Programador Portal 
> > CidadãoPGwww.cidadaopg.sp.gov.br
> >
> > Samuel Goldwyn<
> http://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html>
> > - "I'm willing to admit that I may not always be right, but I am never
> > wrong."
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-...@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/cake-php?hl=.
>
>
>

--

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




Re: Problem creating a function in CakePHP

2009-11-17 Thread Dave Strickler
Sorry, my mistake. Posted this without my reading glasses.

On Nov 17, 2009, at 5:14 AM, jacmoe wrote:

> I changed the subject back to the original - why the heck did you tag
> onto an existing topic? Create your own topic.
> 
> On Nov 17, 3:03 am, Dave Strickler  wrote:
>> I am just starting out with CakePHP, and need to use a library called 
>> KoolPHP for a project. While I have it in the Vendors folder, and am loading 
>> up the javascript objects, it looks like the style sheets and maybe the 
>> graphics aren’t getting loaded right.
>> 
>> Has anyone used KoolPHP with CakePHP before, and if so, can I get some 
>> basics on where to put the KoolPHP files and how to call them in a View (or 
>> Controller/Model/Etc).
>> 
>> TIA,
>> 
>> Dave
> 
> --
> 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-...@googlegroups.com.
> To unsubscribe from this group, send email to 
> cake-php+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=.
> 
> 

--

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




Re: How I can integrate cakephp into Joomla.

2009-11-17 Thread David Roda
Hi everyone,

This advice is not specific to integrating CakePHP with Joomla, but I have
used it to integrate with other non Cake sites.

Here is an article which describes this extremely simple but powerful way to
boostrap cake into other applications.

http://debuggable.com/posts/the-ultimate-cakephp-bootstrap-technique:480f4dd5-2bcc-40cb-b45f-4b1dcbdd56cb

On Tue, Nov 17, 2009 at 4:14 AM, fabio <3bi...@gmail.com> wrote:

> Hello Landed.at,
>
> I like your vision of intengration between CakePHP and Joomla, not as
> a bridging like Jake was supposed, but as two separate entities:
> Joomla as good website administrable, CakePHP as a good webapp to
> manage additional databases totally separated from Joomla database (ie
> database of properties in a Real Estate Website).
>
> Did you came up with any working experiment using this model ?
>
> cheers
>
> fabio
>
>
> On 22 Ott, 12:37, "www.landed.at"  wrote:
> > I was thinking that it was also useful to know how one might have both
> > frameworks working in the same folder structure but no bridge so to
> > speak.
> > Advantages could be thatjoomlaprovides a very good looking easy to
> > administer website.then cakephp provides some really cool bespoke
> > applications that it is hard to do withjoomla.
> > The support forjoomlaseems to be dropping off in my opinion and the
> > framework isnt really easy to pick up on to do something specific.
> >
> > But what would the folder structure be
> >
> > /root/cake
> > /root/joomla
> >
> > or
> >
> > /root/cake/...vendors/joomla
> >
> > or
> >
> > /root/joomla/cake
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-...@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/cake-php?hl=.
>
>
>

--

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




Re: Simple Multiple File upload

2009-11-17 Thread David Roda
I have found SwfUpload to be by far the best way to upload files, including
multi-file upload.  It requires some configuration but it is very powerful
and is well worth it to become comfortable with.
http://demo.swfupload.org/v220/index.htm

On Tue, Nov 17, 2009 at 3:21 AM, Jeremy Burns  wrote:

> Try this:
> http://bakery.cakephp.org/articles/view/file-upload-component-w-automagic-model-optional
>
> Jeremy Burns
> jeremybu...@me.com
>
> On 17 Nov 2009, at 08:18, appel268576 wrote:
>
> > Hi Cake Community.
> >
> > I am busy developing an application and looking towards a solution /
> > plugin that will help me upload files / images etc.
> >
> > I have been banging my head searching for a decent tutorial that is
> > well documented, is there anything that you can suggest and one that
> > you have used before?
> >
> > Regards
> >
> > --
> >
> > You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> > To post to this group, send email to cake-...@googlegroups.com.
> > To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com
> .
> > For more options, visit this group at
> http://groups.google.com/group/cake-php?hl=.
> >
> >
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-...@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/cake-php?hl=.
>
>
>

--

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




Re: How to check if an image exist or not

2009-11-17 Thread Liu Gang
Thanks, I found that WWW_ROOT is ok:)

- Original Message - 
From: "David Roda" 
To: 
Sent: Monday, November 16, 2009 12:04 AM
Subject: Re: How to check if an image exist or not


> Try adding debug(WEBROOT_DIR.'/img/'.$file); at the top of your page and
> check the output
> On Sun, 2009-11-15 at 07:48 -0800, PDEagle wrote:
>> WEBROOT_DIR.'/img/'.$file
> 
> --
> 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-...@googlegroups.com.
> To unsubscribe from this group, send email to 
> cake-php+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=.
> 
> 
>

--

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




Problem creating a function in CakePHP

2009-11-17 Thread jacmoe
I changed the subject back to the original - why the heck did you tag
onto an existing topic? Create your own topic.

On Nov 17, 3:03 am, Dave Strickler  wrote:
> I am just starting out with CakePHP, and need to use a library called KoolPHP 
> for a project. While I have it in the Vendors folder, and am loading up the 
> javascript objects, it looks like the style sheets and maybe the graphics 
> aren’t getting loaded right.
>
> Has anyone used KoolPHP with CakePHP before, and if so, can I get some basics 
> on where to put the KoolPHP files and how to call them in a View (or 
> Controller/Model/Etc).
>
> TIA,
>
> Dave

--

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




Re: How to access hasMany relation in CakePHP 1.2

2009-11-17 Thread Amit Rawat
Try this

$this->set('users', $this->Donor->find('all', array
('conditions'=>array('
Organization.org_name'=>"%habib%"),'fields'=>array('Donor.*','Organization.*','DonorDetail')));

--

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




Re: How to access hasMany relation in CakePHP 1.2

2009-11-17 Thread mike karthauser
Does your find work without the condition?


Mike Karthauser
Brightstorm limited
Tel: 07939252144

On 17 Nov 2009, at 08:12, habib  wrote:

> class Donor extends AppModel
> {
>var $name = 'Donor';
>
>   var $hasOne = array(
>'DonorDetail'=>array(
> 'className'=>'DonorDetail',
> 'foreignKey'=>'donor_id',
> 'dependent'=> true
>)
>   );
>
>var $hasMany = array(
> 'Organization'=>array(
>'className'=>'Organization',
>'foreignKey'=>'donor_id',
>'dependent'=> true
>
> )
>);
>
> class DonorsController extends AppController
> {
>var $name = 'Donors';
>var $helpers = array('Html', 'Javascript', 'Ajax');
>
>  function view()
>   {
>
>   $this->set('users', $this->Donor->find('all', array
> ('conditions'=>array('Organization.org_name'=>"%habib%")));
> // this line does not work
>
>   }
> }
>
> please any information ..send me
>
> Thank you
> ---
> Habib
> }
>
> --
>
> You received this message because you are subscribed to the Google  
> Groups "CakePHP" group.
> To post to this group, send email to cake-...@googlegroups.com.
> To unsubscribe from this group, send email to 
> cake-php+unsubscr...@googlegroups.com 
> .
> For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl= 
> .
>
>
>

--

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




Re: Stuck with GoogleMap vs. CakePHP

2009-11-17 Thread jodator
Well, this one below is working for me (on localhost, so my key is
abdedfg ;) ):


http://maps.google.com/maps?
file=api&v=2&key=abcdefg&sensor=true"
type="text/javascript">


function initialize() {
if (GBrowserIsCompatible()) {
  var map = new GMap2(document.getElementById("map_canvas"));
  map.setCenter(new GLatLng(, ), 12);
}
  }

$(document).ready(function() {
initialize();
});/* document ready */


Those should be changed with numerical values:
$specialPage['SpecialPage']['GoogleLatitude'];
$specialPage['SpecialPage']['GoogleLongitude'];

This is just copy paste from Google API, but always work ;)
Btw, as you can see you can use &javasrcript('google.js', true); so
it's inline

Below is jQuery standard function called when document is ready (page
loads).

$(document).ready(function() {
initialize();
});/* document ready */

If you're not using jQuery, you should have call to initialize() here:



On Nov 17, 5:19 am, Lance Willett  wrote:
> Hi Julia,
> When you are using $javascript->link you will generally want the
> script to be called in the head of the document (not inline). Which
> means adding "false" as the second parameter: 
> seehttp://api.cakephp.org/class/javascript-helper#method-JavascriptHelpe
>
> Calling the Google Maps script inline could be causing the issue.
>
> On Nov 16, 5:04 pm, Julia  wrote:
>
> > Hi,
>
> > I have been fighting with GoogleMap vs. CakePHP for a few hours.
> > I have a layout in which I call:-
>
> > $url = 'http://maps.google.com/maps?file=api&v=2&key=MYKEY';
> > echo $javascript->link($url);
>
> > when I attempt to display a page using this layout, the brower hangs
> > displaying "Read maps.gstatic.com" in the status bar.
>
> > I cannto see any error in Firebug,
>
> > What's more, if I call "http://maps.google.com/maps?
> > file=api&v=2&key=MYKEY" in my browser window, it displays well.
>
> > Any help wouold be greatly appreciated.
>
>

--

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




Re: Vendor [aurigma image uploader] not displaying

2009-11-17 Thread Dmitry
Please, post support case regarding this issue: 
http://aurigma.com/MyAurigma/CreateCase.aspx

On Nov 16, 8:48 pm, Octavian  wrote:
> Anyone? Or does my code seem OK?

--

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




How to access hasMany relation in CakePHP 1.2

2009-11-17 Thread habib
class Donor extends AppModel
{
var $name = 'Donor';

   var $hasOne = array(
'DonorDetail'=>array(
 'className'=>'DonorDetail',
 'foreignKey'=>'donor_id',
 'dependent'=> true
)
   );

var $hasMany = array(
 'Organization'=>array(
'className'=>'Organization',
'foreignKey'=>'donor_id',
'dependent'=> true

 )
);

class DonorsController extends AppController
{
var $name = 'Donors';
var $helpers = array('Html', 'Javascript', 'Ajax');

  function view()
   {

   $this->set('users', $this->Donor->find('all', array
('conditions'=>array('Organization.org_name'=>"%habib%")));
// this line does not work

   }
 }

 please any information ..send me

Thank you
---
Habib
}

--

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




Re: How I can integrate cakephp into Joomla.

2009-11-17 Thread fabio
Hello Landed.at,

I like your vision of intengration between CakePHP and Joomla, not as
a bridging like Jake was supposed, but as two separate entities:
Joomla as good website administrable, CakePHP as a good webapp to
manage additional databases totally separated from Joomla database (ie
database of properties in a Real Estate Website).

Did you came up with any working experiment using this model ?

cheers

fabio


On 22 Ott, 12:37, "www.landed.at"  wrote:
> I was thinking that it was also useful to know how one might have both
> frameworks working in the same folder structure but no bridge so to
> speak.
> Advantages could be thatjoomlaprovides a very good looking easy to
> administer website.then cakephp provides some really cool bespoke
> applications that it is hard to do withjoomla.
> The support forjoomlaseems to be dropping off in my opinion and the
> framework isnt really easy to pick up on to do something specific.
>
> But what would the folder structure be
>
> /root/cake
> /root/joomla
>
> or
>
> /root/cake/...vendors/joomla
>
> or
>
> /root/joomla/cake

--

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




Re: Simple Multiple File upload

2009-11-17 Thread Jeremy Burns
Try this: 
http://bakery.cakephp.org/articles/view/file-upload-component-w-automagic-model-optional

Jeremy Burns
jeremybu...@me.com

On 17 Nov 2009, at 08:18, appel268576 wrote:

> Hi Cake Community.
> 
> I am busy developing an application and looking towards a solution /
> plugin that will help me upload files / images etc.
> 
> I have been banging my head searching for a decent tutorial that is
> well documented, is there anything that you can suggest and one that
> you have used before?
> 
> Regards
> 
> --
> 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-...@googlegroups.com.
> To unsubscribe from this group, send email to 
> cake-php+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=.
> 
> 

--

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




Simple Multiple File upload

2009-11-17 Thread appel268576
Hi Cake Community.

I am busy developing an application and looking towards a solution /
plugin that will help me upload files / images etc.

I have been banging my head searching for a decent tutorial that is
well documented, is there anything that you can suggest and one that
you have used before?

Regards

--

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