Re: Problem with adding records

2012-07-14 Thread mohit kumar
Now the problems are still same, I upgraded to the new version of cake php.
I have deleted and created the database again.
still i am getting same error.

When i try to execute the same query with mysql, it generates no error.

Here is the output of the sql dump from cake php, if executed on mysql , it
generates no error
NrQueryErrorAffectedNum. rowsTook (ms)  1INSERT INTO `competence`.`users`
(`username`, `password`, `role`, `experience`, `modified`, `created`)
VALUES ('mohit', 'mohit', 'Engineer', 1, '2012-07-15 08:48:26', '2012-07-15
08:48:26')
11151 2SELECT `UsersCertification`.`certification_id` FROM
`competence`.`users_certifications` AS `UsersCertification` WHERE
`UsersCertification`.`user_id` = 6
001 3BEGIN
001


*With Best Regards,
Mohit Kumar *
*+91-9582894570*



On Fri, Jul 13, 2012 at 8:17 PM, mohit kumar  wrote:

> Cake PHP 2.2.0
>
> +---+
> | version() |
> +---+
> | 5.5.16|
> +---+
> 1 row in set (0.12 sec)
>
>
> On Fri, Jul 13, 2012 at 8:09 PM, Mike Griffin  wrote:
>
>> Where is the error message appearing?
>>
>> I've tried creating a database and creating the table and when I run the
>> INSERT query, it works fine. Can you try running that query from the
>> command line and see what happens then?
>>
>> What version of cakePHP and MySQL are you using?
>>
>>
>> On Fri, Jul 13, 2012 at 3:08 PM, mohit kumar  wrote:
>>
>>> That was I guess added by bake tool, i did not code the add function.
>>>
>>> the information that i get when i try to add is as follows
>>>
>>>
>>>
>>> NrQueryErrorAffectedNum. rowsTook (ms)  1INSERT INTO
>>> `competence`.`users` (`username`, `password`, `role`, `experience`,
>>> `modified`, `created`) VALUES ('sid',
>>> '8fee7c4fe462305bdbb0acad830137f0d40af5a2', 'admin', 1, '2012-07-13
>>> 16:01:47', '2012-07-13 16:01:47')
>>> 11169 2SELECT `UsersCertification`.`certification_id` FROM
>>> `competence`.`users_certifications` AS `UsersCertification` WHERE
>>> `UsersCertification`.`user_id` = 5
>>> 000 3BEGIN
>>> The debug information on the page is
>>>
>>>
>>>
>>>
>>>- CORE\Cake\Model\Model.php line 
>>> 1884→ 
>>> DboSource->insertMulti(AppModel,
>>>array, array) 
>>>
>>>object(AppModel) {
>>> useDbConfig => 'default'
>>> useTable => 'users_certifications'
>>> id => false
>>> data => array([maximum depth reached])
>>> schemaName => 'competence'
>>> table => 'users_certifications'
>>> primaryKey => 'id'
>>> validate => array([maximum depth reached])
>>> validationErrors => array([maximum depth reached])
>>> validationDomain => null
>>> name => 'UsersCertification'
>>> alias => 'UsersCertification'
>>> tableToModel => array(
>>> [maximum depth reached]
>>> )
>>> cacheQueries => false
>>> belongsTo => array([maximum depth reached])
>>> hasOne => array([maximum depth reached])
>>> hasMany => array([maximum depth reached])
>>> hasAndBelongsToMany => array([maximum depth reached])
>>> actsAs => null
>>> Behaviors => object(BehaviorCollection) {}
>>> whitelist => array([maximum depth reached])
>>> cacheSources => true
>>> findQueryType => null
>>> recursive => (int) 1
>>> order => null
>>> virtualFields => array([maximum depth reached])
>>> __backAssociation => array([maximum depth reached])
>>> __backInnerAssociation => array([maximum depth reached])
>>> __backOriginalAssociation => array([maximum depth reached])
>>> __backContainableAssociation => array([maximum depth reached])
>>> findMethods => array(
>>> [maximum depth reached]
>>> )
>>> tablePrefix => ''
>>>}
>>>array(
>>> (int) 0 => '`user_id`',
>>> (int) 1 => '`certification_id`'
>>>)
>>>array(
>>> (int) 1 => array(
>>> (int) 0 => '5',
>>> (int) 1 => '1'
>>> )
>>>)
>>>
>>>
>>>
>>> On Fri, Jul 13, 2012 at 7:12 PM, Mike Griffin wrote:
>>>
 What is in the $this->request->data array?

 Mike

 On Fri, Jul 13, 2012 at 2:32 PM, mohit kumar 
 wrote:
 > Thanks for your response,
 >
 > I have already deleted the user table once..
 > The code is mostly used from the bake tool.
 >
 > Here is the snapshot of my UsersController.
 >
 https://github.com/mohitkr05/Competence/blob/master/Controller/UsersController.php
 >
 > There are no entry for id=0;
 >
 > mysql> SELECT id,username FROM users WHERE id=0;
 > Empty set (0.16 sec)
 >
 >
 > My snapshot of user table
 >
 > ++---+
 > | id | username  |
 > ++---+
 > |  1 | vaibhav   |
 > |  2 | vaibhav   |
 > |  3 | mohitkr05 |
 > |  4 | vishal|
 > ++---+
 > 4 rows in set (0.03 sec)
 >
 > and its sql is
 >
 > CREATE TABLE IF NOT EXISTS `users` (
>>>

Re: Security Release - CakePHP 2.1.5 & 2.2.1

2012-07-14 Thread Albert 'Tigr'
Thank you. Could you update the links on the website? They all point to 
2.2.0.

On Saturday, July 14, 2012 11:37:33 PM UTC+2, mark_story wrote:
>
> CakePHP 2.1.5 and 2.2.1 have just been released. If you are using 
> CakePHP's `Xml` class, you should upgrade as soon as possible.
>
> The security issue was recently reported by Paweł Wyleciał. When accepting 
> user provided XML it is possible to read arbitrary files using external 
> entities.  This is particularily dangerous for applications accepting XML 
> data as part of a webservice.  A possible exploit example would be:
>
>curl -X POST -H 'Content-Type: application/xml' http://locahost/posts-d 
> ']>
>
>&payload;
>]'
>
> Once the XML has been processed `$this->request->data['Post']['body']` 
> will contain the contents of `/etc/passwd`. This issue was [fixed](
> http://github.com/cakephp/cakephp/commit/6c905411bac66caad5e220a70e3d561b8a648507)
>  
> and packaged releases for 2.1 and 2.2 have been created.  This issue does 
> not affect the 1.3 or 1.2 release series.  If you are unable to upgrade, 
> you should apply the [patch](
> http://github.com/cakephp/cakephp/commit/6c905411bac66caad5e220a70e3d561b8a648507)
>  
> as soon as possible.
>
> ### Other fixes in 2.2.1
>
> In addition to the security fix 2.2.1 contains fixes for the following 
> issues:
>
> * Fixed missing urlencode on nested named parameters.
> * Fixed ANSI codes being output on windows terminals.
> * Fixed HtmlHelper::image() including the base directory twice when the 
> fullBase option is used.
> * Console logging now respects the quiet flag for shells.
> * TranslateBehavior now saves records with only some translated fields 
> correctly.
> * afterValidate() was made available on behaviors. This was an omission in 
> 2.2.0.
>
> View the complete changelog for 2.2.1 and 2.1.5. Download a packaged 
> release.
>
> CakeFest 2012 is around the corner and we already expect awesome talks and 
> workshops during the best PHP conference out there. If you haven't booked 
> [your tickets](http://cakefest.org/ticket-info) yet, it's about time you 
> do.
>
> As always, thanks to the friendly CakePHP community for the patches, 
> documentation changes and new tickets. Without you there would be no 
> CakePHP!
>
> **Links**
>
> [1] http://cakephp.org/changelogs/2.2.1
> [2] http://cakephp.org/changelogs/2.1.5
> [3] http://github.com/cakephp/cakephp/tags
> [4] http://cakefest.org
>
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Admin / Prefix When Baking

2012-07-14 Thread Advantage+
I have 3 different Admin routing defined in core.php

Configure::write('Routing.prefixes', array('admin', 'manager' , 'editor'));

 

so when baking it asks would you like to add the routing in controller 1/2/3
but it only bake's  one set and doing it again will overwrite the original
controller, is there a way to bake all views and controller actions for all
admin routings at 1 time?

 

Thanks 

A+

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CSS / JS Compression

2012-07-14 Thread Thiago Belem
Maybe  http://code.google.com/p/minify/ ?

Regards,
--
***Thiago Belem*
Desenvolvedor
Rio de Janeiro - RJ - Brasil

*Assando Sites* - Curso online de *CakePHP*
assando-sites.com.br 

thiagobelem.net
cont...@thiagobelem.net

*Skype / gTalk **»* thiago.belem.web
*LinkedIn* *»* br.linkedin.com/in/thiagobelem/pt



On Sat, Jul 14, 2012 at 10:30 PM, Advantage+  wrote:

> Hello Mark, 
>
> ** **
>
> I did see the one you wrote but having to define the specific sets of
> different css / js files did not seem like the option I was looking for in
> a separate ini file. I want to be able to say ok let me try using
> colorbox.js or lightbox.js and add that directly in the view rather than
> define different sets of js / css in a remote file.
>
> ** **
>
> *From:* cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] *On
> Behalf Of *mark_story
> *Sent:* Saturday, July 14, 2012 10:58 PM
> *To:* cake-php@googlegroups.com
> *Subject:* Re: CSS / JS Compression
>
> ** **
>
> I wrote one, its on github.
>
> ** **
>
> http://github.com/markstory/asset_compress.
>
> ** **
>
> It affords the ability to concatenate and minify files. It also allows you
> to integrate preprocessors like less, sass and coffee-script into your
> projects.
>
> ** **
>
> -Mark
>
> On Saturday, 14 July 2012 17:27:34 UTC-4, advantage+ wrote:
>
> I know in older versions of cake there were many compression / combine
> plugins that would take the defined css /js for the view and compress /
> combine / minimize so you ended up with 1 js and 1 css file. Is there
> anything like that for 2.x?
>
>  
>
> I liked the way I defined what I needed in each view specifically….
>
>  
>
> I had used Compressor plugin. And in the view simply dropped in
>
>  
>
> Compressor->add_libs( 'js', array('jquery.form',
> 'jquery.blockUI', 'jquery-ui-1.8.6.custom.min') );?>
>
>  
>
> Anyone fine anything similar?
>
>  
>
> Thanks all.
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Newbie: Problem with Blog tutorial

2012-07-14 Thread Борислав Събев
Shame on you *AD7six* and *Piotr Beschel*! This group is for helping people 
not mocking them!
Yes the question is kinda silly, but this doesn't mean that you should mock 
people. What if 
you end up asking a question that someone better (in Cake) than you 
considers silly?
Would it be nice to get such replies? This is a community not a forum. Man 
up!

On the qestion:
Kunal, *.htaccess* files are Apache configuration files. When the tutorial 
said "*Also remove these .htaccess files*"
it did so under the "*A note on mod_rewite*" section. This is to be done if 
you DO NOT have mod_rewrite working at all 
or if you use a different webserver than Apache. So you do not need to do 
this if your application is running
on an Apache instance with mod_rewrite enabled.

What is mod_rewrite? Well take a look 
here
.

How to use pretty urls with Apache and other webservers? Well read 
this
.

On your problem: it seems that you've managed to get Cake's built in pretty 
Urls to work.
You are seeing index.php as it is the script being run de facto when you do 
this:

*Configure::write('App.baseUrl', env('SCRIPT_NAME'));*


So this is why what you see happens. Try to get mod_rewrite working, it has 
some advantages.

Borislav.

On Saturday, 14 July 2012 16:16:12 UTC+3, Kunal Bajpai wrote:
>
> As described in the blog tutorial - 
>
> Also remove these .htaccess files:
>
> /.htaccess/app/.htaccess/app/webroot/.htaccess
>
> This will make your URLs look like 
> www.example.com/index.php/controllername/actionname/param rather than 
> www.example.com/controllername/actionname/param.
>
> I did the same but still the above mentioned problem exists. My url - *
> blog.com/index.php/posts/ *works, but the  *blog.com/posts/ *shows the 
> error, Url not found on the server
>
> TIA
>
> Kbajpai
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


RE: CSS / JS Compression

2012-07-14 Thread Advantage+
Hello Mark, 

 

I did see the one you wrote but having to define the specific sets of
different css / js files did not seem like the option I was looking for in a
separate ini file. I want to be able to say ok let me try using colorbox.js
or lightbox.js and add that directly in the view rather than define
different sets of js / css in a remote file.

 

From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of mark_story
Sent: Saturday, July 14, 2012 10:58 PM
To: cake-php@googlegroups.com
Subject: Re: CSS / JS Compression

 

I wrote one, its on github.

 

http://github.com/markstory/asset_compress.

 

It affords the ability to concatenate and minify files. It also allows you
to integrate preprocessors like less, sass and coffee-script into your
projects.

 

-Mark

On Saturday, 14 July 2012 17:27:34 UTC-4, advantage+ wrote:

I know in older versions of cake there were many compression / combine
plugins that would take the defined css /js for the view and compress /
combine / minimize so you ended up with 1 js and 1 css file. Is there
anything like that for 2.x?

 

I liked the way I defined what I needed in each view specifically..

 

I had used Compressor plugin. And in the view simply dropped in

 

Compressor->add_libs( 'js', array('jquery.form',
'jquery.blockUI', 'jquery-ui-1.8.6.custom.min') );?>

 

Anyone fine anything similar?

 

Thanks all.

-- 
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help
others with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at
http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CSS / JS Compression

2012-07-14 Thread mark_story
I wrote one, its on github.

http://github.com/markstory/asset_compress.

It affords the ability to concatenate and minify files. It also allows you 
to integrate preprocessors like less, sass and coffee-script into your 
projects.

-Mark

On Saturday, 14 July 2012 17:27:34 UTC-4, advantage+ wrote:
>
> I know in older versions of cake there were many compression / combine 
> plugins that would take the defined css /js for the view and compress / 
> combine / minimize so you ended up with 1 js and 1 css file. Is there 
> anything like that for 2.x?
>
>  
>
> I liked the way I defined what I needed in each view specifically….
>
>  
>
> I had used Compressor plugin. And in the view simply dropped in
>
>  
>
> Compressor->add_libs( 'js', array('jquery.form', 
> 'jquery.blockUI', 'jquery-ui-1.8.6.custom.min') );?>
>
>  
>
> Anyone fine anything similar?
>
>  
>
> Thanks all.
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: 3.0: a peek into CakePHP's future

2012-07-14 Thread mark_story
There isn't really an example yet, as no code has been written.  Based on 
this thread it might be a helpful process to go through a public vetting of 
the proposed model api, and how some common use cases might work.  I know 
that josé has begun implementing basic database abstraction which an api 
that resembles PDO, but no work on the actual model layer has started.

-Mark

On Friday, 13 July 2012 14:08:40 UTC-4, Celso wrote:
>
> A example of the new Model approach?
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: 3.0: a peek into CakePHP's future

2012-07-14 Thread mark_story
I'm not aware of any plans to make the good parts of Cake worse.  We fully 
plan on keeping things like Convention over config, and features like bake 
and scaffolding around, perhaps even make them better.

I find it strange that you think arrays are not adequate for configuration, 
but cite yaml + json as more adequate.  Both these data formats parse into 
arrays.  Wouldn't that also imply that arrays are equally good?  I know 
that arrays can have a more finicky syntax than say yaml, but json is 
equally tedious to edit.

I would be interested in alternative ways to declaratively create 
validation rules.  One reason there are so many nested arrays, is that PHP 
doesn't really provide many other ways to statically define complex 
functionality.  Perhaps validation rules shouldn't be treated as a 
declartive configuration type thing, and instead built at runtime using a 
fluent interface?  I think trying to define validation rules in a format 
like ini files would end pretty horribly.

-Mark

On Friday, 6 July 2012 17:50:27 UTC-4, the_woodsman wrote:
>
>
> I've worked with Cake since the 1.1 release, and recently I've worked a 
> lot with Symfony, and on larger scale apps, which has helped me understand 
> the strengths and weaknesess of both frameworks.
>
> So, a chance to express an opinion on the future of Cake? How could I 
> possibly resist :) 
>
> (Disclaimer: All of this is just my opinion /POV, not preaching here...)
>
> Obviously it's important not to throw the baby out with the bath water - 
> DRY, Convention over config, auto-magic/scaffold features, etc are some of 
> the key features that differentiate Cake from other frameworks, and losing 
> this for the sake of a design pattern or a ridiculous amount of abstraction 
> shouldn't be risked.
>
>  * A clearer Dependency Injection model for core classes. I didn't think 
> Cake had anything like this then I read a post on overriding the Request 
> class, and I was like 'is this DI?' SF2 has a DI component that can be 
> reused for this I think.
>
>  * Appropriate use of arrays. There's a time and a place for arrays, and, 
> imho, data is a good use, and advanced config is not.
> I love Cake's convention over config approach (vs the bloated yaml files 
> of Symfony) but when you *do* need  that config, arrays won't cut-it  for 
> more complex stuff. 
> The support for ini files in Cake 2 is a great step forward in this, and, 
> imho, json, xml, and  ini files should be natively supported for some app 
> config, and similar for  value-object creation.
>
>  * Greater modularity - obviously the move to name spaces (and I hope PSR 
> standards?) is linked to this.
> I think partitioning the folders as per 
> https://groups.google.com/forum/?fromgroups#!topic/cake-php/msttsVAG9tI, 
> and making the different libraries work independently, would be ideal- why 
> shouldn't someone be able to use the SF2 Router and the ZF Controller layer 
> and the Cake model layer if that's what works for them? Or migrate their 
> enterprise app over to another framework incrementally?
>
> For example, take the model layer-  Imho, the model later is one of Cake's 
> best features, and changes should be cautious. 
> * Standalone library -  I think being able to use Cake's model layer as a 
> stand-alone would massively increase the mind-share of Cake.
>  * OO changes - it's a matter of opinion, but Cake's arrays aren't really 
> a massive issue for me. Given you can usually access arrays with object 
> syntax, and there's various community behaviors to achieve this effect 
> anyway, I don't think this a deal breaker.  
>
> Value Objects makes some sense, but I personally hope Cake never goes the 
> way of $record->save, and always keeps with $model->save. 
> Imho, putting too much DB behaviour into the row-level objects leads to a 
> much more complex system, where it's a lot easier to implement poor SQL. 
> If people want that approach, don't re-invent the wheel,  Doctrine and 
> Propel are mature libs and they don't need any more competitors :) 
>
> One places the models could definitely do with a revamp is the setting of 
> validation rules.  
> Once I'm 4 levels deep into the array config, I wish I was making classes 
> or objects or using a separate config format!
>
>
> Okay, sorry for the rant, but I'd be interested  to see how closely my 
> views align with the community at large...
>
>
> On Friday, 6 July 2012 03:36:03 UTC+1, José Lorenzo wrote:
>>
>> Since its creation, more than 7 years ago, CakePHP has grown with a life 
>> of its own. Its main goal has always been to empower developers with tools 
>> that are both easy to learn and use, leverage great libraries requiring low 
>> documentation and low dependencies too. We've had several big releases 
>> along these years and an ever growing community. Being one of the most 
>> popular frameworks out there and probably the first one (!) we have also 
>> gotten a lot of criticism from the developer community in

Re: Database Config

2012-07-14 Thread euromark
use some kind of dynamic db switch to always have the right db setting for 
the corresponding environment
like  http://www.dereuromark.de/2012/02/25/dynamic-database-switching/ 
then your problem resolves itself


Am Sonntag, 15. Juli 2012 00:49:24 UTC+2 schrieb advantage+:
>
> I'm baking local, correct so i need to go into database.php and comment 
> out live config, so i can bake local settings because it wont find the 
> local using live server settings, then uncomment / re comment local 
> settings to upload then re-upload database.
>
> If im making changes to local db its not live, i can bake local and test 
> local without having to always edit the database file.
>
> Like i said no big deal just curious. (using Dreamweaver with Auto Upload 
> on Save) so its a pain in the ass dealing with local and live, i know turn 
> off that setting that's the only reason I asked
>
> :)
>
> On Sat, Jul 14, 2012 at 8:13 PM, euromark wrote:
>
>> for me this doesnt make much sense
>> the database is switched/selected based on the environment not what 
>> action/shell you invoke - normally anyway
>>
>> so for local development you have a local db at all times which will then 
>> also be used for baking
>> or what exactly are you asking? I mean, why switching the local db to a 
>> "more local one" for baking?
>>
>>
>>
>> Am Samstag, 14. Juli 2012 19:35:27 UTC+2 schrieb advantage+:
>>
>>> Is there a way to tell local cake what database to use when baking? So 
>>> for example when baking use $local config
>>>
>>>  
>>>
>>> public $default = array(
>>>
>>>   **  'datasource' => 'Database/Mysql',
>>>
>>>   **  'persistent' => false,
>>>
>>>   **  'host' => 'localhost',
>>>
>>>   **  'login' => top_secret',
>>>
>>>   **  'password' => 'hard_to_guess',
>>>
>>>   **  'database' => 'storage_locker',
>>>
>>> );
>>>
>>> 
>>>
>>> public $local = array(
>>>
>>>   **  'datasource' => 'Database/Mysql',
>>>
>>>   **  'persistent' => false,
>>>
>>>   **  'host' => 'localhost',
>>>
>>>   **  'login' => 'root',
>>>
>>>   **  'password' => '',
>>>
>>>   **  'database' => 'local_site',
>>>
>>> );
>>>
>>>  
>>>
>>> Not a super important question , just curious?
>>>
>>  -- 
>> Our newest site for the community: CakePHP Video Tutorials 
>> http://tv.cakephp.org 
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>> others with their CakePHP related questions.
>>  
>>  
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
>> at http://groups.google.com/group/cake-php
>>
>
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Database Config

2012-07-14 Thread Dave Maharaj
I'm baking local, correct so i need to go into database.php and comment out
live config, so i can bake local settings because it wont find the local
using live server settings, then uncomment / re comment local settings to
upload then re-upload database.

If im making changes to local db its not live, i can bake local and test
local without having to always edit the database file.

Like i said no big deal just curious. (using Dreamweaver with Auto Upload
on Save) so its a pain in the ass dealing with local and live, i know turn
off that setting that's the only reason I asked

:)

