<commit_before><?php 
/**
* Memo Framework (https://github.com/zither/Memo)
*
* @link https://github.com/zither/Memo
* @copyright Copyright (c) 2015 <NAME>
* @license https://github.com/zither/Memo/blob/master/LICENSE (MIT License)
*/
namespace Memo;

use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\ResponseInterface;

class App extends \Pimple\Container
{
    protected $defaultSettings = [
        "cookieLifetime" => "20 minutes",
        "cookiePath" => "/",
        "cookieDomain" => null,
        "cookieSecure" => false,
        "cookieHttpOnly" => false,
        "httpVersion" => "1.1",
        "debug" => true
    ];

    public function __construct(array $userSettings = [])
    {
        parent::__construct();

        $this["settings"] = function ($c) use ($userSettings) {
            return array_merge($c->defaultSettings, $userSettings);
        };

        $this["environment"] = function () {
            return new \Slim\Http\Environment($_SERVER);
        };

        $this["request"] = $this->factory(function ($c) {
            $env = $c["environment"];
            $method = $env["REQUEST_METHOD"];
            $uri = \Slim\Http\Uri::createFromEnvironment($env);
            $headers = \Slim\Http\Headers::createFromEnvironment($env);
            $cookies = \Slim\Http\Cookies::parseHeader($headers->get("Cookie", []));
            $serverParams = $env->all();
            $body = new \Slim\Http\Body(fopen("php://input", "r"));

            return new \Slim\Http\Request($method, $uri, $headers, $cookies, $serverParams, $body);
        });

        $this["response"] = $this->factory(function ($c) {
            $headers = new \Slim\Http\Headers(["Content-Type" => "text/html"]);
            $response = new \Slim\Http\Response(200, $headers);

            return $response->withProtocolVersion($c["settings"]["httpVersion"]);
        });

        $this["router"] = function ($c) {
            return (new Router())->setContainer($c);
        };
    }

    /**
     * Add route
     *
     * @param string $route
     * @param array $callback
     */
    public function addRoute($route, $callback)
    {
        $this["router"]->addRoute($route, $callback);
    }

    /**
     * Run app
     *
     * @return ResponseInterface
     */
    public function run()<commit_msg>Fix POST data missing when uploading a file<commit_after><?php 
/**
* Memo Framework (https://github.com/zither/Memo)
*
* @link https://github.com/zither/Memo
* @copyright Copyright (c) 2015 <NAME>
* @license https://github.com/zither/Memo/blob/master/LICENSE (MIT License)
*/
namespace Memo;

use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\ResponseInterface;

class App extends \Pimple\Container
{
    protected $defaultSettings = [
        "cookieLifetime" => "20 minutes",
        "cookiePath" => "/",
        "cookieDomain" => null,
        "cookieSecure" => false,
        "cookieHttpOnly" => false,
        "httpVersion" => "1.1",
        "debug" => true
    ];

    public function __construct(array $userSettings = [])
    {
        parent::__construct();

        $this["settings"] = function ($c) use ($userSettings) {
            return array_merge($c->defaultSettings, $userSettings);
        };

        $this["environment"] = function () {
            return new \Slim\Http\Environment($_SERVER);
        };

        $this["request"] = $this->factory(function ($c) {
            return \Slim\Http\Request::createFromEnvironment($c["environment"]);
        });

        $this["response"] = $this->factory(function ($c) {
            $headers = new \Slim\Http\Headers(["Content-Type" => "text/html"]);
            $response = new \Slim\Http\Response(200, $headers);

            return $response->withProtocolVersion($c["settings"]["httpVersion"]);
        });

        $this["router"] = function ($c) {
            return (new Router())->setContainer($c);
        };
    }

    /**
     * Add route
     *
     * @param string $route
     * @param array $callback
     */
    public function addRoute($route, $callback)
    {
        $this["router"]->addRoute($route, $callback);
    }

    /**
     * Run app
     *
     * @return ResponseInterface
     */
    public function run()
{'fraction_non_alphanumeric': 0.17005196032120926, 'fraction_numerical': 0.0051960321209258385, 'mean_word_length': 2.423605497170574, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 35, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1599682', 'n_tokens_mistral': 1274, 'n_tokens_neox': 1239, 'n_words': 236}