diff --git a/NugetTesterApplication/NugetTesterApplication/App.config b/NugetTesterApplication/NugetTesterApplication/App.config index 6c3eed2..271c460 100644 --- a/NugetTesterApplication/NugetTesterApplication/App.config +++ b/NugetTesterApplication/NugetTesterApplication/App.config @@ -4,14 +4,14 @@ - - + + - + diff --git a/NugetTesterApplication/NugetTesterApplication/Tests/ApiQuery.cs b/NugetTesterApplication/NugetTesterApplication/Tests/ApiQuery.cs index cf99932..96b3952 100644 --- a/NugetTesterApplication/NugetTesterApplication/Tests/ApiQuery.cs +++ b/NugetTesterApplication/NugetTesterApplication/Tests/ApiQuery.cs @@ -34,7 +34,7 @@ public void Cleanup() [TestMethod] public void OrderByShouldBeConsistent() { - + var xml = this.GetRequest("api/v2/Search()?includePrerelease=true").ToXml(); var founded = xml.FindXmlNodes("feed", "entry").ToArray(); @@ -102,7 +102,7 @@ public void SpecialTest() } [TestMethod] - public void FindPackageByIdShouldShowOnlyList() + public void FindPackageByIdShouldShowListAllItemsButTheNotListed() { try { @@ -114,9 +114,9 @@ public void FindPackageByIdShouldShowOnlyList() var xml = this.GetRequest("api/v2/FindPackagesById?Id=APack").ToXml(); var founded = xml.FindXmlNodes("feed", "entry").ToArray(); - Assert(founded.Count() == 1, "Wrong items count"); + Assert(founded.Count() == 3, "Wrong items count"); Assert(founded[0].FindXmlNodes("title").First().InnerText == "APack", "Wrong package 2"); - Assert(founded[0].FindXmlNodes("m:properties", "d:Version").First().InnerText == "1.0.0.2", "Wrong package id 2"); + Assert(founded[0].FindXmlNodes("m:properties", "d:Version").First().InnerText == "1.0.0.13", "Wrong package id 2"); } finally { diff --git a/README.md b/README.md index 259ec3a..8647be0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ -# PhpNuget V. 4.0.0.0-beta +# PhpNuget V. 3.0.12.11 + +### NOTES ## Purpose @@ -13,18 +15,14 @@ Verified on: * PHP 5.6-IIS 8 * PHP 5.4.2-Apache 2.0 (OpenSuse 13.1) * PHP 5.3.3-Apache 2.2 (CentOS 6.5) +* PHP 7.0.14-Apache 2.4 (Windows 10 Home) ## Installation -### Update from previous version - -To update from previous versions it will suffice to +### Notes for everybody -* Save a copy of the settings.php (for reference) -* Upload the new version -* Open the setup.php page and fill with the previous settings -* All the data will be backupped before the update, even when the database is old -* When moving to mysql version all data will be ported if the relative function is enabled +* When installing the MySql version the db must be present with the user configured! +* The module php_curl must be present and configured inside the php.ini ### Notes for Apache With Red Hat Linux @@ -64,7 +62,17 @@ And then restart Apache This should be enough to let everything works. -### Prerequisities For IIS +### Notes for Apache on Windows + +If php is unable to load curl-related functions copy the following files from the php directory to "C:\Windows\System". +You can verify this by downloading a file from the official nuget repository via the manage packages page. + +* libeay32.dll +* libsasl.dll +* ssleay32.dll +* libssh2 + +### Prerequisites For IIS These steps are NOT needed if your hosting already configured PHP @@ -83,7 +91,6 @@ These steps are NOT needed if your hosting already configured PHP * Web.Config * .htaccess * Verify to have write permissions on the "db" directory. -* If you use mysql you should create a database with a user with full rights. * Open the setup page at http://myhost/mynuget/setup.php and follow the wizard. The value will be prefilled * Admin UserId: the user that will be created (or updated) as admin * Admin Password: the password (on update will be overwritten) @@ -96,12 +103,9 @@ These steps are NOT needed if your hosting already configured PHP * php-cgi.exe: To allow the configuration of php under IIS. * Allow package update via Upload: Default disabled, if enabled it is possible to overwrite the packages BUT THIS IS NOT A STANDARD BEHAVIOUR. * Allow package delete: Default disabled. LEAVING IT ENABLED IS NOT A STANDARD BEHAVIOUR - * Use mysql: If you will use the mysql version this will be checked and will enable further settings: - * Import from txt db: checked if should import from txt db - * MySql UserId: MySQL user id - * MySql Password: MySQL password - * MySql Server: The address of the server - * MySql Db: The db on which should store data +* When using the mysql installation + * Check the "Use mysql" and fill the configuration data + * NOTE: Import from txt db does not yet work!!! * If under IIS set the path of 'php-cgi.exe' (leave blank if your hosting already configured PHP) * Change the password, email and login of the administration without worries. * Rename the setup.php to setup.bak @@ -109,7 +113,6 @@ These steps are NOT needed if your hosting already configured PHP * settings.php * Web.Config * .htaccess - * ManagedFusion.Rewriter.txt * Now open http://myhost/mynuget and see the gallery * Happy Nugetting! @@ -261,22 +264,27 @@ now IIS is serving PHP now in next tutorial i will show you how to set up MySQL ### Should * Add robots.txt -* The gallery should be visible without javscript (for search engines) +* Import v3.0.0.0 txt database on MySQL ### Would -* Export database * Add Email token to reset users passwords * Upload multiple nupkg +* Align the Settings::ResultsPerPage in all the views ## Updates * 4.0.0.0 - * Support for MySql database - * Updated database to version 4.0.0.0 - * Added Version1-3 and VersionBeta fields to allow the group by version in MySQL - * Added automatic import of data when going to mysql version - + * Added MySQL as storage engine + +* 3.0.12.11 + * Added "count" value on all packages requests for nuget 3.5 + * Verified compatibility with Nuget.exe 2.8, 3.4, 3.5 + * Compatibility with PHP7 + +* 3.0.12.10 + * Added wait dialogs for long operations (update, upload from external nuget and refresh packages) + * 3.0.12.9 * Added support for .net 4.5.2 * Internal refactoring for net framework selection diff --git a/nuget3/phpnuget.sql b/nuget3/phpnuget.sql deleted file mode 100644 index 068840d..0000000 --- a/nuget3/phpnuget.sql +++ /dev/null @@ -1,104 +0,0 @@ --- phpMyAdmin SQL Dump --- version 4.1.4 --- http://www.phpmyadmin.net --- --- Host: 127.0.0.1 --- Generation Time: Oct 21, 2015 at 03:30 PM --- Server version: 5.6.15-log --- PHP Version: 5.5.8 - -SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; -SET time_zone = "+00:00"; - - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; - --- --- Database: `phpnuget` --- - --- -------------------------------------------------------- - --- --- Table structure for table `nugetdb_pkg` --- - -CREATE TABLE IF NOT EXISTS `nugetdb_pkg` ( - `version` char(128) NOT NULL DEFAULT '', - `title` text, - `id` char(128) NOT NULL DEFAULT '', - `author` text, - `iconurl` text, - `licenseurl` text, - `projecturl` text, - `downloadcount` int(11) DEFAULT NULL, - `requirelicenseacceptance` tinyint(1) DEFAULT NULL, - `description` text, - `releasenotes` text, - `published` text, - `dependencies` text, - `packagehash` text, - `packagehashalgorithm` text, - `packagesize` int(11) DEFAULT NULL, - `copyright` text, - `tags` text, - `isabsolutelatestversion` tinyint(1) DEFAULT NULL, - `islatestversion` tinyint(1) DEFAULT NULL, - `listed` tinyint(1) DEFAULT NULL, - `versiondownloadcount` int(11) DEFAULT NULL, - `references` text, - `targetframework` text, - `summary` text, - `isprerelease` tinyint(1) DEFAULT NULL, - `owners` text, - `userid` text, - PRIMARY KEY (`version`,`id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - --- --- Dumping data for table `nugetdb_pkg` --- - -INSERT INTO `nugetdb_pkg` (`version`, `title`, `id`, `author`, `iconurl`, `licenseurl`, `projecturl`, `downloadcount`, `requirelicenseacceptance`, `description`, `releasenotes`, `published`, `dependencies`, `packagehash`, `packagehashalgorithm`, `packagesize`, `copyright`, `tags`, `isabsolutelatestversion`, `islatestversion`, `listed`, `versiondownloadcount`, `references`, `targetframework`, `summary`, `isprerelease`, `owners`, `userid`) VALUES -('4.0.30506.0', 'Microsoft ASP.NET MVC 4', 'Microsoft.AspNet.Mvc', 's:9:"Microsoft";', 'http://localhost:8020/pnm/content/packagedefaulticon-50x50.png', 'http://www.microsoft.com/web/webpi/eula/mvc_4_eula_enu.htm', 'http://www.asp.net/mvc', NULL, 1, 'This package contains the runtime assemblies for ASP.NET MVC. ASP.NET MVC gives you a powerful, patterns-based way to build dynamic websites that enables a clean separation of concerns and that gives you full control over markup.', NULL, '2015-10-21T14:32:08.000000Z', 'a:2:{i:0;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:25:"Microsoft.AspNet.WebPages";s:7:"Version";s:11:"2.0.20710.0";}i:1;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:22:"Microsoft.AspNet.Razor";s:7:"Version";s:11:"2.0.20710.0";}}', 'zuQ/kRdHvVYb8oB3TwgMm7VHJ6FPAM7CizQ1FJ9vuHI1uaAMHKfKWJ/GvC8AhYPJuK+i8Q6RZnxic4BnWik18A==', 'SHA512', 266592, 'Microsoft', 'Microsoft AspNet Mvc AspNetMvc', NULL, NULL, 1, NULL, 'a:0:{}', NULL, NULL, 0, 'Microsoft', '{372F9D09-5B4B-4D68-A5FB-AB797193FC25}'), -('4.0.40804.0', 'Microsoft ASP.NET MVC 4', 'Microsoft.AspNet.Mvc', 's:9:"Microsoft";', 'http://localhost:8020/pnm/content/packagedefaulticon-50x50.png', 'http://www.microsoft.com/web/webpi/eula/mvc_4_eula_enu.htm', 'http://www.asp.net/mvc', NULL, 1, 'This package contains the runtime assemblies for ASP.NET MVC. ASP.NET MVC gives you a powerful, patterns-based way to build dynamic websites that enables a clean separation of concerns and that gives you full control over markup.', NULL, '2015-10-21T14:32:17.000000Z', 'a:2:{i:0;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:25:"Microsoft.AspNet.WebPages";s:7:"Version";s:11:"2.0.20710.0";}i:1;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:22:"Microsoft.AspNet.Razor";s:7:"Version";s:11:"2.0.20710.0";}}', 'tQrw7I+Ol1Kr3kDKcA0XNT68ctjciLIUZqGtMBk7fNjEGUUVDifwlOJJXUBQxUayv4aHwB+OOiPFF3ZD6VXmRw==', 'SHA512', 267029, 'Microsoft', 'Microsoft AspNet Mvc AspNetMvc', NULL, NULL, 1, NULL, 'a:0:{}', NULL, NULL, 0, 'Microsoft', '{372F9D09-5B4B-4D68-A5FB-AB797193FC25}'), -('1.0.0.0', 'DigitalMedia.GUIShell.WebMatrix.SDK', 'DigitalMedia.GUIShell.WebMatrix.SDK', 's:28:"Deltatre WebPLU-DigitalMedia";', 'http://localhost:8020/pnm/content/packagedefaulticon-50x50.png', NULL, NULL, NULL, 1, 'DigitalMedia.GUIShell.SDK for .NET Framework 4.5', NULL, '2015-10-21T15:27:51.000000Z', 'a:10:{i:0;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:25:"DigitalMedia.GUIShell.SDK";s:7:"Version";s:7:"0.0.0.0";}i:1;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:16:"Kendar.Linq2Rest";s:7:"Version";s:7:"4.1.0.2";}i:2;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:20:"Microsoft.AspNet.Mvc";s:7:"Version";s:11:"4.0.40804.0";}i:3;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:22:"Microsoft.AspNet.Razor";s:7:"Version";s:5:"3.2.3";}i:4;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:25:"Microsoft.AspNet.WebPages";s:7:"Version";s:5:"3.2.3";}i:5;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:30:"Microsoft.AspNet.WebPages.Data";s:7:"Version";s:5:"3.2.3";}i:6;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:33:"Microsoft.AspNet.WebPages.WebData";s:7:"Version";s:5:"3.2.3";}i:7;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:28:"Microsoft.Web.Infrastructure";s:7:"Version";s:7:"1.0.0.0";}i:8;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:15:"Newtonsoft.Json";s:7:"Version";s:5:"6.0.8";}i:9;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:35:"Deltatre.WebPLU.Infrastructure.Core";s:7:"Version";s:6:"1.3.10";}}', 'GtNLapmVL3HomVDpnFjRGi4IvOay8lDnkwfzLdaqILitCWscUc7wEJx7SP/v2QbKlArnbPRrRBNtsjnA/ScOow==', 'SHA512', 25717, 'Deltatre WebPLU-DigitalMedia', NULL, NULL, NULL, 1, NULL, 'a:0:{}', NULL, NULL, 0, 'Deltatre WebPLU-DigitalMedia', '{372F9D09-5B4B-4D68-A5FB-AB797193FC25}'), -('1.0.0.1', 'DigitalMedia.GUIShell.WebMatrix.SDK', 'DigitalMedia.GUIShell.WebMatrix.SDK', 's:28:"Deltatre WebPLU-DigitalMedia";', 'http://localhost:8020/pnm/content/packagedefaulticon-50x50.png', NULL, NULL, NULL, 1, 'DigitalMedia.GUIShell.SDK for .NET Framework 4.5', NULL, '2015-10-21T15:27:57.000000Z', 'a:10:{i:0;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:25:"DigitalMedia.GUIShell.SDK";s:7:"Version";s:7:"0.0.0.0";}i:1;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:16:"Kendar.Linq2Rest";s:7:"Version";s:7:"4.1.0.2";}i:2;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:20:"Microsoft.AspNet.Mvc";s:7:"Version";s:11:"4.0.40804.0";}i:3;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:22:"Microsoft.AspNet.Razor";s:7:"Version";s:5:"3.2.3";}i:4;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:25:"Microsoft.AspNet.WebPages";s:7:"Version";s:5:"3.2.3";}i:5;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:30:"Microsoft.AspNet.WebPages.Data";s:7:"Version";s:5:"3.2.3";}i:6;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:33:"Microsoft.AspNet.WebPages.WebData";s:7:"Version";s:5:"3.2.3";}i:7;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:28:"Microsoft.Web.Infrastructure";s:7:"Version";s:7:"1.0.0.0";}i:8;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:15:"Newtonsoft.Json";s:7:"Version";s:5:"6.0.8";}i:9;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:35:"Deltatre.WebPLU.Infrastructure.Core";s:7:"Version";s:6:"1.3.10";}}', 'zOVyu0WszXRzUQYUNDaGYe7meu1RRfDGrH3HRFIsKGXt08MSYeiN4PMKnGN4OfJh1qleBEGyByiAMh7miaulbw==', 'SHA512', 25761, 'Deltatre WebPLU-DigitalMedia', NULL, NULL, NULL, 1, NULL, 'a:0:{}', NULL, NULL, 0, 'Deltatre WebPLU-DigitalMedia', '{372F9D09-5B4B-4D68-A5FB-AB797193FC25}'), -('1.0.0.1-alphaC510121', 'DigitalMedia.GUIShell.WebMatrix.SDK', 'DigitalMedia.GUIShell.WebMatrix.SDK', 's:28:"Deltatre WebPLU-DigitalMedia";', 'http://localhost:8020/pnm/content/packagedefaulticon-50x50.png', NULL, NULL, NULL, 1, 'DigitalMedia.GUIShell.SDK for .NET Framework 4.5', NULL, '2015-10-21T15:28:03.000000Z', 'a:10:{i:0;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:25:"DigitalMedia.GUIShell.SDK";s:7:"Version";s:7:"0.0.0.0";}i:1;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:16:"Kendar.Linq2Rest";s:7:"Version";s:7:"4.1.0.2";}i:2;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:20:"Microsoft.AspNet.Mvc";s:7:"Version";s:11:"4.0.40804.0";}i:3;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:22:"Microsoft.AspNet.Razor";s:7:"Version";s:5:"3.2.3";}i:4;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:25:"Microsoft.AspNet.WebPages";s:7:"Version";s:5:"3.2.3";}i:5;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:30:"Microsoft.AspNet.WebPages.Data";s:7:"Version";s:5:"3.2.3";}i:6;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:33:"Microsoft.AspNet.WebPages.WebData";s:7:"Version";s:5:"3.2.3";}i:7;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:28:"Microsoft.Web.Infrastructure";s:7:"Version";s:7:"1.0.0.0";}i:8;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:15:"Newtonsoft.Json";s:7:"Version";s:5:"6.0.8";}i:9;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:35:"Deltatre.WebPLU.Infrastructure.Core";s:7:"Version";s:6:"1.3.10";}}', '8CiQrS/KOj9wJwv7bZwNuoEIFeIfWPBycygnD0GH7woOKr3csO2hRqGO9jlhMJhjuTIZtvEwSZn87zDWvQvpiA==', 'SHA512', 25738, 'Deltatre WebPLU-DigitalMedia', NULL, NULL, NULL, 1, NULL, 'a:0:{}', NULL, NULL, 1, 'Deltatre WebPLU-DigitalMedia', '{372F9D09-5B4B-4D68-A5FB-AB797193FC25}'), -('1.0.0.1-alphaC510157', 'DigitalMedia.GUIShell.WebMatrix.SDK', 'DigitalMedia.GUIShell.WebMatrix.SDK', 's:28:"Deltatre WebPLU-DigitalMedia";', 'http://localhost:8020/pnm/content/packagedefaulticon-50x50.png', NULL, NULL, NULL, 1, 'DigitalMedia.GUIShell.SDK for .NET Framework 4.5', NULL, '2015-10-21T15:28:10.000000Z', 'a:10:{i:0;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:25:"DigitalMedia.GUIShell.SDK";s:7:"Version";s:7:"0.0.0.0";}i:1;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:16:"Kendar.Linq2Rest";s:7:"Version";s:7:"4.1.0.2";}i:2;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:20:"Microsoft.AspNet.Mvc";s:7:"Version";s:11:"4.0.40804.0";}i:3;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:22:"Microsoft.AspNet.Razor";s:7:"Version";s:5:"3.2.3";}i:4;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:25:"Microsoft.AspNet.WebPages";s:7:"Version";s:5:"3.2.3";}i:5;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:30:"Microsoft.AspNet.WebPages.Data";s:7:"Version";s:5:"3.2.3";}i:6;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:33:"Microsoft.AspNet.WebPages.WebData";s:7:"Version";s:5:"3.2.3";}i:7;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:28:"Microsoft.Web.Infrastructure";s:7:"Version";s:7:"1.0.0.0";}i:8;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:15:"Newtonsoft.Json";s:7:"Version";s:5:"6.0.8";}i:9;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:35:"Deltatre.WebPLU.Infrastructure.Core";s:7:"Version";s:6:"1.3.10";}}', '+IlWp7E+k3ocipZzLJVY9O3ubrt+0BSVcgaV67cFRPIYTkdL85VCiR5s/kwzXSIO9ySS2LGVrIlHWLLk5xgSCg==', 'SHA512', 25787, 'Deltatre WebPLU-DigitalMedia', NULL, NULL, NULL, 1, NULL, 'a:0:{}', NULL, NULL, 1, 'Deltatre WebPLU-DigitalMedia', '{372F9D09-5B4B-4D68-A5FB-AB797193FC25}'), -('1.0.0.3', 'DigitalMedia.GUIShell.WebMatrix.SDK', 'DigitalMedia.GUIShell.WebMatrix.SDK', 's:28:"Deltatre WebPLU-DigitalMedia";', 'http://localhost:8020/pnm/content/packagedefaulticon-50x50.png', NULL, NULL, NULL, 1, 'DigitalMedia.GUIShell.SDK for .NET Framework 4.5', NULL, '2015-10-21T15:28:20.000000Z', 'a:10:{i:0;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:25:"DigitalMedia.GUIShell.SDK";s:7:"Version";s:7:"0.0.0.0";}i:1;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:16:"Kendar.Linq2Rest";s:7:"Version";s:7:"4.1.0.2";}i:2;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:20:"Microsoft.AspNet.Mvc";s:7:"Version";s:11:"4.0.40804.0";}i:3;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:22:"Microsoft.AspNet.Razor";s:7:"Version";s:5:"3.2.3";}i:4;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:25:"Microsoft.AspNet.WebPages";s:7:"Version";s:5:"3.2.3";}i:5;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:30:"Microsoft.AspNet.WebPages.Data";s:7:"Version";s:5:"3.2.3";}i:6;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:33:"Microsoft.AspNet.WebPages.WebData";s:7:"Version";s:5:"3.2.3";}i:7;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:28:"Microsoft.Web.Infrastructure";s:7:"Version";s:7:"1.0.0.0";}i:8;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:15:"Newtonsoft.Json";s:7:"Version";s:5:"6.0.8";}i:9;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:35:"Deltatre.WebPLU.Infrastructure.Core";s:7:"Version";s:6:"1.3.10";}}', '5Qpi2MiJvFP1r8XcwFHBhqV7vyecba3WTw3AZ2+n2S2cLA4HbSbo/NnwtvaWWh9PbPwu+LCD9ng72QMAwFHFlw==', 'SHA512', 25765, 'Deltatre WebPLU-DigitalMedia', NULL, NULL, NULL, 1, NULL, 'a:0:{}', NULL, NULL, 0, 'Deltatre WebPLU-DigitalMedia', '{372F9D09-5B4B-4D68-A5FB-AB797193FC25}'), -('1.0.0.3-alphaC511673', 'DigitalMedia.GUIShell.WebMatrix.SDK', 'DigitalMedia.GUIShell.WebMatrix.SDK', 's:28:"Deltatre WebPLU-DigitalMedia";', 'http://localhost:8020/pnm/content/packagedefaulticon-50x50.png', NULL, NULL, NULL, 1, 'DigitalMedia.GUIShell.SDK for .NET Framework 4.5', NULL, '2015-10-21T15:28:27.000000Z', 'a:10:{i:0;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:25:"DigitalMedia.GUIShell.SDK";s:7:"Version";s:7:"0.0.0.0";}i:1;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:16:"Kendar.Linq2Rest";s:7:"Version";s:7:"4.1.0.2";}i:2;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:20:"Microsoft.AspNet.Mvc";s:7:"Version";s:11:"4.0.40804.0";}i:3;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:22:"Microsoft.AspNet.Razor";s:7:"Version";s:5:"3.2.3";}i:4;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:25:"Microsoft.AspNet.WebPages";s:7:"Version";s:5:"3.2.3";}i:5;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:30:"Microsoft.AspNet.WebPages.Data";s:7:"Version";s:5:"3.2.3";}i:6;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:33:"Microsoft.AspNet.WebPages.WebData";s:7:"Version";s:5:"3.2.3";}i:7;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:28:"Microsoft.Web.Infrastructure";s:7:"Version";s:7:"1.0.0.0";}i:8;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:15:"Newtonsoft.Json";s:7:"Version";s:5:"6.0.8";}i:9;O:15:"NugetDependency":3:{s:7:"IsGroup";b:0;s:2:"Id";s:35:"Deltatre.WebPLU.Infrastructure.Core";s:7:"Version";s:6:"1.3.10";}}', 'HVOeOF3uCSh0wjFpTyvyKgye6aV2gu5FN6tnTcPtRh4+DHv6m8cSMBEo3gi3CkEJtR6m2h6gMimBKxj4kJ4bFQ==', 'SHA512', 25954, 'Deltatre WebPLU-DigitalMedia', NULL, NULL, NULL, 1, NULL, 'a:0:{}', NULL, NULL, 1, 'Deltatre WebPLU-DigitalMedia', '{372F9D09-5B4B-4D68-A5FB-AB797193FC25}'); - --- -------------------------------------------------------- - --- --- Table structure for table `nugetdb_usrs` --- - -CREATE TABLE IF NOT EXISTS `nugetdb_usrs` ( - `userid` char(128) NOT NULL DEFAULT '', - `name` text, - `company` text, - `md5password` text, - `packages` text, - `enabled` tinyint(1) DEFAULT NULL, - `email` text, - `token` text, - `admin` tinyint(1) DEFAULT NULL, - `id` text, - PRIMARY KEY (`userid`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - --- --- Dumping data for table `nugetdb_usrs` --- - -INSERT INTO `nugetdb_usrs` (`userid`, `name`, `company`, `md5password`, `packages`, `enabled`, `email`, `token`, `admin`, `id`) VALUES -('admin', 'Administrator', '', '5f4dcc3b5aa765d61d8327deb882cf99', NULL, 1, 'nuget@localhost', '{2A2A0944-3AB6-4629-61EE-BB7E0F62FF04}', 1, '{372F9D09-5B4B-4D68-A5FB-AB797193FC25}'); - -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; diff --git a/nuget_exes/Moq.4.5.28.nupkg b/nuget_exes/Moq.4.5.28.nupkg new file mode 100644 index 0000000..26c5248 Binary files /dev/null and b/nuget_exes/Moq.4.5.28.nupkg differ diff --git a/nuget_exes/NLog.4.3.0.nupkg b/nuget_exes/NLog.4.3.0.nupkg new file mode 100644 index 0000000..be0427d Binary files /dev/null and b/nuget_exes/NLog.4.3.0.nupkg differ diff --git a/nuget_exes/Newtonsoft.Json.4.5.11.nupkg b/nuget_exes/Newtonsoft.Json.4.5.11.nupkg new file mode 100644 index 0000000..0b6dc21 Binary files /dev/null and b/nuget_exes/Newtonsoft.Json.4.5.11.nupkg differ diff --git a/NugetTesterApplication/nuget.exe b/nuget_exes/NuGet.2.8.exe similarity index 100% rename from NugetTesterApplication/nuget.exe rename to nuget_exes/NuGet.2.8.exe diff --git a/nuget_exes/NuGet.3.4.exe b/nuget_exes/NuGet.3.4.exe new file mode 100644 index 0000000..6bb79fe Binary files /dev/null and b/nuget_exes/NuGet.3.4.exe differ diff --git a/nuget_exes/NuGet.3.5.exe b/nuget_exes/NuGet.3.5.exe new file mode 100644 index 0000000..305300a Binary files /dev/null and b/nuget_exes/NuGet.3.5.exe differ diff --git a/src/.htaccess b/src/.htaccess index 34277c7..062f00c 100644 --- a/src/.htaccess +++ b/src/.htaccess @@ -9,80 +9,80 @@ RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v1/\$metadata [NC] -RewriteRule .* /pnm/api/v1/index.php?action=metadata [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v1/\$metadata [NC] +RewriteRule .* /edsa-nuget/api/v1/index.php?action=metadata [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v1/Search\(\)/\$count [NC] -RewriteRule .* /pnm/api/v1/index.php?action=search&count=true [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v1/Search\(\)/\$count [NC] +RewriteRule .* /edsa-nuget/api/v1/index.php?action=search&count=true [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v1/Search\(\) [NC] -RewriteRule .* /pnm/api/v1/index.php?action=search [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v1/Search\(\) [NC] +RewriteRule .* /edsa-nuget/api/v1/index.php?action=search [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v1/Packages\(Id='([^/]+)',Version='([^/]+)'\) [NC] -RewriteRule (.*)api/v1/Packages\(Id='([^/]+)',Version='([^/]+)'\)$ /pnm/api/v1/index.php?action=single&id=$2&version=$3&%1 [NC,L] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v1/Packages\(Id='([^/]+)',Version='([^/]+)'\) [NC] +RewriteRule (.*)api/v1/Packages\(Id='([^/]+)',Version='([^/]+)'\)$ /edsa-nuget/api/v1/index.php?action=single&id=$2&version=$3&%1 [NC,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v1/Packages\(\)/\$count [NC] -RewriteRule .* /pnm/api/v1/index.php?action=packages&count=true [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v1/Packages\(\)/\$count [NC] +RewriteRule .* /edsa-nuget/api/v1/index.php?action=packages&count=true [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v1/Packages/\$count [NC] -RewriteRule .* /pnm/api/v1/index.php?action=packages&count=true [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v1/Packages/\$count [NC] +RewriteRule .* /edsa-nuget/api/v1/index.php?action=packages&count=true [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v1/Packages [NC] -RewriteRule .* /pnm/api/v1/index.php?action=packages [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v1/Packages [NC] +RewriteRule .* /edsa-nuget/api/v1/index.php?action=packages [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v1/FindPackagesById\(\)/\$count [NC] -RewriteRule .* /pnm/api/v1/index.php?action=findpackagesbyd&count=true [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v1/FindPackagesById\(\)/\$count [NC] +RewriteRule .* /edsa-nuget/api/v1/index.php?action=findpackagesbyd&count=true [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v1/FindPackagesById\(\) [NC] -RewriteRule .* /pnm/api/v1/index.php?action=findpackagesbyd [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v1/FindPackagesById\(\) [NC] +RewriteRule .* /edsa-nuget/api/v1/index.php?action=findpackagesbyd [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v1/FindPackagesById [NC] -RewriteRule .* /pnm/api/v1/index.php?action=findpackagesbyd [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v1/FindPackagesById [NC] +RewriteRule .* /edsa-nuget/api/v1/index.php?action=findpackagesbyd [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v1/FindPackagesById/\$count [NC] -RewriteRule .* /pnm/api/v1/index.php?action=findpackagesbyd&count=true [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v1/FindPackagesById/\$count [NC] +RewriteRule .* /edsa-nuget/api/v1/index.php?action=findpackagesbyd&count=true [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v1/package/([^/]+)/([^/]+) [NC] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v1/package/([^/]+)/([^/]+) [NC] RewriteCond %{QUERY_STRING} ^(.*)$ -RewriteRule (.*)api/v1/package/([^/]+)/([^/]+)$ /pnm/api/?id=$2&version=$3&%1 [NC,L] +RewriteRule (.*)api/v1/package/([^/]+)/([^/]+)$ /edsa-nuget/api/?id=$2&version=$3&%1 [NC,L] #API V2 @@ -91,123 +91,123 @@ RewriteRule (.*)api/v1/package/([^/]+)/([^/]+)$ /pnm/api/?id=$2&version=$3&%1 [ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v2/\$metadata [NC] -RewriteRule .* /pnm/api/v2/index.php?action=metadata [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v2/\$metadata [NC] +RewriteRule .* /edsa-nuget/api/v2/index.php?action=metadata [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v2/Search\(\)/\$count [NC] -RewriteRule .* /pnm/api/v2/index.php?action=search&count=true [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v2/Search\(\)/\$count [NC] +RewriteRule .* /edsa-nuget/api/v2/index.php?action=search&count=true [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v2/Packages\(Id='([^/]+)',Version='([^/]+)'\) [NC] -RewriteRule (.*)api/v2/Packages\(Id='([^/]+)',Version='([^/]+)'\)$ /pnm/api/v2/index.php?action=single&id=$2&version=$3&%1 [NC,L] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v2/Packages\(Id='([^/]+)',Version='([^/]+)'\) [NC] +RewriteRule (.*)api/v2/Packages\(Id='([^/]+)',Version='([^/]+)'\)$ /edsa-nuget/api/v2/index.php?action=single&id=$2&version=$3&%1 [NC,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v2/Search\(\) [NC] -RewriteRule .* /pnm/api/v2/index.php?action=search [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v2/Search\(\) [NC] +RewriteRule .* /edsa-nuget/api/v2/index.php?action=search [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v2/Packages\(\)/\$count [NC] -RewriteRule .* /pnm/api/v2/index.php?action=packages&count=true [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v2/Packages\(\)/\$count [NC] +RewriteRule .* /edsa-nuget/api/v2/index.php?action=packages&count=true [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v2/Packages/\$count [NC] -RewriteRule .* /pnm/api/v2/index.php?action=packages&count=true [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v2/Packages/\$count [NC] +RewriteRule .* /edsa-nuget/api/v2/index.php?action=packages&count=true [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v2/Packages [NC] -RewriteRule .* /pnm/api/v2/index.php?action=packages [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v2/Packages [NC] +RewriteRule .* /edsa-nuget/api/v2/index.php?action=packages [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v2/Packages\(\) [NC] -RewriteRule .* /pnm/api/v2/index.php?action=packages [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v2/Packages\(\) [NC] +RewriteRule .* /edsa-nuget/api/v2/index.php?action=packages [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v2/GetUpdates\(\)/\$count [NC] -RewriteRule .* /pnm/api/v2/index.php?action=getupdates&count=true [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v2/GetUpdates\(\)/\$count [NC] +RewriteRule .* /edsa-nuget/api/v2/index.php?action=getupdates&count=true [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v2/GetUpdates\(\) [NC] -RewriteRule .* /pnm/api/v2/index.php?action=getupdates [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v2/GetUpdates\(\) [NC] +RewriteRule .* /edsa-nuget/api/v2/index.php?action=getupdates [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v2/FindPackagesById\(\)/\$count [NC] -RewriteRule .* /pnm/api/v2/index.php?action=findpackagesbyd&count=true [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v2/FindPackagesById\(\)/\$count [NC] +RewriteRule .* /edsa-nuget/api/v2/index.php?action=findpackagesbyd&count=true [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v2/FindPackagesById/\$count [NC] -RewriteRule .* /pnm/api/v2/index.php?action=findpackagesbyd&count=true [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v2/FindPackagesById/\$count [NC] +RewriteRule .* /edsa-nuget/api/v2/index.php?action=findpackagesbyd&count=true [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v2/FindPackagesById\(\) [NC] -RewriteRule .* /pnm/api/v2/index.php?action=findpackagesbyd [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v2/FindPackagesById\(\) [NC] +RewriteRule .* /edsa-nuget/api/v2/index.php?action=findpackagesbyd [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v2/FindPackagesById [NC] -RewriteRule .* /pnm/api/v2/index.php?action=findpackagesbyd [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v2/FindPackagesById [NC] +RewriteRule .* /edsa-nuget/api/v2/index.php?action=findpackagesbyd [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v2/FindPackageById\(\) [NC] -RewriteRule .* /pnm/api/v2/index.php?action=findpackagesbyd [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v2/FindPackageById\(\) [NC] +RewriteRule .* /edsa-nuget/api/v2/index.php?action=findpackagesbyd [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v2/FindPackageById [NC] -RewriteRule .* /pnm/api/v2/index.php?action=findpackagesbyd [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v2/FindPackageById [NC] +RewriteRule .* /edsa-nuget/api/v2/index.php?action=findpackagesbyd [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v2/package/([^/]+)/([^/]+) [NC] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v2/package/([^/]+)/([^/]+) [NC] RewriteCond %{QUERY_STRING} ^(.*)$ -RewriteRule (.*)api/v2/package/([^/]+)/([^/]+)$ /pnm/api/?id=$2&version=$3&%1 [NC,L] +RewriteRule (.*)api/v2/package/([^/]+)/([^/]+)$ /edsa-nuget/api/?id=$2&version=$3&%1 [NC,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_METHOD} !GET RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v2/package [NC] -RewriteRule .* /pnm/upload/ [NC,L] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v2/package [NC] +RewriteRule .* /edsa-nuget/upload/ [NC,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v2/\$batch [NC] -RewriteRule .* /pnm/api/v2/batch.php [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v2/\$batch [NC] +RewriteRule .* /edsa-nuget/api/v2/batch.php [QSA] #API V3 @@ -215,54 +215,54 @@ RewriteRule .* /pnm/api/v2/batch.php [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v3/index.json [NC] -RewriteRule .* /pnm/api/v3/index.php?action=resources [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v3/index.json [NC] +RewriteRule .* /edsa-nuget/api/v3/index.php?action=resources [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v3/search/service/fields [NC] -RewriteRule .* /pnm/api/v3/index.php?action=searchFields [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v3/search/service/fields [NC] +RewriteRule .* /edsa-nuget/api/v3/index.php?action=searchFields [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v3/search/service/query [NC] -RewriteRule .* /pnm/api/v3/index.php?action=searchQuery [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v3/search/service/query [NC] +RewriteRule .* /edsa-nuget/api/v3/index.php?action=searchQuery [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v3/search/service/diag [NC] -RewriteRule .* /pnm/api/v3/index.php?action=searchDiag [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v3/search/service/diag [NC] +RewriteRule .* /edsa-nuget/api/v3/index.php?action=searchDiag [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v3/search/service [NC] -RewriteRule .* /pnm/api/v3/index.php?action=searchResources [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v3/search/service [NC] +RewriteRule .* /edsa-nuget/api/v3/index.php?action=searchResources [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v3/search [NC] -RewriteRule .* /pnm/api/v3/index.php?action=searchService [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v3/search [NC] +RewriteRule .* /edsa-nuget/api/v3/index.php?action=searchService [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v3/registration/([^/]+)/([^/]+).json [NC] -RewriteRule (.*)api/v3/package/([^/]+)/([^/]+)$ /pnm/api/v3/index.php?action=package&id=$2&version=$3 [NC,L] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v3/registration/([^/]+)/([^/]+).json [NC] +RewriteRule (.*)api/v3/package/([^/]+)/([^/]+)$ /edsa-nuget/api/v3/index.php?action=package&id=$2&version=$3 [NC,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v3/registration/([^/]+)/index.json [NC] -RewriteRule (.*)api/v3/package/([^/]+)/([^/]+)$ /pnm/api/v3/index.php?action=packages&id=$2 [NC,L] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v3/registration/([^/]+)/index.json [NC] +RewriteRule (.*)api/v3/package/([^/]+)/([^/]+)$ /edsa-nuget/api/v3/index.php?action=packages&id=$2 [NC,L] #Commons diff --git a/src/ManagedFusion.Rewriter.txt b/src/ManagedFusion.Rewriter.txt index 8eca106..c0cf4cf 100644 --- a/src/ManagedFusion.Rewriter.txt +++ b/src/ManagedFusion.Rewriter.txt @@ -9,80 +9,80 @@ RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v1/\$metadata [NC] -RewriteRule ^/(.*) /pnm/api/v1/index.php?action=metadata [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v1/\$metadata [NC] +RewriteRule ^/(.*) /edsa-nuget/api/v1/index.php?action=metadata [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v1/Search\(\)/\$count [NC] -RewriteRule ^/(.*) /pnm/api/v1/index.php?action=search&count=true [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v1/Search\(\)/\$count [NC] +RewriteRule ^/(.*) /edsa-nuget/api/v1/index.php?action=search&count=true [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v1/Search\(\) [NC] -RewriteRule ^/(.*) /pnm/api/v1/index.php?action=search [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v1/Search\(\) [NC] +RewriteRule ^/(.*) /edsa-nuget/api/v1/index.php?action=search [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v1/Packages\(Id='([^/]+)',Version='([^/]+)'\) [NC] -RewriteRule ^/(.*)api/v1/Packages\(Id='([^/]+)',Version='([^/]+)'\)$ /pnm/api/v1/index.php?action=single&id=$2&version=$3&%1 [NC,L] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v1/Packages\(Id='([^/]+)',Version='([^/]+)'\) [NC] +RewriteRule ^/(.*)api/v1/Packages\(Id='([^/]+)',Version='([^/]+)'\)$ /edsa-nuget/api/v1/index.php?action=single&id=$2&version=$3&%1 [NC,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v1/Packages\(\)/\$count [NC] -RewriteRule ^/(.*) /pnm/api/v1/index.php?action=packages&count=true [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v1/Packages\(\)/\$count [NC] +RewriteRule ^/(.*) /edsa-nuget/api/v1/index.php?action=packages&count=true [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v1/Packages/\$count [NC] -RewriteRule ^/(.*) /pnm/api/v1/index.php?action=packages&count=true [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v1/Packages/\$count [NC] +RewriteRule ^/(.*) /edsa-nuget/api/v1/index.php?action=packages&count=true [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v1/Packages [NC] -RewriteRule ^/(.*) /pnm/api/v1/index.php?action=packages [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v1/Packages [NC] +RewriteRule ^/(.*) /edsa-nuget/api/v1/index.php?action=packages [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v1/FindPackagesById\(\)/\$count [NC] -RewriteRule ^/(.*) /pnm/api/v1/index.php?action=findpackagesbyd&count=true [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v1/FindPackagesById\(\)/\$count [NC] +RewriteRule ^/(.*) /edsa-nuget/api/v1/index.php?action=findpackagesbyd&count=true [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v1/FindPackagesById\(\) [NC] -RewriteRule ^/(.*) /pnm/api/v1/index.php?action=findpackagesbyd [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v1/FindPackagesById\(\) [NC] +RewriteRule ^/(.*) /edsa-nuget/api/v1/index.php?action=findpackagesbyd [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v1/FindPackagesById [NC] -RewriteRule ^/(.*) /pnm/api/v1/index.php?action=findpackagesbyd [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v1/FindPackagesById [NC] +RewriteRule ^/(.*) /edsa-nuget/api/v1/index.php?action=findpackagesbyd [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v1/FindPackagesById/\$count [NC] -RewriteRule ^/(.*) /pnm/api/v1/index.php?action=findpackagesbyd&count=true [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v1/FindPackagesById/\$count [NC] +RewriteRule ^/(.*) /edsa-nuget/api/v1/index.php?action=findpackagesbyd&count=true [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v1/package/([^/]+)/([^/]+) [NC] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v1/package/([^/]+)/([^/]+) [NC] RewriteCond %{QUERY_STRING} ^(.*)$ -RewriteRule ^/(.*)api/v1/package/([^/]+)/([^/]+)$ /pnm/api/?id=$2&version=$3&%1 [NC,L] +RewriteRule ^/(.*)api/v1/package/([^/]+)/([^/]+)$ /edsa-nuget/api/?id=$2&version=$3&%1 [NC,L] #API V2 @@ -91,123 +91,123 @@ RewriteRule ^/(.*)api/v1/package/([^/]+)/([^/]+)$ /pnm/api/?id=$2&version=$3&%1 RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v2/\$metadata [NC] -RewriteRule ^/(.*) /pnm/api/v2/index.php?action=metadata [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v2/\$metadata [NC] +RewriteRule ^/(.*) /edsa-nuget/api/v2/index.php?action=metadata [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v2/Search\(\)/\$count [NC] -RewriteRule ^/(.*) /pnm/api/v2/index.php?action=search&count=true [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v2/Search\(\)/\$count [NC] +RewriteRule ^/(.*) /edsa-nuget/api/v2/index.php?action=search&count=true [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v2/Packages\(Id='([^/]+)',Version='([^/]+)'\) [NC] -RewriteRule ^/(.*)api/v2/Packages\(Id='([^/]+)',Version='([^/]+)'\)$ /pnm/api/v2/index.php?action=single&id=$2&version=$3&%1 [NC,L] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v2/Packages\(Id='([^/]+)',Version='([^/]+)'\) [NC] +RewriteRule ^/(.*)api/v2/Packages\(Id='([^/]+)',Version='([^/]+)'\)$ /edsa-nuget/api/v2/index.php?action=single&id=$2&version=$3&%1 [NC,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v2/Search\(\) [NC] -RewriteRule ^/(.*) /pnm/api/v2/index.php?action=search [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v2/Search\(\) [NC] +RewriteRule ^/(.*) /edsa-nuget/api/v2/index.php?action=search [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v2/Packages\(\)/\$count [NC] -RewriteRule ^/(.*) /pnm/api/v2/index.php?action=packages&count=true [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v2/Packages\(\)/\$count [NC] +RewriteRule ^/(.*) /edsa-nuget/api/v2/index.php?action=packages&count=true [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v2/Packages/\$count [NC] -RewriteRule ^/(.*) /pnm/api/v2/index.php?action=packages&count=true [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v2/Packages/\$count [NC] +RewriteRule ^/(.*) /edsa-nuget/api/v2/index.php?action=packages&count=true [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v2/Packages [NC] -RewriteRule ^/(.*) /pnm/api/v2/index.php?action=packages [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v2/Packages [NC] +RewriteRule ^/(.*) /edsa-nuget/api/v2/index.php?action=packages [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v2/Packages\(\) [NC] -RewriteRule ^/(.*) /pnm/api/v2/index.php?action=packages [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v2/Packages\(\) [NC] +RewriteRule ^/(.*) /edsa-nuget/api/v2/index.php?action=packages [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v2/GetUpdates\(\)/\$count [NC] -RewriteRule ^/(.*) /pnm/api/v2/index.php?action=getupdates&count=true [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v2/GetUpdates\(\)/\$count [NC] +RewriteRule ^/(.*) /edsa-nuget/api/v2/index.php?action=getupdates&count=true [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v2/GetUpdates\(\) [NC] -RewriteRule ^/(.*) /pnm/api/v2/index.php?action=getupdates [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v2/GetUpdates\(\) [NC] +RewriteRule ^/(.*) /edsa-nuget/api/v2/index.php?action=getupdates [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v2/FindPackagesById\(\)/\$count [NC] -RewriteRule ^/(.*) /pnm/api/v2/index.php?action=findpackagesbyd&count=true [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v2/FindPackagesById\(\)/\$count [NC] +RewriteRule ^/(.*) /edsa-nuget/api/v2/index.php?action=findpackagesbyd&count=true [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v2/FindPackagesById/\$count [NC] -RewriteRule ^/(.*) /pnm/api/v2/index.php?action=findpackagesbyd&count=true [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v2/FindPackagesById/\$count [NC] +RewriteRule ^/(.*) /edsa-nuget/api/v2/index.php?action=findpackagesbyd&count=true [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v2/FindPackagesById\(\) [NC] -RewriteRule ^/(.*) /pnm/api/v2/index.php?action=findpackagesbyd [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v2/FindPackagesById\(\) [NC] +RewriteRule ^/(.*) /edsa-nuget/api/v2/index.php?action=findpackagesbyd [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v2/FindPackagesById [NC] -RewriteRule ^/(.*) /pnm/api/v2/index.php?action=findpackagesbyd [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v2/FindPackagesById [NC] +RewriteRule ^/(.*) /edsa-nuget/api/v2/index.php?action=findpackagesbyd [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v2/FindPackageById\(\) [NC] -RewriteRule ^/(.*) /pnm/api/v2/index.php?action=findpackagesbyd [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v2/FindPackageById\(\) [NC] +RewriteRule ^/(.*) /edsa-nuget/api/v2/index.php?action=findpackagesbyd [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v2/FindPackageById [NC] -RewriteRule ^/(.*) /pnm/api/v2/index.php?action=findpackagesbyd [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v2/FindPackageById [NC] +RewriteRule ^/(.*) /edsa-nuget/api/v2/index.php?action=findpackagesbyd [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v2/package/([^/]+)/([^/]+) [NC] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v2/package/([^/]+)/([^/]+) [NC] RewriteCond %{QUERY_STRING} ^(.*)$ -RewriteRule ^/(.*)api/v2/package/([^/]+)/([^/]+)$ /pnm/api/?id=$2&version=$3&%1 [NC,L] +RewriteRule ^/(.*)api/v2/package/([^/]+)/([^/]+)$ /edsa-nuget/api/?id=$2&version=$3&%1 [NC,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_METHOD} !GET RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v2/package [NC] -RewriteRule .* /pnm/upload/ [NC,L] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v2/package [NC] +RewriteRule .* /edsa-nuget/upload/ [NC,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v2/\$batch [NC] -RewriteRule ^/(.*) /pnm/api/v2/batch.php [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v2/\$batch [NC] +RewriteRule ^/(.*) /edsa-nuget/api/v2/batch.php [QSA] #API V3 @@ -215,54 +215,54 @@ RewriteRule ^/(.*) /pnm/api/v2/batch.php [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v3/index.json [NC] -RewriteRule ^/(.*) /pnm/api/v3/index.php?action=resources [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v3/index.json [NC] +RewriteRule ^/(.*) /edsa-nuget/api/v3/index.php?action=resources [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v3/search/service/fields [NC] -RewriteRule ^/(.*) /pnm/api/v3/index.php?action=searchFields [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v3/search/service/fields [NC] +RewriteRule ^/(.*) /edsa-nuget/api/v3/index.php?action=searchFields [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v3/search/service/query [NC] -RewriteRule ^/(.*) /pnm/api/v3/index.php?action=searchQuery [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v3/search/service/query [NC] +RewriteRule ^/(.*) /edsa-nuget/api/v3/index.php?action=searchQuery [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v3/search/service/diag [NC] -RewriteRule ^/(.*) /pnm/api/v3/index.php?action=searchDiag [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v3/search/service/diag [NC] +RewriteRule ^/(.*) /edsa-nuget/api/v3/index.php?action=searchDiag [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v3/search/service [NC] -RewriteRule ^/(.*) /pnm/api/v3/index.php?action=searchResources [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v3/search/service [NC] +RewriteRule ^/(.*) /edsa-nuget/api/v3/index.php?action=searchResources [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v3/search [NC] -RewriteRule ^/(.*) /pnm/api/v3/index.php?action=searchService [QSA] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v3/search [NC] +RewriteRule ^/(.*) /edsa-nuget/api/v3/index.php?action=searchService [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v3/registration/([^/]+)/([^/]+).json [NC] -RewriteRule ^/(.*)api/v3/package/([^/]+)/([^/]+)$ /pnm/api/v3/index.php?action=package&id=$2&version=$3 [NC,L] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v3/registration/([^/]+)/([^/]+).json [NC] +RewriteRule ^/(.*)api/v3/package/([^/]+)/([^/]+)$ /edsa-nuget/api/v3/index.php?action=package&id=$2&version=$3 [NC,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index\.php [NC] -RewriteCond %{REQUEST_URI} ^/pnm/api/v3/registration/([^/]+)/index.json [NC] -RewriteRule ^/(.*)api/v3/package/([^/]+)/([^/]+)$ /pnm/api/v3/index.php?action=packages&id=$2 [NC,L] +RewriteCond %{REQUEST_URI} ^/edsa-nuget/api/v3/registration/([^/]+)/index.json [NC] +RewriteRule ^/(.*)api/v3/package/([^/]+)/([^/]+)$ /edsa-nuget/api/v3/index.php?action=packages&id=$2 [NC,L] #Commons diff --git a/src/api/v2/entrytemplatepre.xml b/src/api/v2/entrytemplatepre.xml index 30ca9e6..6b2dff4 100644 --- a/src/api/v2/entrytemplatepre.xml +++ b/src/api/v2/entrytemplatepre.xml @@ -1,9 +1,11 @@ - @BASEURL@/api/v2/Packages + xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" + xmlns:georss="http://www.georss.org/georss" + xmlns:gml="http://www.opengis.net/gml"> + http://schemas.datacontract.org/2004/07/ Packages @ITEMSCOUNT@ 2014-08-27T11:33:16Z - \ No newline at end of file + \ No newline at end of file diff --git a/src/assets/views/profile/module.js b/src/assets/views/profile/module.js index 11e0c26..f4aa566 100644 --- a/src/assets/views/profile/module.js +++ b/src/assets/views/profile/module.js @@ -1,20 +1,29 @@ app.factory('profilePackagesService',['$http','pathHelper','$q', function($http,pathHelper,$q) { - var doRunAllThings = function(total,skip,count){ + var doRunAllThings = function(spinner,total,skip,count){ + console.log("Running "+skip+" "+count); var apiBase = pathHelper.buildApiPath('packages'); - var prom =$http.post(apiBase+'/?method=refreshpackages&skip='+skip+'&count='+count) .success(function(data){ console.log("Correct "+skip+" "+count); if(skip=total){ + partial=total; + } + setSpinnerValue("Elaborated "+partial+" over "+total+" items"); + doRunAllThings(spinner,total,skip+count,count); + }else{ + setSpinnerValue("Elaborated "+total+" items"); + closeModalSpinner(); } }).error(function(data){ console.log("Wrong "+skip+" "+count); + closeModalSpinner(); }); }; return { @@ -47,13 +56,16 @@ app.factory('profilePackagesService',['$http','pathHelper','$q', var total = 0; var count = 30; var apiBase = this.apiBase; + var spinner = openModalSpinner(); this.http.post(apiBase+'/?method=countpackagestorefresh') .success(function(data){ total = data.Data; + setSpinnerValue("Founded "+total+" items"); console.log("Founded items: "+total); - doRunAllThings(total,skip,count); + doRunAllThings(spinner,total,skip,count); }).error(function(data){ console.log("Wrong count"); + closeModalSpinner(); }); } } @@ -111,14 +123,20 @@ app.controller('profilePackageController', ['$scope', '$controller', 'profilePac }); $scope.update = function(apackage){ + var spinner = openModalSpinner(); + setSpinnerValue("Updating package "+apackage.Id+" "+apackage.Version); + profilePackagesService.update(apackage,apackage.Id,apackage.Version).success(function(data) { - if(data.Success) alert("Package updated!"); - else{ + if(data.Success) { + alert("Package updated!"); + }else{ + closeModalSpinner(); alert(data.Message); return; } $scope.package = data.Data; window.document.title = "Package '"+data.Data.Title+"'"; + closeModalSpinner(); }); } @@ -151,12 +169,15 @@ app.controller('packagesUploadController', ['$scope', '$controller', 'profilePac } $scope.download = function(url,packageId,packageVersion){ + var spinner = openModalSpinner(); + setSpinnerValue("Downloading package "+$scope.downloadItem.Id+" "+$scope.downloadItem.Version); profilePackagesService.download($scope.downloadItem.Url,$scope.downloadItem.Id,$scope.downloadItem.Version).success(function(data) { - if(data.Success) alert("Package downloaded!"); - else{ + if(data.Success){ + alert("Package downloaded!"); + }else{ alert(data.Message); - return; } + closeModalSpinner(); }); } diff --git a/src/assets/views/profile/module.ori.js b/src/assets/views/profile/module.ori.js deleted file mode 100644 index 987ba4f..0000000 --- a/src/assets/views/profile/module.ori.js +++ /dev/null @@ -1,166 +0,0 @@ - -app.factory('profilePackagesService',['$http','pathHelper','$q', - function($http,pathHelper,$q) { - return { - apiBase : pathHelper.buildApiPath('packages'), - http :$http, - - getAll : function(top,skip) { - return this.http.get(this.apiBase+'/?Query= &top='+top+"&skip="+skip+"&DoGroup=true"); - }, - getById : function(title,version) { - var query = encodeURIComponent("Version eq '"+version+"' and Id eq '"+title+"'"); - return this.http.get(this.apiBase+'/?Query='+query+"&DoGroup=false"); - }, - update : function(apackage,packageId,version) { - return this.http.post(this.apiBase+'/?method=put&Id='+packageId+'&Version='+version,apackage); - }, - download : function(url,id,version) { - return this.http.post(this.apiBase+'/?method=download&Id='+id+'&Version='+version+'&Url='+encodeURIComponent(url)); - }, - getAllVersions : function(title) { - var query = encodeURIComponent("Id eq '"+title+"'"); - return this.http.get(this.apiBase+'/?Query='+query); - }, - refreshPackages : function() { - var skip = 0; - var total = 0; - var count = 30; - var apiBase = this.apiBase; - this.http.post(apiBase+'/?method=countpackagestorefresh') - .success(function(data){ - total = data.Data; - - var defer = $q.defer(); - var promises = []; - var successed = 0; - while(skip=total){ - alert("Refresh completed!"); - }else{ - alert("Error refreshing!"); - } - }); - - }); - } - } - } -]); - -app.controller('profilePackagesController', ['$scope', '$controller', 'profilePackagesService', - function($scope, controller, profilePackagesService){ - $scope.hasNext = false; - $scope.hasPrevious= false; - $scope.next = 10 - $scope.previous= 0; - - profilePackagesService.getAll(11,$scope.Skip).success(function(data) { - if(!data.Success) { - alert(data.Message); - return; - } - var skip = parseInt($scope.Skip); - $scope.packages = data.Data; - - $scope.hasNext = true; - $scope.hasPrevious = true; - $scope.next = skip+10; - $scope.previous = skip-10; - if($scope.Skip>0){ - $scope.previous = skip-10; - } - - if($scope.previous<0){ - $scope.previous = 0; - $scope.hasPrevious = false; - } - if($scope.packages.length<=10){ - $scope.hasNext = false; - $scope.next = -1; - } - - window.document.title = "Packages List"; - }); - - } -]); - -app.controller('profilePackageController', ['$scope', '$controller', 'profilePackagesService', - function($scope, controller, profilePackagesService){ - - profilePackagesService.getById($scope.PackageId,$scope.PackageVersion).success(function(data) { - $scope.package = data.Data[0]; - //console.log($scope.package); - window.document.title = "Packages List"; - profilePackagesService.getAllVersions($scope.PackageId).success(function(data) { - $scope.versions = data.Data; - }); - }); - - - $scope.update = function(apackage){ - profilePackagesService.update(apackage,apackage.Id,apackage.Version).success(function(data) { - if(data.Success) alert("Package updated!"); - else{ - alert(data.Message); - return; - } - $scope.package = data.Data; - window.document.title = "Package '"+data.Data.Title+"'"; - }); - } - } -]); - -app.controller('packagesUploadController', ['$scope', '$controller', 'profilePackagesService','$window', - function($scope, controller, profilePackagesService,$window){ - $scope.downloadItem = { - - }; - $scope.downloadItem.Url ="https://www.nuget.org/api/v2/package/@ID/@VERSION"; - - window.packagesUploadControllerCallback = function(result,packageId,packageVersion,message){ - if(result){ - $window.location.hash = "/profile/"+$scope.UserId+"/packages/"+packageId+"/"+packageVersion; - }else{ - alert("Error uploading file:\r\n"+message); - } - } - - $scope.download = function(url,packageId,packageVersion){ - profilePackagesService.download($scope.downloadItem.Url,$scope.downloadItem.Id,$scope.downloadItem.Version).success(function(data) { - if(data.Success) alert("Package downloaded!"); - else{ - alert(data.Message); - return; - } - }); - } - - $scope.refreshPackages = function(url,packageId,packageVersion){ - profilePackagesService.refreshPackages(); - /*profilePackagesService.refreshPackages().success(function(data) { - if(data.Success){ - alert(data.Data); - }else{ - alert(data.Message); - return; - } - });*/ - } - } -]); \ No newline at end of file diff --git a/src/assets/views/profile/profile.upload.php b/src/assets/views/profile/profile.upload.php index 997070a..a496dfa 100644 --- a/src/assets/views/profile/profile.upload.php +++ b/src/assets/views/profile/profile.upload.php @@ -79,7 +79,7 @@ -
+
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;$jDependencies);$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.
    + + \ No newline at end of file diff --git a/src/scripts/spinner.gif b/src/scripts/spinner.gif new file mode 100644 index 0000000..39fcb67 Binary files /dev/null and b/src/scripts/spinner.gif differ diff --git a/src/settings.php b/src/settings.php index 10ff814..9f2b08d 100644 --- a/src/settings.php +++ b/src/settings.php @@ -3,9 +3,9 @@ define('__MAXUPLOAD_BYTES__',10*1024*1024*1024); define('__PACKAGEHASH__',"SHA512"); //Or SHA256 -define('__UPLOAD_DIR__', "C:\\Projects\\Kendar.Framework\\Github\\endaroza\\PhpNuget.MySql\\src\\data\\packages"); -define('__DATABASE_DIR__', "C:\\Projects\\Kendar.Framework\\Github\\endaroza\\PhpNuget.MySql\\src\\data\\db"); -define('__SITE_ROOT__', "/pnm/"); +define('__UPLOAD_DIR__', "C:\\Kendar\\Development\\PhpNuget_Evo\\PhpNuget\\src\\data\\packages"); +define('__DATABASE_DIR__', "C:\\Kendar\\Development\\PhpNuget_Evo\\PhpNuget\\src\\data\\db"); +define('__SITE_ROOT__', "/edsa-nuget/"); define('__RESULTS_PER_PAGE__', 20); define('__ADMINID__',"admin"); define('__ADMINPASSWORD__',"password"); @@ -17,12 +17,12 @@ //the admin define('__ALLOWUSERADD__',false); -define('__ALLOWPACKAGESDELETE__',true); -define('__ALLOWPACKAGEUPDATE__', true); +define('__ALLOWPACKAGESDELETE__',false); +define('__ALLOWPACKAGEUPDATE__', false); @define('__MYSQL_SERVER__', "127.0.0.1"); -@define('__MYSQL_USER__',"phpnuget"); -@define('__MYSQL_PASSWORD__',"password"); +@define('__MYSQL_USER__',"root"); +@define('__MYSQL_PASSWORD__',""); @define('__MYSQL_DB__',"phpnuget"); @define('__DB_TYPE__',DBMYSQL); diff --git a/src/upload/index.php b/src/upload/index.php index 9e34c6f..648c5af 100644 --- a/src/upload/index.php +++ b/src/upload/index.php @@ -10,18 +10,11 @@ require_once(__ROOT__."/inc/commons/uploadutils.php"); require_once(__ROOT__."/inc/commons/objectsearch.php"); -$doUpLog = false; -if($doUpLog){ - file_put_contents("upload.log","==================================\r\n", FILE_APPEND); - file_put_contents("upload.log","request: ".$_SERVER['REQUEST_URI']."\r\n", FILE_APPEND); - if(sizeof($_POST)>0){ - file_put_contents("upload.log",var_export($_POST,true)."\r\n", FILE_APPEND); - } - if(sizeof($_GET)>0){ - file_put_contents("upload.log",var_export($_GET,true)."\r\n", FILE_APPEND); - } -} +uplog("upload","=================================="); +uplog("upload","request: ".$_SERVER['REQUEST_URI']); +uplogh("upload","Post",$_POST); +uplogh("upload","Get",$_GET); $temp_file = tempnam(sys_get_temp_dir(), 'Tux'); $result = array(); @@ -29,6 +22,7 @@ if (empty($_SERVER['HTTP_X_NUGET_APIKEY'])) { HttpUtils::ApiError('403', 'Invalid API key'); + uplog("upload","No api key!"); die(); } @@ -38,31 +32,35 @@ if(sizeof($users)!=1){ HttpUtils::ApiError('403', 'Invalid API key'); + uplog("upload","Wrong api key!"); die(); } + + uplog("upload","Validation done!"); $user = $users[0]; $uploader = new UploadUtils(Settings::$PackagesRoot,array("nupkg"),Settings::$MaxUploadBytes,true); $uploader->allowAll = true; + uplog("upload","Upload utils initialized!"); $result = $uploader->Upload("package"); if($result['hasError']) { - throw new Exception($result['errorCode']); } - + uplogv("upload","UploadUtils error uploading",$result); + throw new Exception($result['errorCode']); + } $fileName = basename($result["name"],".nupkg"); $nugetReader = new NugetManager(); + uplog("upload","NugetManager initialized!"); $parsedNuspec = $nugetReader->LoadNuspecFromFile($result["destination"]); + uplogv("upload","Nuspec loaded!",$parsedNuspec); $parsedNuspec->UserId=$user->Id; $nuspecData = $nugetReader->SaveNuspec($result["destination"],$parsedNuspec); - - if($doUpLog){ - var_dump($result); - file_put_contents("upload.log",$a."\r\nUpload completed\n", FILE_APPEND); - } - + + uplog("upload","Upload completed"); // All done! header('HTTP/1.1 201 Created'); }catch(Exception $ex){ + uplogv("upload","Error uploading",$ex); if(array_key_exists ("destination",$result)){ unlink($result["destination"]); } diff --git a/src/uploadnupkg.php b/src/uploadnupkg.php index 5b430c0..3615cc4 100644 --- a/src/uploadnupkg.php +++ b/src/uploadnupkg.php @@ -50,7 +50,6 @@ $user = $udb->GetByUserId($loginController->UserId); $nugetReader = new NugetManager(); - $parsedNuspec = $nugetReader->LoadNuspecFromFile($result["destination"]); $parsedNuspec->UserId=$user->Id; @@ -62,7 +61,9 @@ parent.packagesUploadControllerCallback(true,"Id;?>","Version;?>"); parent.packagesUploadControllerCallback(false,"none","none","getMessage();?>");