Monday, May 5, 2014

Re: Thumbs Plugin for CakePHP 2.x

A few remarks from my end:

You should probably composer-ize your plugin to make it easier to include in projects that do not want to go down the old fashioned submodule way.

Those classes you put in Vendor shouldn't be in there. vendor is only for third party code, this code of yours should be in /Lib folder instead - and included
using App::uses which allows lazy loading - your approach doesn't
Actually, your whole plugin shouldn't have to use import() once - `App::import('Lib'..` etc should also be App::uses calls.

Test your code - this is one of the most crucial things missing here - and does not make people confident in your plugin.
It also allows regression and errors to sneak in.

Respecting the cake coding standards would be helpful, especially when you are not doing this solely for yourself, but also for the community - or if you
want others to join in and help you.
This includes the "semantic" cs as well as widely accepted patterns such as "no private, but protected" for example.
The latter allows easier extendability.
Furthermore:
- Use tabs as indentation as well as http://book.cakephp.org/2.0/en/contributing/cakephp-coding-conventions.html
- Dont forget App::uses() calls in classes like Controller etc - this would blow up once you added tests

Respecting all above points should probably make it easier to accept and work with your plugin as well as contribute back.
Mark


Am Montag, 5. Mai 2014 19:25:41 UTC+2 schrieb André Luis:
Hi everyone, me and my friend created a Thumbnails plugin for CakePHP 2.x

This plugin allows you to create thumbnails from any public image just using URL´s, so you can use the thumbnail on your backgrounds too.

For example, if you have http://example.com/img/logotype.png and you wish to create a cropped image 100x100 px you can access http://example.com/thumbs/crop/small/img/logotype.png and will have a 100x100 cropped image from original. Or if you want this same logotype on a red box 300x300 pixels you can access https://example.com/thumbs/fill/medium/red/img/logotype.png

All you need to do is create a configuration file wich will be determine the sizes and fill colors.

--
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+unsubscribe@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.

No comments: