Skip to content
This repository
Browse code

license information, updates for newest composer version

  • Loading branch information...
commit f37d60675927f117ecac8f8198640455dadca563 1 parent ce3b5a3
Bastian Hofmann authored
14  .gitignore
... ...
@@ -1,7 +1,7 @@
1  
-/.idea
2  
-/.settings
3  
-/.project
4  
-/.buildpath
5  
-/composer.phar
6  
-/composer.lock
7  
-/vendor
  1
+.idea
  2
+.settings
  3
+.project
  4
+.buildpath
  5
+composer.phar
  6
+vendor
  7
+repositories
4  .htaccess
@@ -4,9 +4,9 @@ RewriteEngine On
4 4
 # If you need to use the `RewriteBase` directive, it should be the
5 5
 # absolute physical path to the directory that contains this htaccess file.
6 6
 #
7  
-# RewriteBase /
  7
+RewriteBase /broker
8 8
 
9 9
 RewriteRule ^assets/(.*)$ - [QSA,L,NC]
10 10
 RewriteRule ^repositories/[a-zA-Z0-9_\-]+/packages\.json$ - [QSA,L,NC]
11 11
 RewriteRule ^repositories/[a-zA-Z0-9_\-]+/dists/.+$ - [QSA,L,NC]
12  
-RewriteRule ^.*$ index.php [QSA,L,NC]
  12
+RewriteRule ^.*$ index.php [QSA,L,NC]
19  LICENSE
... ...
@@ -0,0 +1,19 @@
  1
+Copyright (c) 2012 ResearchGate GmbH
  2
+
  3
+Permission is hereby granted, free of charge, to any person obtaining a copy
  4
+of this software and associated documentation files (the "Software"), to deal
  5
+in the Software without restriction, including without limitation the rights
  6
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7
+copies of the Software, and to permit persons to whom the Software is furnished
  8
+to do so, subject to the following conditions:
  9
+
  10
+The above copyright notice and this permission notice shall be included in all
  11
+copies or substantial portions of the Software.
  12
+
  13
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19
+THE SOFTWARE.
17  broker.php
... ...
@@ -1,11 +1,16 @@
1 1
 <?php
  2
+/*
  3
+* This file is part of rg\broker.
  4
+*
  5
+* (c) ResearchGate GmbH <bastian.hofmann@researchgate.net>
  6
+*
  7
+* For the full copyright and license information, please view the LICENSE
  8
+* file that was distributed with this source code.
  9
+*/
  10
+require __DIR__ . '/config.php';
  11
+require __DIR__ . '/vendor/autoload.php';
2 12
 
3  
-define('ROOT', __DIR__);
4  
-define('ROOTURL', 'http://localhost:8888/Checkouts/broker');
5  
-
6  
-require __DIR__ . '/vendor/.composer/autoload.php';
7  
-
8  
-$cli = new \Symfony\Component\Console\Application('rg\broker', '1.0.0');
  13
+$cli = new \Symfony\Component\Console\Application('rg\broker', '0.1.0');
9 14
 $cli->setCatchExceptions(true);
10 15
 
11 16
 $cli->addCommands(array(
24  composer.json
@@ -3,7 +3,6 @@
3 3
     "description":"Simple composer repository proxy",
4 4
     "keywords":["package", "repository", "proxy"],
5 5
     "homepage":"https://github.com/researchgate/broker",
6  
-    "version": "0.1.0",
7 6
     "license":"Apache License 2.0",
8 7
     "authors":[
9 8
         {
@@ -12,29 +11,16 @@
12 11
             "homepage":"http://bastianhofmann.de"
13 12
         }
14 13
     ],
15  
-    "repositories": {
16  
-        "slim": {
17  
-            "package": {
18  
-                "name":"codeguy/slim",
19  
-                "version":"1.5.1.5",
20  
-                "source": {
21  
-                    "url": "git://github.com/codeguy/Slim.git",
22  
-                    "type": "git",
23  
-                    "reference": "1.5.1.5"
24  
-                }
25  
-            }
26  
-        }
27  
-    },
28 14
     "require":{
29 15
         "php":">=5.3.2",
30  
-        "symfony/console":"2.0.10",
  16
+        "symfony/console":"*",
31 17
         "composer/composer":"*",
32  
-        "codeguy/slim":"1.5.1.5",
33  
-        "dflydev/markdown":"master-dev"
  18
+        "slim/slim":"1.6.2",
  19
+        "dflydev/markdown":"dev-master"
34 20
     },
35 21
     "autoload":{
36 22
         "psr-0":{
37  
-            "rg\\broker":"/src"
  23
+            "rg":"src/"
38 24
         }
39 25
     }
40  
-}
  26
+}
49  composer.lock
... ...
@@ -0,0 +1,49 @@
  1
