Re: Select para categorias
Por acaso você colocou a as relações entre os modelos Post e Categoria? post hasOne categoria e categoria hasMany posts outra coisa, veja que é $this-Categoria e não $this-$Catetoria. Veja ai e fala para agente. Abraço, Benito 2008/2/8 Bruno Trazzini [EMAIL PROTECTED]: Obrigado pela ajuda, mas isso eu devo colocar dentro do controlador Post certo? Dai a mensagem de erro foi *Undefined property: PostsController::$Categoria* Josenivaldo Benito Junior escreveu: olá, supondo que o seu modelo chama-se Category basta, no controler fazer: $categories = $this-Category-findAll('list'); ... $this-set(compact('categories')); O próprio bake gera dessa forma. Perdoe qualquer erro de sintaxe. Abraço, Benito. 2008/2/7 etapombas [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]: Galera estou com uma dúvida de iniciante. Eu preciso criar um select com todas categorias, pois na hora cadastrar um 'post' (exemplo) eu preciso informar para qual categoria este post pertence. Obrigado ;) --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
Re: Select para categorias
Obrigado pela ajuda, mas isso eu devo colocar dentro do controlador Post certo? Dai a mensagem de erro foi *Undefined property: PostsController::$Categoria* Josenivaldo Benito Junior escreveu: olá, supondo que o seu modelo chama-se Category basta, no controler fazer: $categories = $this-Category-findAll('list'); ... $this-set(compact('categories')); O próprio bake gera dessa forma. Perdoe qualquer erro de sintaxe. Abraço, Benito. 2008/2/7 etapombas [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]: Galera estou com uma dúvida de iniciante. Eu preciso criar um select com todas categorias, pois na hora cadastrar um 'post' (exemplo) eu preciso informar para qual categoria este post pertence. Obrigado ;) --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
Re: Select para categorias
olá, supondo que o seu modelo chama-se Category basta, no controler fazer: $categories = $this-Category-findAll('list'); ... $this-set(compact('categories')); O próprio bake gera dessa forma. Perdoe qualquer erro de sintaxe. Abraço, Benito. 2008/2/7 etapombas [EMAIL PROTECTED]: Galera estou com uma dúvida de iniciante. Eu preciso criar um select com todas categorias, pois na hora cadastrar um 'post' (exemplo) eu preciso informar para qual categoria este post pertence. Obrigado ;) --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
Re: Select para categorias
corrigindo: Query:* SELECT `Post`.`id`, `Post`.`categoria_id`, `Post`.`titulo`, `Categoria`.`id`, `Categoria`.`titulo` FROM `posts` AS `Post` LEFT JOIN `categorias` AS `Categoria` ON (`Categoria`.`post_id` = `Post`.`id`) WHERE 1 = 1 --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
Re: Select para categorias
Poxa cara fiz os relacionamentos mas esta dando erro: * Query:* SELECT `Post`.`id`, `Post`.`categoria_id`, `Post`.`titulo`, `Categoria`.`id`, `Categoria`.`titulo` FROM `posts` AS `Post` LEFT JOIN `categorias` AS `Categoria` ON (`Categoria`.`entrada_id` = `Post`.`id`) WHERE 1 = 1 *Warning*: *SQL Error:* 1054: Unknown column 'Categoria.post_id' in 'on clause' in */home/bru/Sites/cake/cake/libs/model/datasources/dbo_source.php* on line *440* TABELAS: categorias id int titulo varchar posts id titulo categoria_id MODELOS: post model var $hasOne = 'Categoria'; categoria model var $hasMany = 'Entrada';** --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
Re: Select para categorias
Bruno, Perai! Deixa eu entender. 1) Um post pertence a uma categoria certo? ou 2) Um post pertece a várias categorias? (um post pode estar em duas categorias ao mesmo tempo) Assumindo o caso 1 acima: A tabela (modelo) post deveria conter um campo chamado categoria_id. Na tabela categoria não precisa referenciar post mas, deve possuir uma chave primária chamada id. No modelo post você fará uma relação hasOne para categoria e no modelo categoria fará uma relação hasMany com post. Até aqui, seus modelos parecem ok. Mas veja o SQL, ele pesquisa por Categoria.post_id = [...]. Deveria ser Categoria.id = Post.categoria_id. Se o cake montou esse SQL sozinho, reveja suas declarações hasOne e hasMany pois o campo post_id não existe na tabela Categoria (e nem deve existir). Abraço, Benito. On Feb 8, 2008 7:20 PM, Bruno Trazzini [EMAIL PROTECTED] wrote: Poxa cara fiz os relacionamentos mas esta dando erro: * Query:* SELECT `Post`.`id`, `Post`.`categoria_id`, `Post`.`titulo`, `Categoria`.`id`, `Categoria`.`titulo` FROM `posts` AS `Post` LEFT JOIN `categorias` AS `Categoria` ON (`Categoria`.`entrada_id` = `Post`.`id`) WHERE 1 = 1 *Warning*: *SQL Error:* 1054: Unknown column 'Categoria.post_id' in 'on clause' in */home/bru/Sites/cake/cake/libs/model/datasources/dbo_source.php* on line *440* TABELAS: categorias id int titulo varchar posts id titulo categoria_id MODELOS: post model var $hasOne = 'Categoria'; categoria model var $hasMany = 'Entrada';** --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
Problema com views
Olá rapazeada (e moças também, embora ainda não tenha visto nenhuma). É o seguinte: continuo apanhando do Cake 1.2. Gerei pelo bake uma aplicação de teste com 3 tabelas no bd e usando chaves estrangeiras. foram criados os models, controllers e views (edit, delete etc). Ocorre que quando vou acessar as views, recebo a seguinte mensagem de erro: Fatal error: Cannot redeclare class ErrorHandler in C:\xampp\xampp\htdocs\cake_1.2\cake\console\error.php on line /256. A/lguém pode dar uma luz? Sou grato. -- Haroldo Barbosa Designer Gráfico e Desenvolvedor Web (85) 86164953 --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
Um core para várias apps
Bom gente eu queria saber como eu faço pra usar um mesma core do cake com várias apps, será que alguem sabe me dizer como fazer isso... --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
Re: Um core para várias apps
Crie cópias da sua pasta /app e renomeie para o nome da aplicação que precisar...pode ter quantas precisar. Bom gente eu queria saber como eu faço pra usar um mesma core do cake com várias apps, será que alguem sabe me dizer como fazer isso... --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
Re: Um core para várias apps
Eu fiz isso e mais algumas coisas. Ao invés da pasta apps (e suas cópias) ficarem dentro da pasta cake (core) fiz uma estrutura assim: / |--/app1 |--/app2 |--/cake_core Ai, claro, fiz ajustes em cada app para apontar corretamente para o core. Pra que isso? No meu servidor, o diretório app1 é um domínio (ex: www.xyz.com.br) e o diretório app2 é outro domínio (ex: www.wyk.com.br). Assim, cada um dos dois domínios têm, imediatamente, as suas raízes como sendo a aplicação e não me preocupo com roteamentos no core. Particularmente acho a organização de diretórios e a formação de URLs no cake uma característica fantástica! Abraço, Benito. 2008/2/8 Bill [EMAIL PROTECTED]: Crie cópias da sua pasta /app e renomeie para o nome da aplicação que precisar...pode ter quantas precisar. Bom gente eu queria saber como eu faço pra usar um mesma core do cake com várias apps, será que alguem sabe me dizer como fazer isso... --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
Re: Um core para várias apps
Benito, Se você tem em um servidor isso, cuidado. É recomendado que você não torne a pasta inteira da aplicação pública, ou seja, não coloque a pasta app dentro da public_html, www ou htdocs (dependendo do servidor). É recomendado que você coloque apenas a pasta app/webroot na parte pública. O restante deve ficar numa parte não pública. Você conferir melhor em http://tempdocs.cakephp.org/#TOC26557 (manual oficial em inglês) ou http://manual.cakephp.com.br/doku.php?id=install#producao (manual traduzido aqui pelo pessoal do groups). Se ficar meio complicado fazer como especificado, configura a próxima seção (Instalação avançada). Tobias: Os mesmos links valem pra você. Juan Basso On 8 fev, 21:33, Josenivaldo Benito Junior [EMAIL PROTECTED] wrote: Eu fiz isso e mais algumas coisas. Ao invés da pasta apps (e suas cópias) ficarem dentro da pasta cake (core) fiz uma estrutura assim: / |--/app1 |--/app2 |--/cake_core Ai, claro, fiz ajustes em cada app para apontar corretamente para o core. Pra que isso? No meu servidor, o diretório app1 é um domínio (ex:www.xyz.com.br) e o diretório app2 é outro domínio (ex:www.wyk.com.br). Assim, cada um dos dois domínios têm, imediatamente, as suas raízes como sendo a aplicação e não me preocupo com roteamentos no core. Particularmente acho a organização de diretórios e a formação de URLs no cake uma característica fantástica! Abraço, Benito. 2008/2/8 Bill [EMAIL PROTECTED]: Crie cópias da sua pasta /app e renomeie para o nome da aplicação que precisar...pode ter quantas precisar. Bom gente eu queria saber como eu faço pra usar um mesma core do cake com várias apps, será que alguem sabe me dizer como fazer isso...- Ocultar texto entre aspas - - Mostrar texto entre aspas - --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
Re: Um core para várias apps
Oi Juan, Grato pela dica. Não tinha atendado para este fato. Valeus! Abraços, Benito 2008/2/8 Juan Basso [EMAIL PROTECTED]: Benito, Se você tem em um servidor isso, cuidado. É recomendado que você não torne a pasta inteira da aplicação pública, ou seja, não coloque a pasta app dentro da public_html, www ou htdocs (dependendo do servidor). É recomendado que você coloque apenas a pasta app/webroot na parte pública. O restante deve ficar numa parte não pública. Você conferir melhor em http://tempdocs.cakephp.org/#TOC26557 (manual oficial em inglês) ou http://manual.cakephp.com.br/doku.php?id=install#producao (manual traduzido aqui pelo pessoal do groups). Se ficar meio complicado fazer como especificado, configura a próxima seção (Instalação avançada). Tobias: Os mesmos links valem pra você. Juan Basso On 8 fev, 21:33, Josenivaldo Benito Junior [EMAIL PROTECTED] wrote: Eu fiz isso e mais algumas coisas. Ao invés da pasta apps (e suas cópias) ficarem dentro da pasta cake (core) fiz uma estrutura assim: / |--/app1 |--/app2 |--/cake_core Ai, claro, fiz ajustes em cada app para apontar corretamente para o core. Pra que isso? No meu servidor, o diretório app1 é um domínio (ex: www.xyz.com.br) e o diretório app2 é outro domínio (ex:www.wyk.com.br). Assim, cada um dos dois domínios têm, imediatamente, as suas raízes como sendo a aplicação e não me preocupo com roteamentos no core. Particularmente acho a organização de diretórios e a formação de URLs no cake uma característica fantástica! Abraço, Benito. 2008/2/8 Bill [EMAIL PROTECTED]: Crie cópias da sua pasta /app e renomeie para o nome da aplicação que precisar...pode ter quantas precisar. Bom gente eu queria saber como eu faço pra usar um mesma core do cake com várias apps, será que alguem sabe me dizer como fazer isso...- Ocultar texto entre aspas - - Mostrar texto entre aspas - --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
i18n __('again')
Olá turma, Vocês já notaram que os forms gerados pelo cake e seu formhelper são internacionalizáveis. Porém, é só comigo ou o botão submit é único que não compartilha dessa capacidade? Um: $form-end('Submit'); ou: $form-submit('Submit'); Ao passar pelo bake extract não geram strings para tradução. Porém um $form-input('qualquer coisa'); gera string. Isso é bug ou é feature? Abraço, Benito --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
Re: Select para categorias
Caras consegui resolver meu problema. Josenivaldo, um post pertence a uma categoria. Fiz assim e deu certo: Categoria Model var $hasOne = array('Post'); var $displayField = 'titulo'; Post Model var $name = 'Post'; var $belongsTo = 'Categoria'; var $validate = array('valor' = VALID_NUMBER); Tobias, eu estou usando a versão 1.1.x mas mesmo assim consegui Ficou desta forma: Post Controller $this - set('categorias', $this - Post - Categoria - generateList(null, 'titulo ASC')); Post View ?=$html-selectTag('Post/categoria_id', $categorias); ? Notem que existe uma validação no modelo do post. Quando o campo esta em um formato inválido a variável $categorias do controlador perde o valor =/ Por que será que gera esse conflito? --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
Re: Um core para várias apps
Pronto, já mudei! Agora ficou assim: /home/benito --- no servidor de produção | |---cake_core |---app1 |---webroot -dominio xyz |---app2 |---webroot -domino wkz Valeu Juan Abraço, Benito 2008/2/9 Josenivaldo Benito Junior [EMAIL PROTECTED]: Oi Juan, Grato pela dica. Não tinha atendado para este fato. Valeus! Abraços, Benito 2008/2/8 Juan Basso [EMAIL PROTECTED]: Benito, Se você tem em um servidor isso, cuidado. É recomendado que você não torne a pasta inteira da aplicação pública, ou seja, não coloque a pasta app dentro da public_html, www ou htdocs (dependendo do servidor). É recomendado que você coloque apenas a pasta app/webroot na parte pública. O restante deve ficar numa parte não pública. Você conferir melhor em http://tempdocs.cakephp.org/#TOC26557 (manual oficial em inglês) ou http://manual.cakephp.com.br/doku.php?id=install#producao (manual traduzido aqui pelo pessoal do groups). Se ficar meio complicado fazer como especificado, configura a próxima seção (Instalação avançada). Tobias: Os mesmos links valem pra você. Juan Basso On 8 fev, 21:33, Josenivaldo Benito Junior [EMAIL PROTECTED] wrote: Eu fiz isso e mais algumas coisas. Ao invés da pasta apps (e suas cópias) ficarem dentro da pasta cake (core) fiz uma estrutura assim: / |--/app1 |--/app2 |--/cake_core Ai, claro, fiz ajustes em cada app para apontar corretamente para o core. Pra que isso? No meu servidor, o diretório app1 é um domínio (ex: www.xyz.com.br) e o diretório app2 é outro domínio (ex:www.wyk.com.br). Assim, cada um dos dois domínios têm, imediatamente, as suas raízes como sendo a aplicação e não me preocupo com roteamentos no core. Particularmente acho a organização de diretórios e a formação de URLs no cake uma característica fantástica! Abraço, Benito. 2008/2/8 Bill [EMAIL PROTECTED]: Crie cópias da sua pasta /app e renomeie para o nome da aplicação que precisar...pode ter quantas precisar. Bom gente eu queria saber como eu faço pra usar um mesma core do cake com várias apps, será que alguem sabe me dizer como fazer isso...- Ocultar texto entre aspas - - Mostrar texto entre aspas - --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
Component Autocomplete + Pagination
Galera eu estava usando o component pagination e tudo funcionava bunitinhu, dai resolvi testar o componente autocomplete e também tive sucesso com ele. Mas ao usar os dois no mesmo controller o pagination para de funcionar. Gostaria de saber se é possivel chama-los individualmente em cada funçao do controllador. Exemplo: Na funcão listar eu uso o pagination, e na função editar eu uso apenas o autocomplete Será que é possivel ? --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
Re: Um core para várias apps
Eu faço assim na locaweb: Lá eu não posso alterar o local da pasta publica e para cada novo dominio incluso, é criado uma pasta com o nome do dominio na mesma pasta publica(tosco). Algo como. / |--public_html | |-- site1 |-- site2 Então, no root, eu criei um diretório para armazenar os aplicativos, um para cada novo site. / |--apps | | | |--cake | |--app_xyz | |--app_xyz | |--public_html | | | |--dominio_abc | | | | | |-arquivos do diretório webroot | | | |-- dominio_xyz | |-arquivos do diretório webroot Antes eu tinha separado 2 versões do cake. Porem agora só estou trabalhando com a versão 1.2. On 9 fev, 00:12, Josenivaldo Benito Junior [EMAIL PROTECTED] wrote: Pronto, já mudei! Agora ficou assim: /home/benito --- no servidor de produção | |---cake_core |---app1 |---webroot -dominio xyz |---app2 |---webroot -domino wkz Valeu Juan Abraço, Benito 2008/2/9 Josenivaldo Benito Junior [EMAIL PROTECTED]: Oi Juan, Grato pela dica. Não tinha atendado para este fato. Valeus! Abraços, Benito 2008/2/8 Juan Basso [EMAIL PROTECTED]: Benito, Se você tem em um servidor isso, cuidado. É recomendado que você não torne a pasta inteira da aplicação pública, ou seja, não coloque a pasta app dentro da public_html, www ou htdocs (dependendo do servidor). É recomendado que você coloque apenas a pasta app/webroot na parte pública. O restante deve ficar numa parte não pública. Você conferir melhor emhttp://tempdocs.cakephp.org/#TOC26557(manual oficial em inglês) ou http://manual.cakephp.com.br/doku.php?id=install#producao (manual traduzido aqui pelo pessoal do groups). Se ficar meio complicado fazer como especificado, configura a próxima seção (Instalação avançada). Tobias: Os mesmos links valem pra você. Juan Basso On 8 fev, 21:33, Josenivaldo Benito Junior [EMAIL PROTECTED] wrote: Eu fiz isso e mais algumas coisas. Ao invés da pasta apps (e suas cópias) ficarem dentro da pasta cake (core) fiz uma estrutura assim: / |--/app1 |--/app2 |--/cake_core Ai, claro, fiz ajustes em cada app para apontar corretamente para o core. Pra que isso? No meu servidor, o diretório app1 é um domínio (ex: www.xyz.com.br) e o diretório app2 é outro domínio (ex:www.wyk.com.br). Assim, cada um dos dois domínios têm, imediatamente, as suas raízes como sendo a aplicação e não me preocupo com roteamentos no core. Particularmente acho a organização de diretórios e a formação de URLs no cake uma característica fantástica! Abraço, Benito. 2008/2/8 Bill [EMAIL PROTECTED]: Crie cópias da sua pasta /app e renomeie para o nome da aplicação que precisar...pode ter quantas precisar. Bom gente eu queria saber como eu faço pra usar um mesma core do cake com várias apps, será que alguem sabe me dizer como fazer isso...- Ocultar texto entre aspas - - Mostrar texto entre aspas - --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
running cakephp web application in Apache with php4
Hello to everybody, I'm new to cakephp (as many people are!) so the solution to my problem might be as simple as it gets, but I can't find a way out of it! Anyway here is the problem.. On my local machine I run Apache2 + php5 (Debian linux if this matters at all). Also cakephp version is 1.1.xxx I finally managed to finish my website and tried to upload it to the server that hosts the site. The server runs Apache2 and php4, and the site is virtually hosted. When I started testing the site online, I came up with lots of freaking errors such as Missing Database Table in the frontpage. Also I had to deal with some errors about the Javascript helper. Cakephp complains that $javascript is undefined variable and also Call to a member function link() on a non-object, though when I call $javascript-link('myscript.js') (inside my /views/ layouts/default.thtml), it outputs it correctly to the browser. About the Missing Database Table error, I'm pretty sure I have the table in my database. The /app/config/database.php is properly configured (Tested lots of time..) Also in /app/app_controller.php I have defined the $helpers variable to include the 'Javascript' helper (along with some others) My frontpage basicaly has two(2) requestActions (pretty simple with no wierd actions) and nothing more.(inside the /app/views/pages/ home.thtml) Before this post, I want to say that my app was tested in two other machines, one using php4 and the other php5. The problems only arise when dealing with php4. I hope I was pretty clear on the problem I'm facing. Plz help! I'm dead if the site doesn't come up by Monday! Regards Christos PS. If additional information is needed plz tell me to send. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
loadModel() does not work..
Hello All, I have try to test my modules but when it come to loadModel(...) it gives error that Fatal error: Class 'Object' not found in C:\xampp\htdocs\sch\cake\libs \model\datasources\datasource.php on line 37 my testing location is C:\xampp\htdocs\sch\app\tests\app\cases\models Could any body help me for this. Regards, --~--~-~--~~~---~--~~ 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 benchmarking
Hello guys, i am truly sure that cake is my choice when it comes to choose a framework from the bunch of frameworks available out there but i really need to see some benchmarks in order to convince my managers that cake is really for it and it would be our best choice, is there any benchmarks reports available, i would be thankful for any links being posted here or pointed anywhere else. Regards, Ma'moon --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Session warning!
I have problem with cakePHP sessions on localhost! Configure::write('Session.start', true); but when i use view session by this code: print_r($_SESSION) receive : Array( ) after i start session manually by that: session_start(); Session work normal and i can read and write objects, but i see that message in the header: Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent I see that i can't send header info after cakePHP sent it. But how I can to use session in this case. Very strange because session autostart enabled. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
So How do we handle multi-record/model forms?
This is a recurrent topic and there aren't full valid solutions/ tutorials to the problem right now with cake. --~--~-~--~~~---~--~~ 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: Validate one or two fields?
You can set different set of rules on your model: Class MultivalidateModel extends AppModel { var $name = 'Multivalidate'; var $validationSets = array( 'default' = ... default rules, 'state1' = ... full validate array1, 'state2' = ... full validate array2, ); var $currentRuleSet = 'default'; function validates ($data =array()) { $this-validate = $this-$validationSets[$this-currentRuleSet]; parent::validates($data); } } } Also this can be put on a behavior. On Feb 7, 2008 2:25 PM, Siebren Bakker [EMAIL PROTECTED] wrote: I don't actually need to compare the information with that from the database, I just need to validate the data in the fields, preferably using the $validate array present in my User Model, in order to make sure that it is valid data for those fields, without having to add validation data to the controller On Feb 6, 2008 10:18 PM, Rgarg [EMAIL PROTECTED] wrote: do you want to cum pair user written data with database?? -- In the name of Life, Liberty, and the pursuit of my sanity. Siebren Bakker(Aevum Decessus) -BEGIN GEEK CODE BLOCK- Version: 3.12 GCS d- s+: a19 C UL++ P L++ !E W++ N(-) o? K? w(+) O? M-- V? PS+ PE Y- PGP- t+ 5? X- R tv-- b++ Di D+ G+ e h! r y- --END GEEK CODE BLOCK-- --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
DEFAULT_LANGUAGE Questions
Greetings all, I seem to be running into an issue regarding the definition of the DEFAULT_LANGUAGE constant in my application bootstrap.php. I am simply pulling out out top level domain (us, uk, de, etc...) and trying to set the application default language accordingly. EX: 1.2beta, /app/config/bootstrap.php: //Pull out the top level domain from the HTTP_HOST Constant $TLD = substr( env(HTTP_HOST), strrpos(env(HTTP_HOST), .)+1); // define the default language for our available TLD's if($TLD == 'com'){ $default_language = 'eng'; }elseif ($TLD == 'us'){ $default_language = 'eng'; }elseif ($TLD == 'de'){ $default_language = 'deu'; }elseif ($TLD == 'ch'){ $default_language = 'deu'; } //Define the default language constant according to the results define('DEFAULT_LANGUAGE', $default_language); It seems that now DEFAULT_LANGUAGE must be the ISO 639-3 language code(deu, eng, standing contrary to the p28n tutorial found in the bakery), that's fine, but unfortunately it seems no matter what the DEFAULT_LANGUAGE constant is set to, __autoLanguage() grabs the HTTP_ACCEPT_LANGUAGE env variable, and writes it to Config.language instead of DEFAULT_LANGUAGE. Am I missing something here? Poking through l10n.php, it seems that DEFAULT_LANGUAGE is actually a fallback in the event __autoLanguage() cant find anything. Is that true? Can I not somehow bypass the user having the default language based on their browser? Thanks in advance. --~--~-~--~~~---~--~~ 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 benchmarking
You could setup xdebug or Zend and profile your sitebut benchmarking is such a subjective thing. It relies a lot on your server setup, etc. What you could do is say build your own blog - and load it up with the same articles as say an installation of Wordpress or something. Then profile both. See the difference. BUT that's only going to get you so far. Your specific machine's PHP.ini, and other settings AND cpu speed/ram is different from the host you'll be on (most likely)...AND you're testing locally - not through the internet. Now. A more accurate test would be to run the same test on the host you'll be at...but can you get xdebug or something like that setup on your host? Also, you've just gone through a bunch of time to find out if you can build an application faster than Wordpress or Drupal or Joomla! or whatever. My bet, you did build one faster...because all those systems load extra things you probably don't have when you build a custom solution. These CMS' out there try to cover all the bases best they can. That means a lot of overhead. A custom solution is -usually- going to be faster. Plus it's super hard to test for this anyway given all the variables. Just know that CakePHP has some really great scalability and performance options with many different ways to cache data, VERY good control over your queries, and along with the design pattern and such it's really efficient for OO PHP...you just have to be sure you're writing efficient code... ie. be aware of your findAll's and what you're bringing back...do you need it all? Be aware of your custom functions and special operations that you're using, etc. In my opinion - Cake's the best thing since sliced bread for web apps. On Feb 8, 9:20 am, MattC [EMAIL PROTECTED] wrote: Regarding Zoe's comment about Cake checking the db columns every time you retrieve data, that only happens when debug is on. Otherwise the table schema is cached. In general you should look into Cake's built in caching which can negate a lot of the framework overhead. Here is quick test I did to benchmark the improvement with cache turned on:http://www.pseudocoder.com/archives/2007/02/27/cakephp-cache-performa... That was almost a year ago and used Cake 1.1 with file based caching. -Mattwww.pseudocoder.com On Feb 8, 6:26 am, Ma'moon [EMAIL PROTECTED] wrote: Hello guys, i am truly sure that cake is my choice when it comes to choose a framework from the bunch of frameworks available out there but i really need to see some benchmarks in order to convince my managers that cake is really for it and it would be our best choice, is there any benchmarks reports available, i would be thankful for any links being posted here or pointed anywhere else. Regards, Ma'moon --~--~-~--~~~---~--~~ 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 benchmarking
CakePHP shines when developing *web applications*. IMO, there are much better tools out there that do *sites* and do them well. However, anytime you need to add something customized, that's where CakePHP comes in. Also keep in mind that there's an entire slue of caching that it does. However, I'd have to agree with MG. Development time is where it's at. On Feb 8, 2008 7:28 AM, MonkeyGirl [EMAIL PROTECTED] wrote: Hi! To be honest, rendering pages quickly is not the advantage of CakePHP. Any site you've made by hand is inherently going to be faster than one that's having to check, say, what columns are in the database's tables each time you pull something out of them. The reason it's still very much worth using CakePHP despite this slowing down of a site, is that it *really* increases the speed of actually typing in the code to make it. If people are more expensive than computers at your company, then this is why they should consider using it - being able to make sites quicker than they could make them before, even if the individual pages render a little bit slower. You can even buy a faster server instead of hiring several more people to do the grunt work of making the new sites, because the computer now does that for you. :) This is all comparing CakePHP to no framework at all, mind. All that I've said is probably true of all frameworks, though. Hope that helps, Zoe. --~--~-~--~~~---~--~~ 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 authentication example...login redirects
also, in regards to the second error, make sure in your model-validate array, that you have apostrophes around the words 'VALID_NOT_EMPTY', which should clear out that error. On Feb 8, 2008 7:15 AM, MonkeyGirl [EMAIL PROTECTED] wrote: The code i have creates my user and puts it into the database just fine..but after that, nothing happens... no flash, no redirect. Have you made a login() function in /app/controllers/ users_controller.php? It looks like you've got the creation of new users sorted, but you now need to let them log in, which is really a separate process. You need to get the login method working next, then you can worry about making it happen automatically once someone's signed up. This is something I want to explain in my guide soon, but for now try looking into $this-Session in the controller. That's what you can use to store the information about the user who's logging in, so it remembers them as they move around the site. Hope that helps, Zoe. -- In the name of Life, Liberty, and the pursuit of my sanity. Siebren Bakker(Aevum Decessus) -BEGIN GEEK CODE BLOCK- Version: 3.12 GCS d- s+: a19 C UL++ P L++ !E W++ N(-) o? K? w(+) O? M-- V? PS+ PE Y- PGP- t+ 5? X- R tv-- b++ Di D+ G+ e h! r y- --END GEEK CODE BLOCK-- --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
error404.thtml not rendered
Hi there, my error404.thtml doesn't get rendered in my app. It is located in views/errors/ and contains only: code h1?php echo $name; ?/h1 p?php echo $message; ?/p /code The default layout is beeing rendered, but output stops right before the first print $javascript-link() call. On other pages, this call (and layout) works fine. Could anybody point me into the right direction, please? Bassy regards, Benjamin --~--~-~--~~~---~--~~ 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 guide
Why do we keep comparing to Zend? They got an entire team on doc. alone. The think that our only problem here lies with 1.2. IMO, the current 1.1manual is fine for me (maybe have one complete doc, so you don't have to keep clicking through chapters). The only thing we need right now is to get the 1.2 functionality up to that level. But the only thing I would blatantly plagiarize from Zend is the list of examples at the bottom. On Feb 8, 2008 11:08 AM, Mech7 [EMAIL PROTECTED] wrote: Hmmm yes all these blogs scattered everywhere really doesn't help anybody... I hope one day cake will have a manual to the standards of ZendFW.. http://framework.zend.com/manual/en/ It's easy to read and has lots of example code... for every part of the framework. --~--~-~--~~~---~--~~ 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 guide
Hmmm yes all these blogs scattered everywhere really doesn't help anybody... I hope one day cake will have a manual to the standards of ZendFW.. http://framework.zend.com/manual/en/ It's easy to read and has lots of example code... for every part of the framework. --~--~-~--~~~---~--~~ 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 data only appears when in debug mode
Try deleting the /tmp folder contents -- Pablo Viojo [EMAIL PROTECTED] http://pviojo.net On Fri, Feb 8, 2008 at 11:50 AM, glastoveteran [EMAIL PROTECTED] wrote: Hi all, I'm sure I'm doing something obviously wrong but I have several instances where particular fields from a model are only being displayed when I am in debug mode. When I switch to production mode it is as if the value doesn't exist in the model. e.g. in my view I have: ?=$product['Product']['full_description'];? The output is as expected in debug mode but empty in production mode. I thought it may be something to do cacheing - an area I haven't fully explored yet - but to my knowledge I am not using cacheing and CACHE_CHECK is set to false. Any ideas what I'm doing wrong?! Thanks, Alex --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Install CakePhp in Linux with Plesk 8.3
Hi CakePhp Group, i am trying to install an application I have made with CakePhp and locally it's working fine, but when I try to upload it to the server it's not working. I think the server is not properly configured, i mean it doesn't not have persmissions to users to load .htaccess files and alsdo doesn't have enabled the mod_rewrite module. Since the server is a Debian with Plesk 8.3, it is working a little bit different than a normal linux server. So for any particular configuration Plesk needs to be configured in additional files http.include and vhost.conf which are located for each domain in /var/www/vhosts/domain/conf. Do you have any idea on how do I need to configure these files so that ckaephp should work properly? Thanks in advance. Best regards. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Switching useDbConfig variable
I'm running the same cake app on two different servers, development and production. I want to change the database config that's used depending on the server. I've got the following set up now. /config/database.php class DATABASE_CONFIG { var $development = array( 'driver' = 'mysql', 'persistent' = false, 'host' = 'localhost', 'port' = '', 'login' = 'admin', 'password' = 'password', 'database' = 'db', 'schema' = '', 'prefix' = '', 'encoding' = '' ); var $production = array( 'driver' = 'mysql', 'persistent' = false, 'host' = 'localhost', 'port' = '', 'login' = 'user_admin', 'password' = 'password', 'database' = 'user_db', 'schema' = '', 'prefix' = '', 'encoding' = '' ); } /models/table.php class Table extends AppModel { var $name = 'Table'; function beforeFind() { if(is_dir('D:\webserver\private_html\site')) { $this-useDbConfig = 'development'; } elseif(is_dir(DS.'home'.DS.'user'.DS.'public_html')) { $this-useDbConfig = 'production'; } } } It just keeps trying to use the 'default' config. I've also tested my logic by just putting $this-useDbConfig = 'development'; directly under the beforeFind() function, but it still does nothing. Do I need to put this somewhere else? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Translation to specified language?
Hi! This is the first time I use i18n and l10n in a project. I'm trying to find out how to translate a string to multiple languages, or another language than the actually selected. The case in which I want to use this is a list of languages, in which every language-name is translated into it's own language. Here is what I thought it might work: http://bin.cakephp.org/view/1291705152 But it doesn't. Thats what I wanna do: I want to translate the following array (like L10n::catalog) $lang = array('en' = 'English', 'de' = 'German', 'fr' = 'French', 'es' = 'Spanish'); to $lang = array('en' = 'English', 'de' = 'Deutsch', 'fr' = 'Français', 'es' ='Español'); What do I have to do to get this translation working? Regards, Flo --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Resource Needed: Zend Debugger or Eclipse Debugger for CakePhp
I try to use the Zend and/or Eclipse PHP Debugger to debuge the CakePhp. I just don't know how to debug my controller files. I setup a breakpoint in my controller.php. Then, I run the debugger. But, it just doesn't stop at the breakpoint that I want. I am totally a newbie. I know you guys must have a way to set it up. I wonder if there is any magic setup that I need to do. --~--~-~--~~~---~--~~ 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 guide
I quite like the system in php.net - you've got the official docs pages, then a list of user-submitted relevant comments underneath. I often find what I'm looking for in the user comments. If these could be moderated and other users could vote on them, it might make for a fine system to add to the cakephp docs. On Feb 8, 5:19 pm, Baz [EMAIL PROTECTED] wrote: Why do we keep comparing to Zend? They got an entire team on doc. alone. The think that our only problem here lies with 1.2. IMO, the current 1.1manual is fine for me (maybe have one complete doc, so you don't have to keep clicking through chapters). The only thing we need right now is to get the 1.2 functionality up to that level. But the only thing I would blatantly plagiarize from Zend is the list of examples at the bottom. On Feb 8, 2008 11:08 AM, Mech7 [EMAIL PROTECTED] wrote: Hmmm yes all these blogs scattered everywhere really doesn't help anybody... I hope one day cake will have a manual to the standards of ZendFW..http://framework.zend.com/manual/en/ It's easy to read and has lots of example code... for every part of the framework. --~--~-~--~~~---~--~~ 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 benchmarking
Now that's what I would have to disagree with. Who really cares if CI pulls up the static page faster than Cake? I don't see the point in testing something that your application isn't going to be reflecting. Heck, we might as well slap on a .HTML file than benchmark that too. I think you'd need to design the same basic application across all your platforms and test that. Also, by definition, benchmarking requires some sort of comparison. Hence the multiple platforms. On Feb 8, 2008 11:00 AM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: There are a bunch of performance comparisons out there. Most may not me very relevant in a real world project but if you need numbers here are a few: http://paul-m-jones.com/blog/?p=236 http://www.sellersrank.com/php/cakephp-codeigniter-benchmark/ Note: These try to test the most basic setup. On Feb 8, 5:04 pm, Tom.Maiaroto [EMAIL PROTECTED] wrote: ..oh and compared to other frameworks ?? you could try and build the same app over and over and profile them all...but again it's gonna be hard and I would bet you'd get very similar results anyway. UNLESS you have some super huge monster of an app. That would be interesting to see. Like others said, your development time is the most precious thing that Cake can help you with. On Feb 8, 11:02 am, Tom.Maiaroto [EMAIL PROTECTED] wrote: You could setup xdebug or Zend and profile your sitebut benchmarking is such a subjective thing. It relies a lot on your server setup, etc. What you could do is say build your own blog - and load it up with the same articles as say an installation of Wordpress or something. Then profile both. See the difference. BUT that's only going to get you so far. Your specific machine's PHP.ini, and other settings AND cpu speed/ram is different from the host you'll be on (most likely)...AND you're testing locally - not through the internet. Now. A more accurate test would be to run the same test on the host you'll be at...but can you get xdebug or something like that setup on your host? Also, you've just gone through a bunch of time to find out if you can build an application faster than Wordpress or Drupal or Joomla! or whatever. My bet, you did build one faster...because all those systems load extra things you probably don't have when you build a custom solution. These CMS' out there try to cover all the bases best they can. That means a lot of overhead. A custom solution is -usually- going to be faster. Plus it's super hard to test for this anyway given all the variables. Just know that CakePHP has some really great scalability and performance options with many different ways to cache data, VERY good control over your queries, and along with the design pattern and such it's really efficient for OO PHP...you just have to be sure you're writing efficient code... ie. be aware of your findAll's and what you're bringing back...do you need it all? Be aware of your custom functions and special operations that you're using, etc. In my opinion - Cake's the best thing since sliced bread for web apps. On Feb 8, 9:20 am, MattC [EMAIL PROTECTED] wrote: Regarding Zoe's comment about Cake checking the db columns every time you retrieve data, that only happens when debug is on. Otherwise the table schema is cached. In general you should look into Cake's built in caching which can negate a lot of the framework overhead. Here is quick test I did to benchmark the improvement with cache turned on: http://www.pseudocoder.com/archives/2007/02/27/cakephp-cache-performa... That was almost a year ago and used Cake 1.1 with file based caching. -Mattwww.pseudocoder.com On Feb 8, 6:26 am, Ma'moon [EMAIL PROTECTED] wrote: Hello guys, i am truly sure that cake is my choice when it comes to choose a framework from the bunch of frameworks available out there but i really need to see some benchmarks in order to convince my managers that cake is really for it and it would be our best choice, is there any benchmarks reports available, i would be thankful for any links being posted here or pointed anywhere else. Regards, Ma'moon --~--~-~--~~~---~--~~ 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 benchmarking
There are a bunch of performance comparisons out there. Most may not me very relevant in a real world project but if you need numbers here are a few: http://paul-m-jones.com/blog/?p=236 http://www.sellersrank.com/php/cakephp-codeigniter-benchmark/ Note: These try to test the most basic setup. On Feb 8, 5:04 pm, Tom.Maiaroto [EMAIL PROTECTED] wrote: ..oh and compared to other frameworks ?? you could try and build the same app over and over and profile them all...but again it's gonna be hard and I would bet you'd get very similar results anyway. UNLESS you have some super huge monster of an app. That would be interesting to see. Like others said, your development time is the most precious thing that Cake can help you with. On Feb 8, 11:02 am, Tom.Maiaroto [EMAIL PROTECTED] wrote: You could setup xdebug or Zend and profile your sitebut benchmarking is such a subjective thing. It relies a lot on your server setup, etc. What you could do is say build your own blog - and load it up with the same articles as say an installation of Wordpress or something. Then profile both. See the difference. BUT that's only going to get you so far. Your specific machine's PHP.ini, and other settings AND cpu speed/ram is different from the host you'll be on (most likely)...AND you're testing locally - not through the internet. Now. A more accurate test would be to run the same test on the host you'll be at...but can you get xdebug or something like that setup on your host? Also, you've just gone through a bunch of time to find out if you can build an application faster than Wordpress or Drupal or Joomla! or whatever. My bet, you did build one faster...because all those systems load extra things you probably don't have when you build a custom solution. These CMS' out there try to cover all the bases best they can. That means a lot of overhead. A custom solution is -usually- going to be faster. Plus it's super hard to test for this anyway given all the variables. Just know that CakePHP has some really great scalability and performance options with many different ways to cache data, VERY good control over your queries, and along with the design pattern and such it's really efficient for OO PHP...you just have to be sure you're writing efficient code... ie. be aware of your findAll's and what you're bringing back...do you need it all? Be aware of your custom functions and special operations that you're using, etc. In my opinion - Cake's the best thing since sliced bread for web apps. On Feb 8, 9:20 am, MattC [EMAIL PROTECTED] wrote: Regarding Zoe's comment about Cake checking the db columns every time you retrieve data, that only happens when debug is on. Otherwise the table schema is cached. In general you should look into Cake's built in caching which can negate a lot of the framework overhead. Here is quick test I did to benchmark the improvement with cache turned on:http://www.pseudocoder.com/archives/2007/02/27/cakephp-cache-performa... That was almost a year ago and used Cake 1.1 with file based caching. -Mattwww.pseudocoder.com On Feb 8, 6:26 am, Ma'moon [EMAIL PROTECTED] wrote: Hello guys, i am truly sure that cake is my choice when it comes to choose a framework from the bunch of frameworks available out there but i really need to see some benchmarks in order to convince my managers that cake is really for it and it would be our best choice, is there any benchmarks reports available, i would be thankful for any links being posted here or pointed anywhere else. Regards, Ma'moon --~--~-~--~~~---~--~~ 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: Custom Component and Redirect problem
Ok, I try to remove all the print out and stuff, but, i still get the same error. class TradesController extends AppController { var $name = 'Trades'; var $components = array('Date'); var $helpers = array('Html', 'Form'); function index() { } function add() { $this-redirect(array('action'='index')); } } On Feb 7, 5:09 pm, Kjell Bublitz [EMAIL PROTECTED] wrote: If you just wanna test if the timestamp is there, you can simply exit before doing the redirect(). You could just do this: pr($timeStamp); exit(); if you expect an array.. if you expect just a string exit($timeStamp); will do the same trick.. as an alternative to pr() which is just the print_r() output with a pre tag around it, you can use var_dump($timeStamp); to get more details. If you are happy with the results, remove the exit() and continue.. Another way is to take a decent remote debugger with an IDE that uses it. That way you can save yourself from doing all that print_r and echo stuff.. Good IDEs are Zend Studio and Komodo Pro. HTH, Kjell On Feb 7, 2008 11:43 PM, Micro [EMAIL PROTECTED] wrote: I am using CakePhp 1.2 So, I created a component called Date. I embedded in my class following the example. My controller class: class TradesController extends AppController { var $name = 'Trades'; var $components = array('Date'); var $helpers = array('Html', 'Form'); function index() { } function add() { $timeStamp = $this-Date-getTimestamp(); print_r($timeStamp); $this-redirect(array('action'='index')); } } I get this error Warning (2): Cannot modify header information - headers already sent by (output started at C:\xampplite\htdocs\cake12\app\controllers \components\date.php:119) [CORE\cake\libs\controller\controller.php, line 546] If I uncomment the $this-redirect(array('action'='index')), my component works perfectly fine, and i don't get any error. I try to comment out the component part, and it works fine. The problem only occurs when I use my custom component and has the redirect line. Any clue? Thank you. --~--~-~--~~~---~--~~ 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: Switching useDbConfig variable
Oh, nevermind. I just reread. I guess I was simply trying to set up the if else inside the database_config class and set the $default accordingly. On Feb 8, 1:37 pm, Corie [EMAIL PROTECTED] wrote: That actually does look like a better solution, as I was also trying to figure out how to make it switch for all Models. I'm a bit new to OOP, how do you set up your /config/database.php file? You have to put the conditionals in a function right? On Feb 8, 11:32 am, grigri [EMAIL PROTECTED] wrote: Interesting... I do it a completely different way. I have 2 database config files : database.dev.php and database.live.php, each containing a full DATABASE_CONFIG class with my configurations (default, test, and whatever else I need for the app). Then, in /config/database.php, I have this: if (empty($_SERVER['SERVER_NAME']) || in_array(strtolower($_SERVER[SERVER_NAME]), array('grigri', 'localhost'))) { require ./database.dev.php;} else { require ./database.live.php; } This way the models don't have to make any changes, it's all automatic. How do other people deal with this? On Feb 8, 4:23 pm, Corie [EMAIL PROTECTED] wrote: I'm running the same cake app on two different servers, development and production. I want to change the database config that's used depending on the server. I've got the following set up now. /config/database.php class DATABASE_CONFIG { var $development = array( 'driver' = 'mysql', 'persistent' = false, 'host' = 'localhost', 'port' = '', 'login' = 'admin', 'password' = 'password', 'database' = 'db', 'schema' = '', 'prefix' = '', 'encoding' = '' ); var $production = array( 'driver' = 'mysql', 'persistent' = false, 'host' = 'localhost', 'port' = '', 'login' = 'user_admin', 'password' = 'password', 'database' = 'user_db', 'schema' = '', 'prefix' = '', 'encoding' = '' ); } /models/table.php class Table extends AppModel { var $name = 'Table'; function beforeFind() { if(is_dir('D:\webserver\private_html\site')) { $this-useDbConfig = 'development'; } elseif(is_dir(DS.'home'.DS.'user'.DS.'public_html')) { $this-useDbConfig = 'production'; } } } It just keeps trying to use the 'default' config. I've also tested my logic by just putting $this-useDbConfig = 'development'; directly under the beforeFind() function, but it still does nothing. Do I need to put this somewhere else? --~--~-~--~~~---~--~~ 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: Switching useDbConfig variable
That actually does look like a better solution, as I was also trying to figure out how to make it switch for all Models. I'm a bit new to OOP, how do you set up your /config/database.php file? You have to put the conditionals in a function right? On Feb 8, 11:32 am, grigri [EMAIL PROTECTED] wrote: Interesting... I do it a completely different way. I have 2 database config files : database.dev.php and database.live.php, each containing a full DATABASE_CONFIG class with my configurations (default, test, and whatever else I need for the app). Then, in /config/database.php, I have this: if (empty($_SERVER['SERVER_NAME']) || in_array(strtolower($_SERVER[SERVER_NAME]), array('grigri', 'localhost'))) { require ./database.dev.php;} else { require ./database.live.php; } This way the models don't have to make any changes, it's all automatic. How do other people deal with this? On Feb 8, 4:23 pm, Corie [EMAIL PROTECTED] wrote: I'm running the same cake app on two different servers, development and production. I want to change the database config that's used depending on the server. I've got the following set up now. /config/database.php class DATABASE_CONFIG { var $development = array( 'driver' = 'mysql', 'persistent' = false, 'host' = 'localhost', 'port' = '', 'login' = 'admin', 'password' = 'password', 'database' = 'db', 'schema' = '', 'prefix' = '', 'encoding' = '' ); var $production = array( 'driver' = 'mysql', 'persistent' = false, 'host' = 'localhost', 'port' = '', 'login' = 'user_admin', 'password' = 'password', 'database' = 'user_db', 'schema' = '', 'prefix' = '', 'encoding' = '' ); } /models/table.php class Table extends AppModel { var $name = 'Table'; function beforeFind() { if(is_dir('D:\webserver\private_html\site')) { $this-useDbConfig = 'development'; } elseif(is_dir(DS.'home'.DS.'user'.DS.'public_html')) { $this-useDbConfig = 'production'; } } } It just keeps trying to use the 'default' config. I've also tested my logic by just putting $this-useDbConfig = 'development'; directly under the beforeFind() function, but it still does nothing. Do I need to put this somewhere else? --~--~-~--~~~---~--~~ 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 benchmarking
I'm going to have to agree, you can't do accurate tests unless you design the same test app using CakePHP, regular PHP (good luck), and/or other frameworks. IMO, it doesn't make sense trying to benchmark how fast the home.ctp page is pulled up, unless of course that's what your app will be doing. Then again, I'm no benchmarking genius. I guess you could through in some memory_get_peak_usage() calls, but then again, that's memory and not speed or CPU. I think you should think bout those profilers. I don't have enough experience in them to know any better. You're best bet is to focus on development. That's what worked for me. I actually sat down and went from nothing to a small app in 15 minutes. That's what impressed them. And company execs always love the word FREE. On Feb 8, 2008 10:04 AM, Tom.Maiaroto [EMAIL PROTECTED] wrote: ..oh and compared to other frameworks ?? you could try and build the same app over and over and profile them all...but again it's gonna be hard and I would bet you'd get very similar results anyway. UNLESS you have some super huge monster of an app. That would be interesting to see. Like others said, your development time is the most precious thing that Cake can help you with. On Feb 8, 11:02 am, Tom.Maiaroto [EMAIL PROTECTED] wrote: You could setup xdebug or Zend and profile your sitebut benchmarking is such a subjective thing. It relies a lot on your server setup, etc. What you could do is say build your own blog - and load it up with the same articles as say an installation of Wordpress or something. Then profile both. See the difference. BUT that's only going to get you so far. Your specific machine's PHP.ini, and other settings AND cpu speed/ram is different from the host you'll be on (most likely)...AND you're testing locally - not through the internet. Now. A more accurate test would be to run the same test on the host you'll be at...but can you get xdebug or something like that setup on your host? Also, you've just gone through a bunch of time to find out if you can build an application faster than Wordpress or Drupal or Joomla! or whatever. My bet, you did build one faster...because all those systems load extra things you probably don't have when you build a custom solution. These CMS' out there try to cover all the bases best they can. That means a lot of overhead. A custom solution is -usually- going to be faster. Plus it's super hard to test for this anyway given all the variables. Just know that CakePHP has some really great scalability and performance options with many different ways to cache data, VERY good control over your queries, and along with the design pattern and such it's really efficient for OO PHP...you just have to be sure you're writing efficient code... ie. be aware of your findAll's and what you're bringing back...do you need it all? Be aware of your custom functions and special operations that you're using, etc. In my opinion - Cake's the best thing since sliced bread for web apps. On Feb 8, 9:20 am, MattC [EMAIL PROTECTED] wrote: Regarding Zoe's comment about Cake checking the db columns every time you retrieve data, that only happens when debug is on. Otherwise the table schema is cached. In general you should look into Cake's built in caching which can negate a lot of the framework overhead. Here is quick test I did to benchmark the improvement with cache turned on: http://www.pseudocoder.com/archives/2007/02/27/cakephp-cache-performa... That was almost a year ago and used Cake 1.1 with file based caching. -Mattwww.pseudocoder.com On Feb 8, 6:26 am, Ma'moon [EMAIL PROTECTED] wrote: Hello guys, i am truly sure that cake is my choice when it comes to choose a framework from the bunch of frameworks available out there but i really need to see some benchmarks in order to convince my managers that cake is really for it and it would be our best choice, is there any benchmarks reports available, i would be thankful for any links being posted here or pointed anywhere else. Regards, Ma'moon --~--~-~--~~~---~--~~ 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 Association Query....stumped
I've done the following: Clipranking Model: function findClipByRank($site_id){ return $this-query(SELECT Clipranking.rank, Clipranking.site_id, Clipranking.required, Clip.id, Clip.name, Clip.length FROM cliprankings AS Clipranking, clips AS Clip WHERE Clipranking.site_id = $site_id AND Clipranking.clip_id = Clip.id); } And calling in my controller works fine: $clip = $this-Site- Clipranking-findClipByRank($id); In my short experience with Cake, it seems that there would be a more Cake-ish way to accomplish this. I'm a noob here so, it's probably obvious. Thanks, Jeremy --~--~-~--~~~---~--~~ 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 benchmarking
First of all i would like to thank you all for your responses and replies, and to be honest, one of the main reasons why i have chosen cakePHP over any other framework was its community and the support that i may get behind it, so really thank you guys :-). Ok, i do understand your points of view and i truly agree with you all, of course there is a difference in performance between the different environments that the application is running at , so debugging mode is totally in a different state of production ... etc, and i also do agree that human resources programmers costs much more than a computer does, but i still need numbers to convince the managers about cakePHP, honestly speaking, i want to work with cakePHP and i really would love to prove that to them but they require numbers in order to convince them, Matt, i saw your benchmarks but as you said, this is too old from what i am searching at and to be clear i have to say that i am not looking for a comparesion between frameworks here but rather i am looking for benchmarks or reports to prove that cakePHP worth having it in our production servers. currently cakePHP is being used one of our channels where we have build the admin area of this channel using cakePHP that was REALLY On Feb 8, 2008 9:20 AM, MattC [EMAIL PROTECTED] wrote: Regarding Zoe's comment about Cake checking the db columns every time you retrieve data, that only happens when debug is on. Otherwise the table schema is cached. In general you should look into Cake's built in caching which can negate a lot of the framework overhead. Here is quick test I did to benchmark the improvement with cache turned on: http://www.pseudocoder.com/archives/2007/02/27/cakephp-cache-performance/ That was almost a year ago and used Cake 1.1 with file based caching. -Matt www.pseudocoder.com On Feb 8, 6:26 am, Ma'moon [EMAIL PROTECTED] wrote: Hello guys, i am truly sure that cake is my choice when it comes to choose a framework from the bunch of frameworks available out there but i really need to see some benchmarks in order to convince my managers that cake is really for it and it would be our best choice, is there any benchmarks reports available, i would be thankful for any links being posted here or pointed anywhere else. Regards, Ma'moon --~--~-~--~~~---~--~~ 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: setting $this-layout not redirecting to the specified layout
I would think that removing the default layout would then default to the default cake layout (unless you specify something else). is that correct? to answer your previous question, when you set $this-layout = 'uploadlayout'; you're basically telling cake to use the layout file: \views\layouts \uploadlayout.ctp but.. you still need to specify the view you want to use. by default it will be : \views\uploads\index.ctp \views\__CONTROLLER_NAME__\__ACTION_NAME__.ctp j On Jan 18, 2:55 pm, Novice Programmer [EMAIL PROTECTED] wrote: Wow.. Removing default.thtml from the layouts folder, fixes the problem. I am confused ... :( thanks. On 1/19/08, Novice Programmer [EMAIL PROTECTED] wrote: Linux distribution : Redhat. Cake 1.1.x Is there something special that needs to be done when using another layout? Here is what i have done. In the default layout, the following code is written. a href= /uploads/index?php echo $html-image(' topmast5.jpg', array('width'=86, 'height'=33, 'border'=0, 'alt'=));?/ a/ td The controller looks like. ?php class UploadsController extends AppController { var $name = 'Uploads' ; var $helpers = array ('Html', 'Javascript', 'Ajax' ); function index() { $this-layout = 'uploadlayout'; } } ? -- Thanks Regards, Novice (http://ishuonweb.wordpress.com/). -- Thanks Regards, Novice (http://ishuonweb.wordpress.com/). --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Configuration and usage of CakePHP with SQLite
You should have a full path to your sqlite file otherwise it might not work. On Feb 7, 2:18 pm, Thomas [EMAIL PROTECTED] wrote: Hi folks, currently I am getting mad trying to bring CakePHP together with SQLite. Lets tell you my settings first: On a Windows system running Lighttpd with PHP 5.2.5 and unpacked cake_1.1.19.6305.tar.bz2. The php sqlite extension is uncommented and running. The default start website of CakePHP shows up correctly and tells me: Your database configuration file is present. Cake is able to connect to the database. My database.php looks like this: class DATABASE_CONFIG { var $default = array('driver' = 'sqlite', 'connect' = 'sqlite_popen', 'host' = 'localhost', 'login' = 'user', 'password' = 'password', 'database' = 'posts', 'prefix' = ''); var $test = array('driver' = 'mysql', 'connect' = 'mysql_connect', 'host' = 'localhost', 'login' = 'user', 'password' = 'password', 'database' = 'project_name-test', 'prefix' = ''); } My directory layout is like this (some here not so important dirs left out): Lighttpd - htdocs -- app -- posts (the SQLite 2.1 file) - PHP The files in the app dir are created as described in The Cake Blog Tutorial. However if I go to the addresshttp://localhost/posts/index I get a 404 - Not Found error. Another mysterium is, that I can set any name for 'database' and Cake still tells me Cake is able to connect to the database. and creates a 0 byte file in the htdocs dir. I'd really appreciate any help! Thanks alot, Thomas --~--~-~--~~~---~--~~ 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 guide
I second this. it's a great way to provide the general method and usage while also providing multiple, more specific examples that often are more relevant in the real world. brian Quoting grigri [EMAIL PROTECTED]: I quite like the system in php.net - you've got the official docs pages, then a list of user-submitted relevant comments underneath. I often find what I'm looking for in the user comments. If these could be moderated and other users could vote on them, it might make for a fine system to add to the cakephp docs. On Feb 8, 5:19 pm, Baz [EMAIL PROTECTED] wrote: Why do we keep comparing to Zend? They got an entire team on doc. alone. The think that our only problem here lies with 1.2. IMO, the current 1.1manual is fine for me (maybe have one complete doc, so you don't have to keep clicking through chapters). The only thing we need right now is to get the 1.2 functionality up to that level. But the only thing I would blatantly plagiarize from Zend is the list of examples at the bottom. On Feb 8, 2008 11:08 AM, Mech7 [EMAIL PROTECTED] wrote: Hmmm yes all these blogs scattered everywhere really doesn't help anybody... I hope one day cake will have a manual to the standards of ZendFW..http://framework.zend.com/manual/en/ It's easy to read and has lots of example code... for every part of the framework. --~--~-~--~~~---~--~~ 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 get controller name from an element view?
Hi im newbie and my English still sucks, but i want to know get the controller name since an element view. 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: Custom Component and Redirect problem
I figure out now. There is some funny character in my Date component. That's why it screw up the header for redirect. Thank you for everyone input. I love the CakePhp community. On Feb 8, 11:26 am, Micro [EMAIL PROTECTED] wrote: Ok, I try to remove all the print out and stuff, but, i still get the same error. class TradesController extends AppController { var $name = 'Trades'; var $components = array('Date'); var $helpers = array('Html', 'Form'); function index() { } function add() { $this-redirect(array('action'='index')); } } On Feb 7, 5:09 pm, Kjell Bublitz [EMAIL PROTECTED] wrote: If you just wanna test if the timestamp is there, you can simply exit before doing the redirect(). You could just do this: pr($timeStamp); exit(); if you expect an array.. if you expect just a string exit($timeStamp); will do the same trick.. as an alternative to pr() which is just the print_r() output with a pre tag around it, you can use var_dump($timeStamp); to get more details. If you are happy with the results, remove the exit() and continue.. Another way is to take a decent remote debugger with an IDE that uses it. That way you can save yourself from doing all that print_r and echo stuff.. Good IDEs are Zend Studio and Komodo Pro. HTH, Kjell On Feb 7, 2008 11:43 PM, Micro [EMAIL PROTECTED] wrote: I am using CakePhp 1.2 So, I created a component called Date. I embedded in my class following the example. My controller class: class TradesController extends AppController { var $name = 'Trades'; var $components = array('Date'); var $helpers = array('Html', 'Form'); function index() { } function add() { $timeStamp = $this-Date-getTimestamp(); print_r($timeStamp); $this-redirect(array('action'='index')); } } I get this error Warning (2): Cannot modify header information - headers already sent by (output started at C:\xampplite\htdocs\cake12\app\controllers \components\date.php:119) [CORE\cake\libs\controller\controller.php, line 546] If I uncomment the $this-redirect(array('action'='index')), my component works perfectly fine, and i don't get any error. I try to comment out the component part, and it works fine. The problem only occurs when I use my custom component and has the redirect line. Any clue? Thank you. --~--~-~--~~~---~--~~ 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: PHP has encountered a Stack overflow
I'm getting the same stack overflow and redefined path() errors with the 6311 release too, FWIW And apparently there's been no commits to 1.2.x.x trunk to the core libs? So using a nightly wouldn't make a difference? On Jan 16, 5:41 pm, PJ Hile [EMAIL PROTECTED] wrote: I was having those same problems, and had to delete the 'cake' directory completely and copy over the new one from the 6311 release. I guess there are some extra files that end up getting removed in this new version. Everything worked after that! On Jan 12, 5:45 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I'm not getting stack overflow, but i'm getting the redeclare paths() error. Am downloading new version of basics.php now. Any other ideas on this? I don't think I'll be going into 300-something classes to search for duplicate aliases just now. M On Jan 11, 6:47 am, AD7six [EMAIL PROTECTED] wrote: On Jan 10, 10:32 pm, Adam Royle [EMAIL PROTECTED] wrote: Hey AD, Can you elaborate on why there shouldn't be duplicate aliases? I'm pretty sure I've done this many times without issues. So have I, but with more recent 1.2 builds the configure class (in particular) relies on the alias being unique to give you an instance of the class you want, and the lookup is based only on the alias. hth, AD --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Plugin and helper with the same name
If I have a plugin and a helper (in app or in plugin dir) with the same name, I get a blank page, without any error. When I make the helper bugging, I get the php error. If I rename the helper and its file, it works well. Any idea? Cheers, Jake --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
saveAll with multiple records, {$model}_id is missing
Hi there ... Is there a way to get this work? If i run this, the related data is saved, but the todo_id is missing. If I use the same with a single field the todo_id field is added ... todo.php -- ?php class Todo extends AppModel { var $name = 'Todo'; var $hasMany = array('Task'); } ? task.php -- ?php class Task extends AppModel { var $name = 'Task'; var $belongsTo = array('Todo'); } ? todos_controller.php -- ?php class TodosController extends AppController { var $name = 'Todos'; function add() { if (!empty($this-data)) { $this-cleanUpFields(); $this-Todo-create(); if ($this-Todo-saveAll($this-data)) { } else { } } } } ? todos/add.ctp -- div class=todos form ?php echo $form-create('Todo');? fieldset legend?php __('Add Todo');?/legend ?php echo $form-input('Todo.name'); ? /fieldset fieldset legend?php __('Add Tasks for todo');?/legend ?php echo $form-input('Task.1.name'); echo $form-input('Task.2.name'); ? /fieldset ?php echo $form-end('Submit');? /div --~--~-~--~~~---~--~~ 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 get controller name from an element view?
Hi im newbie and my English still sucks, but i want to know get the controller name since an element view. Thanks. Try echoing out $this-params['controller'] - is that what you're after? Hope that helps, Zoe. --~--~-~--~~~---~--~~ 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 guide
I quite like the system in php.net - you've got the official docs pages, then a list of user-submitted relevant comments underneath. I often find what I'm looking for in the user comments. If these could be moderated and other users could vote on them, it might make for a fine system to add to the cakephp docs. look at the unofficial effort at http://docs.cakephp.nu/ -- -- (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/ http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/ http://blog.samdevore.com/cakephp-pages/i-cant-bake/ --~--~-~--~~~---~--~~ 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: Associating data with a HABTM join?
Hm. Looks like I may need kludge something together to make the project deadline since I'm already neck deep in cake 1.1. Thanks for the advice, will keep an eye on 1.2's progress. On Feb 7, 12:15 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Make a model for your join table (ProductCustomers / whatever) In the habtm, use the 'with' index to specify this model. This only works in recent versions of 1.2 though, can't remember which revision it actually came out in. simon --~--~-~--~~~---~--~~ 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 benchmarking
..oh and compared to other frameworks ?? you could try and build the same app over and over and profile them all...but again it's gonna be hard and I would bet you'd get very similar results anyway. UNLESS you have some super huge monster of an app. That would be interesting to see. Like others said, your development time is the most precious thing that Cake can help you with. On Feb 8, 11:02 am, Tom.Maiaroto [EMAIL PROTECTED] wrote: You could setup xdebug or Zend and profile your sitebut benchmarking is such a subjective thing. It relies a lot on your server setup, etc. What you could do is say build your own blog - and load it up with the same articles as say an installation of Wordpress or something. Then profile both. See the difference. BUT that's only going to get you so far. Your specific machine's PHP.ini, and other settings AND cpu speed/ram is different from the host you'll be on (most likely)...AND you're testing locally - not through the internet. Now. A more accurate test would be to run the same test on the host you'll be at...but can you get xdebug or something like that setup on your host? Also, you've just gone through a bunch of time to find out if you can build an application faster than Wordpress or Drupal or Joomla! or whatever. My bet, you did build one faster...because all those systems load extra things you probably don't have when you build a custom solution. These CMS' out there try to cover all the bases best they can. That means a lot of overhead. A custom solution is -usually- going to be faster. Plus it's super hard to test for this anyway given all the variables. Just know that CakePHP has some really great scalability and performance options with many different ways to cache data, VERY good control over your queries, and along with the design pattern and such it's really efficient for OO PHP...you just have to be sure you're writing efficient code... ie. be aware of your findAll's and what you're bringing back...do you need it all? Be aware of your custom functions and special operations that you're using, etc. In my opinion - Cake's the best thing since sliced bread for web apps. On Feb 8, 9:20 am, MattC [EMAIL PROTECTED] wrote: Regarding Zoe's comment about Cake checking the db columns every time you retrieve data, that only happens when debug is on. Otherwise the table schema is cached. In general you should look into Cake's built in caching which can negate a lot of the framework overhead. Here is quick test I did to benchmark the improvement with cache turned on:http://www.pseudocoder.com/archives/2007/02/27/cakephp-cache-performa... That was almost a year ago and used Cake 1.1 with file based caching. -Mattwww.pseudocoder.com On Feb 8, 6:26 am, Ma'moon [EMAIL PROTECTED] wrote: Hello guys, i am truly sure that cake is my choice when it comes to choose a framework from the bunch of frameworks available out there but i really need to see some benchmarks in order to convince my managers that cake is really for it and it would be our best choice, is there any benchmarks reports available, i would be thankful for any links being posted here or pointed anywhere else. Regards, Ma'moon --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
when to use Configure::method() over a DEFINE?
this may be more of a design/convention question, but I was curious as to when other bakers decide to add a configuration variable to Cake's Configure over DEFINE (of course both would probably be done in / config/core.php) I have a couple default values I'd like to set. For example I want to set a date field in the db to the current GMT time or I have an initial state for user activity that only changes once they login. Say the default state for user activity is 5 (some arbitrary num). Would you put that in config, define, or database? What about a default date (say gmnow() that you can't use as a default in the db) Interested in hearing what you all think... 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: Dispatcher baseUrl method setting wrong webroot variable in CakePhp 1.2
I'm gonna do that. But I have a question. Do I have to use the 1.2.X.X nightly build to do the test? because the line 1031 in dispatcher.test.php only appear in the nightly build. Thanks for your time. Kind regards. --~--~-~--~~~---~--~~ 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 guide
Isn't that just like the API, generated from code? And it seems to have stopped after 11/7/07 On Feb 8, 2008 2:54 PM, Samuel DeVore [EMAIL PROTECTED] wrote: I quite like the system in php.net - you've got the official docs pages, then a list of user-submitted relevant comments underneath. I often find what I'm looking for in the user comments. If these could be moderated and other users could vote on them, it might make for a fine system to add to the cakephp docs. look at the unofficial effort at http://docs.cakephp.nu/ -- -- (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/ http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/ http://blog.samdevore.com/cakephp-pages/i-cant-bake/ --~--~-~--~~~---~--~~ 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: Switching useDbConfig variable
Interesting... I do it a completely different way. I have 2 database config files : database.dev.php and database.live.php, each containing a full DATABASE_CONFIG class with my configurations (default, test, and whatever else I need for the app). Then, in /config/database.php, I have this: if (empty($_SERVER['SERVER_NAME']) || in_array(strtolower($_SERVER[SERVER_NAME]), array('grigri', 'localhost'))) { require ./database.dev.php; } else { require ./database.live.php; } This way the models don't have to make any changes, it's all automatic. How do other people deal with this? On Feb 8, 4:23 pm, Corie [EMAIL PROTECTED] wrote: I'm running the same cake app on two different servers, development and production. I want to change the database config that's used depending on the server. I've got the following set up now. /config/database.php class DATABASE_CONFIG { var $development = array( 'driver' = 'mysql', 'persistent' = false, 'host' = 'localhost', 'port' = '', 'login' = 'admin', 'password' = 'password', 'database' = 'db', 'schema' = '', 'prefix' = '', 'encoding' = '' ); var $production = array( 'driver' = 'mysql', 'persistent' = false, 'host' = 'localhost', 'port' = '', 'login' = 'user_admin', 'password' = 'password', 'database' = 'user_db', 'schema' = '', 'prefix' = '', 'encoding' = '' ); } /models/table.php class Table extends AppModel { var $name = 'Table'; function beforeFind() { if(is_dir('D:\webserver\private_html\site')) { $this-useDbConfig = 'development'; } elseif(is_dir(DS.'home'.DS.'user'.DS.'public_html')) { $this-useDbConfig = 'production'; } } } It just keeps trying to use the 'default' config. I've also tested my logic by just putting $this-useDbConfig = 'development'; directly under the beforeFind() function, but it still does nothing. Do I need to put this somewhere else? --~--~-~--~~~---~--~~ 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 authentication example...login redirects
also, in regards to the second error, make sure in your model-validate array, that you have apostrophes around the words 'VALID_NOT_EMPTY', which should clear out that error. Will it? I thought VALID_NOT_EMPTY *was* a constant, not a literal string. I've also heard on someone's blog that it's now depreciated, but with no clue as to what by. I know there's a bunch of new validation types such as credit card in the new system, but I can't seem to find not empty anymore. Is this depreciated or not? Thanks, Zoe. --~--~-~--~~~---~--~~ 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 authentication example...login redirects
The code i have creates my user and puts it into the database just fine..but after that, nothing happens... no flash, no redirect. Have you made a login() function in /app/controllers/ users_controller.php? It looks like you've got the creation of new users sorted, but you now need to let them log in, which is really a separate process. You need to get the login method working next, then you can worry about making it happen automatically once someone's signed up. This is something I want to explain in my guide soon, but for now try looking into $this-Session in the controller. That's what you can use to store the information about the user who's logging in, so it remembers them as they move around the site. Hope that helps, Zoe. --~--~-~--~~~---~--~~ 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 authentication example...login redirects
in 1.2, it is required to be set in a string, or you could use the following validation rule: allowEmpty The 'allowEmpty' key should be assigned a boolean value. If ' allowEmpty' is false, data passed to the model's save() method must include the field and a non-empty data value for that field. This rule is only enforced when the field index is present in the supplied data array. The default value of 'allowEmpty' is false. On Feb 8, 2008 7:32 AM, MonkeyGirl [EMAIL PROTECTED] wrote: also, in regards to the second error, make sure in your model-validate array, that you have apostrophes around the words 'VALID_NOT_EMPTY', which should clear out that error. Will it? I thought VALID_NOT_EMPTY *was* a constant, not a literal string. I've also heard on someone's blog that it's now depreciated, but with no clue as to what by. I know there's a bunch of new validation types such as credit card in the new system, but I can't seem to find not empty anymore. Is this depreciated or not? Thanks, Zoe. -- In the name of Life, Liberty, and the pursuit of my sanity. Siebren Bakker(Aevum Decessus) -BEGIN GEEK CODE BLOCK- Version: 3.12 GCS d- s+: a19 C UL++ P L++ !E W++ N(-) o? K? w(+) O? M-- V? PS+ PE Y- PGP- t+ 5? X- R tv-- b++ Di D+ G+ e h! r y- --END GEEK CODE BLOCK-- --~--~-~--~~~---~--~~ 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 benchmarking
Hi! To be honest, rendering pages quickly is not the advantage of CakePHP. Any site you've made by hand is inherently going to be faster than one that's having to check, say, what columns are in the database's tables each time you pull something out of them. The reason it's still very much worth using CakePHP despite this slowing down of a site, is that it *really* increases the speed of actually typing in the code to make it. If people are more expensive than computers at your company, then this is why they should consider using it - being able to make sites quicker than they could make them before, even if the individual pages render a little bit slower. You can even buy a faster server instead of hiring several more people to do the grunt work of making the new sites, because the computer now does that for you. :) This is all comparing CakePHP to no framework at all, mind. All that I've said is probably true of all frameworks, though. Hope that helps, Zoe. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
highlighting form input fields on error (1.2)
hi, in earlier versions of cake an CSS error class was added to form fields when there was an error. This no longer seems to be the case now that I use $form-error(Model.field) ...has this functionality been deprecated? Thanks in advance, --~--~-~--~~~---~--~~ 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 benchmarking
i am sorry, i really do not know how the msg has been sent since i did not even know hit the send button!!! anyway, i was saying that ity was REALLY fast building that admin area with it, we do have more than 40 channels in our company that we shall have them revamped and i am seriously concedering cakePHP but after making sure that we could rely on it, any comments or directions or points are more than welcommed, and thank you all again :-) On Feb 8, 2008 10:58 AM, Ma'moon [EMAIL PROTECTED] wrote: First of all i would like to thank you all for your responses and replies, and to be honest, one of the main reasons why i have chosen cakePHP over any other framework was its community and the support that i may get behind it, so really thank you guys :-). Ok, i do understand your points of view and i truly agree with you all, of course there is a difference in performance between the different environments that the application is running at , so debugging mode is totally in a different state of production ... etc, and i also do agree that human resources programmers costs much more than a computer does, but i still need numbers to convince the managers about cakePHP, honestly speaking, i want to work with cakePHP and i really would love to prove that to them but they require numbers in order to convince them, Matt, i saw your benchmarks but as you said, this is too old from what i am searching at and to be clear i have to say that i am not looking for a comparesion between frameworks here but rather i am looking for benchmarks or reports to prove that cakePHP worth having it in our production servers. currently cakePHP is being used one of our channels where we have build the admin area of this channel using cakePHP that was REALLY On Feb 8, 2008 9:20 AM, MattC [EMAIL PROTECTED] wrote: Regarding Zoe's comment about Cake checking the db columns every time you retrieve data, that only happens when debug is on. Otherwise the table schema is cached. In general you should look into Cake's built in caching which can negate a lot of the framework overhead. Here is quick test I did to benchmark the improvement with cache turned on: http://www.pseudocoder.com/archives/2007/02/27/cakephp-cache-performance/ That was almost a year ago and used Cake 1.1 with file based caching. -Matt www.pseudocoder.com On Feb 8, 6:26 am, Ma'moon [EMAIL PROTECTED] wrote: Hello guys, i am truly sure that cake is my choice when it comes to choose a framework from the bunch of frameworks available out there but i really need to see some benchmarks in order to convince my managers that cake is really for it and it would be our best choice, is there any benchmarks reports available, i would be thankful for any links being posted here or pointed anywhere else. Regards, Ma'moon --~--~-~--~~~---~--~~ 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 I define a new global function?
app/config/bootstrap.php http://tempdocs.cakephp.org/#TOC42845 On Feb 8, 2008 4:20 PM, johnnyice [EMAIL PROTECTED] wrote: I grabbed a handy function from php.net (array_merge_recursive_unique) that I want to use. It doesn't make sense to add it to my controller and it's not quite robust enough to become a component. I don't want to modify the cake core basics.php file where the global functions are located (not good practice when I decide to move to the next cake version), so where could I place additional global functions like this? thanks in advance! j -- -- (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/ http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/ http://blog.samdevore.com/cakephp-pages/i-cant-bake/ --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
can I define a new global function?
I grabbed a handy function from php.net (array_merge_recursive_unique) that I want to use. It doesn't make sense to add it to my controller and it's not quite robust enough to become a component. I don't want to modify the cake core basics.php file where the global functions are located (not good practice when I decide to move to the next cake version), so where could I place additional global functions like this? thanks in advance! j --~--~-~--~~~---~--~~ 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 benchmarking
Regarding Zoe's comment about Cake checking the db columns every time you retrieve data, that only happens when debug is on. Otherwise the table schema is cached. In general you should look into Cake's built in caching which can negate a lot of the framework overhead. Here is quick test I did to benchmark the improvement with cache turned on: http://www.pseudocoder.com/archives/2007/02/27/cakephp-cache-performance/ That was almost a year ago and used Cake 1.1 with file based caching. -Matt www.pseudocoder.com On Feb 8, 6:26 am, Ma'moon [EMAIL PROTECTED] wrote: Hello guys, i am truly sure that cake is my choice when it comes to choose a framework from the bunch of frameworks available out there but i really need to see some benchmarks in order to convince my managers that cake is really for it and it would be our best choice, is there any benchmarks reports available, i would be thankful for any links being posted here or pointed anywhere else. Regards, Ma'moon --~--~-~--~~~---~--~~ 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 data only appears when in debug mode
Hi all, I'm sure I'm doing something obviously wrong but I have several instances where particular fields from a model are only being displayed when I am in debug mode. When I switch to production mode it is as if the value doesn't exist in the model. e.g. in my view I have: ?=$product['Product']['full_description'];? The output is as expected in debug mode but empty in production mode. I thought it may be something to do cacheing - an area I haven't fully explored yet - but to my knowledge I am not using cacheing and CACHE_CHECK is set to false. Any ideas what I'm doing wrong?! Thanks, Alex --~--~-~--~~~---~--~~ 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 cache model table schema?
Nevermind ... I found out my tmp directory structure was messed up. 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: CakePHP guide
[EMAIL PROTECTED] wrote: I second this. it's a great way to provide the general method and usage while also providing multiple, more specific examples that often are more relevant in the real world. ONLY if they are moderated... too many people use the comments as a place to request free help, and then the doc's degenerate quickly. That and a lot of inaccurate or incomplete information getting posted. I like the idea, but someone's gotta ride herd on it. -Scott Quoting grigri [EMAIL PROTECTED]: I quite like the system in php.net - you've got the official docs pages, then a list of user-submitted relevant comments underneath. I often find what I'm looking for in the user comments. If these could be moderated and other users could vote on them, it might make for a fine system to add to the cakephp docs. --~--~-~--~~~---~--~~ 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 guide
On Feb 8, 2008 2:10 PM, Baz [EMAIL PROTECTED] wrote: Isn't that just like the API, generated from code? And it seems to have stopped after 11/7/07 I think the plan was that it was going to support the notion of comments like the php.net manual. But like you said it died, which has been the history of non-official documentation. Here is my opinion on the docs, if you need something written or want to right something for it look at the list of needs and right it and just send it to John, he will make it look right and sound right and you will feel good. Or he will send it back and let you know what to fix/ add -- -- (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/ http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/ http://blog.samdevore.com/cakephp-pages/i-cant-bake/ --~--~-~--~~~---~--~~ 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: when to use Configure::method() over a DEFINE?
looks like you put global constants in the bootstrap.php file. -- This file is ideal for a number of common bootstrapping tasks: 1. Defining convenience functions 2. Registering global constants 3. Defining additional model, view, and controller paths -- from: http://tempdocs.cakephp.org/#TOC42845 BUT for variables like the number of search results per page. Would you put that in your bootstrap file too or as a design preference add it to the Configure namespace? john On Feb 8, 2:33 pm, johnnyice [EMAIL PROTECTED] wrote: this may be more of a design/convention question, but I was curious as to when other bakers decide to add a configuration variable to Cake's Configure over DEFINE (of course both would probably be done in / config/core.php) I have a couple default values I'd like to set. For example I want to set a date field in the db to the current GMT time or I have an initial state for user activity that only changes once they login. Say the default state for user activity is 5 (some arbitrary num). Would you put that in config, define, or database? What about a default date (say gmnow() that you can't use as a default in the db) Interested in hearing what you all think... 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: when to use Configure::method() over a DEFINE?
On Feb 8, 2008, at 4:49 PM, johnnyice wrote: looks like you put global constants in the bootstrap.php file. -- This file is ideal for a number of common bootstrapping tasks: 1. Defining convenience functions 2. Registering global constants 3. Defining additional model, view, and controller paths -- from: http://tempdocs.cakephp.org/#TOC42845 BUT for variables like the number of search results per page. Would you put that in your bootstrap file too or as a design preference add it to the Configure namespace? You can add defines *or* Configure calls in bootstrap. Bootstrap is probably the place to do what you want. A define is probably what you want, since number of search results isn't going to change dynamically in the middle of a request. $0.02, -- 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: when to use Configure::method() over a DEFINE?
On Feb 8, 2008, at 3:33 PM, johnnyice wrote: this may be more of a design/convention question, but I was curious as to when other bakers decide to add a configuration variable to Cake's Configure over DEFINE (of course both would probably be done in / config/core.php) Depends on whether or not you want it to be constant (unchangeable), or something you can play with during a request. I have a couple default values I'd like to set. For example I want to set a date field in the db to the current GMT time or I have an initial state for user activity that only changes once they login. Say the default state for user activity is 5 (some arbitrary num). Would you put that in config, define, or database? What about a default date (say gmnow() that you can't use as a default in the db) Depends how much it'll change and when. fwiw, 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: Session expiring when Flash file calls controller method in background
Hi guys, Quick question. Where is Configure::write('Session.checkAgent', false); supposed to go? In config/core.php or in the controller action? Thanks. On Feb 4, 3:48 pm, skoggins [EMAIL PROTECTED] wrote: Ok. Thanks! On Feb 4, 2:20 pm, Troy Gilbert [EMAIL PROTECTED] wrote: Yeah, that's definitely the problem... I ran across someone else discussing it recently as well. When Flash does a POST it uses an agent string of Flash Player or similar instead of the browser's user-agent (no idea why). Only way to work around it is to change Cake so that it doesn't consider user-agent when checking sessions. So, you've got to upgrade or find the part of the session source code that checks the agent and comment that out (no idea, I'm using 1.2beta). Troy. On Feb 4, 2008 3:53 PM, skoggins [EMAIL PROTECTED] wrote: I found out some more info about the problem. It only logs me out when I do a POST from Flash. Get works fine. I haven't been able to upgrade to 1.1.19 yet so I can't try: Configure::write('Session.checkAgent', false); Troy, my flash player is version 8,0,22,0 and I am running XP. Does this still sound like the same problem? Is there a fix without having to upgrade? Thanks. On Jan 30, 3:15 pm, Troy Gilbert [EMAIL PROTECTED] wrote: Configure::write('Session.checkAgent', false); Yes, that's most likely it. While the agent should be the same when the Flash Player speaks to the web server (because it's using the web browser's network stack), I've seen some configurations report it slightly differently. Curious, what OS/browser are you using the Flash Player on (and what version of the Player)? Troy. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Auth Problems
I'm using the Auth component. I am running into some trouble and I am not sure what is causing it. As soon as I add the auth component to my site, I can no longer access any of the pages. I tried putting this: $this-Auth-allow('login'); but it did not work. --~--~-~--~~~---~--~~ 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 guide
I would like to offer some help with the official docs. I'm not sure how much time i can put in because, like everyone else, i've got a crap-load on my plate already. But the docs do need some serious help. The presentation, for one, makes it difficult to find things. That, and the underlying generated markup is horrendous. John: i don't at all mean to criticise; i fully understand the situation. I'm just pointing out a couple of areas that i think could use some improvement, since this thread is beginning to look like a sign-up sheet. Zoe: your guide is a huge addition! Maybe it can be folded into the official docs, or maybe it can become a companion guide. Perhaps some agreement about that can be reached, and might spur both projects forward. I agree with Baz Zoe about not quite knowing whether the steps i'm taking are appropriate. With the new behaviors and whatnot, coupled with all of the novel ways people are coming up with to do things, it can be a bit dizzying trying to figure out just what is appropriate. Just yesterday, i spent ages going over Andy's Attachment behavior, trying to make sense of the (almost) comment-less code. The good thing is that I learned a great deal about Cake (and a couple of neat PHP tricks). And I realised that my brainwave to deal with uploads in the validation code was ... validated by others--more astute about Cake than I--who'd figured it out already. The best, though, was that, after finally judging that I had Andy's behavior figured out, I stumbled upon David Persson's wonderful (and wonderfully-packaged) Attachments Project[1], built upon a collection of others' cool ideas (including Andy's). Going through the source I suddenly had botha revelation for how Cake works (or, at least, should) and inspiration for how to resolve some long-standing problems with my project (well over and above those things that Cake has already addressed for me). My point being that good documentation--especially in the source--can help tremendously. [1] http://cakeforge.org/projects/attm/ --~--~-~--~~~---~--~~ 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: Session expiring when Flash file calls controller method in background
When I put it in config/core.php it gives me: Fatal error: Class 'Configure' not found in both version 1.1.18.5850 and 1.1.19.6350. When I put it in the controller it doesn't throw an error but doesn't fix the problem either. Configure::version(); works in the controller so I'm assuming I have access to the class. Any ideas why this is? Thanks for the help, this is driving me insane. On Feb 8, 4:49 pm, Chris Hartjes [EMAIL PROTECTED] wrote: On Feb 8, 2008 7:31 PM, skoggins [EMAIL PROTECTED] wrote: Hi guys, Quick question. Where is Configure::write('Session.checkAgent', false); supposed to go? In config/core.php or in the controller action? Thanks. Well, if you want it application-wide than put it in config/core.php. -- Chris Hartjes Internet Loudmouth Motto for 2008: Moving from herding elephants to handling snakes... @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: Auth Problems
On Feb 8, 2008 7:57 PM, Neil [EMAIL PROTECTED] wrote: $this-Auth-allow('action1', 'action2', 'action3') vs $this-Auth-allow('login'); whats the difference? The difference is that the Auth component automatically allows you to access an action called 'login'. If you do $this-Auth-allow('login'), I can 100% guarantee that things will not work properly. $this-Auth-allow(...) specifies what actions you do not want to be protected by authentication. -- Chris Hartjes Internet Loudmouth Motto for 2008: Moving from herding elephants to handling snakes... @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: Session expiring when Flash file calls controller method in background
Hmm... looking at core.php I see everything starts with define(...); Do I need a different syntax then just plopping Configure::write('Session.checkAgent', false); in there? On Feb 8, 4:49 pm, Chris Hartjes [EMAIL PROTECTED] wrote: On Feb 8, 2008 7:31 PM, skoggins [EMAIL PROTECTED] wrote: Hi guys, Quick question. Where is Configure::write('Session.checkAgent', false); supposed to go? In config/core.php or in the controller action? Thanks. Well, if you want it application-wide than put it in config/core.php. -- Chris Hartjes Internet Loudmouth Motto for 2008: Moving from herding elephants to handling snakes... @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: Auth Problems
ok thanks for the info! I changed that error however my site still is not working. in all my controllers I have: var $components = array('Auth'); and then when ever I want an action to work without Authentication i put: function beforeFilter() { $this-Auth-allow('action1', 'action2', 'ect...'); } any clue why this is not working? I am not able to access any pages On Feb 8, 8:01 pm, Chris Hartjes [EMAIL PROTECTED] wrote: On Feb 8, 2008 7:57 PM, Neil [EMAIL PROTECTED] wrote: $this-Auth-allow('action1', 'action2', 'action3') vs $this-Auth-allow('login'); whats the difference? The difference is that the Auth component automatically allows you to access an action called 'login'. If you do $this-Auth-allow('login'), I can 100% guarantee that things will not work properly. $this-Auth-allow(...) specifies what actions you do not want to be protected by authentication. -- Chris Hartjes Internet Loudmouth Motto for 2008: Moving from herding elephants to handling snakes... @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: Auth Problems
this is the error I am getting: The page isn't redirecting properly Firefox has detected that the server is redirecting the request for this address in a way that will never complete. * This problem can sometimes be caused by disabling or refusing to accept cookies. --~--~-~--~~~---~--~~ 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: Auth Problems
I think you'll need to post you app_controller code (as pertains to auth) you may have some info in the debug file On 09/02/2008, Neil [EMAIL PROTECTED] wrote: this is the error I am getting: The page isn't redirecting properly Firefox has detected that the server is redirecting the request for this address in a way that will never complete. * This problem can sometimes be caused by disabling or refusing to accept cookies. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Missing model in console script error
Hi I have a simple console script called alert.php in /vendors/shells. I am using only one model. I have it define with the $uses var and I am trying to execute a findAll method on Model. I know this model works becuase I use the same one in several controllers in my main application. Each time I run the console script it tells me that the model is missing. Below is the actual code I have. Is there something I'm missing? begin snippet class AlertShell extends Shell { var $uses = array('Threshold'); function main() { $alert_count = 0; $thresholds = $this-Threshold-findAll(array('next_alert'=date('Y- m-d'), 'target_date'='=' . date('Y-m-d'))); } end snippet when I run this with: cake alert I get the following error: Error: Missing model 'Threshold' I have added the cake console directory to my path thanks for your 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 -~--~~~~--~~--~--~---
Wish To paginate by a HABTM relationship with a kicker...
So, I've been pulling my hair out trying to figure out how to do this, reading everything on pagination in CakePHP 1.2... So here's a quick explanation of my setup, then I'll explain what effect I want to achieve. I have a table of items which looks something like (this is simplified): --- items --- | id | name | description | price | --- | 5 | test| some desc | 2.50 | Then there's a table called descriptors (other useful things to describe items): --- descriptors | id | name || --- | 1 | color || --- Then the join table or what have you (this is part of the kicker): --- descriptors_items | id | item_id | descriptor_id | value | | 1 | 5 | 1 | blue | What I want to be able to do is create extra descriptors for items that function as table headers in the view ultimately. This way, for instance, I could have items sorted by color in a table. Later, if I need an additional way to describe a product (like size), I can just create another descriptor and be done with it. No table editing. I figured out how to get the value field from the join table with some array mucking around at Mariano's site: http://cricava.com/blogs/index.php?blog=6title=modelizing_habtm_join_tables_in_cakephp_more=1c=1tb=1pb=1 As well as how to sort by HABTM at : http://www.littlehart.net/atthekeyboard/2007/12/11/cakephp-pagination-with-a-habtm-relationship/ What the latter site seems to buy me is being able to sort items that have the same Tag, rather than using the tag name as an actual clickable field. I recall reading somewhere about being able to swap columns for rows in SQL, through some sort of crazy join I imagine. Will I ultimately end up needing to create a SQL view of my data like this and modelize it? It would be great if there's a CakePHP way to do it. Thanks for your time, -Kris --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Is there a good solution for this?
I have to tables, stories and comments. They have a relationship story has many comments. comment belongs to story. In stories, I have a field named visiblecomments (yes it's long ;) I want to return only a number of comments (that is defined in visiblecomments) in every story. Example: Story 1: id: 1 title: this is first story. visiblecomments: 2 has 4 comments. Story 2: id: 2 title: this is second story visiblecomments: 1 has 5 comments. I want it to return the following: 2 comments from the first story and 1 comment from the second story. hope that made any sense.. -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: Is there a good solution for this?
On Feb 9, 2008 7:48 AM, freespac [EMAIL PROTECTED] wrote: 2 comments from the first story and 1 comment from the second story. Without having a flag in the comments for visibility I don't think there is a way to return only the visible comments T -- = Cheesecake-Photoblog: http://cheesecake-photoblog.org PHP for E-Biz: http://sanisoft.com = --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups 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 -~--~~~~--~~--~--~---