Autodoc
  • Namespace
  • Class
  • Tree

Namespaces

  • BlueTihi
    • Context
  • Brickrouge
    • Element
      • Nodes
    • Renderer
    • Widget
  • ICanBoogie
    • ActiveRecord
    • AutoConfig
    • CLDR
    • Composer
    • Core
    • Event
    • Exception
    • HTTP
      • Dispatcher
      • Request
    • I18n
      • Translator
    • Mailer
    • Modules
      • Taxonomy
        • Support
      • Thumbnailer
        • Versions
    • Object
    • Operation
      • Dispatcher
    • Prototype
    • Routes
    • Routing
      • Dispatcher
    • Session
  • Icybee
    • ActiveRecord
      • Model
    • ConfigOperation
    • Document
    • EditBlock
    • Element
      • ActionbarContextual
      • ActionbarSearch
      • ActionbarToolbar
    • FormBlock
    • Installer
    • ManageBlock
    • Modules
      • Articles
      • Cache
        • Collection
        • ManageBlock
      • Comments
        • ManageBlock
      • Contents
        • ManageBlock
      • Dashboard
      • Editor
        • Collection
      • Files
        • File
        • ManageBlock
      • Forms
        • Form
        • ManageBlock
      • I18n
      • Images
        • ManageBlock
      • Members
      • Modules
        • ManageBlock
      • Nodes
        • ManageBlock
        • Module
      • Pages
        • BreadcrumbElement
        • LanguagesElement
        • ManageBlock
        • NavigationBranchElement
        • NavigationElement
        • Page
        • PageController
      • Registry
      • Search
      • Seo
      • Sites
        • ManageBlock
      • Taxonomy
        • Terms
          • ManageBlock
        • Vocabulary
          • ManageBlock
      • Users
        • ManageBlock
        • NonceLogin
        • Roles
      • Views
        • ActiveRecordProvider
        • Collection
        • View
    • Operation
      • ActiveRecord
      • Constructor
      • Module
      • Widget
    • Rendering
  • None
  • Patron
  • PHP

Classes

  • AdjustThumbnailOptions
  • AdjustThumbnailVersion
  • CacheManager
  • GetOperation
  • Hooks
  • Module
  • PopThumbnailVersion
  • Thumbnail
  • Version
  • Versions

Exceptions

  • VersionNotDefined

Constants

  • CACHE_VERSIONS
 1 <?php
 2 
 3 /*
 4  * This file is part of the Icybee package.
 5  *
 6  * (c) Olivier Laviale <olivier.laviale@gmail.com>
 7  *
 8  * For the full copyright and license information, please view the LICENSE
 9  * file that was distributed with this source code.
10  */
11 
12 namespace ICanBoogie\Modules\Thumbnailer;
13 
14 use ICanBoogie\Errors;
15 
16 /**
17  * @property string $repository Path to the thumbnails repository.
18  */
19 class Module extends \ICanBoogie\Module
20 {
21     /**
22      * Getter for the $repository magic property.
23      */
24     protected function get_repository()
25     {
26         return \ICanBoogie\REPOSITORY . 'thumbnailer' . DIRECTORY_SEPARATOR;
27     }
28 
29     /**
30      * Creates the repository folder where generated thumbnails are saved.
31      */
32     public function install(Errors $errors)
33     {
34         $path = \ICanBoogie\REPOSITORY . 'thumbnailer' .  DIRECTORY_SEPARATOR;
35 
36         if (!file_exists($path))
37         {
38             $parent = dirname($path);
39 
40             if (is_writable($parent))
41             {
42                 mkdir($path, 0705, true);
43             }
44             else
45             {
46                 $errors[$this->id] = $errors->format('Unable to create %directory directory, its parent is not writable', array('%directory' => \ICanBoogie\strip_root($path)));
47             }
48         }
49 
50         return !count($errors);
51     }
52 
53     /**
54      * Check if the repository folder has been created.
55      */
56     public function is_installed(Errors $errors)
57     {
58         $path = \ICanBoogie\REPOSITORY . 'thumbnailer';
59 
60         if (!file_exists($path))
61         {
62             $errors[$this->id] = $errors->format('The %directory directory is missing.', array('%directory' => \ICanBoogie\strip_root($path)));
63         }
64 
65         return !count($errors);
66     }
67 }
Autodoc API documentation generated by ApiGen 2.8.0