+{
  2
+    "hash": "cfa693acbcb540e2c4131f1ff9795858",
  3
+    "packages": [
  4
+        {
  5
+            "package": "composer/composer",
  6
+            "version": "dev-master",
  7
+            "source-reference": "655588a5e0afeddbfda6dd9e137cebb4b9d660a8"
  8
+        },
  9
+        {
  10
+            "package": "dflydev/markdown",
  11
+            "version": "dev-master",
  12
+            "source-reference": "91c6649f89472f6ab60a107a80acc72baacf585c"
  13
+        },
  14
+        {
  15
+            "package": "justinrainbow/json-schema",
  16
+            "version": "1.1.0"
  17
+        },
  18
+        {
  19
+            "package": "seld/jsonlint",
  20
+            "version": "1.0.0"
  21
+        },
  22
+        {
  23
+            "package": "slim/slim",
  24
+            "version": "1.6.2"
  25
+        },
  26
+        {
  27
+            "package": "symfony/console",
  28
+            "version": "dev-master",
  29
+            "source-reference": "8d58af16c425977018293eb0a1570c9629b37994",
  30
+            "alias": "2.1.9999999.9999999-dev"
  31
+        },
  32
+        {
  33
+            "package": "symfony/finder",
  34
+            "version": "dev-master",
  35
+            "source-reference": "19ef3c1ca88f6e69d9cca0eda2e3a20f85e0173a",
  36
+            "alias": "2.1.9999999.9999999-dev"
  37
+        },
  38
+        {
  39
+            "package": "symfony/process",
  40
+            "version": "dev-master",
  41
+            "source-reference": "1bc1398d51180fd2aeded9c44f4d7b73bea817cd",
  42
+            "alias": "2.1.9999999.9999999-dev"
  43
+        }
  44
+    ],
  45
+    "packages-dev": null,
  46
+    "aliases": [
  47
+
  48
+    ]
  49
+}
11  config.php
... ...
@@ -0,0 +1,11 @@
  1
+<?php
  2
+/*
  3
+* This file is part of rg\broker.
  4
+*
  5
+* (c) ResearchGate GmbH <bastian.hofmann@researchgate.net>
  6
+*
  7
+* For the full copyright and license information, please view the LICENSE
  8
+* file that was distributed with this source code.
  9
+*/
  10
+define('ROOT', __DIR__);
  11
+define('ROOTURL', 'http://localhost:8080/broker');
26  index.php
... ...
@@ -1,18 +1,14 @@
1 1
 <?php
2  
-
3  
-define('ROOT', __DIR__);
4  
-define('ROOTURL', 'http://localhost:8888/Checkouts/broker');
5  
-
6  
-require __DIR__ . '/vendor/.composer/autoload.php';
7  
-
8  
-$universalLoader = new \Symfony\Component\ClassLoader\UniversalClassLoader();
9  
-$universalLoader->registerPrefix('Slim_', __DIR__ . '/vendor/codeguy/slim');
10  
-$universalLoader->register();
11  
-
12  
-$mapLoader = new \Symfony\Component\ClassLoader\MapClassLoader(array(
13  
-    'Slim' => __DIR__ . '/vendor/codeguy/slim/Slim/Slim.php'
14  
-));
15  
-$mapLoader->register();
  2
+/*
  3
+* This file is part of rg\broker.
  4
+*
  5
+* (c) ResearchGate GmbH <bastian.hofmann@researchgate.net>
  6
+*
  7
+* For the full copyright and license information, please view the LICENSE
  8
+* file that was distributed with this source code.
  9
+*/
  10
