<commit_before><?php
namespace ebi;
/**
 * リクエストを処理する
 * @author tokushima
 */
class Request implements \IteratorAggregate{
	private $vars = array();
	private $files = array();
	private $args;

	public function __construct(){
		if('' != ($pathinfo = (isset($_SERVER['PATH_INFO'])) ? $_SERVER['PATH_INFO'] : '')){
			if($pathinfo[0] != '/') $pathinfo = '/'.$pathinfo;
			$this->args = preg_replace("/(.*?)\?.*/","\\1",$pathinfo);
		}
		if(isset($_SERVER['REQUEST_METHOD'])){
			if(isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST'){
				if(isset($_POST) && is_array($_POST)){
					if(isset($_SERVER['CONTENT_TYPE']) && $_SERVER['CONTENT_TYPE'] == 'application/json'){
						$json = json_decode(file_get_content('php://input'),true);
						if(is_array($json)){
							foreach($json as $k => $v){
								$this->vars[$k] = $v;
							}
						}
					}
					foreach($_POST as $k => $v){
						$this->vars[$k] = (get_magic_quotes_gpc() && is_string($v)) ? stripslashes($v) : $v;
					}
				}
				if(isset($_FILES) && is_array($_FILES)){
					$marge_func = function($arr,$pk,$files,&$map) use(&$marge_func){
						if(is_array($arr)){
							foreach($arr as $k => $v){
								$marge_func($v,array_merge($pk,array($k)),$files,$map);
							}
						}else{
							$ks = implode('',array_map(function($v){ return '[\''.$v.'\']';},$pk));<commit_msg>PUT/DELETEの処理しよう<commit_after><?php
namespace ebi;
/**
 * リクエストを処理する
 * @author tokushima
 */
class Request implements \IteratorAggregate{
	private $vars = array();
	private $files = array();
	private $args;

	public function __construct(){
		if('' != ($pathinfo = (isset($_SERVER['PATH_INFO'])) ? $_SERVER['PATH_INFO'] : '')){
			if($pathinfo[0] != '/') $pathinfo = '/'.$pathinfo;
			$this->args = preg_replace("/(.*?)\?.*/","\\1",$pathinfo);
		}
		if(isset($_SERVER['REQUEST_METHOD'])){
			if(isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST'){
				if(isset($_POST) && is_array($_POST)){
					if(isset($_SERVER['CONTENT_TYPE']) && $_SERVER['CONTENT_TYPE'] == 'application/json'){
						$json = json_decode(file_get_contents('php://input'),true);
						if(is_array($json)){
							foreach($json as $k => $v){
								$this->vars[$k] = $v;
							}
						}
					}
					foreach($_POST as $k => $v){
						$this->vars[$k] = (get_magic_quotes_gpc() && is_string($v)) ? stripslashes($v) : $v;
					}
				}
				if(isset($_FILES) && is_array($_FILES)){
					$marge_func = function($arr,$pk,$files,&$map) use(&$marge_func){
						if(is_array($arr)){
							foreach($arr as $k => $v){
								$marge_func($v,array_merge($pk,array($k)),$files,$map);
							}
						}else{
							$ks = implode('',array_map(function($v){ return '[\''.$v.'\']';},$pk));
{'fraction_non_alphanumeric': 0.24614820249449743, 'fraction_numerical': 0.001467351430667645, 'mean_word_length': 3.8351063829787235, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 0, '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': '1958643', 'n_tokens_mistral': 1219, 'n_tokens_neox': 982, 'n_words': 145}