Re: cake deployer

2007-10-03 Thread Dave J

Doesn't need to be so complicated.

You could just use Cake's new console to make a script to export the
HEAD revision to Cake's tmp directory, rsync to the target server
(using '-avz' as options) and you're done. Then you could just add
bells and whistles, like specifying which svn revision you want to
deploy, but that's just small stuff.


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



Re: HABTM question from newbie

2007-10-03 Thread Comida411

Rt,
Can you clarify... I mean the auto create feature is a convenience...
right...
The alternative is for me to create the model manually
Is it bad practice to create models for joins tables comprised soley
of two foreign keys.. Is that just a bad idea in general?
Thank you for your time
T

On Oct 3, 12:20 pm, rtconner <[EMAIL PROTECTED]> wrote:
> Sure why not.
>
> Cake 1.2 has recenlty added a feature where you can speficy a 'With'
> association which auto-creates a model for the join table.
> You may want to mess around with that.
>
> An example can be found in the OCPHP doc found 
> here:http://cakephp.org/downloads
>
> On Oct 3, 8:25 am, Comida411 <[EMAIL PROTECTED]> wrote:
>
>
>
> > There appear to be 3 types of join table in my data model..
>
> > 1. Pure join - table comprised of two or more foreign keys only and no
> > other attribues (column headers)
> > 2. Join as parent - table comprised of two or more foreign keys only
> > and no other attribues... wherein he table is also the parent to
> > another table
> > 3. Join with attributes table comprised of two or more foreign keys
> > and several other attribues
>
> > Can I make a rule, that there should be a cake model in cases 2 and 3
> > but not in case 1
>
> > Thank you in advance for your response..
> > [EMAIL PROTECTED] Hide quoted text -
>
> - Show quoted text -


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



Re: cake deployer

2007-10-03 Thread Adwin Wijaya

Ah .. i just heard that capistrano can work with cakephp :) i thought
it was rubys.

On Oct 4, 9:21 am, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> http://www.littlehart.net/atthekeyboard/2007/09/21/deploying-cakephp-...
>
> On 10/3/07, Adwin Wijaya <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > I was impressed with cake console to generate new project ... but I
> > think we need to supply with cake deployer .
>
> > i got this problem when i created a project using console, let say the
> > file is in c:\php\cake12\ (contains all 1.2 files)
>
> > then i created a new project on c:\www\htdocs\cake
>
> > when I have to deploy on the target server (let say in linux web
> > host), i need to modify the bootstrap.php first to change the path and
> > then I have to add the cakelibs into my cake applications.
>
> > I think, it would be good if we supply with cake deployer. it will
> > create a zipped file that contains all model, view, controllers and
> > cake libs in one directory. deployer creates a install.php file so
> > when we upload to server, we just call install.php and then the
> > install.php will unzipped the app, configure the path, etc
> > (include .htaccess if possible).
>
> > ruby on rails doesnt need this because all gems are installed on the
> > server, but we need this since we dont have any *gems* (we called it
> > pear ..*should be pear[l] ... lol* ) :p 
>
> > i think is would be great if this features available on the 1.2
>
> > what do you think guys ?
>
> --
> Chris Hartjes
> Cake Development Corporationhttp://www.cakedevelopment.com
>
> My motto for 2007:  "Just build it, damnit!"
>
> @TheKeyboard -http://www.littlehart.net/atthekeyboard


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



Re: HTML4 Strict Doctype doesn't validate using $html->docType('html4-strict')

2007-10-03 Thread Jay Gilmore (smashingjay)



On Oct 3, 7:30 pm, Chambrln <[EMAIL PROTECTED]> wrote:
> There is a ticket opened for this problem but it was converted to an
> Enhancement instead of a bug and nothing appears to have been done
> about it.  If you use the HTML helper to set your DOCTYPE and want
> your page to validate here is a workaround until this is fixed.
>
> In your /cake/libs/view/helpers/html.php change your docType function
> to the following.
>
> function docType($type = 'xhtml-strict') {
> if (isset($this->__docTypes[$type])) {
> if ($type == 'html4-strict')
> {
> foreach ($this->tags as $id=>$value)
> {
> $this->tags[$id] = str_replace('/>', 
> '>', $value);
> }
> }
>
> return $this->output($this->__docTypes[$type]);
> }
> }
>
> I have yet to encounter any problems with this and the page now
> validates.

I haven't tried this but I might say if you are going to replace the /
> you may as well drop the space as well so your code would read as
follows:

$this->tags[$id] = str_replace(' />', '>', $value);

Just to beatify and make pretty. I have done this same thing with a
CMS though and it works fine as I too am a fan of 4.01 Strict.


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



Re: cake deployer

2007-10-03 Thread Samuel DeVore

Has anyone used Ant?  We use it for a Java struts deployment and have
been toying with getting our CakePHP code hooked in

On 10/3/07, Chris Hartjes <[EMAIL PROTECTED]> wrote:
>
> http://www.littlehart.net/atthekeyboard/2007/09/21/deploying-cakephp-applications-using-capistrano/
>
> On 10/3/07, Adwin Wijaya <[EMAIL PROTECTED]> wrote:
> >
> > I was impressed with cake console to generate new project ... but I
> > think we need to supply with cake deployer .
> >
> > i got this problem when i created a project using console, let say the
> > file is in c:\php\cake12\ (contains all 1.2 files)
> >
> > then i created a new project on c:\www\htdocs\cake
> >
> > when I have to deploy on the target server (let say in linux web
> > host), i need to modify the bootstrap.php first to change the path and
> > then I have to add the cakelibs into my cake applications.
> >
> > I think, it would be good if we supply with cake deployer. it will
> > create a zipped file that contains all model, view, controllers and
> > cake libs in one directory. deployer creates a install.php file so
> > when we upload to server, we just call install.php and then the
> > install.php will unzipped the app, configure the path, etc
> > (include .htaccess if possible).
> >
> > ruby on rails doesnt need this because all gems are installed on the
> > server, but we need this since we dont have any *gems* (we called it
> > pear ..*should be pear[l] ... lol* ) :p 
> >
> > i think is would be great if this features available on the 1.2
> >
> > what do you think guys ?
> >
> >
> > >
> >
>
>
> --
> Chris Hartjes
> Cake Development Corporation
> http://www.cakedevelopment.com
>
> My motto for 2007:  "Just build it, damnit!"
>
> @TheKeyboard - http://www.littlehart.net/atthekeyboard
>
> >
>


-- 
(the old fart) the advice is free, the lack of crankiness will cost you

- its a fine line between a real question and an idiot

http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/

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



Re: cake deployer

2007-10-03 Thread Chris Hartjes

http://www.littlehart.net/atthekeyboard/2007/09/21/deploying-cakephp-applications-using-capistrano/

On 10/3/07, Adwin Wijaya <[EMAIL PROTECTED]> wrote:
>
> I was impressed with cake console to generate new project ... but I
> think we need to supply with cake deployer .
>
> i got this problem when i created a project using console, let say the
> file is in c:\php\cake12\ (contains all 1.2 files)
>
> then i created a new project on c:\www\htdocs\cake
>
> when I have to deploy on the target server (let say in linux web
> host), i need to modify the bootstrap.php first to change the path and
> then I have to add the cakelibs into my cake applications.
>
> I think, it would be good if we supply with cake deployer. it will
> create a zipped file that contains all model, view, controllers and
> cake libs in one directory. deployer creates a install.php file so
> when we upload to server, we just call install.php and then the
> install.php will unzipped the app, configure the path, etc
> (include .htaccess if possible).
>
> ruby on rails doesnt need this because all gems are installed on the
> server, but we need this since we dont have any *gems* (we called it
> pear ..*should be pear[l] ... lol* ) :p 
>
> i think is would be great if this features available on the 1.2
>
> what do you think guys ?
>
>
> >
>


-- 
Chris Hartjes
Cake Development Corporation
http://www.cakedevelopment.com

My motto for 2007:  "Just build it, damnit!"

@TheKeyboard - http://www.littlehart.net/atthekeyboard

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



Re: cake deployer

2007-10-03 Thread Walker Hamilton