On Sat, Jul 14, 2012 at 8:13 PM, euromark wrote:

> for me this doesnt make much sense
> the database is switched/selected based on the environment not what
> action/shell you invoke - normally anyway
>
> so for local development you have a local db at all times which will then
> also be used for baking
> or what exactly are you asking? I mean, why switching the local db to a
> "more local one" for baking?
>
>
>
> Am Samstag, 14. Juli 2012 19:35:27 UTC+2 schrieb advantage+:
>
>> Is there a way to tell local cake what database to use when baking? So
>> for example when baking use $local config
>>
>>
>>
>> public $default = array(
>>
>>   **  'datasource' => 'Database/Mysql',
>>
>>   **  'persistent' => false,
>>
>>   **  'host' => 'localhost',
>>
>>   **  'login' => top_secret',
>>
>>   **  'password' => 'hard_to_guess',
>>
>>   **  'database' => 'storage_locker',
>>
>> );
>>
>>
>>
>> public $local = array(
>>
>>   **  'datasource' => 'Database/Mysql',
>>
>>   **  'persistent' => false,
>>
>>   **  'host' => 'localhost',
>>
>>   **  'login' => 'root',
>>
>>   **  'password' => '',
>>
>>   **  'database' => 'local_site',
>>
>> );
>>
>>
>>
>> Not a super important question , just curious?
>>
>  --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Media PLugin

