Re: Where to place own Application-Libs?

2006-12-12 Thread [EMAIL PROTECTED]

Hi,

I would say yes and no. I told you that we port an existing project to
cake. Therfore, there truely is something to do concerning MVC. But
there are some objects used in the code, which are good and shouldn't
be replaced. Think of objects that do actions or hold data. They do not
have any database-access etc. Actually they wrap downer code to make
things more readable and easier to understand in the components and
controllers.

These objects are in their own herachie and depend on the actual
implementation and soon depend on at least the cake-models. They are
compareable to components, but one should not implement them as ones.
In my implementation I play with these objects in controllers and
components. This produces very sweet code, I think ;-)

I think the app/vendor dir is quite suitable, but what I think is wrong
with vendors is, that these objects and classes are absolutley
project-related (at least the upper, precise ones). They depend on the
intended usage.

What about these? still vendosr? I would place them in some sort of
app/lib dir.

Thanks,

Thomas

On Dec 11, 6:58 pm, Felix Geisendörfer [EMAIL PROTECTED] wrote:
 Well to me this sounds like you'll simply have to add some refactoring
 to your todo list and split up this code into some tasty Cake(PHP)
 layers (MVC). Otherwise go with vendors.

 -- Felix Geisendörfer aka the_undefined
 --http://www.thinkingphp.orghttp://www.fg-webdesign.de

 John David Anderson (_psychic_) wrote:

  On Dec 11, 2006, at 10:45 AM, [EMAIL PROTECTED] wrote:

  Hi there,

  we are porting an existing php-application to cakephp. This goes quite
  harmless so far = very good!

  But now we want to integrate some existing libs and includes of the
  old
  application into the cake-structure. But I do not know where to put
  them. There are bussiness-logic-units, which are neither components,
  nor models.

  They also hevily depend on the whole application, so
  calling them a vendor-lib would'nt be right.

  Why not? I guess we need a better idea of why vendors won't work.

  The vendors directories are usually the best places to put this sort
  of stuff.
 
  -- John


--~--~-~--~~~---~--~~
 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: acl.php

2006-12-12 Thread Daniel Kvasnicka jr.

Try executing 'php-cgi' or 'php5-cgi' instead of php. That solved the
problem for me.

Dan

On Dec 6, 7:15 am, Falagar [EMAIL PROTECTED] wrote:
 Hi,

 I tried to use the ACL example from the manual and ran into problems. I
 have 1.1.11.4064 installed, the database connection is set up and I
 have successfully baked stuff with bake.php.

 When running php acl.php initdb -app blabla from /cake/scripts the
 following error occurs:

 Fatal error: Class 'Configure' not found in
 C:\www\xampp\htdocs\cake\cake\libs\m
 odel\datasources\dbo_source.php on line 84

 I added the following lines in acl.php in a futile attempt to fix it:

 require ('cake'.DS.'dispatcher.php');
 require ('cake'.DS.'libs'.DS.'configure.php');

 and the errors go away, however, now I get HTML code back telling me
 this (abridged):

 h1Missing Database Table/h1
 p class=errorNo Database table for model Aro (expected aros),
 create it first./p
 pspan class=noticestrongNotice:/strong If you want to
 customize this e
 rror message, create
 blabla\views/errors/missing_table.thtml./span/p

 I looked a little bit further into the script but got lost. The
 $command variable is set to 'initdb' correctly, but the switch
 statement is never reached. Nor is the line: if (ACL_CLASSNAME !=
 'DB_ACL'){.

 But isn't the whole point of initdb to create those tables in the
 database? Or am I just totally misunderstanding something? Any help is
 greatly appreciated.
 
 Mike


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



permanent scaffold

2006-12-12 Thread Alessandro Nuzzo

Hi all. I'm an italian web developer falling in love with cake ;)
Before starting write my project, I want to be sure that nobody has
already done.
I want to do something like rdBaker [1], but with an option that can
write all the code for the scaffolding.
So I have _all_ code written in view, and I can change only few things.
For example, if I want to change only an input field or change a
textarea in a checkbox, the other are still correct.

I trust in you :D (and I hope that you understand my idea.. and my bad english)

[1] http://rdbaker.rd11.org/bakes/index/

--~--~-~--~~~---~--~~
 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 - data array not updates after data inserting in database.

2006-12-12 Thread Webchemist

Hello all. I developed a project based on the CakePHP. But I am
confronted with problem:
 1) an action for updating databese records in a table exists
 2) for building view, get an ID from request, then do aDataArray =
model-findById(ID), pass the array into View. All ok.
 3) do some changes (new text etc.) - send POST data to the controller
action, then do
model-setId(ID)
model-update(DATA_FROM_POST)
4) in order to get changed record, do aDataArray = model-findById(ID)
again and pass the array into View.
And now we have the next:
 - in the database the record is changed
 - in aDataArray the OLD data are holded, in spite of the fact that
findById was called after update.
I am totally discouraged. 
Please help to solve!


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



Replication load balancing support?

2006-12-12 Thread DavidJ