Have you heard of Capistrano? ( http://capify.org )

It's good. Don't re-invent the wheel.


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



cake deployer

2007-10-03 Thread Adwin Wijaya

I was impressed with cake console to generate new project ... but I
think we need to supply with cake deployer .

i got this problem when i created a project using console, let say the
file is in c:\php\cake12\ (contains all 1.2 files)

then i created a new project on c:\www\htdocs\cake

when I have to deploy on the target server (let say in linux web
host), i need to modify the bootstrap.php first to change the path and
then I have to add the cakelibs into my cake applications.

I think, it would be good if we supply with cake deployer. it will
create a zipped file that contains all model, view, controllers and
cake libs in one directory. deployer creates a install.php file so
when we upload to server, we just call install.php and then the
install.php will unzipped the app, configure the path, etc
(include .htaccess if possible).

ruby on rails doesnt need this because all gems are installed on the
server, but we need this since we dont have any *gems* (we called it
pear ..*should be pear[l] ... lol* ) :p 

i think is would be great if this features available on the 1.2

what do you think guys ?


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



Controller Test + testing file upload

2007-10-03 Thread bingo

Hi I have a simple controller method that uploads a file and updates
the database table. I want to create a unit test for the this method
but not able to find how to send data to the controller without using
the form.

Can anyone enlighten me??

Thanks
Ritesh


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



During "edit" -- if validation fails, user is returned "add" form

2007-10-03 Thread Wayne Fay

I baked Model, Controller, and Views for my Organization table. It is
basically a standard User table, and my functions are virtually
unchanged from baking.

Then I added validation to various fields and added error messages for
the validations in my add.ctp and edit.ctp files.

Now when I edit an Organization (see HTML [1]), if I enter proper
values for all the fields, the edit goes thru fine. When I leave out a
required field or do something that fails validation, Cake brings me
back to the form showing "Edit Organization" but the HTML [2] shows
that I'm actually adding an Organization. I have included HTML below,
as well as the edit() function [3].

So when I make a change to the field and submit, instead of going in
as an edit, it calls add which fails due to duplicate indexes (the
userid field).

Any ideas??
Wayne

[1]

   
Edit Organization

[2]
The Organization could not be
saved. Please try again.
   
Edit Organization

[3]
function edit($id = null) {
$this->log(__FILE__ . ':' . __METHOD__ . ": init.", LOG_DEBUG);
if (!$id && empty($this->data)) {
$this->Session->setFlash('Invalid Organization');
$this->redirect(array('action'=>'index'), null, true);
}
if (!empty($this->data)) {
$this->cleanUpFields();
if ($this->Organization->save($this->data)) {
$this->Session->setFlash('The Organization has been 
updated.');
$this->redirect(array('action'=>'index'), null, true);
} else {
$this->Session->setFlash('The Organization could not be 
saved.
Please try again.');
}
}
if (empty($this->data)) {
$this->data = $this->Organization->read(null, $id);
}
}

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



Re: During "edit" -- if validation fails, user is returned "add" form

2007-10-03 Thread Wayne Fay

I figured it out. I had removed the $id field from the form rather
than merely making it hidden. Turns out, that breaks a few things...
duh. ;-)

Wayne

On 10/3/07, Wayne Fay <[EMAIL PROTECTED]> wrote:
> I baked Model, Controller, and Views for my Organization table. It is
> basically a standard User table, and my functions are virtually
> unchanged from baking.
>
> Then I added validation to various fields and added error messages for
> the validations in my add.ctp and edit.ctp files.
>
> Now when I edit an Organization (see HTML [1]), if I enter proper
> values for all the fields, the edit goes thru fine. When I leave out a
> required field or do something that fails validation, Cake brings me
> back to the form showing "Edit Organization" but the HTML [2] shows
> that I'm actually adding an Organization. I have included HTML below,
> as well as the edit() function [3].
>
> So when I make a change to the field and submit, instead of going in
> as an edit, it calls add which fails due to duplicate indexes (the
> userid field).
>
> Any ideas??
> Wayne
>
> [1]
> 
>  action="/cake/organizations/edit/20"> style="display:none"> value="e388b4d13f9e4c1d5cdf1d63612e1e5aa62db978"
> id="OrganizationEditFormToken936739629" />   
> Edit Organization
>
> [2]
> The Organization could not be
> saved. Please try again.
>  action="/cake/organizations/add/"> style="display:none"> value="e2d7ac5c821aca68b05079b1e65746aaf773ad11"
> id="OrganizationAddFormToken1675815126" />   
> Edit Organization
>
> [3]
> function edit($id = null) {
> $this->log(__FILE__ . ':' . __METHOD__ . ": init.", LOG_DEBUG);
> if (!$id && empty($this->data)) {
> $this->Session->setFlash('Invalid Organization');
> $this->redirect(array('action'=>'index'), null, true);
> }
> if (!empty($this->data)) {
> $this->cleanUpFields();
> if ($this->Organization->save($this->data)) {
> $this->Session->setFlash('The Organization has been 
> updated.');
> $this->redirect(array('action'=>'index'), null, true);
> } else {
> $this->Session->setFlash('The Organization could not 
> be saved.
> Please try again.');
> }
> }
> if (empty($this->data)) {
> $this->data = $this->Organization->read(null, $id);
> }
> }
>

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



HTML4 Strict Doctype doesn't validate using $html->docType('html4-strict')

2007-10-03 Thread Chambrln

There is a ticket opened for this problem but it was converted to an
Enhancement instead of a bug and nothing appears to have been done
about it.  If you use the HTML helper to set your DOCTYPE and want
your page to validate here is a workaround until this is fixed.

In your /cake/libs/view/helpers/html.php change your docType function
to the following.


function docType($type = 'xhtml-strict') {
if (isset($this->__docTypes[$type])) {
if ($type == 'html4-strict')
{
foreach ($this->tags as $id=>$value)
{
$this->tags[$id] = str_replace('/>', 
'>', $value);
}
}

return $this->output($this->__docTypes[$type]);
}
}


I have yet to encounter any problems with this and the page now
validates.


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



MySQL driver problem?

2007-10-03 Thread Dani

Hi everybody.
I'm continually getting the following messages randomly:

Warning (2): mysql_connect() [function.mysql-connect]: Lost connection
to MySQL server at 'reading authorization packet', system error: 0
[CORE/cake/libs/model/datasources/dbo/dbo_mysql.php, line 100]
Warning (2): mysql_select_db(): supplied argument is not a valid MySQL-
Link resource [CORE/cake/libs/model/datasources/dbo/dbo_mysql.php,
line 105]

Warning (2): mysql_query(): supplied argument is not a valid MySQL-
Link resource [CORE/cake/libs/model/datasources/dbo/dbo_mysql.php,
line 133]

Warning (2): session_start() [function.session-start]: Cannot send
session cookie - headers already sent by (output started at /home/
daniel/public_html/needish/cake/basics.php:747) [CORE/cake/libs/
session.php, line 154]

Warning (2): session_start() [function.session-start]: Cannot send
session cache limiter - headers already sent (output started at /home/
daniel/public_html/needish/cake/basics.php:747) [CORE/cake/libs/
session.php, line 154]

Warning (2): Cannot modify header information - headers already sent
by (output started at /home/daniel/public_html/needish/cake/basics.php:
747) [CORE/cake/libs/session.php, line 155]

If I reload the page, everything works as it should, but messages
continue to appear randomly once in a while. For some reason my app is
loosing its connection to the database and I don't know whether it is
a MySQL driver problem, a Cake problem or my app problem...
Does anyone know if there's any way of fixing this issue?
Thanks!


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



Re: please help me out

2007-10-03 Thread francky06l

If you do not want to load the details in the page (that could be like
a tooltip), but for query the DB when you pass over the mail, you
would need a bit of javascript and an ajax request.
To make it step by step, you should try to do your ajax request with a
link (by clicking), then you can play with javascript to make the
request on "hover" .
The tooltip approach is easier I think

On Oct 3, 2:25 pm, hemant sonker <[EMAIL PROTECTED]> wrote:
> hi
> i am a newbe in cakephp. i am using cakephp 1.2.
> i have columns in my database like email,subject, message, and date.
> what i am trying to do is that whenever i puts a mouse on email,it
> should have a hover kind of thing which displays the users full
> name ,age ,sex and place.
>
> i have a table named users in which these fields are there.
> how can i fetch this value from the ysers table so that ,whenever i
> hover on email it should give me full details.
>
> please help me soon as possible.
>
> regards
>
> hemant sonker


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



Re: Model with no corresponding table needs DB access

2007-10-03 Thread Grant Cox

In Cake each table can be represented by a model.  If you want to
change data in a table, do it through that table's model.  This may
mean something like

function doAdminStuff()
{
  $this->Model1->cleanUp();
  $this->Model2->runScheduledTasks();
}

in your "admin" model.  Even with useTable = false, I would expect you
can still have $this->query() if you need to execute some SQL
directly.

However, perhaps post more about what you structure is - it sounds
like there would be a better way.  Controllers should not need to call
other controllers (except in rare cases) - the vast majority of your
application code should be in models / components, which can be
executed from any controller action.


On Oct 4, 3:18 am, rpupkin77 <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have a model for administering a site, it itself does not connect to
> any table so I have $useTable = false. And in the controller, I have
> most of the data being handled by using other controllers' actions.
>
> There is one instance in which I need this model to access the
> database, however.  How do I give this model database connectivity if
> I am not using a table. Another question I have is, can I pass form
> data as POST from on controller to another?
>
> I have looked through the API, but I find it a little hard to
> understand without examples.


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



Re: Debug not working / queries aborting

2007-10-03 Thread francky06l

Well there might be a solution by writing in the log or print_r how
far you go. Start in the index.php of webroot, then dispatcher
etc ..It's long but at least you will know if ever you enter in your
controller.
I have been trying your site, it's not a timeout since the blank page
appears right away.

Sorry can't help more from here
Good luck and if you find the problem/solution, keep update the post.

On Oct 3, 11:25 pm, digitalcowboy <[EMAIL PROTECTED]> wrote:
> Thanks for the reply, but no, I don't think that's it.  In fact, the
> new server has twice the physical memory as the old server and the PHP
> memory limit is set 4x higher, but the old server will return the full
> result set.
>
> Also, as I said, that is just one example.  I have other places where
> I'm using Pagination and it returns the empty page when clicking on
> more than 500 results at a time in the Pagination options.
>
> I appreciate your tip about the limit, but that doesn't solve my
> problem.  In many cases there is a business need to have thousands of
> results returned in one page.
>
> This would also be much easier to track down if I could figure out why
> Cake's debug is not working AT ALL on this server.
>
> On Oct 3, 12:50 am, francky06l <[EMAIL PROTECTED]> wrote:
>
> > looks like a resource problem when having too many results. Have you
> > tried to limit the results set in your findAll (case of Virginia) ?
> > Try by setting the "limit" parameter in the query.
> > I had that problem (not exactly), that was not a timeout issue but
> > rather a memory_limit (max 8 Gb) authorized in php.ini.
>
> > Hope it's a hint
>
> > On Oct 3, 7:31 am, digitalcowboy <[EMAIL PROTECTED]> wrote:
>
> > > I apologize if the solution to my issue is to be found elsewhere.
> > > I've tried to look but don't really know what I'm looking for and I
> > > don't have a lot of time.
>
> > > I have two problems and I think - but I'm not sure - they are
> > > related.  I have a client's production site running on a Cake-based
> > > solution I created.  Recently we outgrew our dedicated server and I
> > > added a second beefier server.  The Cake-based site is all now on the
> > > new server.  I replicated everything as exactly as I could.
>
> > > Now I have two issues - First (and most critical) is that queries with
> > > large results are just not running at all.  I don't mean large or
> > > complicated queries.  In most cases they are simple queries with a
> > > large result set.  They are not timing out.  They are just not running
> > > at all.  After just a few seconds Cake returns an empty page.  Empty
> > > as in:  "View Source" is an empty file.  Other queries - and the
> > > majority of the site - are running fine.  In addition, the old server
> > > is now pointing to the database on the new server and doesn't have
> > > this problem.  Queries that return a blank page on the new server,
> > > work (albeit slowly because of the remote db) on the old server.
>
> > > Second, in trying to troubleshoot this, I discovered that I'm getting
> > > no debug results at all, anywhere on the new server no matter what I
> > > set the debug level to in app/config/core.php.
>
> > > I've checked every timeout I can think of - PHP input, PHP script,
> > > Apache, etc.  I cannot find anything different between the two
> > > servers.
>
> > > Please help.  This site is profitable and the core of my client's
> > > business.  They are losing customers and getting justifiably
> > > impatient.  I need a quick resolution.
>
> > > Details:  CakePHP 1.1.something on PHP 5, MySQL 5 (5.024 on the old
> > > server and 5.027 on new), CentOS 4.  You can see one example of the
> > > problem by going tohttp://govdirections.com/bids/sitemap/state/and
> > > then clicking on the "List" link next to Virginia.  That's the new
> > > server and will return a totally empty page after just a few seconds -
> > > as if the query doesn't even attempt to run.  On the old server,
> > > pulling from the same database, it takes a good long time, but will
> > > eventually return ~22,000 rows.  (That number of rows is not normal -
> > > it's a separate problem.  This is just one example but the problem is
> > > also affecting paged results on the new server when trying to switch
> > > to anything greater than 500 results at once.)


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



Re: cakePHP friend/buddy system

2007-10-03 Thread cakeFreak

Try to read these posts:


Self-referential has_many :through associations
http://blog.hasmanythrough.com/2006/4/21/self-referential-through

http://groups.google.com/group/cake-php/browse_frm/thread/c8ebc2097f8aad11/fae9ec58501534e6?lnk=gst&q=friend&rnum=1#fae9ec58501534e6

http://groups.google.com/group/cake-php/browse_frm/thread/e70d4147be079a08/89b225e4ea426352?lnk=gst&q=friend&rnum=4#89b225e4ea426352

Hope this helps!

Dan


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



Re: Debug not working / queries aborting

2007-10-03 Thread digitalcowboy

Thanks for the reply, but no, I don't think that's it.  In fact, the
new server has twice the physical memory as the old server and the PHP
memory limit is set 4x higher, but the old server will return the full
result set.

Also, as I said, that is just one example.  I have other places where
I'm using Pagination and it returns the empty page when clicking on
more than 500 results at a time in the Pagination options.

I appreciate your tip about the limit, but that doesn't solve my
problem.  In many cases there is a business need to have thousands of
results returned in one page.

This would also be much easier to track down if I could figure out why
Cake's debug is not working AT ALL on this server.

On Oct 3, 12:50 am, francky06l <[EMAIL PROTECTED]> wrote:
> looks like a resource problem when having too many results. Have you
> tried to limit the results set in your findAll (case of Virginia) ?
> Try by setting the "limit" parameter in the query.
> I had that problem (not exactly), that was not a timeout issue but
> rather a memory_limit (max 8 Gb) authorized in php.ini.
>
> Hope it's a hint
>
> On Oct 3, 7:31 am, digitalcowboy <[EMAIL PROTECTED]> wrote:
>
> > I apologize if the solution to my issue is to be found elsewhere.
> > I've tried to look but don't really know what I'm looking for and I
> > don't have a lot of time.
>
> > I have two problems and I think - but I'm not sure - they are
> > related.  I have a client's production site running on a Cake-based
> > solution I created.  Recently we outgrew our dedicated server and I
> > added a second beefier server.  The Cake-based site is all now on the
> > new server.  I replicated everything as exactly as I could.
>
> > Now I have two issues - First (and most critical) is that queries with
> > large results are just not running at all.  I don't mean large or
> > complicated queries.  In most cases they are simple queries with a
> > large result set.  They are not timing out.  They are just not running
> > at all.  After just a few seconds Cake returns an empty page.  Empty
> > as in:  "View Source" is an empty file.  Other queries - and the
> > majority of the site - are running fine.  In addition, the old server
> > is now pointing to the database on the new server and doesn't have
> > this problem.  Queries that return a blank page on the new server,
> > work (albeit slowly because of the remote db) on the old server.
>
> > Second, in trying to troubleshoot this, I discovered that I'm getting
> > no debug results at all, anywhere on the new server no matter what I
> > set the debug level to in app/config/core.php.
>
> > I've checked every timeout I can think of - PHP input, PHP script,
> > Apache, etc.  I cannot find anything different between the two
> > servers.
>
> > Please help.  This site is profitable and the core of my client's
> > business.  They are losing customers and getting justifiably
> > impatient.  I need a quick resolution.
>
> > Details:  CakePHP 1.1.something on PHP 5, MySQL 5 (5.024 on the old
> > server and 5.027 on new), CentOS 4.  You can see one example of the
> > problem by going tohttp://govdirections.com/bids/sitemap/state/and
> > then clicking on the "List" link next to Virginia.  That's the new
> > server and will return a totally empty page after just a few seconds -
> > as if the query doesn't even attempt to run.  On the old server,
> > pulling from the same database, it takes a good long time, but will
> > eventually return ~22,000 rows.  (That number of rows is not normal -
> > it's a separate problem.  This is just one example but the problem is
> > also affecting paged results on the new server when trying to switch
> > to anything greater than 500 results at once.)


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



cakePHP friend/buddy system

2007-10-03 Thread avi

I am using cakephp 1.2 alpha.
I would like some suggestions/feedback on my implementation of a buddy
system using cakephp and ACL component.

ARO
Group::Users
  Group::Guests
  anom
  Group::Members
  david
  cool_dude
  Group::Admins
  power_dude

ACO
Root
   +Users
   cool_dude
   david
+Posts
+Photos

and then I would set permissions as such.
$this->Acl->grant(cool_dude,david,read)
$this->Acl->grant(david,cool_dude,read)

So that cool_dude and david can view all of each others posts, photos,
etc. Is this a smart approach? it seems pretty heavy to me as I will
have to duplicate all users in the ARO and ACO table in addition to
creating 2 entries in the aro_aco table for permissions. How does one
create a buddy/friend system in cakephp similar to that of facebook/
myspace?


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



Re: Transport a ID in the URL

2007-10-03 Thread rtconner

Uhm, It's a bit of a hack, but when i needed to do something
similar...
I made a helper that extended HtmlHelper (called SHtmlHelper), and
then I overwrote the url method in that new helper.
Then at the top of my layout files I put
 so now all instances of $html helper used my new
helper.

I have no idea if this is best practice. Lets hope gwoo reads this
thread, and drops some advice down.



On Oct 3, 12:31 pm, cyberhorst <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I need to transport some kind of ID (it could also be a Session-ID)
> through the URL. This could look like this:http://domain.com/ID1234/posts/edit
> orhttp://domain.com/ID7895/users/
> This ID can easily be identified by a RegEx.
> The problem is how can cake pass this ID **automatically** to every
> other cake-generated URL on this page (like with html->link(), form->create() 
> or redirect()  - which all based on Router::url)? Do I have
>
> to write my own link() and form() functions?
>
> The easiest way would be to store this ID in a session, but I need to
> have different IDs in one browsersession and to access all pages
> directly, so I have to have the ID in the url.
>
> I tried to set up a route:
>
> Router::connect('/:MyID/:controller/:action/*',array(),array('MyID' =>
> 'ID[0-9]{4}'));
>
> but it did not work. Then I added something like this to core.php:
>
> ereg("/(ID[0-9]{4})/",$_SERVER["REQUEST_URI"],$MyID);
> if ($MyID[1]) define ('BASE_URL', "/".$MyID[1]);
>
> this worked reasonably but the value of $this->here is incorrect
> afterwards and it seemed to me that this is not a good way to do it.
>
> Have you any ideas how to accomplish this? THANKS!


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



Re: DocumentRoot(?) kills PHP preprocessor on Ubuntu+Apache

2007-10-03 Thread val

Damn Cache of the Firefox!! (sorry..)
Finally solved!

The soulution was found here
http://66.102.9.104/search?q=cache:GJ6xSnWcp8oJ:www.movingtofreedom.org/2007/05/09/how-to-wordpress-on-ubuntu-gnu-linux/+apache2+%22AllowOverride+All%22+%22which+is+a:+PHTML+file%22&hl=en&ct=clnk&cd=1
---


Briar Patch

Please, Br'er Fox, please don't throw me in the briar patch!
PHTML Files

When I first installed this stuff on my desktop machine and tried:

http://localhost/phpmyadmin and
http://localhost/phpmyadmin/index.php

I'd get a dialog window from Firefox:

You have chosen to open

[blank line]

which is a: PHTML file

And a prompt for an application to use for opening it. I picked /usr/
bin/firefox. The browser refreshed and then prompted again. This time
I cleverly selected to always use this application, and was rewarded
with a cascading opening of new tabs until Firefox crashed.

Searching in Google I found a lot of people with this problem. One
main theme in the advice was to clear out the Firefox cache. (Tools >>
Clear Private Data is one way you can do that.) I tried that and
restarted Firefox and tried a few more times for good measure, but no
luck.

A lot of other pages suggested dabbling in httpd.conf or apache2.conf.
I finally tried:

sudo vi /etc/apache2/apache2.conf

And followed advice to uncomment these lines:

#AddType application/x-httpd-php .php
#AddType application/x-httpd-php-source .phps

And add .phtml:

AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps

Then a restart of Apache (see instructions in the Apache section
above), and maybe a final clearing of the cache in Firefox, and
finally I could open phpMyAdmin in the browser.

(I didn't have this problem when I installed on my 6.10/Edgy laptop.
Those lines are still commented there. And then I couldn't get it to
break again on my desktop so I could write about the details here.
Kind of a flaky problem.)
Trying to stop/start/restart Apache as a regular user

If you try issuing commands to Apache as a regular user (most likely
because you forgot to use sudo), you'll get errors that might not make
your mistake obvious. Especially with /usr/sbin/apache2ctl:

httpd not running, trying to start
(13): make_sock: could not bind to address [::]:80
no listening sockets available, shutting down
Unable to open logs

With /etc/init.d/apache2, a little bit more of a clue with the first
line:

open: Permission denied
* Forcing reload of apache 2.0 web server...
httpd (pid 27117?) not running

And it hangs there until you try CTRL+C.


On Oct 3, 9:15 pm, val <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I changed the
>
>  /etc/apache2/sites-available/default
>
> just like it was suggested - added
>
>AllowOverride All
>
>
> and changed
>DocumentRoot /var/www/cake/app/webroot
>
> but then if I typehttp://localhostin Firefox, it gives me a dialog:
>  You have chosen to open
>
>  which is a: PHTML file
>  from:http://localhost
>
>  What should Firefox do with this file?... etc..
>
> >From this moment this happened to any php file which I tried to open
>
> in browser.
> When I changed
>  /etc/apache2/sites-available/default
> to how it was before the change, Apache started to work properly
> again.
>
> Please help?


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



DocumentRoot(?) kills PHP preprocessor on Ubuntu+Apache

2007-10-03 Thread val

Hi all,

I changed the

 /etc/apache2/sites-available/default

just like it was suggested - added
   
   AllowOverride All
   

and changed
   DocumentRoot /var/www/cake/app/webroot

but then if I type http://localhost in Firefox, it gives me a dialog:
 You have chosen to open

 which is a: PHTML file
 from: http://localhost

 What should Firefox do with this file?... etc..

>From this moment this happened to any php file which I tried to open
in browser.
When I changed
 /etc/apache2/sites-available/default
to how it was before the change, Apache started to work properly
again.

Please help?


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



Re: Code Style Fanaticism

2007-10-03 Thread Sonic Baker
Sorry to butt in but,

If the bakery code is intelligently to recognise different styles then would
it be much of a job to automatically reformat the submitted code rather than
have the user do it? Couldn't it call the indent program via the command
line?

Just wondering cause I also prefer the "nesting-scope-obvious" opening
bracket position.

Cheers,

Sonic

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



Transport a ID in the URL

2007-10-03 Thread cyberhorst

Hi,

I need to transport some kind of ID (it could also be a Session-ID)
through the URL. This could look like this: http://domain.com/ID1234/posts/edit
or http://domain.com/ID7895/users/
This ID can easily be identified by a RegEx.
The problem is how can cake pass this ID **automatically** to every
other cake-generated URL on this page (like with html->link(), form-
>create() or redirect()  - which all based on Router::url)? Do I have
to write my own link() and form() functions?

The easiest way would be to store this ID in a session, but I need to
have different IDs in one browsersession and to access all pages
directly, so I have to have the ID in the url.

I tried to set up a route:

Router::connect('/:MyID/:controller/:action/*',array(),array('MyID' =>
'ID[0-9]{4}'));

but it did not work. Then I added something like this to core.php:

ereg("/(ID[0-9]{4})/",$_SERVER["REQUEST_URI"],$MyID);
if ($MyID[1]) define ('BASE_URL', "/".$MyID[1]);

this worked reasonably but the value of $this->here is incorrect
afterwards and it seemed to me that this is not a good way to do it.

Have you any ideas how to accomplish this? THANKS!


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



Re: Blog tutorial confusion... setting datetime without using now()... how did it do this?

2007-10-03 Thread EVan

Awesome, thanks for the help.

On Oct 3, 1:22 pm, "Samuel DeVore" <[EMAIL PROTECTED]> wrote:
> and it is mentioned in the "configuration" and the "blog tutorial"
> sections in the manual
>
> "If you include a 'created' and/or 'modified' column in your table,
> Cake will automatically populate the field when appropriate."
>
> "Check out Appendix "Cake Conventions" more information, but suffice
> it to say that naming our table 'posts' automatically hooks it to our
> Post model, and having fields called 'modified' and 'created' will be
> automagically managed by Cake."
>
> On 10/3/07, Samuel DeVore <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > it is nomenclature vodoo
>
> > On 10/3/07, EVan <[EMAIL PROTECTED]> wrote:
>
> > > I'm confused as to how the datetime is set for the modified and
> > > created fields in the blog tutorial.  I feel like the the
> > > posts_controller should contain something with a now() function or
> > > something... but it doesn't and the whole thing works fine.   ... ?
>
> > > Furthermore, I can't see in the code why the 'add' function affects
> > > only the 'created' field while 'edit' affects only the 'modified'
> > > field.  Is this more nomenclature voodoo?
>
> > > A searched the API and the manual for any clues but I really can't
> > > figure this one out... I think it's implicative of my general
> > > understanding up to this point.
>
> > --
> > (the old fart) the advice is free, the lack of crankiness will cost you
>
> > - its a fine line between a real question and an idiot
>
> >http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/
>
> --
> (the old fart) the advice is free, the lack of crankiness will cost you
>
> - its a fine line between a real question and an idiot
>
> http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/- Hide 
> quoted text -
>
> - Show quoted text -


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



Re: Process Flow - Controller to Controller

2007-10-03 Thread starkey

Yeah, I have created a hasMany relationship in the User model to
Groups.  Are you saying the User controller, on save(), will
automatically insert one or more new Groups and make the relationship
because of the hasMany relationship?  I never considered that...  So
on one form posting to the User controller I could have:

User Name: __

Select Memberships:
__ Group A
__ Group B

Add to New Group(s):
_
_

SUBMIT  CANCEL

That would be great!

Thanks,
Shawn

On Oct 3, 2:29 pm, TGG008 <[EMAIL PROTECTED]> wrote:
> I'm thinking of it too,
>
> but i think you should define the relationship between the Group and
> User Model
>
> then when you create a User in the User Model ,,It'll automatically Do
> the associated action..
>
> On Oct 4, 1:56 am, starkey <[EMAIL PROTECTED]> wrote:
>
> > Hello, all!
>
> > I am trying to figure out the best practice in this situation...  In
> > my application's setup process you create new items in a flow.  For
> > example, they can add a new user and put that user in a new group:
>
> > Create User -> Create User Group
>
> > So I would have a User controller and a Group controller.  When the
> > user submits the form to create a User it calls the User controller
> > which saves the data.  Now, to automatically send the user to the
> > "Create Group" page should I use $this->redirect('/Group/add')?
>
> > I can't really think of a better way...
>
> > Thanks,
> > Shawn


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



Re: Process Flow - Controller to Controller

2007-10-03 Thread TGG008

I'm thinking of it too,

but i think you should define the relationship between the Group and
User Model

then when you create a User in the User Model ,,It'll automatically Do
the associated action..

On Oct 4, 1:56 am, starkey <[EMAIL PROTECTED]> wrote:
> Hello, all!
>
> I am trying to figure out the best practice in this situation...  In
> my application's setup process you create new items in a flow.  For
> example, they can add a new user and put that user in a new group:
>
> Create User -> Create User Group
>
> So I would have a User controller and a Group controller.  When the
> user submits the form to create a User it calls the User controller
> which saves the data.  Now, to automatically send the user to the
> "Create Group" page should I use $this->redirect('/Group/add')?
>
> I can't really think of a better way...
>
> Thanks,
> Shawn


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



Re: user can edit only his own posts, editor editing all of them

2007-10-03 Thread Chris Hartjes

On 10/3/07, DJ Spark <[EMAIL PROTECTED]> wrote:
>
>  I've searched, but since I'm not sure what to search for, I'll ask here:
>
>  Suppose I have a blog system, where a user can edit only his own
> posts, an editor may edit all posts, a visitor can only read them.

Hey Spark,

I've done this sort of thing using the Auth component.

1) if the user ID of the person who created the post matches
$this->Auth->user('id'), then they can edit the post
2) if the value in $this->Auth->user('role') == 'admin', you can edit the post

I usually put that info in my edit() and / or delete() methods to make
sure that only users who have the proper authorization levels can edit
or delete things.

'id' and 'role' are fields in the table being used for authorization,
so they automagically show up in $this->Auth->user(...).

Hope that helps.

-- 
Chris Hartjes
Cake Development Corporation
http://www.cakedevelopment.com

My motto for 2007:  "Just build it, damnit!"

@TheKeyboard - http://www.littlehart.net/atthekeyboard

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



user can edit only his own posts, editor editing all of them

2007-10-03 Thread DJ Spark

 I've searched, but since I'm not sure what to search for, I'll ask here:

 Suppose I have a blog system, where a user can edit only his own
posts, an editor may edit all posts, a visitor can only read them.

 Is this what ACL is made for ? ACL + some other thing ? ACL is not
that ? Do I need to make a custom solution every time ?

 After searches in some cakeforge projects, I didn't find any system
that seems to fit, only using custom solutions, as the ones I've made
before... Also looked for a lot of ACL/Auth tutorials, and only one
showed almost what I need...

  Since it looks to me a very common problem, I thought I must be
doing the wrong thing here. Am I ?

  Thank you
  Spark


-- 
[livesets] http://djspark.com.br/
[web] http://sydi.net
[filmes] http://melhoresfilmes.com.br

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



Process Flow - Controller to Controller

2007-10-03 Thread starkey

Hello, all!

I am trying to figure out the best practice in this situation...  In
my application's setup process you create new items in a flow.  For
example, they can add a new user and put that user in a new group:

Create User -> Create User Group

So I would have a User controller and a Group controller.  When the
user submits the form to create a User it calls the User controller
which saves the data.  Now, to automatically send the user to the
"Create Group" page should I use $this->redirect('/Group/add')?

I can't really think of a better way...

Thanks,
Shawn


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



Re: Image handling strategies

2007-10-03 Thread burzum

> Use Behaviors - one for uploading and one for resizing

Can you post, name or link both? ;)

> put them in webroot unless you want to do ACL stuff on the images

I've defined a constant in the bootstrap.php that contains an absolute
path to everything i want to store.

FILE_PATH/reports/$id/photos/
FILE_PATH/reports/$id/files/
FILE_PATH/errand/$id/files/

For example.

---

And how can i process more then one image? I have multiple photos in
one form and its required that they appear after uploading resized in
the same form.


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



Re: Blog tutorial confusion... setting datetime without using now()... how did it do this?

2007-10-03 Thread Samuel DeVore

and it is mentioned in the "configuration" and the "blog tutorial"
sections in the manual

"If you include a 'created' and/or 'modified' column in your table,
Cake will automatically populate the field when appropriate."

"Check out Appendix "Cake Conventions" more information, but suffice
it to say that naming our table 'posts' automatically hooks it to our
Post model, and having fields called 'modified' and 'created' will be
automagically managed by Cake."



On 10/3/07, Samuel DeVore <[EMAIL PROTECTED]> wrote:
> it is nomenclature vodoo
>
> On 10/3/07, EVan <[EMAIL PROTECTED]> wrote:
> >
> > I'm confused as to how the datetime is set for the modified and
> > created fields in the blog tutorial.  I feel like the the
> > posts_controller should contain something with a now() function or
> > something... but it doesn't and the whole thing works fine.   ... ?
> >
> > Furthermore, I can't see in the code why the 'add' function affects
> > only the 'created' field while 'edit' affects only the 'modified'
> > field.  Is this more nomenclature voodoo?
> >
> > A searched the API and the manual for any clues but I really can't
> > figure this one out... I think it's implicative of my general
> > understanding up to this point.
> >
> >
> > > >
> >
>
>
> --
> (the old fart) the advice is free, the lack of crankiness will cost you
>
> - its a fine line between a real question and an idiot
>
> http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/
>


-- 
(the old fart) the advice is free, the lack of crankiness will cost you

- its a fine line between a real question and an idiot

http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/

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



Re: Blog tutorial confusion... setting datetime without using now()... how did it do this?

2007-10-03 Thread Samuel DeVore

it is nomenclature vodoo

On 10/3/07, EVan <[EMAIL PROTECTED]> wrote:
>
> I'm confused as to how the datetime is set for the modified and
> created fields in the blog tutorial.  I feel like the the
> posts_controller should contain something with a now() function or
> something... but it doesn't and the whole thing works fine.   ... ?
>
> Furthermore, I can't see in the code why the 'add' function affects
> only the 'created' field while 'edit' affects only the 'modified'
> field.  Is this more nomenclature voodoo?
>
> A searched the API and the manual for any clues but I really can't
> figure this one out... I think it's implicative of my general
> understanding up to this point.
>
>
> >
>


-- 
(the old fart) the advice is free, the lack of crankiness will cost you

- its a fine line between a real question and an idiot

http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/

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



Model with no corresponding table needs DB access

2007-10-03 Thread rpupkin77

Hi,

I have a model for administering a site, it itself does not connect to
any table so I have $useTable = false. And in the controller, I have
most of the data being handled by using other controllers' actions.

There is one instance in which I need this model to access the
database, however.  How do I give this model database connectivity if
I am not using a table. Another question I have is, can I pass form
data as POST from on controller to another?

I have looked through the API, but I find it a little hard to
understand without examples.


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



Re: HOW DO I DO THIS

2007-10-03 Thread Lir

I think the same. Maybe I'm not inserting properly my new select but I
don't see what is wrong. Take a look to the new select:

  $query_loss = "SELECT"
  . " LOSS_SEQ_NUM"
  . " FROM LOSS"
  . " WHERE LOSS_POL_NUM = '".$policy."'";

$result_query_loss = $this->DB->Execute($query_loss);
$return= $this->DB->GetAll($query_loss);


echo "";
echo ' ';
foreach ($return as $row)
{
   echo "
$row[LOSS_SEQ_NUM]";
}
   echo'';


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



Cake 1.2 - Enums and auto-populate field after dropdown selection

2007-10-03 Thread Wayne Fay

First off, I have a couple enums in a table in my app. Under Cake 1.1,
the enums were turned into a dropdown and displayed properly. Using
cake_1.2.0.5427alpha, I don't get the dropdowns. I haven't tried any
nightly builds but am happy to do so if it would give me back the
functionality I need without any other significant negative effects.
Is this a known issue, and/or what do I need to do to make it work
like it did under 1.1?

Additionally, we would like to somehow auto-populate a text box (which
is not saved to the db) with a description string corresponding to the
selection made in the dropdown. We have a part number (dropdown) that
they select, and then a list of descriptions (short string) that we'd
like to show after they've made their selection ofn th. I can store
the part number and descriptions in the database in another table, or
do something else altogether, but I'm unsure about the proper approach
with Cake. Any suggestions??

Thanks!
Wayne

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



Re: Objects instead of arrays

2007-10-03 Thread rtconner

Hey gwoo that is a nice piece of code. I turned it into a behavior.
http://bin.cakephp.org/saved/24246

Although, I can't quite figure out how to get paginate to work with
objectify... :/

On Oct 3, 6:28 am, gwoo <[EMAIL PROTECTED]> wrote:
> ok, i had to dig a bit 
> deeperhttp://groups.google.com/group/cake-php/browse_thread/thread/fc7ef676...


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



Re: HABTM question from newbie

2007-10-03 Thread rtconner

Sure why not.

Cake 1.2 has recenlty added a feature where you can speficy a 'With'
association which auto-creates a model for the join table.
You may want to mess around with that.

An example can be found in the OCPHP doc found here: 
http://cakephp.org/downloads

On Oct 3, 8:25 am, Comida411 <[EMAIL PROTECTED]> wrote:
> There appear to be 3 types of join table in my data model..
>
> 1. Pure join - table comprised of two or more foreign keys only and no
> other attribues (column headers)
> 2. Join as parent - table comprised of two or more foreign keys only
> and no other attribues... wherein he table is also the parent to
> another table
> 3. Join with attributes table comprised of two or more foreign keys
> and several other attribues
>
> Can I make a rule, that there should be a cake model in cases 2 and 3
> but not in case 1
>
> Thank you in advance for your response..
> [EMAIL PROTECTED]


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



Blog tutorial confusion... setting datetime without using now()... how did it do this?

2007-10-03 Thread EVan

I'm confused as to how the datetime is set for the modified and
created fields in the blog tutorial.  I feel like the the
posts_controller should contain something with a now() function or
something... but it doesn't and the whole thing works fine.   ... ?

Furthermore, I can't see in the code why the 'add' function affects
only the 'created' field while 'edit' affects only the 'modified'
field.  Is this more nomenclature voodoo?

A searched the API and the manual for any clues but I really can't
figure this one out... I think it's implicative of my general
understanding up to this point.


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



Re: how to protect reserved files

2007-10-03 Thread cakeFreak


Cheers Samuel,

I'll try to keep them under the root without ACL an with conditional
rules!

Dan


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



Re: how to protect reserved files

2007-10-03 Thread Samuel DeVore

you will probably not want to keep them in webroot but have them piped
though a controller that you can use acl or some other access rules to
conditionally serve them.

Sam D

On 10/3/07, cakeFreak <[EMAIL PROTECTED]> wrote:
>
> Hey guys,
>
> I need to build a filesharing section for one website.
>
> Is there any suggested strategy in order to protect reserved files
> from download?
>
> More precisely:
> -
> Even if I show the download link only to some usergroups, if somebody
> get to know the correct location of the file  on the server, he can
> access it.
> I would like to avoid the latter problem.
> -
> Any help is appreciated!
>
> ;o)
>
> Daniel
>
>
> >
>