2012-07-14 Thread AppSynergy
Hi all, 

I just ran into this same problem - I want the image upload to be optional, 
but don't want to go to the trouble of creating another Model (I had this 
system originally, and am trying to improve things by bringing the image 
into the main model!)

Anyway, I found a sneaky way to have one's cake:

 ---
// IN CONTROLLER
// Images are optional
*if ($this->request->data['Model']['file']['name'] == '') {*
*$this->Model->saveField('file',*
*'PATH_TO_SOME_DEFAULT_IMAGE');*
*}*
if ($this->Model->save($this->request->data)) {
 ...

This works** because you add the file field after the new model is created, 
but before the beforeSave() stuff kicks in. 
The end result - it thinks you already have a file, so doesn't check - then 
overwrites it with a blank value anyway. I don't think it even matters what 
default value you enter, doesn't even have to be a valid image location
End result : no file, valid save.

** AFAICS, better explanations welcome!

Cheers, A


On Wednesday, February 29, 2012 4:23:04 PM UTC, jeremyharris wrote:
>
> What about setting an empty hidden field in the view, like
>
> echo $this->Form->hidden('Model.file', array('value' => ''));
>
> I'd probably be more prone to just copy and paste the Coupler to my own 
> behaviors and modify it, or create a new small behavior that is just 
> dedicated to this task.
>
> On Wednesday, February 29, 2012 7:49:01 AM UTC-8, 
> keith...@classoutfit.comwrote:
>>
>> I tried it earlier by adding the following to the end of the beforeSave() 
>> in our Users model:
>>
>> if (!isset($this->data['User']['file'])) { $this->data['User']['file'] = 
>> null; }
>>
>> But when I tested it I discovered that the beforeSave() in the Media 
>> Coupler was firing before the beforeSave() in our Users model, so it was 
>> too late to add the empty 'file' key to the array as the 'User' had already 
>> been unset by the Coupler. I've therefore had to roll the change back and 
>> go back to the drawing board for now.
>>
>> Keith Gorman
>> *Class Outfit*
>> **
>> keithgor...@classoutfit.com
>> www.classoutfit.com 
>>
>> On 29 Feb 2012, at 15:21, jeremyharris wrote:
>>
>> I probably didn't take your reply the right way. Hopefully I wasn't too 
>> harsh myself.
>>
>> Anyway, hopefully you'll get a response from David soon. Did you ever get 
>> to try out passing an empty 'file' key in the form (i.e., a hidden field)? 
>> That way, the key would exist and the Coupler wouldn't unset the data. I 
>> don't think this is a very elegant solution either, but I was curious if 
>> you tried it out.
>>
>> On Tuesday, February 28, 2012 8:41:39 PM UTC-8, Jeremy Burns wrote:
>>>
>>> Gosh my reply sounded harsh on you Jeremy - that wasn't my intention. 
>>> We've commented out the line that unsets the data and it *all seems fine*, 
>>> which also feels dirty. The user records are saving correctly, we can 
>>> subsequently add images to user records and all other dedicated image 
>>> tables that use the coupler are functioning too. I did reach out to David 
>>> yesterday, hoping to learn more from him so that we can implement this 
>>> properly and will report back.
>>>
>>> Jeremy Burns
>>> Class Outfit
>>>
>>> http://www.classoutfit.com
>>>  
>>> On 28 Feb 2012, at 21:15:25, jeremyharris wrote:
>>>
>>> I didn't say I agreed with how it worked, I was just explaining what I 
>>> think the author's intended use case was. The question was if you were 
>>> missing a setting or doing anything wrong. You weren't, so I just threw out 
>>> some ideas based on how the Coupler works. Feel free to take it up with the 
>>> author or create a Coupler that works for you.
>>>
>>> I'm glad that an empty image doesn't create garbage data, that thought 
>>> was based off of what the Coupler does down the road (check the file and 
>>> populate dirname and basename).
>>>
>>> On Tuesday, February 28, 2012 12:06:23 PM UTC-8, Jeremy Burns wrote:

 I understand what you are saying but I don't think it's the full 
 answer. It's a perfectly valid use case to have a table that has an 
 optional image in it without the need to have a separate join table. The 
 absence of the image doesn't create any garbage data; the user row is 
 still 
 valid. A bio snap for a user is good example. For the plugin to simply 
 clear the whole data array because the optional image fields aren't 
 populated is nuts. If the fields are empty simply return true and let the 
 main model get on with its work.

 Jeremy Burns
 Class Outfit

 http://www.classoutfit.com
  
 On 28 Feb 2012, at 15:45:29, jeremyharris wrote:

 It should only unset the data if you are creating the User and it's 
 missing the 'file' key. If you are updating, you shouldn't *need* the 
 'file' key.

 That said, you can probably get away with passing an empty (or a path 
 to a default image) file key when you are creating the User using a hidden 
 field. Thi

Re: Database Config

2012-07-14 Thread euromark
for me this doesnt make much sense
the database is switched/selected based on the environment not what 
action/shell you invoke - normally anyway

so for local development you have a local db at all times which will then 
also be used for baking
or what exactly are you asking? I mean, why switching the local db to a 
"more local one" for baking?



Am Samstag, 14. Juli 2012 19:35:27 UTC+2 schrieb advantage+:
>
> Is there a way to tell local cake what database to use when baking? So for 
> example when baking use $local config
>
>  
>
> public $default = array(
>
> 'datasource' => 'Database/Mysql',
>
> 'persistent' => false,
>
> 'host' => 'localhost',
>
> 'login' => top_secret',
>
> 'password' => 'hard_to_guess',
>
> 'database' => 'storage_locker',
>
> );
>
> 
>
> public $local = array(
>
> 'datasource' => 'Database/Mysql',
>
> 'persistent' => false,
>
> 'host' => 'localhost',
>
> 'login' => 'root',
>
> 'password' => '',
>
> 'database' => 'local_site',
>
> );
>
>  
>
> Not a super important question , just curious?
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Security Release - CakePHP 2.1.5 & 2.2.1

2012-07-14 Thread mark_story
CakePHP 2.1.5 and 2.2.1 have just been released. If you are using CakePHP's 
`Xml` class, you should upgrade as soon as possible.

The security issue was recently reported by Paweł Wyleciał. When accepting 
user provided XML it is possible to read arbitrary files using external 
entities.  This is particularily dangerous for applications accepting XML 
data as part of a webservice.  A possible exploit example would be:

   curl -X POST -H 'Content-Type: application/xml' http://locahost/posts -d 
']>
   
   &payload;
   ]'