+require __DIR__ . '/config.php';
  11
+require __DIR__ . '/vendor/autoload.php';
16 12
 
17 13
 $application = new \rg\broker\web\Application();
18  
-$application->run();
  14
+$application->run();
30  src/rg/broker/commands/AddRepository.php
... ...
@@ -1,4 +1,12 @@
1 1
 <?php
  2
+/*
  3
+ * This file is part of rg\broker.
  4
+ *
  5
+ * (c) ResearchGate GmbH <bastian.hofmann@researchgate.net>
  6
+ *
  7
+ * For the full copyright and license information, please view the LICENSE
  8
+ * file that was distributed with this source code.
  9
+ */
2 10
 namespace rg\broker\commands;
3 11
 
4 12
 use Symfony\Component\Console\Input\InputInterface;
@@ -48,18 +56,8 @@ protected function execute(InputInterface $input, OutputInterface $output) {
48 56
         $composer->setLocker(new \rg\broker\customizations\Locker());
49 57
         $composer->getDownloadManager()->setDownloader('pear', new \rg\broker\customizations\PearDownloader($io));
50 58
 
51  
-        $installCommand = new \Composer\Command\InstallCommand();
52  
-        $eventDispatcher = new \Composer\Script\EventDispatcher($composer, $io);
53  
-        $installCommand->install(
54  
-            $io,
55  
-            $composer,
56  
-            $eventDispatcher,
57  
-            false,
58  
-            false,
59  
-            false,
60  
-            false,
61  
-            true
62  
-        );
  59
+        $installer = \Composer\Installer::create($io, $composer);
  60
+        $installer->run();
63 61
 
64 62
         $packages = array();
65 63
         $dumper = new \Composer\Package\Dumper\ArrayDumper();
@@ -92,6 +90,10 @@ protected function getPackageArray($repositoryName,
92 90
         $packageArray = $dumper->dump($package);
93 91
         unset($packageArray['source']);
94 92
         unset($packageArray['dist']);
  93
+	    if ($package->isDev()) {
  94
+            $packageArray['version'] = 'master';
  95
+            $packageArray['version_normalized'] = $packageArray['version'];
  96
+        }
95 97
         $packageArray['dist'] = array(
96 98
             'type' => 'zip',
97 99
             'url' => ROOTURL . '/repositories/' . $repositoryName . '/dists/' . $zipfileName . '.zip',
@@ -139,11 +141,11 @@ protected function createZipFile($repositoryDir,
139 141
      * @throws \Exception
140 142
      */
141 143
     protected function getInstalledPackages($repositoryDir) {
142  
-        $file = new \Composer\Json\JsonFile($repositoryDir . '/sources/.composer/installed.json');
  144
+        $file = new \Composer\Json\JsonFile($repositoryDir . '/sources/composer/installed.json');
143 145
         if (!$file->exists()) {
144 146
             throw new \Exception('no packages installed in repository');
145 147
         }
146 148
         return $file->read();
147 149
     }
148 150
 
149  
-}
  151
+}
8  src/rg/broker/commands/RemoveRepository.php
... ...
@@ -1,4 +1,12 @@
1 1
 <?php
  2
+/*
  3
+ * This file is part of rg\broker.
  4
+ *
  5
+ * (c) ResearchGate GmbH <bastian.hofmann@researchgate.net>
  6
+ *
  7
+ * For the full copyright and license information, please view the LICENSE
  8
+ * file that was distributed with this source code.
  9
+ */
2 10
 namespace rg\broker\commands;
3 11
 
4 12
 use Symfony\Component\Console\Input\InputInterface;
25  src/rg/broker/customizations/Cache.php
... ...
@@ -0,0 +1,25 @@
  1
+<?php
  2
+/*
  3
+ * This file is part of rg\broker.
  4
+ *
  5
+ * (c) ResearchGate GmbH <bastian.hofmann@researchgate.net>
  6
+ *
  7
+ * For the full copyright and license information, please view the LICENSE
  8
+ * file that was distributed with this source code.
  9
+ */
  10
+namespace rg\broker\customizations;
  11
+
  12
+class Cache extends \Composer\Cache {
  13
+
  14
+    public function __construct() {
  15
+    }
  16
+
  17
+    public function read($file) {
  18
+    }
  19
+
  20
+    public function write($file, $contents) {
  21
+    }
  22
+
  23
+    public function sha1($file) {
  24
+    }
  25
+}
12  src/rg/broker/customizations/Locker.php
... ...
@@ -1,4 +1,12 @@
1 1
 <?php
  2
+/*
  3
+ * This file is part of rg\broker.
  4
+ *
  5
+ * (c) ResearchGate GmbH <bastian.hofmann@researchgate.net>
  6
+ *
  7
+ * For the full copyright and license information, please view the LICENSE
  8
+ * file that was distributed with this source code.
  9
+ */
2 10
 namespace rg\broker\customizations;
3 11
 
4 12
 class Locker extends \Composer\Package\Locker {
@@ -20,4 +28,8 @@ public function isFresh() {
20 28
     public function getLockedPackages() {
21 29
         return array();
22 30
     }
  31
+
  32
+    public function setLockData(array $packages, $devPackages, array $aliases) {
  33
+
  34
+    }
23 35
 }
8  src/rg/broker/customizations/PearDownloader.php
... ...
@@ -1,4 +1,12 @@
1 1
 <?php
  2
+/*
  3
+ * This file is part of rg\broker.
  4
+ *
  5
+ * (c) ResearchGate GmbH <bastian.hofmann@researchgate.net>
  6
+ *
  7
+ * For the full copyright and license information, please view the LICENSE
  8
+ * file that was distributed with this source code.
  9
+ */
2 10
 namespace rg\broker\customizations;
3 11
 
4 12
 class PearDownloader extends \Composer\Downloader\FileDownloader {
10  src/rg/broker/repositories/Repository.php
... ...
@@ -1,4 +1,12 @@
1 1
 <?php
  2
+/*
  3
+ * This file is part of rg\broker.
  4
+ *
  5
+ * (c) ResearchGate GmbH <bastian.hofmann@researchgate.net>
  6
+ *
  7
+ * For the full copyright and license information, please view the LICENSE
  8
+ * file that was distributed with this source code.
  9
+ */
2 10
 namespace rg\broker\repositories;
3 11
 
4 12
 class Repository extends \Composer\Repository\ComposerRepository {
@@ -8,6 +16,8 @@ class Repository extends \Composer\Repository\ComposerRepository {
8 16
     public function __construct($name) {
9 17
         $this->name = $name;
10 18
         $this->url = ROOT . '/repositories/' .$name;
  19
+        $this->cache = new \rg\broker\customizations\Cache();
  20
+        $this->io = new \Composer\IO\NullIO();
11 21
     }
12 22
 
13 23
     public function getName() {
8  src/rg/broker/repositories/RepositoryBrowser.php
... ...
@@ -1,4 +1,12 @@
1 1
 <?php
  2
+/*
  3
+ * This file is part of rg\broker.
  4
+ *
  5
+ * (c) ResearchGate GmbH <bastian.hofmann@researchgate.net>
  6
+ *
  7
+ * For the full copyright and license information, please view the LICENSE
  8
+ * file that was distributed with this source code.
  9
+ */
2 10
 namespace rg\broker\repositories;
3 11
 
4 12
 class RepositoryBrowser {
10  src/rg/broker/web/Application.php
... ...
@@ -1,4 +1,12 @@
1 1
 <?php
  2
+/*
  3
+ * This file is part of rg\broker.
  4
+ *
  5
+ * (c) ResearchGate GmbH <bastian.hofmann@researchgate.net>
  6
+ *
  7
+ * For the full copyright and license information, please view the LICENSE
  8
+ * file that was distributed with this source code.
  9
+ */
2 10
 namespace rg\broker\web;
3 11
 
4 12
 class Application {
@@ -78,7 +86,7 @@ public function getRepository($repositoryName) {
78 86
      */
79 87
     public function getPackage($repositoryName, $packageName) {
80 88
         $repository = $this->getRepository($repositoryName);
81  
-        $packages = $repository->findPackagesByName($packageName);
  89
+        $packages = $repository->findPackages($packageName);
82 90
         if (!$packages) {
83 91
             $this->app->redirect(ROOTURL . '/' . $repositoryName);
84 92
         }
8  src/rg/broker/web/View.php
... ...
@@ -1,4 +1,12 @@
1 1
 <?php
  2
+/*
  3
+ * This file is part of rg\broker.
  4
+ *
  5
+ * (c) ResearchGate GmbH <bastian.hofmann@researchgate.net>
  6
+ *
  7
+ * For the full copyright and license information, please view the LICENSE
  8
+ * file that was distributed with this source code.
  9
+ */
2 10
 namespace rg\broker\web;
3 11
 
4 12
 class View extends \Slim_View {
10  src/rg/broker/web/templates/footer.php
... ...
@@ -1,3 +1,13 @@
10  src/rg/broker/web/templates/header.php
... ...
@@ -1,3 +1,13 @@
  1
+<?php
  2
+/*
  3
+* This file is part of rg\broker.
  4
+*
  5
+* (c) ResearchGate GmbH <bastian.hofmann@researchgate.net>
  6
+*
  7
+* For the full copyright and license information, please view the LICENSE
  8
+* file that was distributed with this source code.
  9
+*/
  10
+?>
1 11
 <!DOCTYPE html>
2 12
 <html lang="en">
3 13
 <head>
10  src/rg/broker/web/templates/home.php
... ...
@@ -1 +1,11 @@
  1
+<?php
  2
+/*
  3
+* This file is part of rg\broker.
  4
+*
  5
+* (c) ResearchGate GmbH <bastian.hofmann@researchgate.net>
  6
+*
  7
+* For the full copyright and license information, please view the LICENSE
  8
+* file that was distributed with this source code.
  9
+*/
  10
+?>
1 11
 <?php echo $content; ?>
10  src/rg/broker/web/templates/package.php
... ...
@@ -1,2 +1,12 @@
  1
+<?php
  2
+/*
  3
+* This file is part of rg\broker.
  4
+*
  5
+* (c) ResearchGate GmbH <bastian.hofmann@researchgate.net>
  6
+*
  7
+* For the full copyright and license information, please view the LICENSE
  8
+* file that was distributed with this source code.
  9
+*/
  10
+?>
1 11
 <?php require 'repository_header.php'; ?>
2 12
 <?php require 'package_item.php'; ?>
10  src/rg/broker/web/templates/package_item.php
... ...
@@ -1,3 +1,13 @@
  1
+<?php
  2
+/*
  3
+* This file is part of rg\broker.
  4
+*
  5
+* (c) ResearchGate GmbH <bastian.hofmann@researchgate.net>
  6
+*
  7
+* For the full copyright and license information, please view the LICENSE
  8
+* file that was distributed with this source code.
  9
+*/
  10
+?>
1 11
 <?php /** @var \Composer\Package\PackageInterface $package  */ ?>
2 12
 <div class="row-fluid">
3 13
 <div class="well">
10  src/rg/broker/web/templates/repository.php
... ...
@@ -1,3 +1,13 @@
  1
+<?php
  2
+/*
  3
+* This file is part of rg\broker.
  4
+*
  5
+* (c) ResearchGate GmbH <bastian.hofmann@researchgate.net>
  6
+*
  7
+* For the full copyright and license information, please view the LICENSE
  8
+* file that was distributed with this source code.
  9
+*/
  10
+?>
1 11
 <?php require 'repository_header.php'; ?>
2 12
 
3 13
 <?php foreach ($currentRepository->getPackages() as $package):?>
10  src/rg/broker/web/templates/repository_header.php
... ...
@@ -1,3 +1,13 @@
  1
+<?php
  2
+/*
  3
+* This file is part of rg\broker.
  4
+*
  5
+* (c) ResearchGate GmbH <bastian.hofmann@researchgate.net>
  6
+*
  7
+* For the full copyright and license information, please view the LICENSE
  8
+* file that was distributed with this source code.
  9
+*/
  10
+?>
1 11
 <div class="row-fluent">
2 12
     <ul class="nav nav-pills pull-right">
3 13
         <li class="active">

0 notes on commit f37d606

Please sign in to comment.
Something went wrong with that request. Please try again.