-- 
(the old fart) the advice is free, the lack of crankiness will cost you

- its a fine line between a real question and an idiot

http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/

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



HABTM question from newbie

2007-10-03 Thread Comida411

There appear to be 3 types of join table in my data model..

1. Pure join - table comprised of two or more foreign keys only and no
other attribues (column headers)
2. Join as parent - table comprised of two or more foreign keys only
and no other attribues... wherein he table is also the parent to
another table
3. Join with attributes table comprised of two or more foreign keys
and several other attribues

Can I make a rule, that there should be a cake model in cases 2 and 3
but not in case 1

Thank you in advance for your response..
[EMAIL PROTECTED]


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



Re: pastemonkey.org now live!

2007-10-03 Thread Cheeze

seems cool!

On Oct 2, 7:29 am, "Tane Piper" <[EMAIL PROTECTED]>
wrote:
> Hey folks,
>
> I'm pleased to announce the full service of Paste Monkey is now
> running athttp://pastemonkey.org.  This is a collaborative pastebin
> developed in CakePHP 1.2, and running AJAX with jQuery.
>
> It is still in the beta stage, but very functional, with features such as:
>
> * Use of Live Query and jQuery UI to create a rich interface
> * A permalink for both the user
> (http://pastemonkey.org/add/yournamehere) and for pastes
> * Expiry time for pastes (Day, Week, Month or Never)
> * The ability to edit a paste, and download a diff patch file, as well
> as download the origional source
> * Live Search, where you type in the word you are looking for in the
> source, tab off the field and it will be searched and highlighted for
> you
> * SPAM CAPTCHA using ReCaptcha (a captcha project with a purpose,
> check outhttp://recaptcha.net)
> * You are able to search by tags and by language to find similar posts.
>
> Hopefully you will all find it useful, and I am happy to offer
> subdomains to any communities that may want to use the bin (or you can
> host your own if you dare!), and please submit any bugs or
> enhancements athttp://code.google.com/p/pastemonkey/issues/list
>
> --
> Tane Piper
> Blog -http://digitalspaghetti.me.uk
> AJAX Pastebin -http://pastemonkey.org
>
> This email is: [ x ] blogable [ ] ask first [ ] private


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



Re: change model $useTable on the fly

2007-10-03 Thread cakeFreak

Cheers guys!

I'll post my findings here lata (if somebody else is interested to the
same topic)!

Dan

On 3 Ott, 15:57, gwoo <[EMAIL PROTECTED]> wrote:
> do a search in this group for setSource


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



Re: change model $useTable on the fly

2007-10-03 Thread gwoo

do a search in this group for setSource


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



Re: Objects instead of arrays

2007-10-03 Thread gwoo

function beforeRender() {
 $this->data = Set::reverse($this->data);
}


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



Re: Objects instead of arrays

2007-10-03 Thread Joshua Benner





I think object returns are not fully implemented. It will be an uphill
battle if you want to use the data in that way.

stefanb wrote:

  Well, that didn't seem to work:
"Fatal error: Cannot use object of type stdClass as array in C:\xampp
\htdocs\cake\cake\libs\view\helpers\form.php on line 136"

Is there a way to set "objectify = true" in just one place, and have
everything work just fine? Or will I have to write "objectify=true" /
"objectify=false" in all sorts of places to make this work?

On Oct 3, 2:28 pm, gwoo <[EMAIL PROTECTED]> wrote:
  
  
ok, i had to dig a bit deeperhttp://groups.google.com/group/cake-php/browse_thread/thread/fc7ef676...

  
  


  


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





Re: change model $useTable on the fly

2007-10-03 Thread cmbg

If you're talking about how to change the relationships to a model,
you would use bindModel and unbindModel.  I don't think you can change
a models table when you could use multiple models in a controller via
the uses array.

;b

On Oct 3, 8:39 am, cakeFreak <[EMAIL PROTECTED]> wrote:
> Anyone knows how it is possible to change the table used by a model on
> the fly?
>
> Should I use a beforeFind condition in my model?
>
> Dan


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



Re: Objects instead of arrays

2007-10-03 Thread stefanb

Well, that didn't seem to work:
"Fatal error: Cannot use object of type stdClass as array in C:\xampp
\htdocs\cake\cake\libs\view\helpers\form.php on line 136"

Is there a way to set "objectify = true" in just one place, and have
everything work just fine? Or will I have to write "objectify=true" /
"objectify=false" in all sorts of places to make this work?

On Oct 3, 2:28 pm, gwoo <[EMAIL PROTECTED]> wrote:
> ok, i had to dig a bit 
> deeperhttp://groups.google.com/group/cake-php/browse_thread/thread/fc7ef676...


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



change model $useTable on the fly

2007-10-03 Thread cakeFreak

Anyone knows how it is possible to change the table used by a model on
the fly?

Should I use a beforeFind condition in my model?

Dan


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



Re: Objects instead of arrays

2007-10-03 Thread gwoo

ok, i had to dig a bit deeper
http://groups.google.com/group/cake-php/browse_thread/thread/fc7ef676f60ab03/81270d96a20cb44e?lnk=gst&q=gwoo+objects&rnum=4#81270d96a20cb44e


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



Re: Objects instead of arrays

2007-10-03 Thread stefanb

Yes, and I found this:

http://groups.google.com/group/cake-php/browse_thread/thread/a1699f504009f873/439d3756be935f9c?lnk=gst&q=objects+arrays&rnum=6#439d3756be935f9c
"There is no such functionality available in CakePHP so you have to
write it yourself. "

But that post was written in February, so I was wondering if this
feature had been added since then. But I guess not?

On Oct 3, 2:02 pm, gwoo <[EMAIL PROTECTED]> wrote:
> have you searched this group?


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



please help me out

2007-10-03 Thread hemant sonker

hi
i am a newbe in cakephp. i am using cakephp 1.2.
i have columns in my database like email,subject, message, and date.
what i am trying to do is that whenever i puts a mouse on email,it
should have a hover kind of thing which displays the users full
name ,age ,sex and place.

i have a table named users in which these fields are there.
how can i fetch this value from the ysers table so that ,whenever i
hover on email it should give me full details.

please help me soon as possible.


regards

hemant sonker


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



Re: Objects instead of arrays

2007-10-03 Thread gwoo

have you searched this group?


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



Re: Save into multiple models

2007-10-03 Thread grigri

checkLoggedIn();
if (!empty($this->data)) {
if ($this->Post->save($this->data) && $this-
>Post->Meta->save($this->data)) {
$this->flash('It worked', '/');
}
}
}
?>

