diff --git a/README.md b/README.md index f7fb8f3ff..f36e63824 100644 --- a/README.md +++ b/README.md @@ -6,13 +6,19 @@ Just a simple user authentication solution inside a super-simple framework skele (and comes with an auto-installer), using the future-proof official bcrypt password hashing/salting implementation of PHP 5.5+, plus some nice features that will speed up the time from idea to first usable prototype application dramatically. Nothing more. This project has its focus on hardcore simplicity. Everything is as simple as possible, -made for smaller projects and typical agency work. If you want to build massive corporate applications with all the -features modern frameworks have, then have a look at [Laravel](http://laravel.com), [Symfony](http://symfony.com) or -[Yii](http://www.yiiframework.com), but if you just want to create quickly small to mid-size applications, then HUGE -might be interesting for you. +made for smaller projects, typical agency work and quick pitch drafts. If you want to build massive corporate +applications with all the features modern frameworks have, then have a look at [Laravel](http://laravel.com), +[Symfony](http://symfony.com) or [Yii](http://www.yiiframework.com), but if you just want to quickly create something +that just works, then this script might be interesting for you. + +HUGE's simple-as-possible architecture was inspired by several conference talks, slides and articles about huge +applications that - surprisingly and intentionally - go back to the basics of programming, using procedural programming, +static classes, extremely simple constructs, not-totally-DRY code etc. while keeping the code extremely readable +([StackOverflow](http://www.dev-metal.com/architecture-stackoverflow/), Wikipedia, SoundCloud). + +Buzzwords: [KISS](http://en.wikipedia.org/wiki/KISS_principle), [YASNI](http://en.wikipedia.org/wiki/You_aren%27t_gonna_need_it). [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/panique/huge/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/panique/huge/?branch=master) -[![Build Status](https://scrutinizer-ci.com/g/panique/huge/badges/build.png?b=master)](https://scrutinizer-ci.com/g/panique/huge/build-status/master) [![Code Climate](https://codeclimate.com/github/panique/huge/badges/gpa.svg)](https://codeclimate.com/github/panique/huge) [![Dependency Status](https://www.versioneye.com/user/projects/54ca11fbde7924f81a000010/badge.svg?style=flat)](https://www.versioneye.com/user/projects/54ca11fbde7924f81a000010) diff --git a/application/config/config.development.php b/application/config/config.development.php index ce67ee250..1ac7c5b19 100644 --- a/application/config/config.development.php +++ b/application/config/config.development.php @@ -7,8 +7,8 @@ /** * Configuration for: Error reporting - * Useful to show every little problem during development, but only show hard errors in production. - * It's a little bit dirty to put this here, but who cares. + * Useful to show every little problem during development, but only show hard / no errors in production. + * It's a little bit dirty to put this here, but who cares. For development purposes it's totally okay. */ error_reporting(E_ALL); ini_set("display_errors", 1); diff --git a/application/model/AvatarModel.php b/application/model/AvatarModel.php index 8d199334b..7c55dc63f 100644 --- a/application/model/AvatarModel.php +++ b/application/model/AvatarModel.php @@ -91,10 +91,14 @@ public static function validateImageFile() if (!is_dir(Config::get('PATH_AVATARS')) OR !is_writable(Config::get('PATH_AVATARS'))) { Session::add('feedback_negative', Text::get('FEEDBACK_AVATAR_FOLDER_DOES_NOT_EXIST_OR_NOT_WRITABLE')); return false; - } else if (!isset($_FILES['avatar_file']) OR empty ($_FILES['avatar_file']['tmp_name'])) { + } + + if (!isset($_FILES['avatar_file']) OR empty ($_FILES['avatar_file']['tmp_name'])) { Session::add('feedback_negative', Text::get('FEEDBACK_AVATAR_IMAGE_UPLOAD_FAILED')); return false; - } else if ($_FILES['avatar_file']['size'] > 5000000) { + } + + if ($_FILES['avatar_file']['size'] > 5000000) { // if input file too big (>5MB) Session::add('feedback_negative', Text::get('FEEDBACK_AVATAR_UPLOAD_TOO_BIG')); return false; @@ -107,7 +111,9 @@ public static function validateImageFile() if ($image_proportions[0] < Config::get('AVATAR_SIZE') OR $image_proportions[1] < Config::get('AVATAR_SIZE')) { Session::add('feedback_negative', Text::get('FEEDBACK_AVATAR_UPLOAD_TOO_SMALL')); return false; - } else if (!($image_proportions['mime'] == 'image/jpeg' || $image_proportions['mime'] == 'image/png')) { + } + + if (!($image_proportions['mime'] == 'image/jpeg' || $image_proportions['mime'] == 'image/png')) { Session::add('feedback_negative', Text::get('FEEDBACK_AVATAR_UPLOAD_WRONG_TYPE')); return false; }