Hello.
I'm not a CakePHP user (yet) :)
Q: My current site uses MySql master/slave replication for load
balancing.  So, all SQL queries from a particular web-server host go to
its corresponding MySQL slave host, but all SQL updates/inserts must go
to the MySQL Master host.

Does Cake PHP have support for that (or any snippets etc.)?  If not,
would it be easy to acheive transparently from the rest of the CakePHP
app? (or would it require sprinkling something through the code
all-over?)

Thanks,
-David.


--~--~-~--~~~---~--~~
 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: Replication load balancing support?

2006-12-12 Thread nate

Oops, that last 'beforeSave' should actually read 'afterDelete'.


--~--~-~--~~~---~--~~
 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: Replication load balancing support?

2006-12-12 Thread Mariano Iglesias

If that's not scalability, I don't know what is.

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!


--~--~-~--~~~---~--~~
 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: Share with CakePHP´s community

2006-12-12 Thread Mariano Iglesias

Hey Emiliano, what newspaper was it? Since it was Monday I'm assuming La
Nacion, am I right? Was this the article?

http://buscador.lanacion.com.ar/Nota.asp?nota_id=866485high=htmli
(non-spanish bakers: link in Spanish)

Felix  JQuery, what a work of evangelism ;)

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de emiliano
Enviado el: Lunes, 11 de Diciembre de 2006 06:04 p.m.
Para: Cake PHP
Asunto: Re: Share with CakePHP´s community

Felix, thanks for the reply. As I`m not a AJAX guy (almost neither a
PHP coder), I thought it could be a good thing to share what an
argentinian newspaper show today in their pages (not many bakers read
argentinian newspapers).

I will follow your advice and learn JQuery.

Emiliano


--~--~-~--~~~---~--~~
 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: Share with CakePHP´s community

2006-12-12 Thread emiliano

Mariano, that's the article!

On 12 dic, 20:31, Mariano Iglesias [EMAIL PROTECTED]
wrote:
 Hey Emiliano, what newspaper was it? Since it was Monday I'm assuming La
 Nacion, am I right? Was this the article?

 http://buscador.lanacion.com.ar/Nota.asp?nota_id=866485high=htmli
 (non-spanish bakers: link in Spanish)

 Felix  JQuery, what a work of evangelism ;)

 -MI

 ---

 Remember, smart coders answer ten questions for every question they ask.
 So be smart, be cool, and share your knowledge.

 BAKE ON!

 -Mensaje original-
 De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
 de emiliano
 Enviado el: Lunes, 11 de Diciembre de 2006 06:04 p.m.
 Para: Cake PHP
 Asunto: Re: Share with CakePHP´s community

 Felix, thanks for the reply. As I`m not a AJAX guy (almost neither a
 PHP coder), I thought it could be a good thing to share what an
 argentinian newspaper show today in their pages (not many bakers read
 argentinian newspapers).
 
 I will follow your advice and learn JQuery.
 
 Emiliano


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



a controller+model that is accessible from all controllers / models is a ...

2006-12-12 Thread pigeon

plugin ? component ? vendor library ?

In particular, i'd like to add a language api to my cake app. I need
methods like translate($alias, $langcode) to be accessible from
_anywhere_ in the application.

Where do I start?
All suggestions are greatly appreciated.

Thanks
andrew


--~--~-~--~~~---~--~~
 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: bake.php errors

2006-12-12 Thread j o e l

gwoo wrote:
 how about you try to debug the problem and submit a patch. Before you
 do that make sure you have the latest nightly download.
 [EMAIL PROTECTED]:~/Development/cake/dev/core/cake/scripts$ php
bake.php
Gwoo, I apologize, but I haven't used Cake in awhile, as I haven't done
much programming lately.  It seems like things have changed quite a
bit, since I last used it (around 1.1.2).  I found your screencast and
discovered how to correctly use the new bake.php script now, and it
works pefectly.

I am still experiencing some issues with Cake overall, however, and I
was wondering if someone could point me in the right direction?  I used
to use the alternate configuration, with the app, cake, and webroot in
separate folders.  I have successfully setup the latest version of Cake
(svn) utilizing this setup, as well as the development setup. Here's my
current setup...

CAKE SETUP: alternate
===
/home/joel/Development/cake/dev/apps/Test - /cake_install/app
/home/joel/Development/cake/dev/www/Test - /cake_install/app/webroot
/home/joel/Development/cake/dev/core - /cake_install/cake

index.php under /home/joel/Development/cake/www/Test is configured as
follows:
  define('ROOT',
DS.'home'.DS.'joel'.DS.'Development'.DS.'cake'.DS.'dev'.DS.'apps');
  define('APP_DIR', 'Test');
  define('CAKE_CORE_INCLUDE_PATH',
DS.'home'.DS.'joel'.DS.'Development'.DS.'cake'.DS.'dev'.DS.'core');

This setup displays the default home page with debug showing the
database file was found and cake successfully connected to the
database.  All of the CSS and images were missing until I read a thread
on this mailing list about uncommenting the BASE_URL definition in the
core.php file.  However, the mod_rewrite or the .htaccess files don't
seem to be working properly.  The only path which works after baking
now, looks like...

