diff options
author | Andreas Gohr <andi@splitbrain.org> | 2014-02-16 20:52:10 +0100 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2014-02-16 20:52:10 +0100 |
commit | dfe934f96f476bdcf60d82feceb4d2a78df28ca0 (patch) | |
tree | 7036626b48446557ef610076356f22dfada489b8 /lib/images/fileicons/generate.php | |
parent | 221cb66533e11a3e20e642d760af06bb19f7e14b (diff) | |
download | rpg-dfe934f96f476bdcf60d82feceb4d2a78df28ca0.tar.gz rpg-dfe934f96f476bdcf60d82feceb4d2a78df28ca0.tar.bz2 |
Switched file icons against generated ones, added 32x32 versions
Diffstat (limited to 'lib/images/fileicons/generate.php')
-rw-r--r-- | lib/images/fileicons/generate.php | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/images/fileicons/generate.php b/lib/images/fileicons/generate.php new file mode 100644 index 000000000..2dd25eb33 --- /dev/null +++ b/lib/images/fileicons/generate.php @@ -0,0 +1,35 @@ +<?php + +// this is not provided by DokuWiki and needs to checked out separately from +// https://github.com/splitbrain/file-icon-generator +require '/home/andi/projects/fileiconbuilder/FileIconBuilder.php'; + +if('cli' != php_sapi_name()) die('This has to be run from command line'); +if(!defined('DOKU_INC')) define('DOKU_INC', realpath(dirname(__FILE__).'/../../../').'/'); +define('NOSESSION', 1); +require_once(DOKU_INC.'inc/init.php'); + + +/** + * Class DokuFileIconBuilder + * + * overwrite mime type loading with loading DokuWiki's mime type config instead + */ +class DokuFileIconBuilder extends FileIconBuilder { + + protected function loadmimetypes(){ + $this->mimetypes = getMimeTypes(); + foreach(array_keys($this->mimetypes) as $ext) { + $this->mimetypes[$ext] = ltrim($this->mimetypes[$ext], '!'); + } + } +} + + +echo "Important: you should enable the commented file types in mime.conf to make sure the icon are generated!\n"; + +// generate all the icons +$DFIB = new DokuFileIconBuilder(); +$DFIB->createAll(__DIR__); + +echo "generation done\n"; |