On Oct 3, 9:26 am, Johan Forngren <[EMAIL PROTECTED]> wrote:
> Hi,
>
> This is my first post here. If this isn't an appropriate place to ask
> questions, please point me in the right direction.
>
> How do I save data into multiple models? This is my current code:
>
>  class Post extends AppModel {
> var $hasOne = array(
> 'Meta' => array (
> 'className' => 'Meta',
> 'dependent' => TRUE,
> 'foreignKey' => 'id',
> ),
> );
>
> }
>
>  class Meta extends AppModel {
> var $useTable = 'meta';
> var $belongsTo = array (
> 'Post' => array (
> 'className' => 'Post',
> 'foreignKey' => 'id',
> ),
> );
>
> }
>
>  class PostsController extends AppController {
> function add() {
> $this->checkLoggedIn();
> if (!empty($this->data)) {
> if ($this->Post->save($this->data)) {
> /*
> *
> * I would like this code to save into meta as well
> *
> */
> $this->flash('It worked', '/');
> }
> }
> }
>
> add.thtml
> formTag('/posts/add')?>
> input('Post/title') ?>
> input('Meta/tid') ?>
> submit() ?>
>
> I hope you understand my question and thanks for your time.
>
> Cheers,
>   Johan Forngren


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



Objects instead of arrays

2007-10-03 Thread stefanb

Hello,

Is there a way to access data from my models as objects instead of
arrays?

// In my view:

foreach ( $categories as $category ) {
 echo $category->name; // I want this
 echo $category['Category']['name']; // Instead of this
}


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



Re: Image handling strategies

2007-10-03 Thread drayen

I would also like call your attention to the Attach This ! project on
cakeforge (disclaimer : its my project). It handles uploads (including
images) using swfupload (with fall back to normal form) but also is
distributed with a MIT licensed alternative to phpThumb which can re-
size images on the fly (and then cache them).

http://cakeforge.org/projects/attachments/

Come talk to me in #cakephp or #attach_this (on irc.freenode.net) if
you want a private demo of attach this.

Drayen

On Oct 3, 10:50 am, "Jon Bennett" <[EMAIL PROTECTED]> wrote:
> > I'm a cake beginner and also pretty much a php beginner, as until now
> > i only had to understand what it (can) do, but never had to code
> > myself.
>
> > In order to develop my skills i started to code a little portfolio-app
> > and right now I'm running into some rather conceptual questions:
>
> > I want to upload pictures and save and keep the original, and then
> > resize them in two versions for display (big and thumb). The upload is
> > working, now i wonder where the resizing would take place in a MVC
> > approach - in the model or in the controller? My initial Idea is to do
> > it in the controller->view action to be able to recreate them if I
> > need to change sizes for layout reasons. But somehow it seems to me
> > that the model would be more appropriate.
>
> > Second question - Image serving: I could save the processed Images in
> > the webroot/img folder and in my views access them through a direct
> > link or I could read them and output them as raw data through a
> > template, providing the correct header information etc. What are the
> > pros and cons of either solution?
>
> check outhttp://www.ad7six.com/MiBlog/GenericFileUploadBehavior-
> should fit the bill perfectly for you.
>
> hth,
>
> jon
>
> --
>
> jon bennett
> w:http://www.jben.net/
> iChat (AIM): jbendotnet Skype: jon-bennett


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



how to protect reserved files

2007-10-03 Thread cakeFreak

Hey guys,

I need to build a filesharing section for one website.

Is there any suggested strategy in order to protect reserved files
from download?

More precisely:
-
Even if I show the download link only to some usergroups, if somebody
get to know the correct location of the file  on the server, he can
access it.
I would like to avoid the latter problem.
-
Any help is appreciated!

;o)

