-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c88f5e1
commit 829f7ba
Showing
4 changed files
with
130 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Visual Studio directories | ||
.vs | ||
server/bin | ||
server/obj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 15 | ||
VisualStudioVersion = 15.0.26430.16 | ||
MinimumVisualStudioVersion = 15.0.26124.0 | ||
Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "mediawiki", "mediawiki\mediawiki.msbuildproj", "{419BB192-DEA4-498A-8FFD-093F39CC884B}" | ||
EndProject | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "server", "server\server.csproj", "{E05A30A4-4806-4E9F-9404-1DBD6B3571A5}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Debug|x64 = Debug|x64 | ||
Debug|x86 = Debug|x86 | ||
Release|Any CPU = Release|Any CPU | ||
Release|x64 = Release|x64 | ||
Release|x86 = Release|x86 | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{419BB192-DEA4-498A-8FFD-093F39CC884B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{419BB192-DEA4-498A-8FFD-093F39CC884B}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{419BB192-DEA4-498A-8FFD-093F39CC884B}.Debug|x64.ActiveCfg = Debug|Any CPU | ||
{419BB192-DEA4-498A-8FFD-093F39CC884B}.Debug|x64.Build.0 = Debug|Any CPU | ||
{419BB192-DEA4-498A-8FFD-093F39CC884B}.Debug|x86.ActiveCfg = Debug|Any CPU | ||
{419BB192-DEA4-498A-8FFD-093F39CC884B}.Debug|x86.Build.0 = Debug|Any CPU | ||
{419BB192-DEA4-498A-8FFD-093F39CC884B}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{419BB192-DEA4-498A-8FFD-093F39CC884B}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{419BB192-DEA4-498A-8FFD-093F39CC884B}.Release|x64.ActiveCfg = Release|Any CPU | ||
{419BB192-DEA4-498A-8FFD-093F39CC884B}.Release|x64.Build.0 = Release|Any CPU | ||
{419BB192-DEA4-498A-8FFD-093F39CC884B}.Release|x86.ActiveCfg = Release|Any CPU | ||
{419BB192-DEA4-498A-8FFD-093F39CC884B}.Release|x86.Build.0 = Release|Any CPU | ||
{E05A30A4-4806-4E9F-9404-1DBD6B3571A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{E05A30A4-4806-4E9F-9404-1DBD6B3571A5}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{E05A30A4-4806-4E9F-9404-1DBD6B3571A5}.Debug|x64.ActiveCfg = Debug|Any CPU | ||
{E05A30A4-4806-4E9F-9404-1DBD6B3571A5}.Debug|x64.Build.0 = Debug|Any CPU | ||
{E05A30A4-4806-4E9F-9404-1DBD6B3571A5}.Debug|x86.ActiveCfg = Debug|Any CPU | ||
{E05A30A4-4806-4E9F-9404-1DBD6B3571A5}.Debug|x86.Build.0 = Debug|Any CPU | ||
{E05A30A4-4806-4E9F-9404-1DBD6B3571A5}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{E05A30A4-4806-4E9F-9404-1DBD6B3571A5}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{E05A30A4-4806-4E9F-9404-1DBD6B3571A5}.Release|x64.ActiveCfg = Release|Any CPU | ||
{E05A30A4-4806-4E9F-9404-1DBD6B3571A5}.Release|x64.Build.0 = Release|Any CPU | ||
{E05A30A4-4806-4E9F-9404-1DBD6B3571A5}.Release|x86.ActiveCfg = Release|Any CPU | ||
{E05A30A4-4806-4E9F-9404-1DBD6B3571A5}.Release|x86.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
using System; | ||
using System.IO; | ||
using Microsoft.AspNetCore.Builder; | ||
using Microsoft.AspNetCore.Hosting; | ||
using Microsoft.AspNetCore.Rewrite; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Peachpie.Web; | ||
|
||
namespace Website.Server | ||
{ | ||
class Program | ||
{ | ||
static void Main(string[] args) | ||
{ | ||
var root = System.IO.Directory.GetCurrentDirectory() + "/mediawiki"; | ||
|
||
var host = new WebHostBuilder() | ||
.UseKestrel() | ||
.UseUrls("http://*:5004/") | ||
.UseStartup<Startup>() | ||
.UseWebRoot(root) | ||
.UseContentRoot(root) | ||
.Build(); | ||
|
||
host.Run(); | ||
} | ||
} | ||
|
||
class Startup | ||
{ | ||
public void ConfigureServices(IServiceCollection services) | ||
{ | ||
// Adds a default in-memory implementation of IDistributedCache. | ||
services.AddDistributedMemoryCache(); | ||
|
||
services.AddSession(options => | ||
{ | ||
options.IdleTimeout = TimeSpan.FromMinutes(30); | ||
options.CookieHttpOnly = true; | ||
}); | ||
} | ||
|
||
public void Configure(IApplicationBuilder app) | ||
{ | ||
var rewriteOptions = new RewriteOptions() | ||
.AddRewrite(@"^index.php/(.+)", "index.php?title=$1", skipRemainingRules: true); | ||
app.UseRewriter(rewriteOptions); | ||
|
||
app.UseSession(); | ||
|
||
app.UsePhp(new PhpRequestOptions(scriptAssemblyName: "mediawiki")); | ||
|
||
app.UseDefaultFiles(); | ||
app.UseStaticFiles(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>netcoreapp2.0</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="2.0.1" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Session" Version="2.0.1" /> | ||
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.0.1" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Rewrite" Version="2.0.1" /> | ||
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="2.0.0" /> | ||
<PackageReference Include="Peachpie.NETCore.Web" Version="0.9.0-CI00853" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\mediawiki\mediawiki.msbuildproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |