Kohana v3.3.5
This commit is contained in:
37
modules/image/.travis.yml
Normal file
37
modules/image/.travis.yml
Normal file
@@ -0,0 +1,37 @@
|
||||
sudo: false
|
||||
|
||||
language: php
|
||||
|
||||
# Only build the main develop/master branches - feature branches will be covered by PRs
|
||||
branches:
|
||||
only:
|
||||
- /^[0-9\.]+\/(develop|master)$/
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- vendor
|
||||
- $HOME/.composer/cache
|
||||
|
||||
php:
|
||||
- 5.3
|
||||
- 5.4
|
||||
- 5.5
|
||||
- 5.6
|
||||
- 7.0
|
||||
- hhvm
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- php: 5.3
|
||||
env: 'COMPOSER_PHPUNIT="lowest"'
|
||||
|
||||
before_script:
|
||||
- composer install --prefer-dist
|
||||
- if [ "$COMPOSER_PHPUNIT" = "lowest" ]; then composer update --prefer-lowest --with-dependencies phpunit/phpunit; fi;
|
||||
- vendor/bin/koharness
|
||||
|
||||
script:
|
||||
- cd /tmp/koharness && ./vendor/bin/phpunit --bootstrap=modules/unittest/bootstrap.php modules/unittest/tests.php
|
||||
|
||||
notifications:
|
||||
email: false
|
@@ -0,0 +1,6 @@
|
||||
# Kohana - image processing module
|
||||
|
||||
| ver | Stable | Develop |
|
||||
|-------|--------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------|
|
||||
| 3.3.x | [](https://travis-ci.org/kohana/image) | [](https://travis-ci.org/kohana/image) |
|
||||
| 3.4.x | [](https://travis-ci.org/kohana/image) | [](https://travis-ci.org/kohana/image) |
|
||||
|
@@ -23,6 +23,7 @@ abstract class Kohana_Image {
|
||||
const VERTICAL = 0x12;
|
||||
|
||||
/**
|
||||
* @deprecated - provide an image.default_driver value in your configuration instead
|
||||
* @var string default driver: GD, ImageMagick, etc
|
||||
*/
|
||||
public static $default_driver = 'GD';
|
||||
@@ -44,8 +45,9 @@ abstract class Kohana_Image {
|
||||
{
|
||||
if ($driver === NULL)
|
||||
{
|
||||
// Use the default driver
|
||||
$driver = Image::$default_driver;
|
||||
// Use the driver from configuration file or default one
|
||||
$configured_driver = Kohana::$config->load('image.default_driver');
|
||||
$driver = ($configured_driver) ? $configured_driver : Image::$default_driver;
|
||||
}
|
||||
|
||||
// Set the class name
|
||||
|
@@ -611,6 +611,7 @@ class Kohana_Image_GD extends Image {
|
||||
switch (strtolower($extension))
|
||||
{
|
||||
case 'jpg':
|
||||
case 'jpe':
|
||||
case 'jpeg':
|
||||
// Save a JPG file
|
||||
$save = 'imagejpeg';
|
||||
|
@@ -314,6 +314,7 @@ class Kohana_Image_Imagick extends Image {
|
||||
switch ($format)
|
||||
{
|
||||
case 'jpg':
|
||||
case 'jpe':
|
||||
case 'jpeg':
|
||||
$type = IMAGETYPE_JPEG;
|
||||
break;
|
||||
|
@@ -24,6 +24,11 @@
|
||||
"kohana/core": ">=3.3",
|
||||
"php": ">=5.3.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"kohana/core": "3.3.*@dev",
|
||||
"kohana/unittest": "3.3.*@dev",
|
||||
"kohana/koharness": "*@dev"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-gd": "*"
|
||||
},
|
||||
@@ -31,6 +36,9 @@
|
||||
"branch-alias": {
|
||||
"dev-3.3/develop": "3.3.x-dev",
|
||||
"dev-3.4/develop": "3.4.x-dev"
|
||||
}
|
||||
},
|
||||
"installer-paths": {
|
||||
"vendor/{$vendor}/{$name}": ["type:kohana-module"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
8
modules/image/config/image.php
Normal file
8
modules/image/config/image.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php defined('SYSPATH') OR die('No direct script access.');
|
||||
|
||||
return array(
|
||||
// Provide the default driver to use - eg a value of Imagick will use Image_Imagick as the driver class
|
||||
// If you set a value for this config key, then the Image::$default_driver static variable that was used
|
||||
// to configure earlier versions will be ignored.
|
||||
'default_driver' => NULL,
|
||||
);
|
@@ -4,7 +4,24 @@ Kohana 3.x provides a simple yet powerful image manipulation module. The [Image]
|
||||
|
||||
## Drivers
|
||||
|
||||
[Image] module ships with [Image_GD] driver which requires `GD` extension enabled in your PHP installation. This is the default driver. Additional drivers can be created by extending the [Image] class.
|
||||
[Image] module ships with [Image_GD] driver which requires `GD` extension enabled in your PHP installation, and
|
||||
[Image_Imagick] driver which requires the `imagick` PHP extension. Additional drivers can be created by extending
|
||||
the [Image] class.
|
||||
|
||||
The [Image_GD] driver is the default. You can change this by providing an `image.default_driver` configuration option
|
||||
- for example:
|
||||
|
||||
~~~
|
||||
// application/config/image.php
|
||||
<?php
|
||||
return array(
|
||||
'default_driver' => 'Imagick'
|
||||
);
|
||||
~~~
|
||||
|
||||
[!!] Older versions of Kohana allowed you to configure the driver with the `Image::$default_driver` static variable in
|
||||
the bootstrap, an extension class, or elsewhere. That variable is now deprecated and will be ignored if you set a
|
||||
config value.
|
||||
|
||||
## Getting Started
|
||||
|
||||
@@ -18,4 +35,4 @@ Kohana::modules(array(
|
||||
));
|
||||
~~~
|
||||
|
||||
Next: [Using the image module](using).
|
||||
Next: [Using the image module](using).
|
||||
|
8
modules/image/koharness.php
Normal file
8
modules/image/koharness.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
// Configuration for koharness - builds a standalone skeleton Kohana app for running unit tests
|
||||
return array(
|
||||
'modules' => array(
|
||||
'image' => __DIR__,
|
||||
'unittest' => __DIR__ . '/vendor/kohana/unittest'
|
||||
),
|
||||
);
|
Reference in New Issue
Block a user