Verzeichnisstruktur phpBB-3.2.0
- Veröffentlicht
- 06.01.2017
So funktioniert es
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
obtain_imagick_path.php
01 <?php
02 /**
03 *
04 * This file is part of the phpBB Forum Software package.
05 *
06 * @copyright (c) phpBB Limited <https://www.phpbb.com>
07 * @license GNU General Public License, version 2 (GPL-2.0)
08 *
09 * For full copyright and license information, please see
10 * the docs/CREDITS.txt file.
11 *
12 */
13
14 namespace phpbb\install\module\obtain_data\task;
15
16 class obtain_imagick_path extends \phpbb\install\task_base implements \phpbb\install\task_interface
17 {
18 /**
19 * @var \phpbb\install\helper\config
20 */
21 protected $config;
22
23 /**
24 * Constructor
25 *
26 * @param \phpbb\install\helper\config $config Installer's config
27 */
28 public function __construct(\phpbb\install\helper\config $config)
29 {
30 $this->config = $config;
31
32 parent::__construct(true);
33 }
34
35 /**
36 * {@inheritdoc}
37 */
38 public function run()
39 {
40 // Can we find ImageMagick anywhere on the system?
41 $exe = (DIRECTORY_SEPARATOR == '\\') ? '.exe' : '';
42
43 $magic_home = getenv('MAGICK_HOME');
44 $img_imagick = '';
45 if (empty($magic_home))
46 {
47 $locations = array('C:/WINDOWS/', 'C:/WINNT/', 'C:/WINDOWS/SYSTEM/', 'C:/WINNT/SYSTEM/', 'C:/WINDOWS/SYSTEM32/', 'C:/WINNT/SYSTEM32/', '/usr/bin/', '/usr/sbin/', '/usr/local/bin/', '/usr/local/sbin/', '/opt/', '/usr/imagemagick/', '/usr/bin/imagemagick/');
48 $path_locations = str_replace('\\', '/', (explode(($exe) ? ';' : ':', getenv('PATH'))));
49
50 $locations = array_merge($path_locations, $locations);
51 foreach ($locations as $location)
52 {
53 // The path might not end properly, fudge it
54 if (substr($location, -1, 1) !== '/')
55 {
56 $location .= '/';
57 }
58
59 if (@file_exists($location) && @is_readable($location . 'mogrify' . $exe) && @filesize($location . 'mogrify' . $exe) > 3000)
60 {
61 $img_imagick = str_replace('\\', '/', $location);
62 continue;
63 }
64 }
65 }
66 else
67 {
68 $img_imagick = str_replace('\\', '/', $magic_home);
69 }
70
71 $this->config->set('img_imagick', $img_imagick);
72 }
73
74 /**
75 * {@inheritdoc}
76 */
77 static public function get_step_count()
78 {
79 return 0;
80 }
81
82 /**
83 * {@inheritdoc}
84 */
85 public function get_task_lang_name()
86 {
87 return '';
88 }
89 }
90