GitHost.io will be shut down on June 1, 2019. At that point this instance will be unreachable and all data will be irrevocably deleted. More details at https://about.gitlab.com/gitlab-hosted/#githost-is-shutting-down-on-june-1st-2019

Commit 19c4fe18 authored by Rob Myers's avatar Rob Myers

Move to Composer for dependency management.

Files now include  ...vendor/autoload.php where needed and the
external_dependencies folder has been removed. The installation instructions
have been updated to reflect these changes. nixtape and gnukebox have separate
composer files to ease separate installation.
Feedback on this strategy is welcomed.

Use phpunit rather than simpletest for all tests. simpletest is no longer a
dependency.

Update to current versions of libraries. Where this has caused errors to be
logged (notably for templates) code has been changed to resolve them.
parent 5784e50a
gnukebox/config.php gnukebox/config.php
gnukebox/vendor
nixtape/config.php nixtape/config.php
nixtape/themes/gnufm/templates_c/ nixtape/themes/gnufm/templates_c/
nixtape/vendor
Other external dependencies which are currently bundled within the nixtape source tree:
- jQuery 1.3.2
- ARC2
--- Installing GNU FM --- --- Installing GNU FM ---
If for any reason you might need assistance following these instructions, please don't If for any reason you might need assistance following these instructions,
hestitate to join us at #libre.fm @ freenode (IRC). please don't hestitate to join us at #libre.fm @ freenode (IRC).
Dependencies: Dependencies:
- Postgresql (recommended) / MySQL / SQlite (untested?) - Postgresql (recommended) / MySQL / SQlite (untested?)
- Apache / lighttpd - Apache / lighttpd
- PHP 5 - PHP 5
...@@ -11,10 +11,13 @@ Dependencies: ...@@ -11,10 +11,13 @@ Dependencies:
- Smarty + Smarty-gettext (see footnote) - Smarty + Smarty-gettext (see footnote)
- Database modules for PHP - Database modules for PHP
(this guide assumes you are capable of creating a user and database yourself) PHP dependencies (AdoDB, Smarty, Smarty-gettext) are managed via composer.
(This guide assumes you are capable of creating a user and database yourself.)
TODO: Write guide for creating user and database TODO: Write guide for creating user and database
First, grab yourself a copy of the code. It is available here: First, grab yourself a copy of the code. It is available here:
http://gitorious.org/foocorp/gnu-fm http://gitorious.org/foocorp/gnu-fm
The checkout should contain a bunch of folders, the only ones we're The checkout should contain a bunch of folders, the only ones we're
...@@ -23,49 +26,52 @@ interested in at the moment are the ones called "gnukebox" and "nixtape". ...@@ -23,49 +26,52 @@ interested in at the moment are the ones called "gnukebox" and "nixtape".
GNU FM is divided into two modules: gnukebox, which receives scrobbles, and GNU FM is divided into two modules: gnukebox, which receives scrobbles, and
nixtape, which is the web frontend and provides the webservices (such as radio). nixtape, which is the web frontend and provides the webservices (such as radio).
Although gnukebox and nixtape have the same dependencies, they have separate
composer files to make separate installation easier.
--------------------------------------------------------------------------------
Gnukebox: Gnukebox:
Installing gnukebox is easy: Installing gnukebox is easy:
(1) Copy the contents of gnukebox to the root of a vhost. (1) Copy the contents of gnukebox to the root of a vhost.
(2) Set up correct permissions on files and folders (2) Run 'composer install' in that directory.
(3) Run 'install.php' through a web browser. (3) Set up correct permissions on files and folders.
(4) Run 'install.php' through a web browser.
Gnukebox needs to be at the root of a vhost, simply because that's where clients Gnukebox needs to be at the root of a vhost, simply because that's where
expect it to be. For the rest of this document I'll assume gnukebox is accessible clients expect it to be. For the rest of this document I'll assume gnukebox is
through the address 'gnukebox.local'. To complete step 1, copy the contents of accessible through the address 'gnukebox.local'. To complete step 1, copy the
the "gnukebox"-folder to the root of your vhost: contents of the "gnukebox" folder to the root of your vhost:
$ cp -r gnukebox/* /var/www/htdocs/gnukebox/. $ cp -r gnukebox/* /var/www/htdocs/gnukebox/.
/var/www/htdocs/gnukebox is just where I've set up my gnukebox-vhost in Apache. /var/www/htdocs/gnukebox is just where I've set up my gnukebox-vhost in Apache.
Gnukebox relies on an external database abstraction layer called ADOdb. This can be installed Install the dependencies using composer:
systemwide through a package manager or locally for gnukebox only by extracting the ADOdb-archive
present in the "external_dependencies"-folder.
To install ADOdb system wide either use your distributions package manager or find a guide that
tells you how to do it manually. If you decide to use a local copy you will need to repeat this
step when installing nixtape.
To use a local copy of ADOdb: $ cd /var/www/htdocs/gnukebox
$ cp external_dependencies/adodb511.tgz /var/www/htdocs/gnukebox/. $ composer install
$ cd /var/www/htdocs/gnukebox
$ tar zxvf adodb511.tgz
$ mv adodb5 adodb
Now run these commands as root to correctly set permissions (assuming www-data is the user Now run these commands as root to correctly set permissions (assuming www-data
your webserver runs under). is the user your webserver runs under).
$ chown www-data:www-data -R /var/www/htdocs/gnukebox $ chown www-data:www-data -R /var/www/htdocs/gnukebox
Now point your browser to 'http://gnukebox.local/install.php'. Now point your browser to 'http://gnukebox.local/install.php'.
Just fill in the appropriate details and click 'Install'. This should connect to the database, Just fill in the appropriate details and click 'Install'. This should connect
create the appropriate tables and complete the 'config.php'-file in the gnukebox-directory. to the database, create the appropriate tables and complete the 'config.php'
If the script was unable to create the file, it will echo the contents to the screen and tell file in the gnukebox-directory.
you to create it yourself. Note: Some users have reported getting a Server 500-error here.
If you do, see if the tables were created and if 'config.php' has appeared in your gnukebox-folder.
--------------------------------------------------------------------------------------------------- If the script was unable to create the file, it will echo the contents to the
screen and tell you to create it yourself.
Note: Some users have reported getting a Server 500-error here. If you do, see
if the tables were created and if 'config.php' has appeared in your gnukebox
folder.
--------------------------------------------------------------------------------
Nixtape: Nixtape:
...@@ -75,33 +81,11 @@ Installing the base system: ...@@ -75,33 +81,11 @@ Installing the base system:
$ cp -r nixtape/* /var/www/htdocs/nixtape/. $ cp -r nixtape/* /var/www/htdocs/nixtape/.
$ mkdir /var/www/htdocs/nixtape/themes/gnufm/templates_c $ mkdir /var/www/htdocs/nixtape/themes/gnufm/templates_c
Installing dependencies (Smarty+AdoDB): Installing dependencies:
$ cd /var/www/htdocs/nixtape/
Both Smarty and AdoDB can be downloaded and placed in the gnukebox-folder (both are also located in $ composer install
the folder "external_dependencies"). If installed through a package manager, make sure Smarty
is installed correctly[1]. When unpacking Smarty, move all files in smarty/libs/ to smarty/.
Installing Smarty:
$ cd external_dependencies
$ cp Smarty* /var/www/htdocs/nixtape/.
$ cp smarty* /var/www/htdocs/nixtape/.
$ tar zxvf Smarty*
$ tar zxvf smarty*
$ mv smarty/libs/* smarty/.
$ mv smarty-gettext/block.t.php smarty/plugins/.
Installing ADOdb:
$ cp external_dependencies/adodb511.tgz /var/www/htdocs/nixtape/.
$ cd /var/www/htdocs/nixtape
$ tar zxvf adodb511.tgz
$ mv adodb5 adodb
Setting the correct permissions: Setting the correct permissions:
$ chown www-data:www-data -R /var/www/htdocs/nixtape $ chown www-data:www-data -R /var/www/htdocs/nixtape
Now access your installation through a browser and follow the instructions. Now access your installation through a browser and follow the instructions.
__________________________________________________________________________
[1] Debian installs Smarty wrong and Ubuntu installs Smarty-Gettext wrong.
See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=514305 and
https://bugs.launchpad.net/ubuntu/+source/smarty-gettext/+bug/150461
{
"require": {
"adodb/adodb-php": "~5.19",
"smarty/smarty": "~3.1",
"smarty-gettext/smarty-gettext": "~1.1.1"
},
"require-dev": {
"phpunit/phpunit": "~4.8"
}
}
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "d4b64c97f79aa2ab95e92b4cab22f0fc",
"packages": [
{
"name": "adodb/adodb-php",
"version": "v5.19",
"source": {
"type": "git",
"url": "https://github.com/ADOdb/ADOdb.git",
"reference": "773bb9b7ccd81b403bf75f7ef476c3f2d7ee04de"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ADOdb/ADOdb/zipball/773bb9b7ccd81b403bf75f7ef476c3f2d7ee04de",
"reference": "773bb9b7ccd81b403bf75f7ef476c3f2d7ee04de",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
"type": "library",
"autoload": {
"files": [
"adodb.inc.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-2.1",
" BSD-2-Clause"
],
"authors": [
{
"name": "John Lim",
"email": "jlim@natsoft.com",
"role": "Author"
},
{
"name": "Damien Regad",
"role": "Current maintainer"
}
],
"description": "ADOdb is a PHP database abstraction layer library",
"homepage": "http://adodb.sourceforge.net/",
"keywords": [
"database"
],
"time": "2014-04-23 14:37:03"
},
{
"name": "smarty-gettext/smarty-gettext",
"version": "1.1.1",
"source": {
"type": "git",
"url": "https://github.com/smarty-gettext/smarty-gettext.git",
"reference": "0e3c7c89c2c877dd5a3d7f07a950d78de987238d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/smarty-gettext/smarty-gettext/zipball/0e3c7c89c2c877dd5a3d7f07a950d78de987238d",
"reference": "0e3c7c89c2c877dd5a3d7f07a950d78de987238d",
"shasum": ""
},
"require": {
"ext-gettext": "*",
"ext-pcre": "*",
"php": ">=5.2.1"
},
"bin": [
"tsmarty2c.php"
],
"type": "library",
"autoload": {
"files": [
"block.t.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-2.1+"
],
"authors": [
{
"name": "Sagi Bashari",
"email": "sagi@boom.org.il"
},
{
"name": "Elan Ruusamäe",
"email": "glen@delfi.ee"
}
],
"description": "Gettext plugin enabling internationalization in Smarty Package files",
"homepage": "https://github.com/smarty-gettext/smarty-gettext",
"time": "2014-11-12 17:06:33"
},
{
"name": "smarty/smarty",
"version": "v3.1.27",
"source": {
"type": "git",
"url": "https://github.com/smarty-php/smarty.git",
"reference": "4537d8aae6c4a26f5439bc3a05d3437d25c2c4d2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/smarty-php/smarty/zipball/4537d8aae6c4a26f5439bc3a05d3437d25c2c4d2",
"reference": "4537d8aae6c4a26f5439bc3a05d3437d25c2c4d2",
"shasum": ""
},
"require": {
"php": ">=5.2"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.1.x-dev"
}
},
"autoload": {
"classmap": [
"libs/Smarty.class.php",
"libs/SmartyBC.class.php",
"libs/sysplugins/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-3.0"
],
"authors": [
{
"name": "Monte Ohrt",
"email": "monte@ohrt.com"
},
{
"name": "Uwe Tews",
"email": "uwe.tews@googlemail.com"
},
{
"name": "Rodney Rehm",
"email": "rodney.rehm@medialize.de"
}
],
"description": "Smarty - the compiling PHP template engine",
"homepage": "http://www.smarty.net",
"keywords": [
"templating"
],
"time": "2015-06-18 00:55:59"
}
],
"packages-dev": [
{
"name": "doctrine/instantiator",
"version": "1.0.5",
"source": {
"type": "git",
"url": "https://github.com/doctrine/instantiator.git",
"reference": "8e884e78f9f0eb1329e445619e04456e64d8051d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d",
"reference": "8e884e78f9f0eb1329e445619e04456e64d8051d",
"shasum": ""
},
"require": {
"php": ">=5.3,<8.0-DEV"
},
"require-dev": {
"athletic/athletic": "~0.1.8",
"ext-pdo": "*",
"ext-phar": "*",
"phpunit/phpunit": "~4.0",
"squizlabs/php_codesniffer": "~2.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Marco Pivetta",
"email": "ocramius@gmail.com",
"homepage": "http://ocramius.github.com/"
}
],
"description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
"homepage": "https://github.com/doctrine/instantiator",
"keywords": [
"constructor",
"instantiate"
],
"time": "2015-06-14 21:17:01"
},
{
"name": "phpdocumentor/reflection-docblock",
"version": "2.0.4",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
"reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8",
"reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"phpunit/phpunit": "~4.0"
},
"suggest": {
"dflydev/markdown": "~1.0",
"erusev/parsedown": "~1.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
}
},
"autoload": {
"psr-0": {
"phpDocumentor": [
"src/"
]
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mike van Riel",
"email": "mike.vanriel@naenius.com"
}
],
"time": "2015-02-03 12:10:50"
},
{
"name": "phpspec/prophecy",
"version": "v1.5.0",
"source": {
"type": "git",
"url": "https://github.com/phpspec/prophecy.git",
"reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/4745ded9307786b730d7a60df5cb5a6c43cf95f7",
"reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7",
"shasum": ""
},
"require": {
"doctrine/instantiator": "^1.0.2",
"phpdocumentor/reflection-docblock": "~2.0",
"sebastian/comparator": "~1.1"
},
"require-dev": {
"phpspec/phpspec": "~2.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.4.x-dev"
}
},
"autoload": {
"psr-0": {
"Prophecy\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Konstantin Kudryashov",
"email": "ever.zet@gmail.com",
"homepage": "http://everzet.com"
},
{
"name": "Marcello Duarte",
"email": "marcello.duarte@gmail.com"
}
],
"description": "Highly opinionated mocking framework for PHP 5.3+",
"homepage": "https://github.com/phpspec/prophecy",
"keywords": [
"Double",
"Dummy",
"fake",
"mock",
"spy",
"stub"
],
"time": "2015-08-13 10:07:40"
},
{
"name": "phpunit/php-code-coverage",
"version": "2.2.2",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
"reference": "2d7c03c0e4e080901b8f33b2897b0577be18a13c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2d7c03c0e4e080901b8f33b2897b0577be18a13c",
"reference": "2d7c03c0e4e080901b8f33b2897b0577be18a13c",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"phpunit/php-file-iterator": "~1.3",
"phpunit/php-text-template": "~1.2",
"phpunit/php-token-stream": "~1.3",
"sebastian/environment": "^1.3.2",
"sebastian/version": "~1.0"
},
"require-dev": {
"ext-xdebug": ">=2.1.4",
"phpunit/phpunit": "~4"
},
"suggest": {
"ext-dom": "*",
"ext-xdebug": ">=2.2.1",
"ext-xmlwriter": "*"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.2.x-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sb@sebastian-bergmann.de",
"role": "lead"
}
],
"description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
"homepage": "https://github.com/sebastianbergmann/php-code-coverage",
"keywords": [
"coverage",
"testing",
"xunit"
],
"time": "2015-08-04 03:42:39"
},
{
"name": "phpunit/php-file-iterator",
"version": "1.4.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-file-iterator.git",
"reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0",
"reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.4.x-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sb@sebastian-bergmann.de",
"role": "lead"
}
],
"description": "FilterIterator implementation that filters files based on a list of suffixes.",
"homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
"keywords": [
"filesystem",
"iterator"
],
"time": "2015-06-21 13:08:43"
},
{
"name": "phpunit/php-text-template",
"version": "1.2.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-text-template.git",
"reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
"reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"type": "library",
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de",
"role": "lead"
}
],
"description": "Simple template engine.",
"homepage": "https://github.com/sebastianbergmann/php-text-template/",
"keywords": [
"template"
],
"time": "2015-06-21 13:50:34"
},
{
"name": "phpunit/php-timer",
"version": "1.0.7",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-timer.git",
"reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3e82f4e9fc92665fafd9157568e4dcb01d014e5b",
"reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"type": "library",
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sb@sebastian-bergmann.de",
"role": "lead"
}
],
"description": "Utility class for timing",
"homepage": "https://github.com/sebastianbergmann/php-timer/",
"keywords": [
"timer"
],
"time": "2015-06-21 08:01:12"
},
{
"name": "phpunit/php-token-stream",
"version": "1.4.6",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-token-stream.git",
"reference": "3ab72c62e550370a6cd5dc873e1a04ab57562f5b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3ab72c62e550370a6cd5dc873e1a04ab57562f5b",
"reference": "3ab72c62e550370a6cd5dc873e1a04ab57562f5b",
"shasum": ""
},
"require": {
"ext-tokenizer": "*",
"php": ">=5.3.3"
},
"require-dev": {
"phpunit/phpunit": "~4.2"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.4-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de"
}
],
"description": "Wrapper around PHP's tokenizer extension.",
"homepage": "https://github.com/sebastianbergmann/php-token-stream/",
"keywords": [
"tokenizer"
],
"time": "2015-08-16 08:51:00"
},
{
"name": "phpunit/phpunit",
"version": "4.8.6",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "2246830f4a1a551c67933e4171bf2126dc29d357"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2246830f4a1a551c67933e4171bf2126dc29d357",
"reference": "2246830f4a1a551c67933e4171bf2126dc29d357",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-json": "*",
"ext-pcre": "*",
"ext-reflection": "*",
"ext-spl": "*",
"php": ">=5.3.3",
"phpspec/prophecy": "^1.3.1",
"phpunit/php-code-coverage": "~2.1",