Former-commit-id: d8e704e16a
This commit is contained in:
Leon Stafford 2017-04-02 22:14:15 +12:00
parent e35c12a957
commit 5957cbc1b5
2 changed files with 3 additions and 16 deletions

View file

@ -1,10 +1,4 @@
<?php
/**
* @package WP Static HTML Output
*
* Copyright (c) 2011 Leon Stafford
*/
class StaticHtmlOutput {
const VERSION = '1.9';
const OPTIONS_KEY = 'wp-static-html-output-options';
@ -263,7 +257,7 @@ class StaticHtmlOutput {
$files = scandir($dir);
foreach($files as $item){
if($item != '.' && $item != '..'){
$ContentType = GuessType($item);
$ContentType = GuessMimeType($item);
if(is_dir($dir.'/'.$item)) {
UploadDirectory($S3, $Bucket, $dir.'/'.$item, $siteroot);
} else if(is_file($dir.'/'.$item)) {
@ -281,13 +275,7 @@ class StaticHtmlOutput {
}
}
/*
* GuessType -
*
* Make a simple guess as to the file's content type,
* and return a MIME type.
*/
function GuessType($File) {
function GuessMimeType($File) {
$Info = pathinfo($File, PATHINFO_EXTENSION);
switch (strtolower($Info))
{

View file

@ -18,8 +18,7 @@ require_once 'library/StaticHtmlOutput.php';
StaticHtmlOutput::init(__FILE__);
function pluginActionLinks($links)
{
function pluginActionLinks($links) {
$settings_link = '<a href="tools.php?page=wp-static-html-output-options">' . __('Settings', 'static-html-output-plugin') . '</a>';
array_unshift( $links, $settings_link );
return $links;