Joostina CMS / CMF v2.* API
  • Docs
  • Package
  • Class
  • Tree
  • Todo
Overview

Packages

  • Components
    • Acls
      • Models
        • Admin
        • Site
    • BlogCategory
      • Models
        • Admin
        • Site
    • Blogs
      • Controllers
        • Admin
        • Site
      • Helpers
      • Models
        • Admin
        • Site
    • Coder
      • Controllers
        • Admin
      • Models
        • Admin
    • Comments
      • Controllers
        • Admin
        • Site
      • Helpers
      • Models
        • Admin
        • Site
    • CommentsCounter
      • Models
        • Admin
        • Site
    • Mainpage
      • Controllers
        • Site
    • News
      • Controllers
        • Admin
        • Site
      • Helpers
      • Models
        • Admin
        • Site
    • Pages
      • Controllers
        • Admin
        • Site
      • Models
        • Site
    • Search
      • Controllers
        • Site
    • Site
      • Controllers
        • Admin
        • Site
    • Sitemap
      • Controllers
        • Admin
        • Site
      • Models
        • Admin
        • Site
    • Test
      • Controllers
        • Site
    • Torrents
      • Controllers
        • Site
    • Users
      • Controllers
        • Admin
        • Site
      • Models
        • Admin
        • Site
  • Compression
  • Core
    • Libraries
      • Arhive
      • Array
      • Attached
      • Autoadmin
      • Autoloader
      • Benchmark
      • Breadcrumbs
      • Cache
      • Config
      • Cookie
      • Csrf
      • Database
        • Drivers
          • Interfaces
      • Datetime
      • Debug
      • Editor
      • Events
      • File
      • Filter
      • Flashmessage
      • Folder
      • Hit
      • Html
      • Image
      • Inflector
      • Inputfilter
      • Libraries
      • Mail
      • Module
      • Nestedset
      • Pager
      • Pages
      • Params
      • Randomizer
      • Request
      • RobotLoader
      • Route
      • Security
      • Session
      • Static
      • String
      • Text
      • Trash
      • Validate
  • Email
  • Extra
    • Libraries
      • Basket
  • Joostina
    • Controller
    • Core
    • Document
  • JSMin
  • Libraries
    • Extra
      • Basket
        • Models
          • Site
  • None
  • Plugins
    • Autoadmin
    • Editor
    • Sitemap
  • SimpleMail
  • Vendors
    • Libraries
      • Email

Classes

  • BzCompression
  • GzCompression
  • LzfCompression

Interfaces

  • iCompression
 1: <?php
 2: require_once 'iCompression.php';
 3: /**
 4:  * Use the Bz compression
 5:  *
 6:  * @package Compression
 7:  * @filesource BzCompression.php
 8:  *
 9:  * @author Cyril Nicodème
10:  * @version 0.1
11:  *
12:  * @since 15/07/2008
13:  *
14:  * @license GNU/GPL
15:  */
16: class BzCompression implements iCompression
17: {
18:     /**
19:      * Constructor
20:      * Used to check if the extensions exists
21:      *
22:      * @throws NotFoundException
23:      */
24:     public function __construct ()
25:     {
26:         if (!function_exists ('bzcompress'))
27:             throw new Exception ('Bz extensions is missing');
28:     }
29: 
30:     /**
31:      * Compress the given value to the specific compression
32:      *
33:      * @param String $sValue
34:      * @param String $iLevel (Optionnal) : Between 0 and 9
35:      *
36:      * @return String
37:      *
38:      * @throws Exception
39:      */
40:     public function compress ($sValue, $iLevel = null)
41:     {
42:         if (!is_string ($sValue))
43:             throw new Exception ('Invalid first argument, must be a string');
44: 
45:         if (isset ($iLevel) && !is_int ($iLevel))
46:             throw new Exception ('Invalid second argument, must be an int');
47: 
48:         if ($iValue < 0 || $iValue > 9)
49:             throw new Exception ('Invalid second argument, must be between 0 and 9');
50: 
51:         return bzcompress ($sValue, $iLevel);
52:     }
53: 
54:     /**
55:      * Decompress the given value with the specific compression
56:      *
57:      * @param String $sValue
58:      *
59:      * @return String
60:      *
61:      * @throws Exception
62:      */
63:     public function decompress ($sValue)
64:     {
65:         if (!is_string ($sValue))
66:             throw new Exception ('Invalid first argument, must be a string');
67: 
68:         return bzdecompress ($sValue);
69:     }
70: }
71: 
Joostina CMS / CMF v2.* API API documentation generated by ApiGen 2.6.1 – Template adapted by @olvlv and Joostina Team