mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-05 15:55:39 +08:00
Add xlswriter extension windows support (#712)
* Add xlswriter extension windows support * cs fix
This commit is contained in:
@@ -18,4 +18,23 @@ class xlswriter extends Extension
|
||||
}
|
||||
return $arg;
|
||||
}
|
||||
|
||||
public function getWindowsConfigureArg(): string
|
||||
{
|
||||
return '--with-xlswriter';
|
||||
}
|
||||
|
||||
public function patchBeforeMake(): bool
|
||||
{
|
||||
if (PHP_OS_FAMILY === 'Windows') {
|
||||
$content = file_get_contents($this->source_dir . '/library/libxlsxwriter/src/theme.c');
|
||||
$bom = pack('CCC', 0xEF, 0xBB, 0xBF);
|
||||
if (substr($content, 0, 3) !== $bom) {
|
||||
file_put_contents($this->source_dir . '/library/libxlsxwriter/src/theme.c', $content);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user