public function requestIn($ctx) { $_g = $this; if (strtolower($ctx->request->get_httpMethod()) === "post" && $ctx->request->isMultipart()) { $file = null; $postName = null; $origFileName = null; $size = 0; $tmpFilePath = null; $dateStr = DateTools::format(Date::now(), "%Y%m%d-%H%M"); $dir = _hx_string_or_null($ctx->get_contentDirectory()) . _hx_string_or_null(haxe_io_Path::addTrailingSlash(ufront_web_upload_TmpFileUploadMiddleware::$subDir)); $path = haxe_io_Path::removeTrailingSlashes($dir); $path1 = haxe_io_Path::addTrailingSlash($path); $_p = null; $parts = new _hx_array(array()); while ($path1 !== ($_p = haxe_io_Path::directory($path1))) { $parts->unshift($path1); $path1 = $_p; } $_g1 = 0; while ($_g1 < $parts->length) { $part = $parts[$_g1]; ++$_g1; if (_hx_char_code_at($part, strlen($part) - 1) !== 58 && !file_exists($part)) { @mkdir($part, 493); } unset($part); } $onPart = array(new _hx_lambda(array(&$_g, &$ctx, &$dateStr, &$dir, &$file, &$origFileName, &$postName, &$size, &$tmpFilePath), "ufront_web_upload_TmpFileUploadMiddleware_0"), 'execute'); $onData = array(new _hx_lambda(array(&$_g, &$ctx, &$dateStr, &$dir, &$file, &$onPart, &$origFileName, &$postName, &$size, &$tmpFilePath), "ufront_web_upload_TmpFileUploadMiddleware_1"), 'execute'); $onEndPart = array(new _hx_lambda(array(&$_g, &$ctx, &$dateStr, &$dir, &$file, &$onData, &$onPart, &$origFileName, &$postName, &$size, &$tmpFilePath), "ufront_web_upload_TmpFileUploadMiddleware_2"), 'execute'); return tink_core__Future_Future_Impl_::map($ctx->request->parseMultipart($onPart, $onData, $onEndPart), array(new _hx_lambda(array(&$_g, &$ctx, &$dateStr, &$dir, &$file, &$onData, &$onEndPart, &$onPart, &$origFileName, &$postName, &$size, &$tmpFilePath), "ufront_web_upload_TmpFileUploadMiddleware_3"), 'execute'), null); } else { return ufront_core_SurpriseTools::success(); } }
public function doCreateSessionDirectory() { $dir = haxe_io_Path::removeTrailingSlashes($this->savePath); return ufront_core_SurpriseTools::tryCatchSurprise(array(new _hx_lambda(array(&$dir), "ufront_web_session_FileSession_1"), 'execute'), "Failed to create directory " . _hx_string_or_null($dir), _hx_anonymous(array("fileName" => "FileSession.hx", "lineNumber" => 203, "className" => "ufront.web.session.FileSession", "methodName" => "doCreateSessionDirectory"))); }