Daniel


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



Re: Image handling strategies

2007-10-03 Thread Jon Bennett

> I'm a cake beginner and also pretty much a php beginner, as until now
> i only had to understand what it (can) do, but never had to code
> myself.
>
> In order to develop my skills i started to code a little portfolio-app
> and right now I'm running into some rather conceptual questions:
>
> I want to upload pictures and save and keep the original, and then
> resize them in two versions for display (big and thumb). The upload is
> working, now i wonder where the resizing would take place in a MVC
> approach - in the model or in the controller? My initial Idea is to do
> it in the controller->view action to be able to recreate them if I
> need to change sizes for layout reasons. But somehow it seems to me
> that the model would be more appropriate.
>
> Second question - Image serving: I could save the processed Images in
> the webroot/img folder and in my views access them through a direct
> link or I could read them and output them as raw data through a
> template, providing the correct header information etc. What are the
> pros and cons of either solution?

check out http://www.ad7six.com/MiBlog/GenericFileUploadBehavior -
should fit the bill perfectly for you.

hth,

jon

-- 

jon bennett
w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett

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



Re: CONNECT MS ACCESS DATABASE

2007-10-03 Thread kaki

I have the access database close.


On 28 sep, 17:26, RichardAtHome <[EMAIL PROTECTED]> wrote:
> Do you have the Access database open in Access when you try to connect
> to it through PHP?
>
> Been a while since I've done anything with Access but I do remember
> that used to be a problem.
>
> Close down access, then run your cake app.
>
> Also, just to save yourself some headaches down the line: Access gets
> very ropey with more than a couple of concurrent users connected to
> it.
>
> On Sep 28, 10:07 am, kaki <[EMAIL PROTECTED]> wrote:
>
> > Hi, I´m trying to connect to a MS Access Database , i've written this
> > in my 'database.php'
>
> >var $default = array('driver'   => 'adodb',
> > 'connect'  => 'access',
> > 'host' => 'Driver={Microsoft Access
> > Driver(*.mdb)};Dbq=D:\bd1.mdb;  ',
> > 'login'=> 'root',
> > 'password' => '',
> > 'database' => 'origen2',
> > 'prefix'   => '');
>
> > but appears next error:
>
> > Your database configuration file is present.
>
> > Warning: odbc_connect() [function.odbc-connect]: SQL error: [Microsoft]
> > [Administrador de controladores ODBC] No se encuentra el nombre del
> > origen de datos y no se especificó ningún controlador predeterminado,
> > SQL state IM002 in SQLConnect in D:\wamp\www\cake\app\config\drivers
> > \adodb-odbc.inc.php on line 60
>
> > Cake is not able to connect to the database.


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



