Move Cache to src

relocate the cache class to Friendica\Core namespace
This commit is contained in:
Adam Magness
2017-11-09 11:05:18 -05:00
parent 8b673bf78d
commit 06c3af9b60
21 changed files with 1177 additions and 728 deletions
+313 -257
View File
File diff suppressed because it is too large Load Diff
+1
View File
@@ -5,6 +5,7 @@
*/
use Friendica\App;
use Friendica\Core\Cache;
use Friendica\Core\Config;
use Friendica\Core\System;
use Friendica\Database\DBM;
+1
View File
@@ -1,6 +1,7 @@
<?php
use Friendica\App;
use Friendica\Core\Cache;
use Friendica\Core\System;
use Friendica\Core\Config;
+1
View File
@@ -1,6 +1,7 @@
<?php
use Friendica\App;
use Friendica\Core\Cache;
use Friendica\Core\Config;
use Friendica\Database\DBM;
use Friendica\Network\Probe;
+1 -1
View File
@@ -1,5 +1,5 @@
<?php
use Friendica\Core\Cache;
use Friendica\Core\Config;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
+1 -1
View File
@@ -1,5 +1,5 @@
<?php
use Friendica\Core\Cache;
use Friendica\Core\Config;
use Friendica\Database\DBM;
use Friendica\Network\Probe;
+206 -157
View File
@@ -4,6 +4,7 @@
*/
use Friendica\App;
use Friendica\Core\Cache;
use Friendica\Core\Config;
use Friendica\Core\PConfig;
use Friendica\Core\System;
@@ -13,7 +14,6 @@ use Friendica\Database\DBM;
require_once 'include/ForumManager.php';
require_once 'include/bbcode.php';
require_once 'mod/proxy.php';
require_once 'include/cache.php';
/**
*
@@ -34,20 +34,21 @@ require_once 'include/cache.php';
* the theme is chosen before the _init() function of a theme is run, which will usually
* load a lot of theme-specific content
*
* @param App $a
* @param string $nickname
* @param int $profile
* @param array $profiledata
* @param object $a App
* @param string $nickname string
* @param int $profile int
* @param array $profiledata array
*/
function profile_load(App $a, $nickname, $profile = 0, $profiledata = array()) {
$user = q("SELECT `uid` FROM `user` WHERE `nickname` = '%s' LIMIT 1",
function profile_load(App $a, $nickname, $profile = 0, $profiledata = array())
{
$user = q(
"SELECT `uid` FROM `user` WHERE `nickname` = '%s' LIMIT 1",
dbesc($nickname)
);
if (!$user && count($user) && !count($profiledata)) {
logger('profile error: ' . $a->query_string, LOGGER_DEBUG);
notice( t('Requested account is not available.') . EOL );
notice(t('Requested account is not available.') . EOL);
$a->error = 404;
return;
}
@@ -56,7 +57,7 @@ function profile_load(App $a, $nickname, $profile = 0, $profiledata = array()) {
if (empty($pdata) && empty($profiledata)) {
logger('profile error: ' . $a->query_string, LOGGER_DEBUG);
notice( t('Requested profile is not available.') . EOL );
notice(t('Requested profile is not available.') . EOL);
$a->error = 404;
return;
}
@@ -64,8 +65,9 @@ function profile_load(App $a, $nickname, $profile = 0, $profiledata = array()) {
// fetch user tags if this isn't the default profile
if (!$pdata['is-default']) {
$x = q("SELECT `pub_keywords` FROM `profile` WHERE `uid` = %d AND `is-default` = 1 LIMIT 1",
intval($pdata['profile_uid'])
$x = q(
"SELECT `pub_keywords` FROM `profile` WHERE `uid` = %d AND `is-default` = 1 LIMIT 1",
intval($pdata['profile_uid'])
);
if ($x && count($x))
$pdata['pub_keywords'] = $x[0]['pub_keywords'];
@@ -79,8 +81,9 @@ function profile_load(App $a, $nickname, $profile = 0, $profiledata = array()) {
$a->page['title'] = $a->profile['name'] . " @ " . $a->config['sitename'];
if (!$profiledata && !PConfig::get(local_user(),'system','always_my_theme'))
$_SESSION['theme'] = $a->profile['theme'];
if (!$profiledata && !PConfig::get(local_user(), 'system', 'always_my_theme')) {
$_SESSION['theme'] = $a->profile['theme'];
}
$_SESSION['mobile-theme'] = $a->profile['mobile-theme'];
@@ -92,30 +95,35 @@ function profile_load(App $a, $nickname, $profile = 0, $profiledata = array()) {
$theme_info_file = "view/theme/" . current_theme() . "/theme.php";
if (file_exists($theme_info_file)) {
require_once $theme_info_file;
include_once $theme_info_file;
}
if (! (x($a->page,'aside')))
if (! (x($a->page, 'aside'))) {
$a->page['aside'] = '';
}
if (local_user() && local_user() == $a->profile['uid'] && $profiledata) {
$a->page['aside'] .= replace_macros(get_markup_template('profile_edlink.tpl'),array(
'$editprofile' => t('Edit profile'),
'$profid' => $a->profile['id']
));