mosbth /
cimage
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php |
||
|
0 ignored issues
–
show
|
|||
| 2 | /** |
||
| 3 | * Resize and crop images on the fly, store generated images in a cache. |
||
| 4 | * |
||
| 5 | * This version is a all-in-one version of img.php, it is not dependant an any other file |
||
| 6 | * so you can simply copy it to any place you want it. |
||
| 7 | * |
||
| 8 | * @author Mikael Roos [email protected] |
||
| 9 | * @example http://dbwebb.se/opensource/cimage |
||
| 10 | * @link https://github.com/mosbth/cimage |
||
| 11 | * |
||
| 12 | */ |
||
| 13 | define("CIMAGE_BUNDLE", true); |
||
| 14 | |||
| 15 | |||
| 16 | /** |
||
| 17 | * Change configuration details in the array below or create a separate file |
||
| 18 | * where you store the configuration details. |
||
| 19 | * |
||
| 20 | * The configuration file should be named the same name as this file and then |
||
| 21 | * add '_config.php'. If this file is named 'img.php' then name the |
||
| 22 | * config file should be named 'img_config.php'. |
||
| 23 | * |
||
| 24 | * The settings below are only a few of the available ones. Check the file in |
||
| 25 | * webroot/img_config.php for a complete list of configuration options. |
||
| 26 | */ |
||
| 27 | $config = array( |
||
| 28 | |||
| 29 | //'mode' => 'production', // 'production', 'development', 'strict' |
||
| 30 | //'image_path' => __DIR__ . '/img/', |
||
| 31 | //'cache_path' => __DIR__ . '/../cache/', |
||
| 32 | //'alias_path' => __DIR__ . '/img/alias/', |
||
| 33 | //'remote_allow' => true, |
||
| 34 | //'password' => false, // "secret-password", |
||
| 35 | |||
| 36 | ); |
||
| 37 |
The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.
The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.
To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.