X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=boot.php;h=4deafe317c279c1a4a514e4d19ee34d2cc742b2e;hb=013d2604f886bc7cbd2c5263d3577e8cf40f9fcc;hp=7bf3e75a6b2de3a7b8e9f78e842899e1a347a8be;hpb=036964de4d86f0109ece00cc9394b2a044c06c1e;p=friendica.git
diff --git a/boot.php b/boot.php
index 7bf3e75a6b..4deafe317c 100644
--- a/boot.php
+++ b/boot.php
@@ -2,7 +2,7 @@
set_time_limit(0);
-define ( 'BUILD_ID' , 1005 );
+define ( 'BUILD_ID' , 1007 );
define ( 'EOL', "
\r\n");
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
@@ -28,6 +28,7 @@ define ( 'NAMESPACE_THREAD' , 'http://purl.org/syndication/thread/1.0' )
define ( 'NAMESPACE_TOMB' , 'http://purl.org/atompub/tombstones/1.0' );
define ( 'NAMESPACE_ACTIVITY', 'http://activitystrea.ms/spec/1.0/' );
define ( 'NAMESPACE_ACTIVITY_SCHEMA', 'http://activitystrea.ms/schema/1.0/');
+define ( 'NAMESPACE_SALMON_ME', 'http://salmon-protocol.org/ns/magic-env');
define ( 'ACTIVITY_LIKE', NAMESPACE_ACTIVITY_SCHEMA . 'like' );
define ( 'ACTIVITY_DISLIKE', NAMESPACE_DFRN . '/dislike' );
@@ -169,6 +170,15 @@ class App {
}}
+// retrieve the App structure
+// useful in functions which require it but don't get it passed to them
+
+if(! function_exists('get_app')) {
+function get_app() {
+ global $a;
+ return $a;
+}};
+
// Multi-purpose function to check variable state.
// Usage: x($var) or $x($array,'key')
@@ -226,7 +236,6 @@ function check_config(&$a) {
$stored = intval($build);
$current = intval(BUILD_ID);
if(($stored < $current) && file_exists('update.php')) {
-
// We're reporting a different version than what is currently installed.
// Run any existing update scripts to bring the database up to current.
@@ -269,19 +278,21 @@ function replace_macros($s,$r) {
// load string tranlsation table for alternate language
-// not yet implemented
if(! function_exists('load_translation_table')) {
function load_translation_table($lang) {
global $a;
+ if(file_exists("view/$lang/strings.php"))
+ include("view/$lang/strings.php");
}}
// translate string if translation exists
if(! function_exists('t')) {
function t($s) {
- global $a;
+
+ $a = get_app();
if($a->strings[$s])
return $a->strings[$s];
@@ -488,14 +499,18 @@ function goaway($s) {
}}
// Generic XML return
-// Outputs a basic XML status structure to STDOUT, with a value variable
-// of $st and terminates the current process.
+// Outputs a basic dfrn XML status structure to STDOUT, with a variable
+// of $st and an optional text of $message and terminates the current process.
if(! function_exists('xml_status')) {
-function xml_status($st) {
+function xml_status($st, $message = '') {
+
+ if(strlen($message))
+ $xml_message = "\t" . xmlify($message) . "\r\n";
+
header( "Content-type: text/xml" );
echo ''."\r\n";
- echo "$st\r\n";
+ echo "\r\n\t$st\r\n$xml_message\r\n";
killme();
}}