mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-21 00:42:15 +00:00
EZ-Components
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* Base exception for the ImageConversion package.
|
||||
*
|
||||
* @package ImageConversion
|
||||
* @version 1.3.5
|
||||
* @copyright Copyright (C) 2005-2008 eZ systems as. All rights reserved.
|
||||
* @license http://ez.no/licenses/new_bsd New BSD License
|
||||
*/
|
||||
|
||||
/**
|
||||
* General exception container for the ImageConversion component.
|
||||
*
|
||||
* @package ImageConversion
|
||||
* @version 1.3.5
|
||||
*/
|
||||
abstract class ezcImageException extends ezcBaseException
|
||||
{
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* File containing the ezcImageFileNameInvalidException.
|
||||
*
|
||||
* @package ImageConversion
|
||||
* @version 1.3.5
|
||||
* @copyright Copyright (C) 2005-2008 eZ systems as. All rights reserved.
|
||||
* @license http://ez.no/licenses/new_bsd New BSD License
|
||||
*/
|
||||
|
||||
/**
|
||||
* Thrown if a given file name contains illegal characters (', ", $).
|
||||
*
|
||||
* @package ImageConversion
|
||||
* @version 1.3.5
|
||||
*/
|
||||
class ezcImageFileNameInvalidException extends ezcImageException
|
||||
{
|
||||
/**
|
||||
* Creates a new ezcImageFileNameInvalidException.
|
||||
*
|
||||
* @param string $file The invalid file name.
|
||||
* @return void
|
||||
*/
|
||||
function __construct( $file )
|
||||
{
|
||||
parent::__construct( "The file name '{$file}' contains an illegal character (', \", $)." );
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/**
|
||||
* File containing the ezcImageFileNotProcessableException.
|
||||
*
|
||||
* @package ImageConversion
|
||||
* @version 1.3.5
|
||||
* @copyright Copyright (C) 2005-2008 eZ systems as. All rights reserved.
|
||||
* @license http://ez.no/licenses/new_bsd New BSD License
|
||||
*/
|
||||
|
||||
/**
|
||||
* Thrown if a file could not be processed by a handler.
|
||||
*
|
||||
* @package ImageConversion
|
||||
* @version 1.3.5
|
||||
*/
|
||||
class ezcImageFileNotProcessableException extends ezcImageException
|
||||
{
|
||||
/**
|
||||
* Creates a new ezcImageFileNotProcessableException.
|
||||
*
|
||||
* @param string $file The not processable file.
|
||||
* @param string $reason The reason why the file could not be processed.
|
||||
* @return void
|
||||
*/
|
||||
function __construct( $file, $reason = null )
|
||||
{
|
||||
$reasonPart = "";
|
||||
if ( $reason )
|
||||
{
|
||||
$reasonPart = " $reason";
|
||||
}
|
||||
parent::__construct( "File '{$file}' could not be processed.{$reasonPart}" );
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/**
|
||||
* File containing the ezcImageFilterFailedException.
|
||||
*
|
||||
* @package ImageConversion
|
||||
* @version 1.3.5
|
||||
* @copyright Copyright (C) 2005-2008 eZ systems as. All rights reserved.
|
||||
* @license http://ez.no/licenses/new_bsd New BSD License
|
||||
*/
|
||||
|
||||
/**
|
||||
* Thrown if the given filter failed.
|
||||
*
|
||||
* @package ImageConversion
|
||||
* @version 1.3.5
|
||||
*/
|
||||
class ezcImageFilterFailedException extends ezcImageException
|
||||
{
|
||||
/**
|
||||
* Creates a new ezcImageFilterFailedException.
|
||||
*
|
||||
* @param string $filterName The failed filter.
|
||||
* @param string $reason The reason why the filter failed.
|
||||
* @return void
|
||||
*/
|
||||
function __construct( $filterName, $reason = null )
|
||||
{
|
||||
$reasonPart = "";
|
||||
if ( $reason )
|
||||
{
|
||||
$reasonPart = " $reason";
|
||||
}
|
||||
parent::__construct( "The filter '{$filterName}' failed.{$reasonPart}" );
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* File containing the ezcImageFilterNotAvailableException.
|
||||
*
|
||||
* @package ImageConversion
|
||||
* @version 1.3.5
|
||||
* @copyright Copyright (C) 2005-2008 eZ systems as. All rights reserved.
|
||||
* @license http://ez.no/licenses/new_bsd New BSD License
|
||||
*/
|
||||
|
||||
/**
|
||||
* Thrown if the given filter is not available.
|
||||
*
|
||||
* @package ImageConversion
|
||||
* @version 1.3.5
|
||||
*/
|
||||
class ezcImageFilterNotAvailableException extends ezcImageException
|
||||
{
|
||||
/**
|
||||
* Creates a new ezcImageFilterNotAvailableException.
|
||||
*
|
||||
* @param string $filterName The affected filter.
|
||||
* @return void
|
||||
*/
|
||||
function __construct( $filterName )
|
||||
{
|
||||
parent::__construct( "Filter '{$filterName}' does not exist." );
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/**
|
||||
* File containing the ezcImageHandlerNotAvailableException.
|
||||
*
|
||||
* @package ImageConversion
|
||||
* @version 1.3.5
|
||||
* @copyright Copyright (C) 2005-2008 eZ systems as. All rights reserved.
|
||||
* @license http://ez.no/licenses/new_bsd New BSD License
|
||||
*/
|
||||
|
||||
/**
|
||||
* Thrown if a specified handler class is not available.
|
||||
*
|
||||
* @package ImageConversion
|
||||
* @version 1.3.5
|
||||
*/
|
||||
class ezcImageHandlerNotAvailableException extends ezcImageException
|
||||
{
|
||||
/**
|
||||
* Creates a new ezcImageHandlerNotAvailableException.
|
||||
*
|
||||
* @param string $handlerClass Name of the affected class.
|
||||
* @param string $reason Reason why it is not available.
|
||||
* @return void
|
||||
*/
|
||||
function __construct( $handlerClass, $reason = null )
|
||||
{
|
||||
$reasonPart = "";
|
||||
if ( $reason )
|
||||
{
|
||||
$reasonPart = " $reason";
|
||||
}
|
||||
parent::__construct( "Handler class '{$handlerClass}' not found.{$reasonPart}" );
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* File containing the ezcImageHandlerSettingsInvalidException.
|
||||
*
|
||||
* @package ImageConversion
|
||||
* @version 1.3.5
|
||||
* @copyright Copyright (C) 2005-2008 eZ systems as. All rights reserved.
|
||||
* @license http://ez.no/licenses/new_bsd New BSD License
|
||||
*/
|
||||
|
||||
/**
|
||||
* Thrown if invalid handler settings are submitted when creating an
|
||||
* {@link ezcImageConverter}.
|
||||
*
|
||||
* @package ImageConversion
|
||||
* @version 1.3.5
|
||||
*/
|
||||
class ezcImageHandlerSettingsInvalidException extends ezcImageException
|
||||
{
|
||||
/**
|
||||
* Creates a new ezcImageHandlerSettingsInvalidException.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct( "Invalid handler settings." );
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* File containing the ezcImageInvalidFilterParameterException.
|
||||
*
|
||||
* @package ImageConversion
|
||||
* @version 1.3.5
|
||||
* @copyright Copyright (C) 2005-2008 eZ systems as. All rights reserved.
|
||||
* @license http://ez.no/licenses/new_bsd New BSD License
|
||||
*/
|
||||
|
||||
/**
|
||||
* Thrown if the given filter failed.
|
||||
*
|
||||
* @package ImageConversion
|
||||
* @version 1.3.5
|
||||
*/
|
||||
class ezcImageInvalidFilterParameterException extends ezcImageException
|
||||
{
|
||||
/**
|
||||
* Creates a new ezcImageInvalidFilterParameterException.
|
||||
*
|
||||
* @param string $filterName Name of the filter.
|
||||
* @param string $parameterName Affected parameter.
|
||||
* @param string $actualValue Received value.
|
||||
* @param string $expectedRange Expected value range.
|
||||
* @return void
|
||||
*/
|
||||
function __construct( $filterName, $parameterName, $actualValue, $expectedRange = null )
|
||||
{
|
||||
$actualValue = var_export( $actualValue, true );
|
||||
$message = "Wrong value '{$actualValue}' submitted for parameter '{$parameterName}' of filter '{$filterName}'.";
|
||||
if ( $expectedRange !== null )
|
||||
{
|
||||
$message .= " Expected parameter to be in range '{$expectedRange}'.";
|
||||
}
|
||||
parent::__construct( $message );
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/**
|
||||
* File containing the ezcImageInvalidReferenceException.
|
||||
*
|
||||
* @package ImageConversion
|
||||
* @version 1.3.5
|
||||
* @copyright Copyright (C) 2005-2008 eZ systems as. All rights reserved.
|
||||
* @license http://ez.no/licenses/new_bsd New BSD License
|
||||
*/
|
||||
|
||||
/**
|
||||
* Thrown if no valid image reference could be found for an action (conversion,
|
||||
* filter, load, save,...).
|
||||
*
|
||||
* @package ImageConversion
|
||||
* @version 1.3.5
|
||||
*/
|
||||
class ezcImageInvalidReferenceException extends ezcImageException
|
||||
{
|
||||
/**
|
||||
* Creates a new ezcImageInvalidReferenceException.
|
||||
*
|
||||
* @param string $reason The reason.
|
||||
* @return void
|
||||
*/
|
||||
function __construct( $reason = null )
|
||||
{
|
||||
$reasonPart = "";
|
||||
if ( $reason )
|
||||
{
|
||||
$reasonPart = " $reason";
|
||||
}
|
||||
parent::__construct( "No valid reference found for action.{$reasonPart}" );
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* File containing the ezcImageMimeTypeUnsupportedException.
|
||||
*
|
||||
* @package ImageConversion
|
||||
* @version 1.3.5
|
||||
* @copyright Copyright (C) 2005-2008 eZ systems as. All rights reserved.
|
||||
* @license http://ez.no/licenses/new_bsd New BSD License
|
||||
*/
|
||||
|
||||
/**
|
||||
* Thrown if a requested MIME type is not supported for input, output or input/output.
|
||||
*
|
||||
* @package ImageConversion
|
||||
* @version 1.3.5
|
||||
*/
|
||||
class ezcImageMimeTypeUnsupportedException extends ezcImageException
|
||||
{
|
||||
/**
|
||||
* Creates a new ezcImageMimeTypeUnsupportedException.
|
||||
*
|
||||
* @param string $mimeType Affected mime type.
|
||||
* @param string $direction "input" or "output".
|
||||
* @return void
|
||||
*/
|
||||
function __construct( $mimeType, $direction )
|
||||
{
|
||||
parent::__construct( "Converter does not support MIME type '{$mimeType}' for '{$direction}'." );
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* File containing the ezcImageMissingFilterParameter.
|
||||
*
|
||||
* @package ImageConversion
|
||||
* @version 1.3.5
|
||||
* @copyright Copyright (C) 2005-2008 eZ systems as. All rights reserved.
|
||||
* @license http://ez.no/licenses/new_bsd New BSD License
|
||||
*/
|
||||
|
||||
/**
|
||||
* Thrown if an expected parameter for a filter was not submitted.
|
||||
*
|
||||
* @package ImageConversion
|
||||
* @version 1.3.5
|
||||
*/
|
||||
class ezcImageMissingFilterParameterException extends ezcImageException
|
||||
{
|
||||
/**
|
||||
* Creates a new ezcImageMissingFilterParameterException.
|
||||
*
|
||||
* @param string $filterName Affected filter.
|
||||
* @param string $parameterName Affected parameter.
|
||||
* @return void
|
||||
*/
|
||||
function __construct( $filterName, $parameterName )
|
||||
{
|
||||
parent::__construct( "The filter '{$filterName}' expects a parameter called '{$parameterName}' which was not submitted." );
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
/**
|
||||
* File containing the abstract class ezcImageTransformationException.
|
||||
*
|
||||
* @package ImageConversion
|
||||
* @version 1.3.5
|
||||
* @copyright Copyright (C) 2005-2008 eZ systems as. All rights reserved.
|
||||
* @license http://ez.no/licenses/new_bsd New BSD License
|
||||
* @filesource
|
||||
*/
|
||||
|
||||
/**
|
||||
* Exception to be thrown be ezcImageTransformation classes.
|
||||
*
|
||||
* This is a special exception which is used in ezcImageTransformation to
|
||||
* catch all transformation exceptions. Purpose is to provide a catch
|
||||
* all for all transformation inherited excptions, that leaves the source
|
||||
* exception in tact for logging or analysis purposes.
|
||||
*
|
||||
* @see ezcImageTransformation
|
||||
*
|
||||
* @package ImageConversion
|
||||
* @version 1.3.5
|
||||
*/
|
||||
class ezcImageTransformationException extends ezcImageException
|
||||
{
|
||||
|
||||
/**
|
||||
* Stores the parent exception.
|
||||
* Each transformation exception is based on a parent, which can be any
|
||||
* ezcImage* exception. The transformation exception deals as a collection
|
||||
* container to catch all these exception at once.
|
||||
*
|
||||
* @var ezcImageException
|
||||
*/
|
||||
public $parent;
|
||||
|
||||
/**
|
||||
* Creates a new ezcImageTransformationException using a parent exception.
|
||||
* Creates a new ezcImageTransformationException and appends an existing
|
||||
* exception to it. The ezcImageTransformationException is just the catch-
|
||||
* all container. The parent is stored for logging/debugging purpose.
|
||||
*
|
||||
* @param ezcBaseException $e Any exception that may occur during
|
||||
* transformation.
|
||||
*/
|
||||
public function __construct( ezcBaseException $e )
|
||||
{
|
||||
$this->parent = $e;
|
||||
$message = $e->getMessage();
|
||||
parent::__construct( "Transformation failed. '{$message}'." );
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* File containing the ezcImageTransformationAlreadyExistsException.
|
||||
*
|
||||
* @package ImageConversion
|
||||
* @version 1.3.5
|
||||
* @copyright Copyright (C) 2005-2008 eZ systems as. All rights reserved.
|
||||
* @license http://ez.no/licenses/new_bsd New BSD License
|
||||
*/
|
||||
|
||||
/**
|
||||
* Thrown if a transformation with the given name already exists.
|
||||
*
|
||||
* @package ImageConversion
|
||||
* @version 1.3.5
|
||||
*/
|
||||
class ezcImageTransformationAlreadyExistsException extends ezcImageException
|
||||
{
|
||||
/**
|
||||
* Creates a new ezcImageTransformationAlreadyExistsException.
|
||||
*
|
||||
* @param string $name Name of the collision transformation.
|
||||
* @return void
|
||||
*/
|
||||
function __construct( $name )
|
||||
{
|
||||
parent::__construct( "Transformation '{$name}' already exists." );
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* File containing the ezcImageTransformationNotAvailableException.
|
||||
*
|
||||
* @package ImageConversion
|
||||
* @version 1.3.5
|
||||
* @copyright Copyright (C) 2005-2008 eZ systems as. All rights reserved.
|
||||
* @license http://ez.no/licenses/new_bsd New BSD License
|
||||
*/
|
||||
|
||||
/**
|
||||
* Thrown if a transformation with the given name does not exists.
|
||||
*
|
||||
* @package ImageConversion
|
||||
* @version 1.3.5
|
||||
*/
|
||||
class ezcImageTransformationNotAvailableException extends ezcImageException
|
||||
{
|
||||
/**
|
||||
* Creates a new ezcImageTransformationNotAvailableException.
|
||||
*
|
||||
* @param string $name Name of the missing transformation.
|
||||
* @return void
|
||||
*/
|
||||
function __construct( $name )
|
||||
{
|
||||
parent::__construct( "Transformation '{$name}' does not exists." );
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user