Refresh packages db from packages directory.
diff --git a/src/inc/api_nuget.php b/src/inc/api_nuget.php
index 1e446e6..b1bcd12 100644
--- a/src/inc/api_nuget.php
+++ b/src/inc/api_nuget.php
@@ -62,10 +62,21 @@ private function MakeDepString($d)
$sd = $d[$i];
if($sd->IsGroup){
$fw= $this->TranslateNet($sd->TargetFramework);
- for($j=0;$j
Dependencies);$j++){
- $sdd = $sd->Dependencies[$j];
- $tora[]=($sdd->Id.":".$sdd->Version.":".$fw);
- }
+ //if(strpos($fw,"+")===FALSE) {
+ for($j=0;$jDependencies);$j++){
+ $sdd = $sd->Dependencies[$j];
+ $tora[]=($sdd->Id.":".$sdd->Version.":".$fw);
+ }
+ /*}else{
+ $fws = explode("+",$fw);
+ for($k=0;$kDependencies);$j++){
+ $sdd = $sd->Dependencies[$j];
+ $tora[]=($sdd->Id.":".$sdd->Version.":".$subfw);
+ }
+ }
+ }*/
}else{
$tora[]=($sd->Id.":".$sd->Version.":");
}
diff --git a/src/inc/commons/apibase.php b/src/inc/commons/apibase.php
index e5ae8cd..c611bb4 100644
--- a/src/inc/commons/apibase.php
+++ b/src/inc/commons/apibase.php
@@ -85,7 +85,7 @@ public function Execute($method = null)
try{
if(array_key_exists($function,$availableMethods)){
- $this->$availableMethods[$function]();
+ $this->{$availableMethods[$function]}();
}else{
ApiBase::ReturnError("Invalid method ".$function,405);
}
diff --git a/src/inc/commons/http.php b/src/inc/commons/http.php
index 65fbcfd..863055b 100644
--- a/src/inc/commons/http.php
+++ b/src/inc/commons/http.php
@@ -1,4 +1,7 @@
$block){
- if (empty($block) || $block=="--")
- continue;
+ $data = array();
- // you'll have to var_dump $block to understand this and maybe replace \n or \r with a visibile char
- // parse uploaded files
- if (strpos($block, 'application/octet-stream') !== FALSE){
- // match "name", then everything after "stream" (optional) except for prepending newlines
- //preg_match("/name=\"([^\"]*)\".*stream[\n|\r]+([^\n\r].*)?$/s", $block, $matches);
- preg_match("/octet-stream[\n|\r]+([^\n\r].*)?$/s", $block, $matches);
-
- $realData = mb_substr($matches[1], 0, -2);
-
- //$a_data['files'][$matches[1]] = array();
- //$a_data['files'][$matches[1]]["tmp_name"]=Utils::WriteTemporaryFile($realData);
- //$a_data['files'][$matches[1]]["type"]="";
- //$a_data['files'][$matches[1]]["size"]=filesize($a_data['files'][$matches[1]]["tmp_name"]);
- //$a_data['files'][$matches[1]]["error"]=0;
- //$a_data['files'][$matches[1]]["name"]="name";
-
- $tmpFileName = "package";
- $a_data['files'][$tmpFileName] = array();
- $a_data['files'][$tmpFileName]["tmp_name"]=Utils::WriteTemporaryFile($realData);
- $a_data['files'][$tmpFileName]["type"]="";
- $a_data['files'][$tmpFileName]["size"]=filesize($a_data['files'][$tmpFileName]["tmp_name"]);
- $a_data['files'][$tmpFileName]["error"]=0;
- $a_data['files'][$tmpFileName]["name"]="name";
- }else{
- // parse all other fields
- // match "name" and optional value in between newline sequences
- preg_match('/name=\"([^\"]*)\"[\n|\r]+([^\n\r].*)?\r$/s', $block, $matches);
- if(sizeof($matches)>=2){
- $a_data[$matches[1]] = $matches[2];
- }
- }
- }
+ new stream($data);
+ //$_PUT = $data['post'];
- if($onlyFiles) {
- return $a_data["files"];
- }
- return $a_data;
+ return $data['file'];
}
}
diff --git a/src/inc/commons/objectsearch.php b/src/inc/commons/objectsearch.php
index c13c3e9..b182639 100644
--- a/src/inc/commons/objectsearch.php
+++ b/src/inc/commons/objectsearch.php
@@ -157,8 +157,7 @@ function _isGroupBy($operator)
function _isString($operator)
{
if($operator[0]==$operator[sizeof($operator)-1]){
- $res = $this->_isStartString($operator[0]);
- return $res;
+ return $this->_isStartString($operator[0]);
}
return false;
}
@@ -572,7 +571,7 @@ public function _doExecute($parseTreeItem,$subject)
switch($t){
case "string":
case "number":
- case "boolean":
+ case "boolean":
return $parseTreeItem;
}
if($t == "function"){
@@ -965,11 +964,6 @@ public function _cmp($f,$s,$asc,$type)
return 0;
}
- public function dump()
- {
- //var_dump($this->parseResult);
- }
-
public function DoGroupBy($subject)
{
if(sizeof($this->_groupClause)==0) return $subject;
diff --git a/src/inc/commons/smalltxtdb.php b/src/inc/commons/smalltxtdb.php
index 9ae3433..d6e9f5a 100644
--- a/src/inc/commons/smalltxtdb.php
+++ b/src/inc/commons/smalltxtdb.php
@@ -142,7 +142,7 @@ private function load($loadData)
$this->rows = array();
if($loadData){
for ($i = $st; $i < sizeof($splitted); $i++) {
-
+
$splitted[$i] = trim($splitted[$i]);
if($splitted[$i]!=""){
diff --git a/src/inc/commons/uploadutils.php b/src/inc/commons/uploadutils.php
index 7947750..9c1c944 100644
--- a/src/inc/commons/uploadutils.php
+++ b/src/inc/commons/uploadutils.php
@@ -1,6 +1,7 @@
initialize($destinationDir,$allowedExts,$maxSize,$allowAll=false);
- }
-
- public function UploadUtils($destinationDir,$allowedExts,$maxSize,$allowAll=false)
- {
- $this->initialize($destinationDir,$allowedExts,$maxSize,$allowAll);
+ $this->initialize($destinationDir,$allowedExts,$maxSize,$allowAll=false);
}
function initialize($destinationDir,$allowedExts,$maxSize,$allowAll=false)
@@ -39,62 +35,68 @@ function Upload($fileId = "file") {
$isRealFile = true;
if(!array_key_exists($fileId,$files)){
$files = HttpUtils::RawRequest();
- $isRealFile = false;
}
-
-
- $guid = Utils::NewGuid();
- $toret = array();
- $toret["hasError"] = false;
- $toret["errorCode"] = null;
- $toret["errorMessage"] = "";
- $toret["name"]=$files[$fileId]["name"];
- if(array_key_exists("mime",$files[$fileId]))$toret["mime"] = $files[$fileId]["type"];
- if(array_key_exists("size",$files[$fileId]))$toret["sizeBytes"] = $files[$fileId]["size"];
- $exploded = explode(".", $toret["name"]);
- $extension = end($exploded);
-
- if ( $toret["sizeBytes"] >= $this->maxSize){
- $toret["hasError"] = true;
- $toret["errorMessage"] = "Max size is '".$this->maxSize."' bytes. File size is '".$toret["sizeBytes"]."'.";
- }else if ( $this->allowAll<=0 && !in_array($extension, $this->allowedExts)){
- $toret["hasError"] = true;
- $toret["errorMessage"] = "Extension '".$extension."' not allowed. ".
- "The allowed ones are '".implode(", ",$this->allowedExts)."'";
- }else {
- if (array_key_exists("error",$files[$fileId]) && $files[$fileId]["error"] > 0){
- //TODO Error translations http://php.net/manual/en/features.file-upload.errors.php
- $toret["hasError"] = true;
- $toret["errorCode"]= $files[$fileId]["error"];
- }else{
- $toret["tmpName"] = $files[$fileId]["tmp_name"];
+ foreach($files as $fileId => $file){
+
+ $guid = Utils::NewGuid();
+ $toret = array();
+ $toret["hasError"] = false;
+ $toret["errorCode"] = null;
+ $toret["errorMessage"] = "";
+ $toret["name"]=$file["name"];
+ if(array_key_exists("mime",$file))$toret["mime"] = $file["type"];
+ if(array_key_exists("tmp_name",$file))$toret["tmpName"] = $file["tmp_name"];
+ if(array_key_exists("size",$file))$toret["sizeBytes"] = $file["size"];
+ $exploded = explode(".", $toret["name"]);
+ $extension = end($exploded);
- if (file_exists($this->destinationDir."/" . $guid)){
- unlink ($this->destinationDir."/" . $guid);
- }
- $toret["destination"]=$this->destinationDir."/" . $guid;
- if($isRealFile){
- if(!move_uploaded_file($toret["tmpName"],$toret["destination"])){
- $toret["hasError"] = true;
- $toret["errorMessage"] = 'Cannot move file from ' . $toret["tmpName"] . ' to ' . $toret["destination"];
- $toret["errorCode"] = UPLOAD_ERR_CANT_WRITE;
+ if ( $toret["sizeBytes"] >= $this->maxSize){
+ $toret["hasError"] = true;
+ $toret["errorMessage"] = "Max size is '".$this->maxSize."' bytes. File size is '".$toret["sizeBytes"]."'.";
+ }else if ( $this->allowAll<=0 && !in_array($extension, $this->allowedExts)){
+ $toret["hasError"] = true;
+ $toret["errorMessage"] = "Extension '".$extension."' not allowed. ".
+ "The allowed ones are '".implode(", ",$this->allowedExts)."'";
+ }else {
+ if (array_key_exists("error",$file) && $file["error"] > 0){
+ //TODO Error translations http://php.net/manual/en/features.file-upload.errors.php
+ $toret["hasError"] = true;
+ $toret["errorCode"]= $file["error"];
+ }else{
+
+
+ if (file_exists($this->destinationDir."/" . $guid)){
+ unlink ($this->destinationDir."/" . $guid);
}
- }else{
- if(!rename($toret["tmpName"],$toret["destination"])){
- $toret["hasError"] = true;
- $toret["errorMessage"] = 'Cannot rename file from ' . $toret["tmpName"] . ' to ' . $toret["destination"];
- $toret["errorCode"] = UPLOAD_ERR_CANT_WRITE;
+ $toret["destination"]=$this->destinationDir."/" . $guid;
+
+ if(file_exists($toret["tmpName"])){
+ if(!move_uploaded_file($toret["tmpName"],$toret["destination"])){
+ $toret["hasError"] = true;
+ $toret["errorMessage"] = 'Cannot move file from ' . $toret["tmpName"] . ' to ' . $toret["destination"];
+ $toret["errorCode"] = UPLOAD_ERR_CANT_WRITE;
+ }
+ }else{
+ //if($toret["tmpName"]==null){
+ file_put_contents($toret["destination"],$file["content"]);
+ /*}
+ else if(!rename($toret["tmpName"],$toret["destination"])){
+ $toret["hasError"] = true;
+ $toret["errorMessage"] = 'Cannot rename file from ' . $toret["tmpName"] . ' to ' . $toret["destination"];
+ $toret["errorCode"] = UPLOAD_ERR_CANT_WRITE;
+ }*/
}
+ }
}
- }
- }
-
- if($toret["hasError"]){
- unlink($toret["tmpName"]);
- }
- return $toret;
+ //uplogv("uploadutils","Files",$toret);
+ //die();
+ if($toret["hasError"]){
+ unlink($toret["tmpName"]);
+ }
+ return $toret;
+ }
}
}
/*
diff --git a/src/inc/commons/zipmanager.php b/src/inc/commons/zipmanager.php
index 3e8c9d4..73076cd 100644
--- a/src/inc/commons/zipmanager.php
+++ b/src/inc/commons/zipmanager.php
@@ -11,11 +11,6 @@ public function __construct($zipFile)
$this->initialize($zipFile);
}
- public function ZipManager($zipFile)
- {
- $this->initialize($zipFile);
- }
-
private function initialize($zipFile)
{
$this->zipFile = $zipFile;
@@ -26,6 +21,7 @@ private function initialize($zipFile)
public function LoadFile($path)
{
+
$zip = zip_open($this->zipFile);
if ($zip) {
while ($zip_entry = zip_read($zip)) {
@@ -54,6 +50,8 @@ function GenerateInfos() {
if ($zip) {
while ($zip_entry = zip_read($zip)) {
$zip_entry_name = zip_entry_name($zip_entry);
+
+
if (is_dir($zip_entry_name)) {
$folder_count++;
}else {
@@ -94,5 +92,4 @@ function get_file_size_unit($file_size){
}
}
-
?>
\ No newline at end of file
diff --git a/src/inc/db_nugetpackages.php b/src/inc/db_nugetpackages.php
index d996c9a..8247df1 100644
--- a/src/inc/db_nugetpackages.php
+++ b/src/inc/db_nugetpackages.php
@@ -40,7 +40,8 @@ function nugetDbPackageBuilder()
class NuGetDb
{
public function EntityName(){ return "PackageDescriptor";}
- public function NuGetDb()
+
+ public function __constructor()
{
$this->initialize();
}
diff --git a/src/inc/db_nugetpackagesentity.php b/src/inc/db_nugetpackagesentity.php
index bda7f8a..ffb5460 100644
--- a/src/inc/db_nugetpackagesentity.php
+++ b/src/inc/db_nugetpackagesentity.php
@@ -15,7 +15,7 @@ function translateNetVersion($tf)
case(".netframework3.0"): return "net30";
case(".netframework2.0"): return "net20";
case(".netframework1.0"): return "net10";
- default: return "UNKNOWN";
+ default: return $tf;
}
}
diff --git a/src/inc/db_users.php b/src/inc/db_users.php
index a844514..52f678d 100644
--- a/src/inc/db_users.php
+++ b/src/inc/db_users.php
@@ -31,11 +31,6 @@ public function __construct()
$this->initialize();
}
- public function UserDbSortUserId()
- {
- $this->initialize();
- }
-
private function initialize()
{
diff --git a/src/inc/gerfen/class.stream.php b/src/inc/gerfen/class.stream.php
new file mode 100644
index 0000000..e0c5ac5
--- /dev/null
+++ b/src/inc/gerfen/class.stream.php
@@ -0,0 +1,278 @@
+input = file_get_contents('php://input');
+
+ $boundary = $this->boundary();
+
+ if (!count($boundary)) {
+ return array(
+ 'post' => $this->parse($this->input),
+ 'file' => array()
+ );
+ }
+
+ $blocks = $this->split($boundary);
+
+
+ $data = $this->blocks($blocks);
+
+ return $data;
+ }
+
+ /**
+ * @function boundary
+ * @returns Array
+ */
+ private function boundary()
+ {
+ preg_match('/boundary=(.*)$/', $_SERVER['CONTENT_TYPE'], $matches);
+ return str_replace("\"","",$matches[1]);
+ }
+
+ /**
+ * @function parse
+ * @returns Array
+ */
+ private function parse()
+ {
+ parse_str(urldecode($this->input), $result);
+ return $result;
+ }
+
+ /**
+ * @function split
+ * @param $boundary string
+ * @returns Array
+ */
+ private function split($boundary)
+ {
+ $result = preg_split("/-+$boundary/", $this->input);
+
+ array_pop($result);
+ return $result;
+ }
+
+ /**
+ * @function blocks
+ * @param $array array
+ * @returns Array
+ */
+ private function blocks($array)
+ {
+
+ $results = array(
+ 'post' => array(),
+ 'file' => array()
+ );
+
+ foreach($array as $key => $value)
+ {
+ if (empty($value))
+ continue;
+
+ $block = $this->decide($value);
+
+ if (count($block['post']) > 0)
+ array_push($results['post'], $block['post']);
+
+ if (count($block['file']) > 0)
+ $results['file'][$block['file']['name']]= $block['file'];
+ }
+
+ return $this->merge($results);
+ }
+
+ /**
+ * @function decide
+ * @param $string string
+ * @returns Array
+ */
+ private function decide($string)
+ {
+ if (strpos($string, 'application/octet-stream') !== FALSE)
+ {
+ return array(
+ 'post' => array(),
+ 'file' => $this->file($string)
+ );
+ }
+
+ if (strpos($string, 'filename') !== FALSE)
+ {
+ return array(
+ 'post' => array(),
+ 'file' => $this->file_stream($string)
+ );
+ }
+
+ return array(
+ 'post' => $this->post($string),
+ 'file' => array()
+ );
+ }
+
+ /**
+ * @function file
+ * @param $boundary string
+ * @returns Array
+ */
+ private function file($string)
+ {
+ $fileName = Utils::NewGuid();
+ preg_match('/name=\"([^\"]*)\".*stream[\n|\r]+([^\n\r].*)?$/s', $string, $match);
+ if(sizeof($match)==3){
+ uplog("class.stream","Match 3");
+ $cnt = substr($match[2],0,strlen($match[2])-2);
+ return array(
+ //$match[1] => $match[2]
+ "tmp_name"=>null,
+ "name"=>$match[1],
+ "sizeBytes" =>strlen($match[2]),
+ "content"=> $cnt
+ );
+ }else{
+ preg_match('/filename=([^;]*);/', $string, $match);
+ if(sizeof($match)==2){
+ uplog("class.stream","Match 2");
+ $fileName = $match[1];
+ }
+ }
+ $match = preg_split('/\r\n\r\n/s', $string);
+
+ $cnt = substr($match[1],0,strlen($match[1])-2);
+ $res= array(
+ "tmp_name"=>null,
+ "name"=>$fileName,
+ "sizeBytes" =>strlen($cnt),
+ "content"=> $cnt
+ );
+
+ return $res;
+ }
+
+ /**
+ * @function file_stream
+ * @param $boundary string
+ * @returns Array
+ */
+ private function file_stream($string)
+ {
+ $data = array();
+
+ preg_match('/name=\"([^\"]*)\"; filename=\"([^\"]*)\"[\n|\r]+([^\n\r].*)?\r$/s', $string, $match);
+ preg_match('/Content-Type: (.*)?/', $match[3], $mime);
+
+ $image = preg_replace('/Content-Type: (.*)[^\n\r]/', '', $match[3]);
+
+ $path = sys_get_temp_dir().'/php'.substr(sha1(rand()), 0, 6);
+
+ $err = file_put_contents($path, $image);
+
+ if (preg_match('/^(.*)\[\]$/i', $match[1], $tmp)) {
+ $index = $tmp[1];
+ } else {
+ $index = $match[1];
+ }
+
+ $data[$index]['name'] = $match[2];
+ $data[$index]['type'] = $mime[1];
+ $data[$index]['tmp_name'] = $path;
+ $data[$index]['error'] = ($err === FALSE) ? $err : 0;
+ $data[$index]['size'] = filesize($path);
+
+ return $data;
+ }
+
+ /**
+ * @function post
+ * @param $boundary string
+ * @returns Array
+ */
+ private function post($string)
+ {
+ $data = array();
+
+ preg_match('/name=\"([^\"]*)\"[\n|\r]+([^\n\r].*)?\r$/s', $string, $match);
+
+ if (preg_match('/^(.*)\[\]$/i', $match[1], $tmp)) {
+ $data[$tmp[1]][] = $match[2];
+ } else {
+ $data[$match[1]] = $match[2];
+ }
+
+ return $data;
+ }
+
+ /**
+ * @function merge
+ * @param $array array
+ *
+ * Ugly ugly ugly
+ *
+ * @returns Array
+ */
+ private function merge($array)
+ {
+ $results = array(
+ 'post' => array(),
+ 'file' => array()
+ );
+
+ if (count($array['post'] > 0)) {
+ foreach($array['post'] as $key => $value) {
+ foreach($value as $k => $v) {
+ if (is_array($v)) {
+ foreach($v as $kk => $vv) {
+ $results['post'][$k][] = $vv;
+ }
+ } else {
+ $results['post'][$k] = $v;
+ }
+ }
+ }
+ }
+
+ if (count($array['file'] > 0)) {
+ foreach($array['file'] as $key => $value) {
+ $results['file'][$key] = $value;
+ /*foreach($value as $k => $v) {
+ if (is_array($v)) {
+ foreach($v as $kk => $vv) {
+ $results['file'][$kk][] = $vv[0];
+ }
+ } else {
+ $results['file'][$key] = $v;
+ }
+ }*/
+ }
+ }
+
+ return $results;
+ }
+}
diff --git a/src/inc/gerfen/stream.php b/src/inc/gerfen/stream.php
new file mode 100644
index 0000000..ddf8556
--- /dev/null
+++ b/src/inc/gerfen/stream.php
@@ -0,0 +1,96 @@
+ 0) {
+ foreach($_FILES as $key => $value) {
+ if (!is_uploaded_file($value['tmp_name'])) {
+ rename($value['tmp_name'], '/path/to/uploads/'.$value['name']);
+ } else {
+ move_uploaded_file($value['tmp_name'], '/path/to/uploads/'.$value['name']);
+ }
+ }
+}
diff --git a/src/inc/internalsettings.php b/src/inc/internalsettings.php
index 6bcb14c..87c99f0 100644
--- a/src/inc/internalsettings.php
+++ b/src/inc/internalsettings.php
@@ -6,12 +6,11 @@
define('__RW_ADMIN_R_ALL__',0644);
-
class Settings
{
public static $PackageHash = __PACKAGEHASH__;
public static $MaxUploadBytes = __MAXUPLOAD_BYTES__;
- public static $Version = "4.0.0.0-beta";
+ public static $Version = "4.0.0.0";
public static $ResultsPerPage = __RESULTS_PER_PAGE__;
public static $SiteRoot = __SITE_ROOT__;
public static $DataRoot = "";
@@ -53,4 +52,53 @@ function initializeInternalSettings(){
}
initializeInternalSettings();
+
+
+
+$doUpLog = false;
+$doLogBin = false;
+
+function uplog($who,$data)
+{
+ global $doUpLog;
+ if(!$doUpLog)return;
+ file_put_contents($who.".log",$data."\r\n", FILE_APPEND);
+}
+function uplogh($who,$str,$data)
+{
+ global $doUpLog;
+ if(!$doUpLog)return;
+ if(sizeof($data)>0){
+ uplog($who,$str);
+ ob_start();
+ var_dump($data);
+ $result = ob_get_clean();
+ uplog($who,$result);
+ }else{
+ uplog($who,$str."-EMPTY");
+ }
+}
+function uplogv($who,$str,$data)
+{
+ global $doUpLog;
+ if(!$doUpLog)return;
+ uplog($who,$str);
+ ob_start();
+ var_dump($data);
+ $result = ob_get_clean();
+ uplog($who,$result);
+}
+function uplogb($who,$str,$data)
+{
+ global $doUpLog;
+ if(!$doUpLog)return;
+ global $doLogBin;
+ if(!$doLogBin)return;
+ if(sizeof($data)>0){
+ uplog($who,$str);
+ uplog($who,$data);
+ }else{
+ uplog($who,$str."-EMPTY");
+ }
+}
?>
\ No newline at end of file
diff --git a/src/inc/logincontroller.php b/src/inc/logincontroller.php
index 9989673..b2c7f38 100644
--- a/src/inc/logincontroller.php
+++ b/src/inc/logincontroller.php
@@ -33,7 +33,7 @@ function _initialize()
}
}
- function LoginController()
+ function __construct()
{
$this->_initialize();
}
diff --git a/src/inc/nugetreader.php b/src/inc/nugetreader.php
index 9e3ba94..f062382 100644
--- a/src/inc/nugetreader.php
+++ b/src/inc/nugetreader.php
@@ -122,18 +122,29 @@ public function LoadNuspecFromFile($nupkgFile)
$zipmanager = new ZipManager($nupkgFile);
$files = $zipmanager->GenerateInfos();
$nupckgName = "";
+ //uplogh("nugetreader","Nupckg content of '".$nupkgFile."'!",$files);
+ $frameworks = array();
foreach($files["entries_name"] as $fileName)
{
$pinfo = pathinfo($fileName);
- if($pinfo["basename"]==$fileName){
+ if($pinfo["basename"]==$fileName && $nupckgName==""){
if(ends_with($fileName,".nuspec")){
$nupckgName = $fileName;
}
}
+
+ $isLib= strpos($pinfo["dirname"],"lib/");
+ if($isLib!==false && $isLib ==0){
+ $libex = explode("/",$pinfo["dirname"]);
+ if(sizeof($libex)>=2){
+ $frameworks[$libex[1]]=$libex[1];
+ }
+ }
}
+ uplogv("nugetreader.nuget","ZIPCONT",$files);
$nuspecContent = $zipmanager->LoadFile($nupckgName);
-
+ //uplogv("nugetreader","Nuspec content!",$nuspecContent);
$xml = XML2Array($nuspecContent);
$e = new PackageDescriptor();
$m=$xml["metadata"];
@@ -142,7 +153,22 @@ public function LoadNuspecFromFile($nupkgFile)
/*for($i=0;$iTargetFramework = "";
+ uplogv("nugetreader.nuget","fwks",$frameworks);
+ foreach($frameworks as $key=>$val){
+ $urlKey = urldecode($key);
+ if(strpos($urlKey,"+")!==false){
+ $kk = explode("+",$urlKey);
+ foreach($kk as $subk){
+ $e->TargetFramework.="|".$subk."|";
+ }
+ }else{
+ $e->TargetFramework.="|".$key."|";
+ }
+
+ }
+ $e->TargetFramework = str_replace("||","|",$e->TargetFramework);
$e->Dependencies = $this->LoadDependencies($m);
@@ -153,6 +179,7 @@ public function LoadNuspecFromFile($nupkgFile)
$e->PackageHashAlgorithm = strtoupper(Settings::$PackageHash);
$e->PackageSize = filesize($nupkgFile);
$e->Listed = true;
+ uplogv("nugetreader.nuget","nuspec",$e);
return $e;
}
@@ -266,10 +293,10 @@ private function LoadReferences($m)
}
- private function TranslateNet($tf)
+ /*private function TranslateNet($tf)
{
return translateNetVersion($tf);
- }
+ }*/
public function LoadNextVersions($packages,$versions,$available)
{
diff --git a/src/inc/setup/_02_importusers.php b/src/inc/setup/_02_importusers.php
index f0ea95b..5ef5664 100644
--- a/src/inc/setup/_02_importusers.php
+++ b/src/inc/setup/_02_importusers.php
@@ -106,9 +106,11 @@ function stdVerifyVersion($db)
}
$r["@ApplicationPath@"] = $app;
+
//Setup the settings
Utils::ReplaceInFile(Path::Combine(__ROOT__,"inc/setup/settings.php.template"),$r,Path::Combine(__ROOT__,"settings.php"));
echo "Settings initialized.";
+
if($r["@AllowPackageUpdate@"] == "true"){
echo "Package update allowed (warning!).";
}else{
diff --git a/src/inc/setup/_03_importpackages.php b/src/inc/setup/_03_importpackages.php
index 7273b4e..ee42891 100644
--- a/src/inc/setup/_03_importpackages.php
+++ b/src/inc/setup/_03_importpackages.php
@@ -29,7 +29,7 @@
Import Packages
- To impor the packages db from a previous version. The files will be uploaded after.
+ To import the packages db from a previous version. The files will be uploaded after.