Save into multiple models

2007-10-03 Thread Johan Forngren

Hi,

This is my first post here. If this isn't an appropriate place to ask
questions, please point me in the right direction.

How do I save data into multiple models? This is my current code:

 array (
'className' => 'Meta',
'dependent' => TRUE,
'foreignKey' => 'id',
),
);
}

 array (
'className' => 'Post',
'foreignKey' => 'id',
),
);
}

checkLoggedIn();
if (!empty($this->data)) {
if ($this->Post->save($this->data)) {
/*
*
* I would like this code to save into meta as well
*
*/
$this->flash('It worked', '/');
}
}
}

add.thtml
formTag('/posts/add')?>
input('Post/title') ?>
input('Meta/tid') ?>
submit() ?>

I hope you understand my question and thanks for your time.

Cheers,
  Johan Forngren


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



new PROXY new PROXY new PROXY new PROXY ...

2007-10-03 Thread Chinaguy

Forward this email to your friends and spread free surf

Join this yahoo group and have daily fresh and free proxies in you
mailbox
http://tech.groups.yahoo.com/group/unblocker/join



Proxies to Surf ORKUT ,Gazzag ,Myspace ,E-gold ,...
http://www.Peroxy.info
http://www22.uproxy.6x.to
http://www23.uproxy.6x.to
http://www24.uproxy.6x.to
http://www25.uproxy.6x.to
http://www26.uproxy.6x.to





