Commit da8fb234 authored by Addshore's avatar Addshore 🏄
Browse files

Remove some unused code and TODOs

parent fed60931
...@@ -24,7 +24,6 @@ import ( ...@@ -24,7 +24,6 @@ import (
"os" "os"
osexec "os/exec" osexec "os/exec"
"strings" "strings"
"time"
"gerrit.wikimedia.org/r/mediawiki/tools/cli/internal/exec" "gerrit.wikimedia.org/r/mediawiki/tools/cli/internal/exec"
) )
...@@ -86,14 +85,6 @@ func (m MediaWiki) Path(subPath string) string { ...@@ -86,14 +85,6 @@ func (m MediaWiki) Path(subPath string) string {
return m.Directory() + string(os.PathSeparator) + subPath return m.Directory() + string(os.PathSeparator) + subPath
} }
/*EnsureCacheDirectory ...*/
func (m MediaWiki) EnsureCacheDirectory() {
err := os.MkdirAll("cache", 0700)
if err != nil {
log.Fatal(err)
}
}
/*MediaWikiIsPresent ...*/ /*MediaWikiIsPresent ...*/
func (m MediaWiki) MediaWikiIsPresent() bool { func (m MediaWiki) MediaWikiIsPresent() bool {
return errorIfDirectoryDoesNotLookLikeCore(m.Directory()) == nil return errorIfDirectoryDoesNotLookLikeCore(m.Directory()) == nil
...@@ -112,18 +103,6 @@ func exitIfNoGit() { ...@@ -112,18 +103,6 @@ func exitIfNoGit() {
} }
} }
/*GitCloneMediaWiki ...*/
func (m MediaWiki) GitCloneMediaWiki(options exec.HandlerOptions) {
exitIfNoGit()
// TODO don't use https by default? use ssh?
exec.RunCommand(options, exec.Command(
"git",
"clone",
"https://gerrit.wikimedia.org/r/mediawiki/core",
m.Path("")))
}
/*CloneSetupOpts for use with GithubCloneMediaWiki*/ /*CloneSetupOpts for use with GithubCloneMediaWiki*/
type CloneSetupOpts = struct { type CloneSetupOpts = struct {
GetMediaWiki bool GetMediaWiki bool
...@@ -200,17 +179,6 @@ func (m MediaWiki) CloneSetup(options CloneSetupOpts) { ...@@ -200,17 +179,6 @@ func (m MediaWiki) CloneSetup(options CloneSetupOpts) {
} }
} }
/*GitCloneVector ...*/
func (m MediaWiki) GitCloneVector(options exec.HandlerOptions) {
exitIfNoGit()
exec.RunCommand(options, exec.Command(
"git",
"clone",
"https://gerrit.wikimedia.org/r/mediawiki/skins/Vector",
m.Path("skins/Vector")))
}
/*LocalSettingsIsPresent ...*/ /*LocalSettingsIsPresent ...*/
func (m MediaWiki) LocalSettingsIsPresent() bool { func (m MediaWiki) LocalSettingsIsPresent() bool {
info, err := os.Stat(m.Path("LocalSettings.php")) info, err := os.Stat(m.Path("LocalSettings.php"))
...@@ -230,53 +198,3 @@ func (m MediaWiki) LocalSettingsContains(text string) bool { ...@@ -230,53 +198,3 @@ func (m MediaWiki) LocalSettingsContains(text string) bool {
return strings.Contains(s, text) return strings.Contains(s, text)
} }
/*RenameLocalSettings ...*/
func (m MediaWiki) RenameLocalSettings() {
const layout = "2006-01-02T15:04:05-0700"
t := time.Now()
localSettingsName := "LocalSettings-" + t.Format(layout) + ".php"
err := os.Rename("LocalSettings.php", localSettingsName)
if err != nil {
log.Fatal(err)
}
}
/*DeleteCache ...*/
func (m MediaWiki) DeleteCache() {
err := os.Rename("cache/.htaccess", ".htaccess.fromcache.tmp")
if err != nil {
log.Fatal(err)
}
err = os.RemoveAll("./cache/")
if err != nil {
log.Fatal(err)
}
err = os.Mkdir("cache", 0700)
if err != nil {
log.Fatal(err)
}
err = os.Rename(".htaccess.fromcache.tmp", "cache/.htaccess")
if err != nil {
log.Fatal(err)
}
}
/*DeleteVendor ...*/
func (m MediaWiki) DeleteVendor() {
err := os.RemoveAll("./vendor")
if err != nil {
log.Fatal(err)
}
err = os.Mkdir("vendor", 0700)
if err != nil {
log.Fatal(err)
}
}
...@@ -222,9 +222,3 @@ func (m MWDD) RmVolumes(dcVolumes []string, options exec.HandlerOptions) { ...@@ -222,9 +222,3 @@ func (m MWDD) RmVolumes(dcVolumes []string, options exec.HandlerOptions) {
exec.Command("docker", append([]string{"volume", "rm"}, dockerVolumes...)...), exec.Command("docker", append([]string{"volume", "rm"}, dockerVolumes...)...),
) )
} }
// TODO more from https://github.com/addshore/mediawiki-docker-dev/blob/4d380cf638bc60b5b6c22853a199639a3eb70b0b/control/src/Shell/DockerCompose.php#L53
// TODO execIt?
// TODO run?
// TODO runDetatched?
// TODO logsTail?
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment