Permalink
Browse files

license information, updates for newest composer version

  • Loading branch information...
bashofmann committed May 10, 2012
1 parent ce3b5a3 commit f37d60675927f117ecac8f8198640455dadca563
View
@@ -1,7 +1,7 @@
-/.idea
-/.settings
-/.project
-/.buildpath
-/composer.phar
-/composer.lock
-/vendor
+.idea
+.settings
+.project
+.buildpath
+composer.phar
+vendor
+repositories
View
@@ -4,9 +4,9 @@ RewriteEngine On
# If you need to use the `RewriteBase` directive, it should be the
# absolute physical path to the directory that contains this htaccess file.
#
-# RewriteBase /
+RewriteBase /broker
RewriteRule ^assets/(.*)$ - [QSA,L,NC]
RewriteRule ^repositories/[a-zA-Z0-9_\-]+/packages\.json$ - [QSA,L,NC]
RewriteRule ^repositories/[a-zA-Z0-9_\-]+/dists/.+$ - [QSA,L,NC]
-RewriteRule ^.*$ index.php [QSA,L,NC]
+RewriteRule ^.*$ index.php [QSA,L,NC]
View
19 LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2012 ResearchGate GmbH
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is furnished
+to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
View
@@ -1,11 +1,16 @@
<?php
+/*
+* This file is part of rg\broker.
+*
+* (c) ResearchGate GmbH <bastian.hofmann@researchgate.net>
+*
+* For the full copyright and license information, please view the LICENSE
+* file that was distributed with this source code.
+*/
+require __DIR__ . '/config.php';
+require __DIR__ . '/vendor/autoload.php';
-define('ROOT', __DIR__);
-define('ROOTURL', 'http://localhost:8888/Checkouts/broker');
-
-require __DIR__ . '/vendor/.composer/autoload.php';
-
-$cli = new \Symfony\Component\Console\Application('rg\broker', '1.0.0');
+$cli = new \Symfony\Component\Console\Application('rg\broker', '0.1.0');
$cli->setCatchExceptions(true);
$cli->addCommands(array(
View
@@ -3,7 +3,6 @@
"description":"Simple composer repository proxy",
"keywords":["package", "repository", "proxy"],
"homepage":"https://github.com/researchgate/broker",
- "version": "0.1.0",
"license":"Apache License 2.0",
"authors":[
{
@@ -12,29 +11,16 @@
"homepage":"http://bastianhofmann.de"
}
],
- "repositories": {
- "slim": {
- "package": {
- "name":"codeguy/slim",
- "version":"1.5.1.5",
- "source": {
- "url": "git://github.com/codeguy/Slim.git",
- "type": "git",
- "reference": "1.5.1.5"
- }
- }
- }
- },
"require":{
"php":">=5.3.2",
- "symfony/console":"2.0.10",
+ "symfony/console":"*",
"composer/composer":"*",
- "codeguy/slim":"1.5.1.5",
- "dflydev/markdown":"master-dev"
+ "slim/slim":"1.6.2",
+ "dflydev/markdown":"dev-master"
},
"autoload":{
"psr-0":{
- "rg\\broker":"/src"
+ "rg":"src/"
}
}
-}
+}
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -0,0 +1,11 @@
+<?php
+/*
+* This file is part of rg\broker.
+*
+* (c) ResearchGate GmbH <bastian.hofmann@researchgate.net>
+*
+* For the full copyright and license information, please view the LICENSE
+* file that was distributed with this source code.
+*/
+define('ROOT', __DIR__);
+define('ROOTURL', 'http://localhost:8080/broker');
View
@@ -1,18 +1,14 @@
<?php
-
-define('ROOT', __DIR__);
-define('ROOTURL', 'http://localhost:8888/Checkouts/broker');
-
-require __DIR__ . '/vendor/.composer/autoload.php';
-
-$universalLoader = new \Symfony\Component\ClassLoader\UniversalClassLoader();
-$universalLoader->registerPrefix('Slim_', __DIR__ . '/vendor/codeguy/slim');
-$universalLoader->register();
-
-$mapLoader = new \Symfony\Component\ClassLoader\MapClassLoader(array(
- 'Slim' => __DIR__ . '/vendor/codeguy/slim/Slim/Slim.php'
-));
-$mapLoader->register();
+/*
+* This file is part of rg\broker.
+*
+* (c) ResearchGate GmbH <bastian.hofmann@researchgate.net>
+*
+* For the full copyright and license information, please view the LICENSE
+* file that was distributed with this source code.
+*/
+require __DIR__ . '/config.php';
+require __DIR__ . '/vendor/autoload.php';
$application = new \rg\broker\web\Application();
-$application->run();
+$application->run();
@@ -1,4 +1,12 @@
<?php
+/*
+ * This file is part of rg\broker.
+ *
+ * (c) ResearchGate GmbH <bastian.hofmann@researchgate.net>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
namespace rg\broker\commands;
use Symfony\Component\Console\Input\InputInterface;
@@ -48,18 +56,8 @@ protected function execute(InputInterface $input, OutputInterface $output) {
$composer->setLocker(new \rg\broker\customizations\Locker());
$composer->getDownloadManager()->setDownloader('pear', new \rg\broker\customizations\PearDownloader($io));
- $installCommand = new \Composer\Command\InstallCommand();
- $eventDispatcher = new \Composer\Script\EventDispatcher($composer, $io);
- $installCommand->install(
- $io,
- $composer,
- $eventDispatcher,
- false,
- false,
- false,
- false,
- true
- );
+ $installer = \Composer\Installer::create($io, $composer);
+ $installer->run();
$packages = array();
$dumper = new \Composer\Package\Dumper\ArrayDumper();
@@ -92,6 +90,10 @@ protected function getPackageArray($repositoryName,
$packageArray = $dumper->dump($package);
unset($packageArray['source']);
unset($packageArray['dist']);
+ if ($package->isDev()) {
+ $packageArray['version'] = 'master';
+ $packageArray['version_normalized'] = $packageArray['version'];
+ }
$packageArray['dist'] = array(
'type' => 'zip',
'url' => ROOTURL . '/repositories/' . $repositoryName . '/dists/' . $zipfileName . '.zip',
@@ -139,11 +141,11 @@ protected function createZipFile($repositoryDir,
* @throws \Exception
*/
protected function getInstalledPackages($repositoryDir) {
- $file = new \Composer\Json\JsonFile($repositoryDir . '/sources/.composer/installed.json');
+ $file = new \Composer\Json\JsonFile($repositoryDir . '/sources/composer/installed.json');
if (!$file->exists()) {
throw new \Exception('no packages installed in repository');
}
return $file->read();
}
-}
+}
@@ -1,4 +1,12 @@
<?php
+/*
+ * This file is part of rg\broker.
+ *
+ * (c) ResearchGate GmbH <bastian.hofmann@researchgate.net>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
namespace rg\broker\commands;
use Symfony\Component\Console\Input\InputInterface;
@@ -0,0 +1,25 @@
+<?php
+/*
+ * This file is part of rg\broker.
+ *
+ * (c) ResearchGate GmbH <bastian.hofmann@researchgate.net>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace rg\broker\customizations;
+
+class Cache extends \Composer\Cache {
+
+ public function __construct() {
+ }
+
+ public function read($file) {
+ }
+
+ public function write($file, $contents) {
+ }
+
+ public function sha1($file) {
+ }
+}
@@ -1,4 +1,12 @@
<?php
+/*
+ * This file is part of rg\broker.
+ *
+ * (c) ResearchGate GmbH <bastian.hofmann@researchgate.net>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
namespace rg\broker\customizations;
class Locker extends \Composer\Package\Locker {
@@ -20,4 +28,8 @@ public function isFresh() {
public function getLockedPackages() {
return array();
}
+
+ public function setLockData(array $packages, $devPackages, array $aliases) {
+
+ }
}
@@ -1,4 +1,12 @@
<?php
+/*
+ * This file is part of rg\broker.
+ *
+ * (c) ResearchGate GmbH <bastian.hofmann@researchgate.net>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
namespace rg\broker\customizations;
class PearDownloader extends \Composer\Downloader\FileDownloader {
@@ -1,4 +1,12 @@
<?php
+/*
+ * This file is part of rg\broker.
+ *
+ * (c) ResearchGate GmbH <bastian.hofmann@researchgate.net>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
namespace rg\broker\repositories;
class Repository extends \Composer\Repository\ComposerRepository {
@@ -8,6 +16,8 @@ class Repository extends \Composer\Repository\ComposerRepository {
public function __construct($name) {
$this->name = $name;
$this->url = ROOT . '/repositories/' .$name;
+ $this->cache = new \rg\broker\customizations\Cache();
+ $this->io = new \Composer\IO\NullIO();
}
public function getName() {
@@ -1,4 +1,12 @@
<?php
+/*
+ * This file is part of rg\broker.
+ *
+ * (c) ResearchGate GmbH <bastian.hofmann@researchgate.net>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
namespace rg\broker\repositories;
class RepositoryBrowser {
Oops, something went wrong.

0 comments on commit f37d606

Please sign in to comment.