forked from splitbrain/file-icon-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example-dokuwiki.php
49 lines (42 loc) · 1.34 KB
/
example-dokuwiki.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/**
* This script builds the file icons for DokuWiki
*
* Give the proper directory as first argument
*/
require 'FileIconBuilder.php';
$dw = '';
if(isset($argv[1])) $dw = $argv[1];
if(!$dw || !is_dir($dw) || !file_exists("$dw/index.php") || !chdir($dw)) {
echo "Please provide the path to DokuWiki's lib/images/fileicons directory";
echo "as parameter to this script\n";
exit(1);
}
$extensions = array(
'jpg', 'gif', 'png', 'ico',
'swf', 'mp3', 'ogg', 'wav', 'webm', 'ogv', 'mp4',
'tgz', 'tar', 'gz', 'bz2', 'zip', 'rar', '7z',
'pdf', 'ps',
'rpm', 'deb',
'doc', 'xls', 'ppt', 'rtf',
'docx', 'xlsx', 'pptx',
'sxw', 'sxc', 'sxi', 'sxd',
'odc', 'odf', 'odg', 'odi', 'odp', 'ods', 'odt',
'html', 'htm', 'txt', 'conf', 'xml', 'csv',
// these might be used in downloadable code blocks:
'c', 'cc', 'cpp', 'h', 'hpp', 'csh', 'diff', 'java', 'pas',
'pl', 'py', 'sh', 'bash', 'asm', 'htm', 'css', 'js', 'json',
'cs', 'lua', 'php', 'rb', 'sql'
);
// generate all the icons
@mkdir('32x32');
$DFIB = new FileIconBuilder();
foreach($extensions as $ext) {
echo "$ext\n";
$DFIB->create16x16($ext,"$ext.png");
$DFIB->create32x32($ext,"32x32/$ext.png");
}
copy("jpg.png", "jpeg.png");
copy("32x32/jpg.png", "32x32/jpeg.png");
copy("htm.png", "html.png");
copy("32x32/htm.png", "32x32/html.png");