http://localhost/cake/dev/Test/index.php?/tables/

How can I get the pretty cake url's, ie
http://localhost/cake/dev/Test/tables/?

I've followed the steps in the install section of the manual, but I
don't have a real clear understanding of how it all works together.
FWIW, I have apache2 installed on Ubuntu 6.10.  The apache2 structure
is split up quite a bit:

[EMAIL PROTECTED]:/etc/apache2$ ls -a
. conf.d  magic   ports.conf
sites-enabled
..envvars mods-available  README   ssl
apache2.conf  httpd.conf  mods-enabledsites-available

httpd.conf is pretty much a blank file, while apache2.conf has the main
config in it.  I guess httpd.conf is to allow further configuration of
the apache2.conf file.  In the mods-available, I have rewrite.load, and
it is enabled in the mods-enabled directory.  In a thread on the Ubuntu
forums, I read where proxy.load must also be enabled in order for the
rewrite to work, and I have done that.  BTW, I added the LoadModule
line in the httpd.conf file as the install section in the CakePHP
manual states (just in case it was different), but I was given an
message that mod_rewrite was already loaded.  So, I assume the
apache2.conf file is parsed first, then the httpd.conf file is parsed
after.  So, the mod_rewrite is supposedly installed and loaded, but I'm
not sure given these results?

[EMAIL PROTECTED]:/etc/apache2$ apache2ctl -l
Compiled in modules:
  core.c
  mod_access.c
  mod_auth.c
  mod_log_config.c
  mod_logio.c
  mod_env.c
  mod_setenvif.c
  prefork.c
  http_core.c
  mod_mime.c
  mod_status.c
  mod_autoindex.c
  mod_negotiation.c
  mod_dir.c
  mod_alias.c
  mod_so.c

Also, can you add a DocumentRoot to your .htaccess, or must it be done
in the httpd.conf file?  If only in the httpd.conf file, can I have
more than one DocumentRoot like for each VirtualHost or something?

I apologize, I'm just not very experienced in all of this.  I
definitely am learning, though. :-)

Thanks in advance, gang!  I appreciate ya!

--joel


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



Helpers scope in Elements...

2006-12-12 Thread Seb

Hi everyone...

I've been pulling my hair out for the past 2 hours and I can't see
what's wrong; am I missing something... or am I trying to do the
impossible.. please... if you know... tell me!!

I use the Pagination helper, which works like a charm in any view. I
also use the html and the form helpers which also, you guessed it, work
like a cham in any view.

Now... there is this piece of html I'd like to move in an element. When
I do, the html and form helpers work like a charm still, whereas the
pagination doesn't.

I debugged it pretty deep only to find out what doesn't make it though
is the helper config...

am I going crazy??!

some code?

these, from within the view, work perfect;
?php echo $pagination-pageNumbers(); ?
?php echo $html-submit('Create');?

whereas from the element, this returns only the submit(Create) button.
?php echo $pagination-pageNumbers(); ?
?php echo $html-submit('Create');?

I call the element like this;
echo $this-renderElement('index' /*no parameters*/ ) );

Both of the helpers are defined in the app_controler.php

again.. am I going crazy?!!

Cheers for any input!

SEb.


--~--~-~--~~~---~--~~
 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: Can't edit my articles on the Bakery

2006-12-12 Thread Mariano Iglesias

Thanks gwoo, it works. My bad, I didn't know there was a place on trac for
the bakery. Will submit there from now on.

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de gwoo
Enviado el: Martes, 12 de Diciembre de 2006 11:03 p.m.
Para: Cake PHP
Asunto: Re: Can't edit my articles on the Bakery

ok, try now. The best place for these questions is on trac.
https://trac.cakephp.org is used to trac bugs in The Bakery. You can
search there for tickets and see if there is something related.


--~--~-~--~~~---~--~~
 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: Can't edit my articles on the Bakery

2006-12-12 Thread gwoo

Thanks Mariano.


--~--~-~--~~~---~--~~
 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: a controller+model that is accessible from all controllers / models is a ...

2006-12-12 Thread Mariano Iglesias
Take a look at this post:

 

http://groups.google.com/group/cake-php/browse_thread/thread/b78b0abbb0d7213
6/ddc05cce0b688f52?lnk=gst
http://groups.google.com/group/cake-php/browse_thread/thread/b78b0abbb0d721
36/ddc05cce0b688f52?lnk=gstq=rnum=20 q=rnum=20

 

-MI

 

---

 

Remember, smart coders answer ten questions for every question they ask. 

So be smart, be cool, and share your knowledge. 

 

BAKE ON!

 

 

-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de pigeon
Enviado el: Miércoles, 13 de Diciembre de 2006 12:25 a.m.
Para: Cake PHP
Asunto: a controller+model that is accessible from all controllers / models
is a ...

 

 

plugin ? component ? vendor library ?

 

In particular, i'd like to add a language api to my cake app. I need

methods like translate($alias, $langcode) to be accessible from

_anywhere_ in the application.

 

Where do I start?

All suggestions are greatly appreciated.



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