Exemplo n.º 1
0
 public static function loadParams()
 {
     $path = substr(self::getPath(), strlen(self::$_resource));
     $path = substr($path, 0, 1) == "/" ? substr($path, 1) : $path;
     $path = substr($path, -1) == "/" ? substr($path, 0, -1) : $path;
     $parts = self::$_pathParts;
     if (count($parts) > 0) {
         foreach ($parts as $key => $part) {
             if ($key % 2 == 1) {
                 self::$_params[$parts[$key - 1]] = urldecode($part);
             } else {
                 if ($part != "") {
                     self::$_params[$part] = "";
                 }
             }
         }
     }
     $queryParams = array();
     if (self::getMethod() == "get") {
         $queryString = $_SERVER['QUERY_STRING'];
         parse_str($queryString, $queryParams);
     } elseif (self::getMethod() == "post") {
         $queryParams = $_POST;
     } elseif (self::getMethod() == "put") {
         $queryParams = array();
         parse_raw_http_request($queryParams);
     }
     self::$_params = array_merge(self::$_params, $queryParams);
 }
include_once mnminclude . 'user.php';
include_once mnminclude . 'utils.php';
include_once '../Smarty.class.php';
include_once '../Classes/CSVToExcelConverter.php';
include_once 'FileUtil.php';
include_once 'rawHttpParser.php';
include_once realpath(dirname(__FILE__) . "/../DAL/DBImporters/DatabaseImporterFactory.php");
require_once realpath(dirname(__FILE__)) . "/../vendor/autoload.php";
Logger::configure(realpath(dirname(__FILE__)) . '/../conf/log4php.xml');
$logger = Logger::getLogger("generalLog");
// module system hook
$vars = '';
check_actions('submit_post_authentication', $vars);
// When mime type is application/octet-stream, parse input stream to get params.
$params = array();
parse_raw_http_request($params);
if (count($params) == 0) {
    // Params are from $_POST.
    $params = $_POST;
}
$sid = $params['sid'];
$uploadTimestamp = $params['uploadTimestamp'];
$fileType = $params['fileType'];
//TODO FIXME: once appeding of files is resolved uncomment here;
$excelFileMode = "join";
//$params['excelFileMode'];
$dbType = $params['dbType'];
$logger->info($_FILES);
upload_0($sid, $uploadTimestamp, $fileType, $excelFileMode, $dbType);
function upload_0($sid, $uploadTimestamp, $fileType, $excelFileMode, $dbType)
{