Send an email to this address to Join
Join group(via Email): [EMAIL PROTECTED]
List owner : [EMAIL PROTECTED] (jacob---nix)


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



Re: Image handling strategies

2007-10-03 Thread lwuelfing
Thanks for your comment, I will look at the helpers. Still I wonder why the
results-array is not available in my afterFind function, I guess I'm missing
out on something here, so any help would be nice.
I put the afterFind function directly in the model and there the results
array is available to the function, so I guess i might have to make it
available in the behaviour somehow but can't find any hint in how.

Lutz

2007/10/3, dardosordi <[EMAIL PROTECTED]>:
>
>
> I prefer to upload in model (using a behaviour) and a image helper
> that resizes and caches thumbs.  There are excelents image helpers out
> there (so you can resize in view), just choose one you like.
>
> On Oct 2, 7:53 am, LW <[EMAIL PROTECTED]> wrote:
> > For some reason I can't post in the original thread, so i had to open
> > a new one, sorry.
> > (if anyone knows why, please tell me)
> >
> > I found the upload-helper and based my own on it, but i don' want to
> > do the resizing at save-time, so i tried to do it in an afterFind
> > function. I'm having trouble to with it though, it doesn't give me the
> > find results:
> >
> > function afterFind(&$results){
> > debug($results);exit();
> > }
> >
> > This doesn't work, the find-results are not there. any suggestion?
> >
> > tx,
> > Lutz
>
>
> >
>

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



