Uploading Cakephp site to live server and getting error 500 internal server error

2015-07-16 Thread Amitava Pramanik
I have created a cakephp site and uploaded to my staging server. The Url is 
http://xecutiontech.com/rr-2/
In my staging server the site has been uploaded to the folder named rr-2 
that's why the url looks like xecutiontech.com/rr-2. The site looks ok if I 
hit the above mentioned url.

My client has provided a domain http://www.hotelhomelyraj.com/ which is now 
pointing the folder named rr-2 which is in my staging server. So clients 
domain is pointing to the same folder. 
It means if I hit the url http://www.hotelhomelyraj.com/ the site should 
open but Its showing 500 Internal Server Error. This the problem please 
help me.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


CakePHP 3

2015-07-16 Thread Rafael Queiroz
Hi guys,

I need store the currently logged in user as a reference for the created
register, the cakebook sample is:

public function add(){
$article = $this-Articles-newEntity();
if ($this-request-is('post')) {
$article = $this-Articles-patchEntity($article,
$this-request-data);*// Added this line
$article-user_id = $this-Auth-user('id');
*// You could also do the following
//$newData = ['user_id' = $this-Auth-user('id')];
//$article = $this-Articles-patchEntity($article, $newData);
if ($this-Articles-save($article)) {
$this-Flash-success(__('Your article has been saved.'));
return $this-redirect(['action' = 'index']);
}
$this-Flash-error(__('Unable to add your article.'));
}
$this-set('article', $article);}

In old version,  2.x, i use beforeSave callbacks in Model and load
AuthComponent, for save user id logged.

Any sugestion for Cake 3 ? Thanks.

-- 
Regards,

Rafael F. Queiroz

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: CakePHP 3

2015-07-16 Thread Rafael Queiroz
Hey man,

I need skinny controller. I need remove this code to controller for using
in Model/Entity or Model/Table.

