]> git.mxchange.org Git - friendica.git/commitdiff
Merge remote-tracking branch 'upstream/master'
authorMichael Vogel <icarus@dabo.de>
Sun, 11 Aug 2013 19:20:36 +0000 (21:20 +0200)
committerMichael Vogel <icarus@dabo.de>
Sun, 11 Aug 2013 19:20:36 +0000 (21:20 +0200)
12 files changed:
include/Photo.php
include/cli_startup.php
include/config.php
include/cronhooks.php
include/delivery.php
include/expire.php
include/gprobe.php
include/notifier.php
include/onepoll.php
include/poller.php
include/queue.php
index.php

index 69b08f62919bc7fe81855238ff9fea847dff556c..f1c9128d36de7c30c0430f218f55bc816fe61b74 100644 (file)
@@ -534,6 +534,9 @@ class Photo {
 
         ob_start();
 
+       // Enable interlacing
+       imageinterlace($this->image, true);
+
         switch($this->getType()){
             case "image/png":
                 $quality = get_config('system','png_quality');
@@ -676,6 +679,7 @@ function guess_image_type($filename, $fromcurl=false) {
              */
             $image = new Imagick($filename);
             $type = $image->getImageMimeType();
+            $image->setInterlaceScheme(Imagick::INTERLACE_PLANE);
         } else {
             $ext = pathinfo($filename, PATHINFO_EXTENSION);
             $types = Photo::supportedTypes();
index e069ec2c989c3a333cd21d7a401dc04f3ee168a7..236fd14427b3a4d608b14922fdf714e4755c457e 100644 (file)
@@ -24,8 +24,11 @@ function cli_startup() {
        load_config('config');
        load_config('system');
 
+       if ($hostname =  get_config('system', 'hostname'))
+               $a->set_hostname($hostname);
+
        $a->set_baseurl(get_config('system','url'));
 
        load_hooks();
 
-}
\ No newline at end of file
+}
index af44f6cc2c3f6f01e18d586622b6c2e44d0d4064..ce30d2d192ce12be96b17a5d7d7b893f52e934d4 100644 (file)
@@ -18,6 +18,9 @@
 if(! function_exists('load_config')) {
 function load_config($family) {
        global $a;
+
+       // To-Do: How to integrate APC here?
+
        $r = q("SELECT * FROM `config` WHERE `cat` = '%s'", dbesc($family));
        if(count($r)) {
                foreach($r as $rr) {
@@ -67,9 +70,17 @@ function get_config($family, $key, $instore = false) {
        if (function_exists("apc_fetch") AND function_exists("apc_exists"))
                if (apc_exists($family."|".$key)) {
                        $val = apc_fetch($family."|".$key);
+                       //logger("APC: fetched stored value ".$family."|".$key, LOGGER_DEBUG);
                        $a->config[$family][$key] = $val;
-                       return $val;
+
+                       if ($val === '!<unset>!')
+                               return false;
+                       else
+                               return $val;
                }
+                       // else
+                       //logger("APC: cache miss for value ".$family."|".$key, LOGGER_DEBUG);
+
 
        $ret = q("SELECT `v` FROM `config` WHERE `cat` = '%s' AND `k` = '%s' LIMIT 1",
                dbesc($family),
@@ -79,10 +90,19 @@ function get_config($family, $key, $instore = false) {
                // manage array value
                $val = (preg_match("|^a:[0-9]+:{.*}$|s", $ret[0]['v'])?unserialize( $ret[0]['v']):$ret[0]['v']);
                $a->config[$family][$key] = $val;
+
+               // If APC is enabled then store the data there
+               if (function_exists("apc_store"))
+                       apc_store($family."|".$key, $val, 600);
+
                return $val;
        }
        else {
                $a->config[$family][$key] = '!<unset>!';
+
+               // If APC is enabled then store the data there
+               if (function_exists("apc_store"))
+                       apc_store($family."|".$key, '!<unset>!', 600);
        }
        return false;
 }}
@@ -181,9 +201,16 @@ function get_pconfig($uid,$family, $key, $instore = false) {
        if (function_exists("apc_fetch") AND function_exists("apc_exists"))
                if (apc_exists($uid."|".$family."|".$key)) {
                        $val = apc_fetch($uid."|".$family."|".$key);
+                       //logger("APC: fetched stored value ".$uid."|".$family."|".$key, LOGGER_DEBUG);
                        $a->config[$uid][$family][$key] = $val;
-                       return $val;
-               }
+
+                       if ($val === '!<unset>!')
+                               return false;
+                       else
+                               return $val;
+               } // else
+                       //logger("APC: cache miss for value ".$family."|".$key, LOGGER_DEBUG);
+
 
        $ret = q("SELECT `v` FROM `pconfig` WHERE `uid` = %d AND `cat` = '%s' AND `k` = '%s' LIMIT 1",
                intval($uid),
@@ -194,10 +221,19 @@ function get_pconfig($uid,$family, $key, $instore = false) {
        if(count($ret)) {
                $val = (preg_match("|^a:[0-9]+:{.*}$|s", $ret[0]['v'])?unserialize( $ret[0]['v']):$ret[0]['v']);
                $a->config[$uid][$family][$key] = $val;
+
+               // If APC is enabled then store the data there
+               if (function_exists("apc_store"))
+                       apc_store($uid."|".$family."|".$key, $val, 600);
+
                return $val;
        }
        else {
                $a->config[$uid][$family][$key] = '!<unset>!';
+
+               // If APC is enabled then store the data there
+               if (function_exists("apc_store"))
+                       apc_store($uid."|".$family."|".$key, '!<unset>!', 600);
        }
        return false;
 }}
index 15d49fe5474b32101c60ff5ba90b58c383f1ac39..096e10b718bd8ea51ff338f1b7a0bfa3e952c824 100644 (file)
@@ -24,6 +24,9 @@ function cronhooks_run(&$argv, &$argc){
        load_config('config');
        load_config('system');
 
+       if ($hostname =  get_config('system', 'hostname'))
+               $a->set_hostname($hostname);
+
        $lockpath = get_config('system','lockpath');
        if ($lockpath != '') {
                $pidfile = new pidfile($lockpath, 'cron.lck');
index d89cded9eb10ed7ecf082d25f0dbef8989109e45..515f286e0fc59db568fcd6227b5af74c4d02224a 100644 (file)
@@ -27,6 +27,9 @@ function delivery_run(&$argv, &$argc){
        load_config('config');
        load_config('system');
 
+       if ($hostname =  get_config('system', 'hostname'))
+               $a->set_hostname($hostname);
+
        load_hooks();
 
        if($argc < 3)
index 4c6fb7a19dd3e1bd37f79cda4eccd38299615a6c..fe1007efd58b006e5e53ae0ebc1639f59b4ce4ed 100644 (file)
@@ -25,6 +25,8 @@ function expire_run(&$argv, &$argc){
        load_config('config');
        load_config('system');
 
+       if ($hostname =  get_config('system', 'hostname'))
+               $a->set_hostname($hostname);
 
        $a->set_baseurl(get_config('system','url'));
 
index 0cf32e95fe9311f04cffeeb1cd5089eb3cb5d119..00a8e562af07f950b73a73b6265ebf332fa803a1 100644 (file)
@@ -24,6 +24,9 @@ function gprobe_run(&$argv, &$argc){
        load_config('config');
        load_config('system');
 
+       if ($hostname =  get_config('system', 'hostname'))
+               $a->set_hostname($hostname);
+
        $a->set_baseurl(get_config('system','url'));
 
        load_hooks();
index a3286355ddabb371578c990abbae967dda6764de..a90e180623ace698fbc12737fa00e3b78eca1bea 100644 (file)
@@ -65,6 +65,9 @@ function notifier_run(&$argv, &$argc){
        load_config('config');
        load_config('system');
 
+       if ($hostname =  get_config('system', 'hostname'))
+               $a->set_hostname($hostname);
+
        load_hooks();
 
        if($argc < 3)
index f38f6b4c61d88fbf54528267d3940e52f64530d5..737f70a28673701831c5dcf5390d3760f06b05f7 100644 (file)
@@ -37,6 +37,9 @@ function onepoll_run(&$argv, &$argc){
        load_config('config');
        load_config('system');
 
+       if ($hostname =  get_config('system', 'hostname'))
+               $a->set_hostname($hostname);
+
        $a->set_baseurl(get_config('system','url'));
 
        load_hooks();
index e927430ea9e7ef6ab2831a2b35869c85d7fb7503..0bbead189109062495c8640b9b9e0e9f3b1e8c6d 100644 (file)
@@ -30,6 +30,9 @@ function poller_run(&$argv, &$argc){
        load_config('config');
        load_config('system');
 
+       if ($hostname =  get_config('system', 'hostname'))
+               $a->set_hostname($hostname);
+
        $maxsysload = intval(get_config('system','maxloadavg'));
        if($maxsysload < 1)
                $maxsysload = 50;
index 64cccad21efe4f796a50e39b480da75415da7d12..f277b3fbd4ec4a8f08c4c1b2f1f53db07c128070 100644 (file)
@@ -25,6 +25,9 @@ function queue_run(&$argv, &$argc){
        load_config('config');
        load_config('system');
 
+       if ($hostname =  get_config('system', 'hostname'))
+               $a->set_hostname($hostname);
+
        $a->set_baseurl(get_config('system','url'));
 
        load_hooks();
index 6b6e873ea6b1987a20206b5bdcbabd2cdda9bccc..67c0c495cf9316994d77926214bc7021da605786 100644 (file)
--- a/index.php
+++ b/index.php
@@ -53,6 +53,9 @@ if(!$install) {
        load_config('config');
        load_config('system');
 
+       if ($hostname =  get_config('system', 'hostname'))
+               $a->set_hostname($hostname);
+
        require_once("include/session.php");
        load_hooks();
        call_hooks('init_1');