Re: How to paginate a custom SQL query?

2007-10-03 Thread Mike Green

I had exactly the same problem, however the *easiest* way to do this
(and I have done it) - is to write your own findAll() in your model.
Paginate will then call this twice. the first time to find how many
rows ( count(*) ) and then again to get the result with a limit.

In your custom findAll you then have the choice, either construct your
own sql query or pass some data back to the parent findall - I
personally would just construct the sql directly from the findall
parameters, this is fairly straightforward.

Using this method I've been able to paginate just about everything -
even queries over several databases using UNION and across tables and
even hosts!

If you need any help please ask - as I would have loved to have know
about this when I wasted the same amount of time trying it myself and
reaching several dead ends.

Best regards

Mike


On Sep 25, 10:04 pm, burzum <[EMAIL PROTECTED]> wrote:
> This manipulates an association in the model and uses it somehow 
> forpagination. But it does NOT paginate a custom mySQL query.
>
> On Sep 25, 5:39 pm, rtconner <[EMAIL PROTECTED]> wrote:
>
> > If you want, you can use these two functions in your model to do
> > custom paginating...
>
> >http://bin.cakephp.org/saved/21687


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



Adding helper in layout

2007-10-03 Thread firdzak

Hi
How to add helper in layout

example, i have a default layout and i want to set a drop down menu at
the menu div.
i have to get a helper in my app/helpers/css_menu to run a function
the maual says that we have to get our helper in array.
but it still dotn wotk for me when i include var $helper = array
('css_menu');
can some one help me..


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



Re: how to disable cakephp pass parameter using /

2007-10-03 Thread AD7six



On Oct 3, 8:02 am, Wimg <[EMAIL PROTECTED]> wrote:
> i have a function in my controller called search(id) .
> i want to pass a parameter id = abc/dce.
> when i type the url,http://localhost/search/abc/dce. error comes.
> anyone knows how to solve this problem

~broken


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