Use use instead of \

This commit is contained in:
Hypolite Petovan 2017-05-11 11:53:04 -04:00
parent bc724f2b68
commit 39f894bd4a
5 changed files with 97 additions and 71 deletions

View file

@ -5,6 +5,13 @@ namespace Friendica;
use Friendica\Core\Config;
use Friendica\Core\PConfig;
use Cache;
use dbm;
use Detection\MobileDetect;
use Exception;
/**
*
* class: App
@ -192,7 +199,7 @@ class App {
}
if (! static::directory_usable($basepath, false)) {
throw new \Exception('Basepath ' . $basepath . ' isn\'t usable.');
throw new Exception('Basepath ' . $basepath . ' isn\'t usable.');
}
$this->basepath = rtrim($basepath, DIRECTORY_SEPARATOR);
@ -276,7 +283,7 @@ class App {
$this->pager['total'] = 0;
// Detect mobile devices
$mobile_detect = new \Mobile_Detect();
$mobile_detect = new MobileDetect();
$this->is_mobile = $mobile_detect->isMobile();
$this->is_tablet = $mobile_detect->isTablet();
@ -687,7 +694,7 @@ class App {
q('START TRANSACTION');
$r = q('SELECT `pid` FROM `process` WHERE `pid` = %d', intval(getmypid()));
if (!\dbm::is_result($r)) {
if (!dbm::is_result($r)) {
q("INSERT INTO `process` (`pid`,`command`,`created`) VALUES (%d, '%s', '%s')", intval(getmypid()), dbesc($command), dbesc(datetime_convert()));
}
q('COMMIT');
@ -700,7 +707,7 @@ class App {
q('START TRANSACTION');
$r = q('SELECT `pid` FROM `process`');
if (\dbm::is_result($r)) {
if (dbm::is_result($r)) {
foreach ($r AS $process) {
if (!posix_kill($process['pid'], 0)) {
q('DELETE FROM `process` WHERE `pid` = %d', intval($process['pid']));
@ -805,7 +812,7 @@ class App {
}
}
$processlist = \dbm::processlist();
$processlist = dbm::processlist();
if ($processlist['list'] != '') {
logger('Processcheck: Processes: ' . $processlist['amount'] . ' - Processlist: ' . $processlist['list'], LOGGER_DEBUG);
@ -896,14 +903,14 @@ class App {
// If the last worker fork was less than 10 seconds before then don't fork another one.
// This should prevent the forking of masses of workers.
$cachekey = 'app:proc_run:started';
$result = \Cache::get($cachekey);
$result = Cache::get($cachekey);
if (!is_null($result) AND ( time() - $result) < 10) {
return;
}
// Set the timestamp of the last proc_run
\Cache::set($cachekey, time(), CACHE_MINUTE);
Cache::set($cachekey, time(), CACHE_MINUTE);
array_unshift($args, ((x($this->config, 'php_path')) && (strlen($this->config['php_path'])) ? $this->config['php_path'] : 'php'));