[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Librefm-commits] [1476] Move licenses.php and resolve-external. php in
From: |
Michael Sheldon |
Subject: |
[Librefm-commits] [1476] Move licenses.php and resolve-external. php in to the utils directory and update references to them. |
Date: |
Sun, 10 May 2009 21:44:25 +0000 |
Revision: 1476
http://svn.sv.gnu.org/viewvc/?view=rev&root=librefm&revision=1476
Author: elleo
Date: 2009-05-10 21:44:24 +0000 (Sun, 10 May 2009)
Log Message:
-----------
Move licenses.php and resolve-external.php in to the utils directory and update
references to them.
Modified Paths:
--------------
trunk/nixtape/data/Album.php
trunk/nixtape/data/Server.php
trunk/nixtape/data/Track.php
Added Paths:
-----------
trunk/nixtape/utils/licenses.php
trunk/nixtape/utils/resolve-external.php
Removed Paths:
-------------
trunk/nixtape/licenses.php
trunk/nixtape/resolve-external.php
Modified: trunk/nixtape/data/Album.php
===================================================================
--- trunk/nixtape/data/Album.php 2009-05-10 20:25:16 UTC (rev 1475)
+++ trunk/nixtape/data/Album.php 2009-05-10 21:44:24 UTC (rev 1476)
@@ -22,7 +22,7 @@
require_once($install_path . '/database.php');
require_once($install_path . '/data/Artist.php');
require_once($install_path . '/data/Track.php');
-require_once($install_path . "/resolve-external.php");
+require_once($install_path . "/utils/resolve-external.php");
require_once($install_path . '/utils/linkeddata.php');
/**
Modified: trunk/nixtape/data/Server.php
===================================================================
--- trunk/nixtape/data/Server.php 2009-05-10 20:25:16 UTC (rev 1475)
+++ trunk/nixtape/data/Server.php 2009-05-10 21:44:24 UTC (rev 1476)
@@ -27,8 +27,8 @@
require_once($install_path . '/data/sanitize.php');
require_once($install_path . '/utils/linkeddata.php');
require_once($install_path . '/utils/arc/ARC2.php');
-require_once($install_path . '/resolve-external.php'); // why isn't this in a
subdir?
-require_once($install_path . '/licenses.php'); // why isn't this in a subdir?
+require_once($install_path . '/utils/resolve-external.php');
+require_once($install_path . '/utils/licenses.php');
/**
* Provides access to server-wide data
Modified: trunk/nixtape/data/Track.php
===================================================================
--- trunk/nixtape/data/Track.php 2009-05-10 20:25:16 UTC (rev 1475)
+++ trunk/nixtape/data/Track.php 2009-05-10 21:44:24 UTC (rev 1476)
@@ -24,8 +24,8 @@
require_once($install_path . '/data/Artist.php');
require_once($install_path . '/data/Album.php');
require_once($install_path . '/data/Server.php');
-require_once($install_path . '/resolve-external.php');
-require_once($install_path . '/licenses.php');
+require_once($install_path . '/utils/resolve-external.php');
+require_once($install_path . '/utils/licenses.php');
require_once($install_path . '/utils/linkeddata.php');
/**
Deleted: trunk/nixtape/licenses.php
===================================================================
--- trunk/nixtape/licenses.php 2009-05-10 20:25:16 UTC (rev 1475)
+++ trunk/nixtape/licenses.php 2009-05-10 21:44:24 UTC (rev 1476)
@@ -1,41 +0,0 @@
-<?php
-define('BY1', 1);
-define('BY2', 2);
-define('BY21', 3);
-define('BY25', 4);
-define('BY3', 5);
-define('BYSA1', 6);
-define('BYSA2', 7);
-define('BYSA21', 8);
-define('BYSA25', 9);
-define('BYSA3', 10);
-define('LAL', 11);
-
-// Arrays containing regular expressions for each license type
-// (so we can support multiple URL formats in the future if needed)
-$by1 = array('http://creativecommons.org/licenses/by/1.0/?.*');
-$by2 = array('http://creativecommons.org/licenses/by/2.0/?.*');
-$by21 = array('http://creativecommons.org/licenses/by/2.1/?.*');
-$by25 = array('http://creativecommons.org/licenses/by/2.5/?.*');
-$by3 = array('http://creativecommons.org/licenses/by/3.0/?.*');
-$bysa1 = array('http://creativecommons.org/licenses/by-sa/1.0/?.*');
-$bysa2 = array('http://creativecommons.org/licenses/by-sa/2.0/?.*');
-$bysa21 = array('http://creativecommons.org/licenses/by-sa/2.1/?.*');
-$bysa25 = array('http://creativecommons.org/licenses/by-sa/2.5/?.*');
-$bysa3 = array('http://creativecommons.org/licenses/by-sa/3.0/?.*');
-$lal = array('http://artlibre.org/licence.php/lal.html');
-
-// map licenses to ids by array position
-$licenses = array(array(), $by1, $by2, $by21, $by25, $by3, $bysa1, $bysa2,
$bysa21, $bysa25, $bysa3, $lal);
-
-function simplify_license($license) {
- global $licenses;
-
- foreach ($licenses as $key => $l) {
- foreach ($l as $urlschema) {
- if (ereg($urlschema, $license)) return $key;
- }
- }
-
- return 0;
-}
Deleted: trunk/nixtape/resolve-external.php
===================================================================
--- trunk/nixtape/resolve-external.php 2009-05-10 20:25:16 UTC (rev 1475)
+++ trunk/nixtape/resolve-external.php 2009-05-10 21:44:24 UTC (rev 1476)
@@ -1,30 +0,0 @@
-<?php
-function resolve_external_url($url) {
- if (substr($url, 0, 10) == 'jamendo://') {
- return process_jamendo_url($url);
- }
-
- return $url;
-}
-
-function process_jamendo_url($url) {
- if (substr($url, 10, 13) == 'track/stream/') {
- $id = substr($url, 23);
- return 'http://api.jamendo.com/get2/stream/track/redirect/?id='
. $id . '&streamencoding=ogg2';
- }
-
- if (substr($url, 10, 15) == 'album/download/') {
- $id = substr($url, 25);
- return
'http://api.jamendo.com/get2/bittorrent/file/plain/?album_id=' . $id .
'&type=archive&class=ogg3';
- }
-
- if (substr($url, 10, 10) == 'album/art/') {
- $id = substr($url, 20);
- return 'http://api.jamendo.com/get2/image/album/redirect/?id='
. $id . '&imagesize=200';
- }
-
- // We don't know what this is
- return $url;
-}
-
-?>
Copied: trunk/nixtape/utils/licenses.php (from rev 1474,
trunk/nixtape/licenses.php)
===================================================================
--- trunk/nixtape/utils/licenses.php (rev 0)
+++ trunk/nixtape/utils/licenses.php 2009-05-10 21:44:24 UTC (rev 1476)
@@ -0,0 +1,41 @@
+<?php
+define('BY1', 1);
+define('BY2', 2);
+define('BY21', 3);
+define('BY25', 4);
+define('BY3', 5);
+define('BYSA1', 6);
+define('BYSA2', 7);
+define('BYSA21', 8);
+define('BYSA25', 9);
+define('BYSA3', 10);
+define('LAL', 11);
+
+// Arrays containing regular expressions for each license type
+// (so we can support multiple URL formats in the future if needed)
+$by1 = array('http://creativecommons.org/licenses/by/1.0/?.*');
+$by2 = array('http://creativecommons.org/licenses/by/2.0/?.*');
+$by21 = array('http://creativecommons.org/licenses/by/2.1/?.*');
+$by25 = array('http://creativecommons.org/licenses/by/2.5/?.*');
+$by3 = array('http://creativecommons.org/licenses/by/3.0/?.*');
+$bysa1 = array('http://creativecommons.org/licenses/by-sa/1.0/?.*');
+$bysa2 = array('http://creativecommons.org/licenses/by-sa/2.0/?.*');
+$bysa21 = array('http://creativecommons.org/licenses/by-sa/2.1/?.*');
+$bysa25 = array('http://creativecommons.org/licenses/by-sa/2.5/?.*');
+$bysa3 = array('http://creativecommons.org/licenses/by-sa/3.0/?.*');
+$lal = array('http://artlibre.org/licence.php/lal.html');
+
+// map licenses to ids by array position
+$licenses = array(array(), $by1, $by2, $by21, $by25, $by3, $bysa1, $bysa2,
$bysa21, $bysa25, $bysa3, $lal);
+
+function simplify_license($license) {
+ global $licenses;
+
+ foreach ($licenses as $key => $l) {
+ foreach ($l as $urlschema) {
+ if (ereg($urlschema, $license)) return $key;
+ }
+ }
+
+ return 0;
+}
Property changes on: trunk/nixtape/utils/licenses.php
___________________________________________________________________
Added: svn:mergeinfo
+
Copied: trunk/nixtape/utils/resolve-external.php (from rev 1474,
trunk/nixtape/resolve-external.php)
===================================================================
--- trunk/nixtape/utils/resolve-external.php (rev 0)
+++ trunk/nixtape/utils/resolve-external.php 2009-05-10 21:44:24 UTC (rev
1476)
@@ -0,0 +1,30 @@
+<?php
+function resolve_external_url($url) {
+ if (substr($url, 0, 10) == 'jamendo://') {
+ return process_jamendo_url($url);
+ }
+
+ return $url;
+}
+
+function process_jamendo_url($url) {
+ if (substr($url, 10, 13) == 'track/stream/') {
+ $id = substr($url, 23);
+ return 'http://api.jamendo.com/get2/stream/track/redirect/?id='
. $id . '&streamencoding=ogg2';
+ }
+
+ if (substr($url, 10, 15) == 'album/download/') {
+ $id = substr($url, 25);
+ return
'http://api.jamendo.com/get2/bittorrent/file/plain/?album_id=' . $id .
'&type=archive&class=ogg3';
+ }
+
+ if (substr($url, 10, 10) == 'album/art/') {
+ $id = substr($url, 20);
+ return 'http://api.jamendo.com/get2/image/album/redirect/?id='
. $id . '&imagesize=200';
+ }
+
+ // We don't know what this is
+ return $url;
+}
+
+?>
Property changes on: trunk/nixtape/utils/resolve-external.php
___________________________________________________________________
Added: svn:mergeinfo
+
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Librefm-commits] [1476] Move licenses.php and resolve-external. php in to the utils directory and update references to them.,
Michael Sheldon <=