60 if (preg_match(
'#(1|ON)#i', ini_get(
'safe_mode'))) {
61 $this->errors[] =
'PHP running in Safe Mode (backtick operator not available) - cannot call metaflac, tags not written';
68 if (is_writable($tempcommentsfilename) && is_file($tempcommentsfilename) && ($fpcomments = fopen($tempcommentsfilename,
'wb'))) {
69 foreach ($this->tag_data as $key => $value) {
70 foreach ($value as $commentdata) {
77 $this->errors[] =
'failed to open temporary tags file, tags not written - fopen("'.$tempcommentsfilename.
'", "wb")';
82 $oldignoreuserabort = ignore_user_abort(
true);
96 $timestampbeforewriting = filemtime($this->filename);
98 $commandline =
GetId3Core::getHelperAppsDir().
'metaflac.exe --no-utf8-convert --remove-all-tags --import-tags-from='.escapeshellarg($tempcommentsfilename).
' '.escapeshellarg($this->filename).
' 2>&1';
99 $metaflacError = `$commandline`;
101 if (empty($metaflacError)) {
103 if ($timestampbeforewriting == filemtime($this->filename)) {
104 $metaflacError =
'File modification timestamp has not changed - it looks like the tags were not written';
108 $metaflacError =
'metaflac.exe not found in '.GetId3Core::getHelperAppsDir();
114 $commandline =
'metaflac --no-utf8-convert --remove-all-tags --import-tags-from='.escapeshellarg($tempcommentsfilename).
' '.escapeshellarg($this->filename).
' 2>&1';
115 $metaflacError = `$commandline`;
120 unlink($tempcommentsfilename);
121 ignore_user_abort($oldignoreuserabort);
123 if (!empty($metaflacError)) {
125 $this->errors[] =
'System call to metaflac failed with this message returned: '.
"\n\n".$metaflacError;
140 if (preg_match(
'#(1|ON)#i', ini_get(
'safe_mode'))) {
141 $this->errors[] =
'PHP running in Safe Mode (backtick operator not available) - cannot call metaflac, tags not deleted';
146 $oldignoreuserabort = ignore_user_abort(
true);
152 $timestampbeforewriting = filemtime($this->filename);
155 $metaflacError = `$commandline`;
157 if (empty($metaflacError)) {
159 if ($timestampbeforewriting == filemtime($this->filename)) {
160 $metaflacError =
'File modification timestamp has not changed - it looks like the tags were not deleted';
164 $metaflacError =
'metaflac.exe not found in '.GetId3Core::getHelperAppsDir();
170 $commandline =
'metaflac --remove-all-tags "'.$this->filename.
'" 2>&1';
171 $metaflacError = `$commandline`;
175 ignore_user_abort($oldignoreuserabort);
177 if (!empty($metaflacError)) {
178 $this->errors[] =
'System call to metaflac failed with this message returned: '.
"\n\n".$metaflacError;
200 return strtoupper(preg_replace(
'#[^ -<>-}]#',
' ', str_replace(
"\x00",
' ', $originalcommentname)));
static environmentIsWindows()
Create styles array
The data for the language used.
static getHelperAppsDir()