On Thu, Jul 16, 2015 at 11:17 AM, 'Sajoscha Sauer' via CakePHP 
cake-php@googlegroups.com wrote:

 Hi Rafael,

 $userid = $this-Auth-user('id');
 $this-request-data['user_id'] = $userid;
 $article = $this-Articles-patchEntity($article, $this-request-data);
 if ($this-Articles-save($article)) {
 …

 That works for me, hope it helps!
 Cheers,
 Sajoscha


 On Jul 16, 2015, at 3:59 PM, Rafael Queiroz rafael...@gmail.com wrote:

 Hi guys,

 I need store the currently logged in user as a reference for the created
 register, the cakebook sample is:

 public function add(){
 $article = $this-Articles-newEntity();
 if ($this-request-is('post')) {
 $article = $this-Articles-patchEntity($article, 
 $this-request-data);*// Added this line
 $article-user_id = $this-Auth-user('id');
 *// You could also do the following
 //$newData = ['user_id' = $this-Auth-user('id')];
 //$article = $this-Articles-patchEntity($article, $newData);
 if ($this-Articles-save($article)) {
 $this-Flash-success(__('Your article has been saved.'));
 return $this-redirect(['action' = 'index']);
 }
 $this-Flash-error(__('Unable to add your article.'));
 }
 $this-set('article', $article);}

 In old version,  2.x, i use beforeSave callbacks in Model and load
 AuthComponent, for save user id logged.

 Any sugestion for Cake 3 ? Thanks.

 --
 Regards,

 Rafael F. Queiroz

 --
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP

 ---
 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.


  --
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP

 ---
 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.




-- 
Atenciosamente,

Rafael F. Queiroz

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


CakePHP 3 Events

2015-07-16 Thread Rafael Queiroz
Hi guys,

I have question for Cake Events conventions:

$event = new Event('Model.Order.afterPlace', $this, []);
“*Order*” or “*Orders*” ?

I abstract modelAlias using in AppTable:

public function afterSave(\Cake\Event\Event $event, $entity, $options) {
if ($entity-isNew()) {
$event = new Event(Model.{$this-alias()}.afterCreate, $this,
[]);
$this-eventManager()-dispatch($event);
}
}

In Cake 3, my modelAlias is plural, not singular.

-- 
Regards,

Rafael F. Queiroz

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: CakePHP 3

2015-07-16 Thread 'Sajoscha Sauer' via CakePHP
Hi Rafael, 

$userid = $this-Auth-user('id');
$this-request-data['user_id'] = $userid;
$article = $this-Articles-patchEntity($article, $this-request-data);
if ($this-Articles-save($article)) {
…

That works for me, hope it helps! 
Cheers, 
Sajoscha


 On Jul 16, 2015, at 3:59 PM, Rafael Queiroz rafael...@gmail.com wrote:
 
 Hi guys,
 
 I need store the currently logged in user as a reference for the created 
 register, the cakebook sample is:
 public function add()
 {
 $article = $this-Articles-newEntity();
 if ($this-request-is('post')) {
 $article = $this-Articles-patchEntity($article, 
 $this-request-data);
 // Added this line
 $article-user_id = $this-Auth-user('id');
 // You could also do the following
 //$newData = ['user_id' = $this-Auth-user('id')];
 //$article = $this-Articles-patchEntity($article, $newData);
 if ($this-Articles-save($article)) {
 $this-Flash-success(__('Your article has been saved.'));
 return $this-redirect(['action' = 'index']);
 }
 $this-Flash-error(__('Unable to add your article.'));
 }
 $this-set('article', $article);
 }
 In old version,  2.x, i use beforeSave callbacks in Model and load 
 AuthComponent, for save user id logged.
 
 Any sugestion for Cake 3 ? Thanks.
 
 -- 
 Regards,
 
 Rafael F. Queiroz
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP 
 https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com 
 mailto:cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com 
 mailto:cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php 
 http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout 
 https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


CakePHP 3 Component

2015-07-16 Thread Rafael Queiroz
Hi guys,

I need loaded components in my Models, actually Auth Component, for store
user id logged. In old version, CakePHP 2.x, i using in my model:

App::uses('AuthComponent', 'Controller/Component');

public function beforeSave() {
if (!$this-id) {
$this-data[$this-alias]['user_id'] = AuthComponent::user('id');
}
}

It's possible in Cake 3 ?

-- 
Atenciosamente,

Rafael F. Queiroz

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Composer and Cake lib folder

2015-07-16 Thread euromark
yes and yes
the additional files don't hurt :)


Am Dienstag, 14. Juli 2015 17:13:31 UTC+2 schrieb brett.shi...@gmail.com:

 Ok, that example clears up my confusion.  Basically when cake is 
 required within the composer file, it gets downloaded to the Vendor 
 folder.

 I then need to edit my app/webroot/index.php to point to the Cake core lib 
 folder in /Vendor/cakephp/.  Is that correct?

 Also, I noticed composer also downloaded the app folder structure into the 
 Vendor.  I am assuming that is just how it is and you can't just download 
 the required core/lib Cake folders?

 On Monday, July 13, 2015 at 8:10:52 AM UTC-7, euromark wrote:

 That is actually how you are *supposed* to do it.
 the vendors including the cake core should never be commited and tracked.

 See https://github.com/dereuromark/cakefest for an example 
 implementation (both 2.x and 3.x composered).

 mark



 Am Sonntag, 12. Juli 2015 13:23:06 UTC+2 schrieb brett.shi...@gmail.com:

 I have a standard Cake project setup on Github.  The project root for 
 has the app, lib folders in addition to all the other files like 
 .gitignore.  I would like to remove the lib folder from my repo and control 
 which Cake version I am using with a dependency manager.  Is this possible 
 with composer? 

 For example, I could just change the composer json file from Cake 2.4 to 
 2.6, and the repo will not have to track the lib folder.  Then when I want 
 to put the project online, I can just have composer download the lib 
 folder. 

 Is this possible?  What would that composer file look like?  I tried 
 adding cakephp/cakephp: ~2.6 to the composer file but it gives and 
 error saying the package could not be found.



-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Uploading Cakephp site to live server and getting error 500 internal server error

2015-07-16 Thread Mike Knight
Please check your web server(nginx/apache) logs . without further
information ,I can't say what's wrong.

2015-07-16 14:03 GMT+08:00 Amitava Pramanik 
amitava.xecution.technolog...@gmail.com:

 I have created a cakephp site and uploaded to my staging server. The Url
 is http://xecutiontech.com/rr-2/
 In my staging server the site has been uploaded to the folder named rr-2
 that's why the url looks like xecutiontech.com/rr-2. The site looks ok if
 I hit the above mentioned url.

 My client has provided a domain http://www.hotelhomelyraj.com/ which is
 now pointing the folder named rr-2 which is in my staging server. So
 clients domain is pointing to the same folder.
 It means if I hit the url http://www.hotelhomelyraj.com/ the site should
 open but Its showing 500 Internal Server Error. This the problem please
 help me.

 --
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP

 ---
 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


CakePHP 3.0.9 Released

2015-07-16 Thread mark_story
The CakePHP core team is happy to announce the immediate availability of 
CakePHP 3.0.9. This is a maintenance release for the 3.0 branch.

Bugfixes


You can expect the following changes in 3.0.9. See the 
[changelog](http://cakephp.org/changelogs/3.0.9) for every commit.

* Index and constraint reflection in MySQL now scopes to the current 
database.
* `.` is now allowed in ObjectRegistry keys. This allows cache 
configurations to have `.` in their names.
* Datetime validation now correctly handles meridian values.
* Improved API documentation.
* Pagination link generation is correct with custom routes.
* `Entity::extractOriginalChanged()` now returns properties that were 
initially null.
* Marshalling `_joinData` in belongsToMany associations with existing 
entities is now handled correctly.
* `Text::tokenize()` now works as expected when the separator is a 
multi-byte character.
* Folders generated by `i18n extract` have the correct permissions assigned.
* Entities are now marked as 'clean' after the afterSave event.
* The ORM does not emit UPDATE statements for hasMany and belongsToMany 
associations that have not actually changed.
* `Response::file()` now accepts files with `..` in the basename.

Improvements


As part of the 3.0 patch releases we are experimenting with implementing 
smaller net new features. In 3.0.9 the following new features were added:

* Associations can now define a `bindingKey()` this column allows you to 
bind associations to non-primary key columns. This aims to remove the need 
to  define `foreignKey = false` in associations.
* Collections can now be serialized and unserialized with ease. This makes  
caching collections easier.
* Exception attributes are no longer logged when debug=0.
* `Response::body()` accepts a callable that can echo content directly or  
return the response body.
* `Email::configuredTransport()` was added to allow enumeration of the 
configured email transports.
* String templates accept `.` and `_` in variable names. This improves 
compatibility with arrays generated by `Hash::flatten()`
* Custom Type classes can define a baseType that maps to a simpler type. 
This makes it easier for FormHelper to generate inputs for custom types.
* `i18n extract` now supports a `--no-location` option. This option will 
omit the location comments for messages from the generated POT file.

As always, a huge thanks to all the community members that helped make this 
release happen by reporting issues and sending pull requests.

Download a [packaged release on 
github](https://github.com/cakephp/cakephp/releases).

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.