mirror of
https://ghproxy.net/https://github.com/elementor/wp2static.git
synced 2025-08-30 13:43:54 +08:00
Replace code that was out-of-sync with master fork
Former-commit-id: d4f51174f2
This commit is contained in:
parent
3610ab7521
commit
003da6496a
1 changed files with 3 additions and 9 deletions
|
@ -283,7 +283,7 @@ class StaticHtmlOutput {
|
||||||
$files = scandir($dir);
|
$files = scandir($dir);
|
||||||
foreach($files as $item){
|
foreach($files as $item){
|
||||||
if($item != '.' && $item != '..'){
|
if($item != '.' && $item != '..'){
|
||||||
$ContentType = GuessType($item);
|
$ContentType = GuessMimeType($item);
|
||||||
if(is_dir($dir.'/'.$item)) {
|
if(is_dir($dir.'/'.$item)) {
|
||||||
UploadDirectory($S3, $Bucket, $dir.'/'.$item, $siteroot);
|
UploadDirectory($S3, $Bucket, $dir.'/'.$item, $siteroot);
|
||||||
} else if(is_file($dir.'/'.$item)) {
|
} else if(is_file($dir.'/'.$item)) {
|
||||||
|
@ -301,13 +301,7 @@ class StaticHtmlOutput {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
function GuessMimeType($File) {
|
||||||
* GuessType -
|
|
||||||
*
|
|
||||||
* Make a simple guess as to the file's content type,
|
|
||||||
* and return a MIME type.
|
|
||||||
*/
|
|
||||||
function GuessType($File) {
|
|
||||||
$Info = pathinfo($File, PATHINFO_EXTENSION);
|
$Info = pathinfo($File, PATHINFO_EXTENSION);
|
||||||
switch (strtolower($Info))
|
switch (strtolower($Info))
|
||||||
{
|
{
|
||||||
|
@ -464,4 +458,4 @@ class StaticHtmlOutput {
|
||||||
error_log('response body was empty');
|
error_log('response body was empty');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue