diff options
author | nodiscc <nodiscc@gmail.com> | 2015-06-26 22:03:10 +0200 |
---|---|---|
committer | nodiscc <nodiscc@gmail.com> | 2015-06-26 22:03:10 +0200 |
commit | 2fbadc3c631e0c7e32b9b956fb5551822729bc33 (patch) | |
tree | 1325de9b3e2c83bc501ab7a977fcbd0fbe4490d5 /index.php | |
parent | da9b0e3e807f05831c00b2f02a16b76eafbb6743 (diff) | |
parent | 9c8752a2061e67c719125edb6e0d6717d1af8553 (diff) | |
download | Shaarli-2fbadc3c631e0c7e32b9b956fb5551822729bc33.tar.gz Shaarli-2fbadc3c631e0c7e32b9b956fb5551822729bc33.tar.zst Shaarli-2fbadc3c631e0c7e32b9b956fb5551822729bc33.zip |
Merge remote-tracking branch 'virtualtam/linkdb/remove-globals'
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -41,8 +41,6 @@ $GLOBALS['config']['HIDE_PUBLIC_LINKS'] = false; | |||
41 | if (is_file($GLOBALS['config']['DATADIR'].'/options.php')) require($GLOBALS['config']['DATADIR'].'/options.php'); | 41 | if (is_file($GLOBALS['config']['DATADIR'].'/options.php')) require($GLOBALS['config']['DATADIR'].'/options.php'); |
42 | 42 | ||
43 | define('shaarli_version','0.0.45beta'); | 43 | define('shaarli_version','0.0.45beta'); |
44 | define('PHPPREFIX','<?php /* '); // Prefix to encapsulate data in PHP code. | ||
45 | define('PHPSUFFIX',' */ ?>'); // Suffix to encapsulate data in PHP code. | ||
46 | // http://server.com/x/shaarli --> /shaarli/ | 44 | // http://server.com/x/shaarli --> /shaarli/ |
47 | define('WEB_PATH', substr($_SERVER["REQUEST_URI"], 0, 1+strrpos($_SERVER["REQUEST_URI"], '/', 0))); | 45 | define('WEB_PATH', substr($_SERVER["REQUEST_URI"], 0, 1+strrpos($_SERVER["REQUEST_URI"], '/', 0))); |
48 | 46 | ||
@@ -700,6 +698,7 @@ function showRSS() | |||
700 | 698 | ||
701 | // If cached was not found (or not usable), then read the database and build the response: | 699 | // If cached was not found (or not usable), then read the database and build the response: |
702 | $LINKSDB = new LinkDB( | 700 | $LINKSDB = new LinkDB( |
701 | $GLOBALS['config']['DATASTORE'], | ||
703 | isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI'], | 702 | isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI'], |
704 | $GLOBALS['config']['HIDE_PUBLIC_LINKS'] | 703 | $GLOBALS['config']['HIDE_PUBLIC_LINKS'] |
705 | ); | 704 | ); |
@@ -780,6 +779,7 @@ function showATOM() | |||
780 | 779 | ||
781 | // Read links from database (and filter private links if used it not logged in). | 780 | // Read links from database (and filter private links if used it not logged in). |
782 | $LINKSDB = new LinkDB( | 781 | $LINKSDB = new LinkDB( |
782 | $GLOBALS['config']['DATASTORE'], | ||
783 | isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI'], | 783 | isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI'], |
784 | $GLOBALS['config']['HIDE_PUBLIC_LINKS'] | 784 | $GLOBALS['config']['HIDE_PUBLIC_LINKS'] |
785 | ); | 785 | ); |
@@ -866,6 +866,7 @@ function showDailyRSS() | |||
866 | 866 | ||
867 | // Read links from database (and filter private links if used it not logged in). | 867 | // Read links from database (and filter private links if used it not logged in). |
868 | $LINKSDB = new LinkDB( | 868 | $LINKSDB = new LinkDB( |
869 | $GLOBALS['config']['DATASTORE'], | ||
869 | isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI'], | 870 | isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI'], |
870 | $GLOBALS['config']['HIDE_PUBLIC_LINKS'] | 871 | $GLOBALS['config']['HIDE_PUBLIC_LINKS'] |
871 | ); | 872 | ); |
@@ -937,6 +938,7 @@ function showDailyRSS() | |||
937 | function showDaily() | 938 | function showDaily() |
938 | { | 939 | { |
939 | $LINKSDB = new LinkDB( | 940 | $LINKSDB = new LinkDB( |
941 | $GLOBALS['config']['DATASTORE'], | ||
940 | isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI'], | 942 | isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI'], |
941 | $GLOBALS['config']['HIDE_PUBLIC_LINKS'] | 943 | $GLOBALS['config']['HIDE_PUBLIC_LINKS'] |
942 | ); | 944 | ); |
@@ -1006,6 +1008,7 @@ function showDaily() | |||
1006 | function renderPage() | 1008 | function renderPage() |
1007 | { | 1009 | { |
1008 | $LINKSDB = new LinkDB( | 1010 | $LINKSDB = new LinkDB( |
1011 | $GLOBALS['config']['DATASTORE'], | ||
1009 | isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI'], | 1012 | isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI'], |
1010 | $GLOBALS['config']['HIDE_PUBLIC_LINKS'] | 1013 | $GLOBALS['config']['HIDE_PUBLIC_LINKS'] |
1011 | ); | 1014 | ); |
@@ -1587,6 +1590,7 @@ function importFile() | |||
1587 | { | 1590 | { |
1588 | if (!(isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI'])) { die('Not allowed.'); } | 1591 | if (!(isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI'])) { die('Not allowed.'); } |
1589 | $LINKSDB = new LinkDB( | 1592 | $LINKSDB = new LinkDB( |
1593 | $GLOBALS['config']['DATASTORE'], | ||
1590 | isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI'], | 1594 | isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI'], |
1591 | $GLOBALS['config']['HIDE_PUBLIC_LINKS'] | 1595 | $GLOBALS['config']['HIDE_PUBLIC_LINKS'] |
1592 | ); | 1596 | ); |