Once the XML has been processed `$this->request->data['Post']['body']` will 
contain the contents of `/etc/passwd`. This issue was 
[fixed](http://github.com/cakephp/cakephp/commit/6c905411bac66caad5e220a70e3d561b8a648507)
 
and packaged releases for 2.1 and 2.2 have been created.  This issue does 
not affect the 1.3 or 1.2 release series.  If you are unable to upgrade, 
you should apply the 
[patch](http://github.com/cakephp/cakephp/commit/6c905411bac66caad5e220a70e3d561b8a648507)
 
as soon as possible.

### Other fixes in 2.2.1

In addition to the security fix 2.2.1 contains fixes for the following 
issues:

* Fixed missing urlencode on nested named parameters.
* Fixed ANSI codes being output on windows terminals.
* Fixed HtmlHelper::image() including the base directory twice when the 
fullBase option is used.
* Console logging now respects the quiet flag for shells.
* TranslateBehavior now saves records with only some translated fields 
correctly.
* afterValidate() was made available on behaviors. This was an omission in 
2.2.0.

View the complete changelog for 2.2.1 and 2.1.5. Download a packaged 
release.

CakeFest 2012 is around the corner and we already expect awesome talks and 
workshops during the best PHP conference out there. If you haven't booked 
[your tickets](http://cakefest.org/ticket-info) yet, it's about time you do.

As always, thanks to the friendly CakePHP community for the patches, 
documentation changes and new tickets. Without you there would be no 
CakePHP!

**Links**

[1] http://cakephp.org/changelogs/2.2.1
[2] http://cakephp.org/changelogs/2.1.5
[3] http://github.com/cakephp/cakephp/tags
[4] http://cakefest.org

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Newbie: Problem with Blog tutorial

2012-07-14 Thread Piotr Beschel
Like! +1

W dniu sobota, 14 lipca 2012 16:19:38 UTC+2 użytkownik AD7six napisał:
>
> In what way is that unexpected?
>
> AD
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: New to CakePHP .. problem with mod_rewrite

2012-07-14 Thread Piotr Beschel


W dniu sobota, 14 lipca 2012 05:24:16 UTC+2 użytkownik surajmundada napisał:
>
>
> I have not installed PHP. Is it necessary to install PHP before CakePHP?
>
>
Yes it is!
Cakephp is PHP framework and to work cake need php compilation. 

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Newbie: Problem with Blog tutorial

2012-07-14 Thread AD7six
In what way is that unexpected?

AD

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Newbie: Problem with Blog tutorial

2012-07-14 Thread Kunal Bajpai
As described in the blog tutorial - 

Also remove these .htaccess files:

/.htaccess/app/.htaccess/app/webroot/.htaccess

This will make your URLs look like 
www.example.com/index.php/controllername/actionname/param rather than 
www.example.com/controllername/actionname/param.

I did the same but still the above mentioned problem exists. My url - 
*blog.com/index.php/posts/ 
*works, but the  *blog.com/posts/ *shows the error, Url not found on the 
server

TIA

Kbajpai

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Edit User on second submit

2012-07-14 Thread chuminh
I am having the same problem with edit. I got exactly the same code as 
above. but when I try to edit and save the data, it does not save, it gives 
me flash message. I wonder what is wrong with the code because i follow 
this edit function from blog tutorial.

Thanks

On Wednesday, July 11, 2012 11:47:44 PM UTC+10, Max Dörfler wrote:
>
>  I guess in your view you have to pass in the id (echo 
> $this->Form->input('id');). This should include a hidden id field.
> I wonder why it works the first time (without leaving a field blank). Are 
> you sure the user gets edited and not a new user created? Because when you 
> save $this->request->data, the data shouldn't contain the id if you didn't 
> pass it from the view!
>
> On 07/11/2012 03:20 PM, Banana Man wrote:
>  
> Hi, 
>
>  I am trying to setup an Edit User authentication action.  I have 
> authentication working fine for adding a user but when i try to edit a user 
> i am running into a problem.  
>
>  If i try to edit a user when all information supplied passes validation 
> it works fine (URL: http://localhost/users/edit/3).  If however i leave a 
> textfield blank when i am validating it against 'notEmpty' the first time i 
> hit the form submit button it works as expected and reloads the edit user 
> page with the validation error displayed (URL: 
> http://localhost/users/edit/3).  If i do nothing and try to submit the 
> form again with the blank textfield i now get redirected to 
> http://localhost/users/edit with an Invalid User message "*Error: * The 
> requested address *'/users/edit'* was not found on this server."
>
>  
>   public function edit($id = null) {
> $this->User->id = $id;
> if (!$this->User->exists()) {
> throw new NotFoundException(__('Invalid user'));
> }
> if ($this->request->is('post') || $this->request->is('put')) {
> if ($this->User->save($this->request->data)) {
> $this->Session->setFlash(__('The user has been saved'));
> $this->redirect(array('action' => 'index'));
> } else {
> $this->Session->setFlash(__('The user could not be saved. 
> Please, try again.'));
> }
> } else {
> $this->request->data = $this->User->read(null, $id);
> }
> }
>  
>  
>  
>  
>  
> Form->create('User', array('action' => 'edit'));?>
>  
>  
>echo $this->Session->flash();
>  echo $this->Form->input('firstname', array('label' => 'First Name'));
>  echo $this->Form->input('secondname', array('label' => 'Second Name'));
>  echo $this->Form->input('address_01', array('label' => 'Address Line 
> 1'));
>  echo $this->Form->input('address_02', array('label' => 'Address Line 
> 2'));
>  echo $this->Form->input('address_03', array('label' => 'Address Line 
> 3'));
>  echo $this->Form->input('address_04', array('label' => 'Address Line 
> 4'));
>  echo $this->Form->input('tel_01', array('label' => 'Telephone'));
>  echo $this->Form->input('email');
>  echo $this->Form->hidden('role', array('value' => 'customer'));
>  ?>
>  
> Form->end(__('Submit'));?>
> 
> 
>  
>  
>
>  Html->link(__('List Users'), array('action' => 
> 'index'));?>
>  
> 
>  
>  
>  
>  Does anyone know why i am getting redirected on the second submit?
>
>  Thanks!
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> at http://groups.google.com/group/cake-php
>
>
>
> 

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


New to CakePHP .. problem with mod_rewrite

2012-07-14 Thread surajmundada
Hi,

I am new to CakePHP ... downloaded Cake 2.2.0 and set it up on Apache as 
given in cookbook.

I did all settings as given in cookbook (both mod_rewrite and CakePHP 
pretty URLs). Still I can not see default cake page in sample blog's 
webroot. Not sure where to look for errors.

I have not installed PHP. Is it necessary to install PHP before CakePHP?

Is there any other documentation/resources available for CakePHP other than 
cookbook?

Please advice.

Regards,
Suraj

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Configure::write('App.baseUrl', env('SCRIPT_NAME')); missing controller

2012-07-14 Thread sb
I have the same problem. I am choosing NOT to use mod_rewrite. I followed 
the instructions in the blog tutorial, but I get missing controllers.
If I don't use mod_rewrite, then I am instructed by the tutorial to delete 
.htaccess. Do I still need to edit the httpd.conf for the overrides?

-sb

On Saturday, June 16, 2012 5:32:28 AM UTC-4, Anooj P wrote:
>
>
> 1)   Make sure that an .htaccess override is allowed: in your httpd.conf, 
>> you should have a section that defines a section for each Directory on your 
>> server. Make sure the AllowOverride is set to All for the correct 
>> Directory. For security and performance reasons, do *not* set 
>> AllowOverride to All in . Instead, look for the 
>> block that refers to your actual website directory.
>
>2)  Make sure you are editing the correct httpd.conf rather than a 
> user- or site-specific httpd.conf.
>3)Make sure Apache is loading up mod_rewrite correctly! You should see 
> something like LoadModule rewrite_module libexec/httpd/mod_rewrite.so or 
> (for Apache 1.3) AddModule mod_rewrite.c in your httpd.conf.
>
> you wil get more info here
> http://book.cakephp.org/compare/333/A-Note-on-mod_rewrite/cakephp/cakephp1x
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php