From 4d00c480263e857eb52dcf8d0a6f08370881c8ee Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 12 May 2016 16:11:38 -0700 Subject: back merge --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index b76e95c4f..9dbd4ead4 100755 --- a/boot.php +++ b/boot.php @@ -46,7 +46,7 @@ require_once('include/account.php'); define ( 'PLATFORM_NAME', 'hubzilla' ); -define ( 'STD_VERSION', '1.6' ); +define ( 'STD_VERSION', '1.7' ); define ( 'ZOT_REVISION', 1 ); define ( 'DB_UPDATE_VERSION', 1168 ); -- cgit v1.2.3 From b497faee27a89ff1a2da07d02dd6f6676183cc98 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sat, 14 May 2016 17:18:51 -0700 Subject: Allow plugins to define autoloaded classes - a class such as Foobar\Class will load addon/foobar/Class.php and also Foobar\Category\Class.php will load addon/foobar/Category/Class.php --- boot.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 9dbd4ead4..d5bde53ac 100755 --- a/boot.php +++ b/boot.php @@ -632,6 +632,17 @@ class ZotlabsAutoloader { return TRUE; } } + $arr = explode('\\',$className); + if($arr && count($arr) > 1) { + $filename = 'addon/' . lcfirst($arr[0]) . '/' . ucfirst($arr[1]) . ((count($arr) === 2) ? '.php' : '/' . ucfirst($arr[2]) . ".php"); + if (file_exists($filename)) { + include($filename); + if (class_exists($className)) { + return TRUE; + } + } + } + return FALSE; } } -- cgit v1.2.3 From 0503b11840d170a7f22d0392d08677c19b663ac2 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sat, 14 May 2016 17:24:50 -0700 Subject: allow addon autoloaders to specify absolute namespace classes starting with \ --- boot.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'boot.php') diff --git a/boot.php b/boot.php index d5bde53ac..e90cd7c15 100755 --- a/boot.php +++ b/boot.php @@ -634,6 +634,8 @@ class ZotlabsAutoloader { } $arr = explode('\\',$className); if($arr && count($arr) > 1) { + if(! $arr[0]) + $arr = array_shift($arr); $filename = 'addon/' . lcfirst($arr[0]) . '/' . ucfirst($arr[1]) . ((count($arr) === 2) ? '.php' : '/' . ucfirst($arr[2]) . ".php"); if (file_exists($filename)) { include($filename); -- cgit v1.2.3 From 0800bd1e1927a2093bf2693762a9b6cef7ae529e Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sat, 14 May 2016 17:30:06 -0700 Subject: we don't need to force case conversion on anything but the plugin name --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index e90cd7c15..86e61c6bc 100755 --- a/boot.php +++ b/boot.php @@ -636,7 +636,7 @@ class ZotlabsAutoloader { if($arr && count($arr) > 1) { if(! $arr[0]) $arr = array_shift($arr); - $filename = 'addon/' . lcfirst($arr[0]) . '/' . ucfirst($arr[1]) . ((count($arr) === 2) ? '.php' : '/' . ucfirst($arr[2]) . ".php"); + $filename = 'addon/' . lcfirst($arr[0]) . '/' . $arr[1] . ((count($arr) === 2) ? '.php' : '/' . $arr[2] . ".php"); if (file_exists($filename)) { include($filename); if (class_exists($className)) { -- cgit v1.2.3 From e8ad16cf2a9121c4d0474fb3195e46342b1e2628 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sun, 15 May 2016 13:20:17 -0700 Subject: issue #387 --- boot.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 86e61c6bc..7d359d011 100755 --- a/boot.php +++ b/boot.php @@ -1669,7 +1669,8 @@ function goaway($s) { function shutdown() { global $db; - $db->close(); + if($db) + $db->close(); } /** -- cgit v1.2.3 From 894114bfbdb31f9678837c7e1a234638afba3ca5 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sun, 15 May 2016 17:54:25 -0700 Subject: be a bit more precise --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 7d359d011..72e86e42b 100755 --- a/boot.php +++ b/boot.php @@ -1669,7 +1669,7 @@ function goaway($s) { function shutdown() { global $db; - if($db) + if(is_object($db) && $db->connected) $db->close(); } -- cgit v1.2.3 From 2dcedd69519a40ca0f40bf7b8b86423e98c778c9 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 16 May 2016 17:07:39 -0700 Subject: more work on sessions and cookies, as some anomalies appeared in caldav and firefox which suggested deeper issues --- boot.php | 1 + 1 file changed, 1 insertion(+) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 72e86e42b..381111b26 100755 --- a/boot.php +++ b/boot.php @@ -700,6 +700,7 @@ class App { private static $perms = null; // observer permissions private static $widgets = array(); // widgets for this page + public static $session = null; public static $groups; public static $language; public static $langsave; -- cgit v1.2.3 From 20cb4130d47028cbedf09f8da9feb6ccf8f759db Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 17 May 2016 17:46:30 -0700 Subject: support work for a long-term fix for issue #390, essentially one can specify a theme:schema string anywhere a theme is input. It will be honoured unless an existing schema setting over-rides this behaviour. This should also be backward compatible but the theme selection code has been cleaned up slightly and there may be subtle differences in behaviour after this commit. On my site this required a page refresh as the first page load after this change was a bit confused. --- boot.php | 106 +++------------------------------------------------------------ 1 file changed, 5 insertions(+), 101 deletions(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 381111b26..7fc096fa3 100755 --- a/boot.php +++ b/boot.php @@ -1874,105 +1874,6 @@ function is_windows() { return ((strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? true : false); } - -function current_theme(){ - $app_base_themes = array('redbasic'); - - $a = get_app(); - $page_theme = null; - - // Find the theme that belongs to the channel whose stuff we are looking at - - if(App::$profile_uid && App::$profile_uid != local_channel()) { - $r = q("select channel_theme from channel where channel_id = %d limit 1", - intval(App::$profile_uid) - ); - if($r) - $page_theme = $r[0]['channel_theme']; - } - - if(array_key_exists('theme', App::$layout) && App::$layout['theme']) - $page_theme = App::$layout['theme']; - - // Allow folks to over-rule channel themes and always use their own on their own site. - // The default is for channel themes to take precedence over your own on pages belonging - // to that channel. - - if($page_theme && local_channel() && App::$profile_uid && local_channel() != App::$profile_uid) { - if(get_pconfig(local_channel(),'system','always_my_theme')) - $page_theme = null; - } - - $is_mobile = App::$is_mobile || App::$is_tablet; - - $standard_system_theme = ((isset(App::$config['system']['theme'])) ? App::$config['system']['theme'] : ''); - $standard_theme_name = ((isset($_SESSION) && x($_SESSION,'theme')) ? $_SESSION['theme'] : $standard_system_theme); - - if($is_mobile) { - if(isset($_SESSION['show_mobile']) && !$_SESSION['show_mobile']) { - $system_theme = $standard_system_theme; - $theme_name = $standard_theme_name; - } - else { - $system_theme = ((isset(App::$config['system']['mobile_theme'])) ? App::$config['system']['mobile_theme'] : ''); - $theme_name = ((isset($_SESSION) && x($_SESSION,'mobile_theme')) ? $_SESSION['mobile_theme'] : $system_theme); - - if($theme_name === '' || $theme_name === '---' ) { - // user has selected to have the mobile theme be the same as the normal one - $system_theme = $standard_system_theme; - $theme_name = $standard_theme_name; - } - } - } - else { - $system_theme = $standard_system_theme; - $theme_name = $standard_theme_name; - - if($page_theme) - $theme_name = $page_theme; - } - - if($theme_name && - (file_exists('view/theme/' . $theme_name . '/css/style.css') || - file_exists('view/theme/' . $theme_name . '/php/style.php'))) - return($theme_name); - - foreach($app_base_themes as $t) { - if(file_exists('view/theme/' . $t . '/css/style.css') || - file_exists('view/theme/' . $t . '/php/style.php')) - return($t); - } - - $fallback = array_merge(glob('view/theme/*/css/style.css'),glob('view/theme/*/php/style.php')); - if(count($fallback)) - return (str_replace('view/theme/','', substr($fallback[0],0,-10))); - -} - - -/** - * @brief Return full URL to theme which is currently in effect. - * - * Provide a sane default if nothing is chosen or the specified theme does not exist. - * - * @param bool $installing default false - * - * @return string - */ -function current_theme_url($installing = false) { - global $a; - - $t = current_theme(); - - $opts = ''; - $opts = ((App::$profile_uid) ? '?f=&puid=' . App::$profile_uid : ''); - $opts .= ((x(App::$layout,'schema')) ? '&schema=' . App::$layout['schema'] : ''); - if(file_exists('view/theme/' . $t . '/php/style.php')) - return('view/theme/' . $t . '/php/style.pcss' . $opts); - - return('view/theme/' . $t . '/css/style.css'); -} - /** * @brief Check if current user has admin role. * @@ -1980,6 +1881,7 @@ function current_theme_url($installing = false) { * * @return bool true if user is an admin */ + function is_site_admin() { $a = get_app(); @@ -2209,7 +2111,9 @@ function construct_page(&$a) { } } - if (($p = theme_include(current_theme() . '.js')) != '') + $current_theme = Zotlabs\Render\Theme::current(); + + if (($p = theme_include($current_theme[0] . '.js')) != '') head_add_js($p); if (($p = theme_include('mod_' . App::$module . '.php')) != '') @@ -2223,7 +2127,7 @@ function construct_page(&$a) { head_add_css(((x(App::$page, 'template')) ? App::$page['template'] : 'default' ) . '.css'); head_add_css('mod_' . App::$module . '.css'); - head_add_css(current_theme_url($installing)); + head_add_css(Zotlabs\Render\Theme::url($installing)); head_add_js('mod_' . App::$module . '.js'); -- cgit v1.2.3 From 9cb1ac3de5d0f540bc6e1f5b1f4277b5a5bb9e67 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 19 May 2016 20:36:32 -0700 Subject: daemon master: create some compatibility code --- boot.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 7fc096fa3..bdce2a03f 100755 --- a/boot.php +++ b/boot.php @@ -1847,6 +1847,18 @@ function proc_run($cmd){ if(count($args) && $args[0] === 'php') $args[0] = ((x(App::$config,'system')) && (x(App::$config['system'],'php_path')) && (strlen(App::$config['system']['php_path'])) ? App::$config['system']['php_path'] : 'php'); + if(strstr($args[1],'include/')) { + $orig = substr(ucfirst(substr($args[1],8)),0,-4); + logger('proc_run_redirect: ' . $orig); + if(file_exists('Zotlabs/Daemon/' . $orig . '.php')) { + array_shift($args); + $args[0] = $orig; + logger('Redirecting old proc_run interface: ' . print_r($args,true)); + \Zotlabs\Daemon\Master::Summon($args); + return; + } + } + for($x = 0; $x < count($args); $x++) $args[$x] = escapeshellarg($args[$x]); -- cgit v1.2.3 From 014168a29bfbba69c2ba887af97e5fb290fa21c5 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 19 May 2016 21:32:19 -0700 Subject: cleanup of daemon infrastructure --- boot.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index bdce2a03f..ca3673361 100755 --- a/boot.php +++ b/boot.php @@ -1847,14 +1847,19 @@ function proc_run($cmd){ if(count($args) && $args[0] === 'php') $args[0] = ((x(App::$config,'system')) && (x(App::$config['system'],'php_path')) && (strlen(App::$config['system']['php_path'])) ? App::$config['system']['php_path'] : 'php'); + + // redirect proc_run statements of legacy daemon processes to the new Daemon Master object class + // We will keep this interface until everybody has transitioned. + if(strstr($args[1],'include/')) { + // convert 'include/foo.php' to 'Foo' $orig = substr(ucfirst(substr($args[1],8)),0,-4); logger('proc_run_redirect: ' . $orig); if(file_exists('Zotlabs/Daemon/' . $orig . '.php')) { - array_shift($args); - $args[0] = $orig; - logger('Redirecting old proc_run interface: ' . print_r($args,true)); - \Zotlabs\Daemon\Master::Summon($args); + array_shift($args); // daemons are all run by php, pop it off the top of the array + $args[0] = $orig; // replace with the new daemon name + logger('Redirecting old proc_run interface: ' . print_r($args,true), LOGGER_DEBUG, LOG_DEBUG); + \Zotlabs\Daemon\Master::Summon($args); // summon the daemon return; } } -- cgit v1.2.3 From a2cec8899ad191b47d116f4ea124be6bd5b05472 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 19 May 2016 22:26:37 -0700 Subject: daemon conversion continued... --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index ca3673361..9b4a7df13 100755 --- a/boot.php +++ b/boot.php @@ -1570,7 +1570,7 @@ function fix_system_urls($oldurl, $newurl) { } } - proc_run('php', 'include/notifier.php', 'refresh_all', $c[0]['channel_id']); + Zotlabs\Daemon\Master::Summon(array('Notifier', 'refresh_all', $c[0]['channel_id'])); } } -- cgit v1.2.3 From 2e83c17e2d4969263dbe87cf1b95faa8e71a7209 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 19 May 2016 22:47:20 -0700 Subject: roll minor version, change example text --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 9b4a7df13..e8a3e1e11 100755 --- a/boot.php +++ b/boot.php @@ -46,7 +46,7 @@ require_once('include/account.php'); define ( 'PLATFORM_NAME', 'hubzilla' ); -define ( 'STD_VERSION', '1.7' ); +define ( 'STD_VERSION', '1.7.1' ); define ( 'ZOT_REVISION', 1 ); define ( 'DB_UPDATE_VERSION', 1168 ); -- cgit v1.2.3 From cae380f068ce3c06360b430c84b267414dc02fcf Mon Sep 17 00:00:00 2001 From: redmatrix Date: Fri, 20 May 2016 01:21:19 -0700 Subject: case issue --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index e8a3e1e11..79524850e 100755 --- a/boot.php +++ b/boot.php @@ -1814,7 +1814,7 @@ function get_max_import_size() { * * $cmd and string args are surrounded with "" */ -function proc_run($cmd){ +function proc_run(){ $a = get_app(); -- cgit v1.2.3 From fdece3b1026ebe0a1e7512bdbd24028aef699318 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Fri, 20 May 2016 01:33:34 -0700 Subject: add some backtrace to find the issue --- boot.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 79524850e..5d2f1d744 100755 --- a/boot.php +++ b/boot.php @@ -1864,8 +1864,13 @@ function proc_run(){ } } - for($x = 0; $x < count($args); $x++) + for($x = 0; $x < count($args); $x++) { + if(is_array($args[$x])) { + logger('ERROR: shell args is array . ' . print_r($args,true)); + btlogger('args:'); + } $args[$x] = escapeshellarg($args[$x]); + } $cmdline = implode($args," "); -- cgit v1.2.3 From aefeda8c416f8aed34a187a5ca2408598add864f Mon Sep 17 00:00:00 2001 From: redmatrix Date: Fri, 20 May 2016 01:45:29 -0700 Subject: recurse one more level of array when processing args --- boot.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 5d2f1d744..3ab5905ff 100755 --- a/boot.php +++ b/boot.php @@ -1829,7 +1829,14 @@ function proc_run(){ foreach($args as $arg) { if(is_array($arg)) { foreach($arg as $n) { - $newargs[] = $n; + if(is_array($n)) { + foreach($n as $w) { + $newargs[] = $w; + } + } + else { + $newargs[] = $n; + } } } else -- cgit v1.2.3 From b2f0d2d085c355010f1475269c4beb4fba7b07dc Mon Sep 17 00:00:00 2001 From: redmatrix Date: Fri, 20 May 2016 17:44:26 -0700 Subject: cleanup proc_run after messing it up with debugging yesterday --- boot.php | 38 ++++++-------------------------------- 1 file changed, 6 insertions(+), 32 deletions(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 3ab5905ff..10244b0d0 100755 --- a/boot.php +++ b/boot.php @@ -1816,38 +1816,19 @@ function get_max_import_size() { */ function proc_run(){ - $a = get_app(); - $args = func_get_args(); $newargs = array(); + if(! count($args)) return; - // expand any arrays - - foreach($args as $arg) { - if(is_array($arg)) { - foreach($arg as $n) { - if(is_array($n)) { - foreach($n as $w) { - $newargs[] = $w; - } - } - else { - $newargs[] = $n; - } - } - } - else - $newargs[] = $arg; - } - - $args = $newargs; + $args = flatten_array_recursive($args); $arr = array('args' => $args, 'run_cmd' => true); call_hooks('proc_run', $arr); + if(! $arr['run_cmd']) return; @@ -1855,8 +1836,8 @@ function proc_run(){ $args[0] = ((x(App::$config,'system')) && (x(App::$config['system'],'php_path')) && (strlen(App::$config['system']['php_path'])) ? App::$config['system']['php_path'] : 'php'); - // redirect proc_run statements of legacy daemon processes to the new Daemon Master object class - // We will keep this interface until everybody has transitioned. + // redirect proc_run statements of legacy daemon processes to the newer Daemon Master object class + // We will keep this interface until everybody has transitioned. (2016-05-20) if(strstr($args[1],'include/')) { // convert 'include/foo.php' to 'Foo' @@ -1871,14 +1852,7 @@ function proc_run(){ } } - for($x = 0; $x < count($args); $x++) { - if(is_array($args[$x])) { - logger('ERROR: shell args is array . ' . print_r($args,true)); - btlogger('args:'); - } - $args[$x] = escapeshellarg($args[$x]); - } - + $args = array_map('escapeshellarg',$args); $cmdline = implode($args," "); if(is_windows()) { -- cgit v1.2.3 From f4da365abdc1ce1da2dde1bb9798f58fc6dc1a9f Mon Sep 17 00:00:00 2001 From: redmatrix Date: Fri, 20 May 2016 19:11:14 -0700 Subject: move template stuff to zotlabs/render --- boot.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 10244b0d0..a5aa3f7a1 100755 --- a/boot.php +++ b/boot.php @@ -908,16 +908,24 @@ class App { /* * register template engines */ + + + spl_autoload_register('ZotlabsAutoloader::loader'); + + self::$meta= new Zotlabs\Web\HttpMeta(); + $smarty = new Zotlabs\Render\SmartyTemplate(); + $dc = get_declared_classes(); +// logger('classes: ' . print_r($dc,true)); + foreach ($dc as $k) { - if (in_array("ITemplateEngine", class_implements($k))){ + + if (in_array('Zotlabs\\Render\\TemplateEngine', class_implements($k))){ self::register_template_engine($k); } } - spl_autoload_register('ZotlabsAutoloader::loader'); - self::$meta= new Zotlabs\Web\HttpMeta(); } -- cgit v1.2.3 From ac095c89f1ef8cf2207c3db94b10c6e4a3d8f5a7 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Fri, 20 May 2016 19:14:49 -0700 Subject: code comments --- boot.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index a5aa3f7a1..fdd900de8 100755 --- a/boot.php +++ b/boot.php @@ -913,14 +913,15 @@ class App { spl_autoload_register('ZotlabsAutoloader::loader'); self::$meta= new Zotlabs\Web\HttpMeta(); + + // create an instance of the smarty template engine so we can register it. + $smarty = new Zotlabs\Render\SmartyTemplate(); $dc = get_declared_classes(); -// logger('classes: ' . print_r($dc,true)); foreach ($dc as $k) { - - if (in_array('Zotlabs\\Render\\TemplateEngine', class_implements($k))){ + if(in_array('Zotlabs\\Render\\TemplateEngine', class_implements($k))) { self::register_template_engine($k); } } -- cgit v1.2.3 From d8ace38041ad3ef161cf9c727c94b6ce2a00ce75 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Fri, 20 May 2016 22:52:47 -0700 Subject: rework the conversation object stuff at a high level - still needs a bit of refactoring --- boot.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index fdd900de8..e7e962b8e 100755 --- a/boot.php +++ b/boot.php @@ -37,7 +37,6 @@ require_once('include/nav.php'); require_once('include/cache.php'); require_once('include/permissions.php'); require_once('library/Mobile_Detect/Mobile_Detect.php'); -require_once('include/BaseObject.php'); require_once('include/features.php'); require_once('include/taxonomy.php'); require_once('include/identity.php'); @@ -903,13 +902,10 @@ class App { self::head_set_icon('/images/hz-32.png'); - BaseObject::set_app($this); - /* * register template engines */ - spl_autoload_register('ZotlabsAutoloader::loader'); self::$meta= new Zotlabs\Web\HttpMeta(); @@ -1080,7 +1076,7 @@ class App { if(! self::$meta->get_field('og:title')) self::$meta->set('og:title',self::$page['title']); - self::$meta->set('generator', Zotlabs\Project\System::get_platform_name()); + self::$meta->set('generator', Zotlabs\Lib\System::get_platform_name()); /* put the head template at the beginning of page['htmlhead'] * since the code added by the modules frequently depends on it @@ -1095,7 +1091,7 @@ class App { '$local_channel' => local_channel(), '$metas' => self::$meta->get(), '$update_interval' => $interval, - 'osearch' => sprintf( t('Search %1$s (%2$s)','opensearch'), Zotlabs\Project\System::get_site_name(), t('$Projectname','opensearch')), + 'osearch' => sprintf( t('Search %1$s (%2$s)','opensearch'), Zotlabs\Lib\System::get_site_name(), t('$Projectname','opensearch')), '$icon' => head_get_icon(), '$head_css' => head_get_css(), '$head_js' => head_get_js(), -- cgit v1.2.3 From 049147a9d78b981482297c3daf48c67f31754259 Mon Sep 17 00:00:00 2001 From: Andrew Manning Date: Sat, 21 May 2016 19:02:23 -0400 Subject: Successful new wiki git repo and item table record --- boot.php | 1 + 1 file changed, 1 insertion(+) (limited to 'boot.php') diff --git a/boot.php b/boot.php index e7e962b8e..1cc0cfcd4 100755 --- a/boot.php +++ b/boot.php @@ -513,6 +513,7 @@ define ( 'ACTIVITY_OBJ_ALBUM', NAMESPACE_ACTIVITY_SCHEMA . 'photo-album' ); define ( 'ACTIVITY_OBJ_EVENT', NAMESPACE_ACTIVITY_SCHEMA . 'event' ); define ( 'ACTIVITY_OBJ_GROUP', NAMESPACE_ACTIVITY_SCHEMA . 'group' ); define ( 'ACTIVITY_OBJ_GAME', NAMESPACE_ACTIVITY_SCHEMA . 'game' ); +define ( 'ACTIVITY_OBJ_WIKI', NAMESPACE_ACTIVITY_SCHEMA . 'wiki' ); define ( 'ACTIVITY_OBJ_TAGTERM', NAMESPACE_ZOT . '/activity/tagterm' ); define ( 'ACTIVITY_OBJ_PROFILE', NAMESPACE_ZOT . '/activity/profile' ); define ( 'ACTIVITY_OBJ_THING', NAMESPACE_ZOT . '/activity/thing' ); -- cgit v1.2.3 From de006771c7fe92a889d759c2c75c1473c420ad47 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sun, 22 May 2016 16:54:30 -0700 Subject: renamed include files identity.php (channel.php) and Contact.php (connections.php) --- boot.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index e7e962b8e..25551346b 100755 --- a/boot.php +++ b/boot.php @@ -39,14 +39,14 @@ require_once('include/permissions.php'); require_once('library/Mobile_Detect/Mobile_Detect.php'); require_once('include/features.php'); require_once('include/taxonomy.php'); -require_once('include/identity.php'); -require_once('include/Contact.php'); +require_once('include/channel.php'); +require_once('include/connections.php'); require_once('include/account.php'); define ( 'PLATFORM_NAME', 'hubzilla' ); define ( 'STD_VERSION', '1.7.1' ); -define ( 'ZOT_REVISION', 1 ); +define ( 'ZOT_REVISION', 1.1 ); define ( 'DB_UPDATE_VERSION', 1168 ); -- cgit v1.2.3 From 5e0698ba8731e7e4659a24c0ab4fa9c4a1aef173 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sun, 22 May 2016 17:52:30 -0700 Subject: turn the oft-repeated block_public ... check into a function observer_prohibited() --- boot.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 25551346b..690a330d8 100755 --- a/boot.php +++ b/boot.php @@ -2400,3 +2400,12 @@ function check_cron_broken() { } + +function observer_prohibited($allow_account = false) { + + if($allow_account) + return (((get_config('system','block_public')) && (! get_account_id()) && (! remote_channel())) ? true : false ); + return (((get_config('system','block_public')) && (! local_channel()) && (! remote_channel())) ? true : false ); + +} + -- cgit v1.2.3 From 80f2ba640ec528bd43db243122a69e765703b7c0 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 24 May 2016 20:49:23 -0700 Subject: code cleanup --- boot.php | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 690a330d8..d4836e61c 100755 --- a/boot.php +++ b/boot.php @@ -1197,7 +1197,6 @@ class App { * @return App */ function get_app() { - global $a; return $a; } @@ -1247,7 +1246,6 @@ function system_unavailable() { function clean_urls() { - global $a; // if(App::$config['system']['clean_urls']) return true; @@ -1255,8 +1253,6 @@ function clean_urls() { } function z_path() { - global $a; - $base = z_root(); if(! clean_urls()) $base .= '/?q='; @@ -1272,7 +1268,6 @@ function z_path() { * @return string */ function z_root() { - global $a; return App::get_baseurl(); } @@ -1604,7 +1599,6 @@ function fix_system_urls($oldurl, $newurl) { // returns the complete html for inserting into the page function login($register = false, $form_id = 'main-login', $hiddens=false) { - $a = get_app(); $o = ''; $reg = false; $reglink = get_config('system', 'register_link'); @@ -1674,9 +1668,7 @@ function goaway($s) { } function shutdown() { - global $db; - if(is_object($db) && $db->connected) - $db->close(); + } /** @@ -1766,7 +1758,6 @@ function remote_user() { * @param string $s Text to display */ function notice($s) { - $a = get_app(); if(! x($_SESSION, 'sysmsg')) $_SESSION['sysmsg'] = array(); // ignore duplicated error messages which haven't yet been displayed @@ -1790,7 +1781,6 @@ function notice($s) { * @param string $s Text to display */ function info($s) { - $a = get_app(); if(! x($_SESSION, 'sysmsg_info')) $_SESSION['sysmsg_info'] = array(); if(App::$interactive) $_SESSION['sysmsg_info'][] = $s; @@ -1891,7 +1881,6 @@ function is_windows() { */ function is_site_admin() { - $a = get_app(); if($_SESSION['delegate']) return false; @@ -1912,7 +1901,7 @@ function is_site_admin() { * @return bool true if user is a developer */ function is_developer() { - $a = get_app(); + if((intval($_SESSION['authenticated'])) && (is_array(App::$account)) && (App::$account['account_roles'] & ACCOUNT_ROLE_DEVELOPER)) @@ -1923,7 +1912,6 @@ function is_developer() { function load_contact_links($uid) { - $a = get_app(); $ret = array(); @@ -2241,7 +2229,6 @@ function appdirpath() { * @param string $icon */ function head_set_icon($icon) { - global $a; App::$data['pageicon'] = $icon; // logger('head_set_icon: ' . $icon); @@ -2253,7 +2240,6 @@ function head_set_icon($icon) { * @return string absolut path to pageicon */ function head_get_icon() { - global $a; $icon = App::$data['pageicon']; if(! strpos($icon, '://')) @@ -2319,7 +2305,7 @@ function z_get_temp_dir() { } function z_check_cert() { - $a = get_app(); + if(strpos(z_root(),'https://') !== false) { $x = z_fetch_url(z_root() . '/siteinfo/json'); if(! $x['success']) { @@ -2340,8 +2326,6 @@ function z_check_cert() { */ function cert_bad_email() { - $a = get_app(); - $email_tpl = get_intltext_template("cert_bad_eml.tpl"); $email_msg = replace_macros($email_tpl, array( '$sitename' => App::$config['system']['sitename'], @@ -2380,8 +2364,6 @@ function check_cron_broken() { return; } - $a = get_app(); - $email_tpl = get_intltext_template("cron_bad_eml.tpl"); $email_msg = replace_macros($email_tpl, array( '$sitename' => App::$config['system']['sitename'], -- cgit v1.2.3 From 4716627453c811bd6be6bf72afd83f43ab1abfc0 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 25 May 2016 21:10:13 -0700 Subject: run background/daemon tasks at approximately 4 hour intervals from web accesses if they aren't being run otherwise. This ensures they run, although perhaps a bit infrequently; even if unconfigured. This is not suitable for a production site, but may be acceptable for small single person hubs and test sites. The 'cron warning email' now means that background processes are totally borked; probably due to a fascist hosting provider that has blocked process execution. --- boot.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index d4836e61c..2fa7d8061 100755 --- a/boot.php +++ b/boot.php @@ -2346,21 +2346,27 @@ function cert_bad_email() { */ function check_cron_broken() { - $t = get_config('system','lastpollcheck'); + $d = get_config('system','lastcron'); + + if((! $d) || ($d < datetime_convert('UTC','UTC','now - 4 hours'))) { + Zotlabs\Daemon\Master::Summon(array('Cron')); + } + + $t = get_config('system','lastcroncheck'); if(! $t) { // never checked before. Start the timer. - set_config('system','lastpollcheck',datetime_convert()); + set_config('system','lastcroncheck',datetime_convert()); return; } + if($t > datetime_convert('UTC','UTC','now - 3 days')) { // Wait for 3 days before we do anything so as not to swamp the admin with messages return; } - $d = get_config('system','lastpoll'); if(($d) && ($d > datetime_convert('UTC','UTC','now - 3 days'))) { // Scheduled tasks have run successfully in the last 3 days. - set_config('system','lastpollcheck',datetime_convert()); + set_config('system','lastcroncheck',datetime_convert()); return; } @@ -2377,7 +2383,6 @@ function check_cron_broken() { 'From: Administrator' . '@' . App::get_hostname() . "\n" . 'Content-type: text/plain; charset=UTF-8' . "\n" . 'Content-transfer-encoding: 8bit' ); - set_config('system','lastpollcheck',datetime_convert()); return; } -- cgit v1.2.3 From 096fdfc61b5381bd3f7918a7c5f6004461354f32 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 26 May 2016 16:33:01 -0700 Subject: consolidate all the sys_boot functionality that is common between the web server and the cli daemon manager. Get rid of yet another global variable ($default_timezone) whilst doing so. --- boot.php | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 2fa7d8061..b0ef5b3b9 100755 --- a/boot.php +++ b/boot.php @@ -579,6 +579,72 @@ define ( 'ITEM_IS_STICKY', 1000 ); define ( 'DBTYPE_MYSQL', 0 ); define ( 'DBTYPE_POSTGRES', 1 ); + +function sys_boot() { + + // our central App object + + \App::init(); + + /* + * Load the configuration file which contains our DB credentials. + * Ignore errors. If the file doesn't exist or is empty, we are running in + * installation mode. + */ + + // miniApp is a conversion object from old style .htconfig.php files + + $a = new \miniApp; + + + \App::$install = ((file_exists('.htconfig.php') && filesize('.htconfig.php')) ? false : true); + + @include('.htconfig.php'); + + if(! defined('UNO')) + define('UNO', 0); + + if(array_key_exists('default_timezone',get_defined_vars())) { + \App::$config['system']['timezone'] = $default_timezone; + } + + $a->convert(); + + \App::$timezone = ((\App::$config['system']['timezone']) ? \App::$config['system']['timezone'] : 'UTC'); + date_default_timezone_set(\App::$timezone); + + + /* + * Try to open the database; + */ + + require_once('include/dba/dba_driver.php'); + + if(! \App::$install) { + \DBA::dba_factory($db_host, $db_port, $db_user, $db_pass, $db_data, $db_type, \App::$install); + if(! \DBA::$dba->connected) { + system_unavailable(); + } + + unset($db_host, $db_port, $db_user, $db_pass, $db_data, $db_type); + + /** + * Load configs from db. Overwrite configs from .htconfig.php + */ + + load_config('config'); + load_config('system'); + load_config('feature'); + + \App::$session = new \Zotlabs\Web\Session(); + \App::$session->init(); + load_hooks(); + call_hooks('init_1'); + } + +} + + /** * * Reverse the effect of magic_quotes_gpc if it is enabled. -- cgit v1.2.3 From 1bce285eca9bf53044f3949a55fc434db2671b3a Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 26 May 2016 17:51:59 -0700 Subject: don't need quite so many backslashes --- boot.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index b0ef5b3b9..1c3938cb4 100755 --- a/boot.php +++ b/boot.php @@ -584,7 +584,7 @@ function sys_boot() { // our central App object - \App::init(); + App::init(); /* * Load the configuration file which contains our DB credentials. @@ -594,10 +594,10 @@ function sys_boot() { // miniApp is a conversion object from old style .htconfig.php files - $a = new \miniApp; + $a = new miniApp; - \App::$install = ((file_exists('.htconfig.php') && filesize('.htconfig.php')) ? false : true); + App::$install = ((file_exists('.htconfig.php') && filesize('.htconfig.php')) ? false : true); @include('.htconfig.php'); @@ -605,13 +605,13 @@ function sys_boot() { define('UNO', 0); if(array_key_exists('default_timezone',get_defined_vars())) { - \App::$config['system']['timezone'] = $default_timezone; + App::$config['system']['timezone'] = $default_timezone; } $a->convert(); - \App::$timezone = ((\App::$config['system']['timezone']) ? \App::$config['system']['timezone'] : 'UTC'); - date_default_timezone_set(\App::$timezone); + App::$timezone = ((App::$config['system']['timezone']) ? App::$config['system']['timezone'] : 'UTC'); + date_default_timezone_set(App::$timezone); /* @@ -620,9 +620,9 @@ function sys_boot() { require_once('include/dba/dba_driver.php'); - if(! \App::$install) { - \DBA::dba_factory($db_host, $db_port, $db_user, $db_pass, $db_data, $db_type, \App::$install); - if(! \DBA::$dba->connected) { + if(! App::$install) { + DBA::dba_factory($db_host, $db_port, $db_user, $db_pass, $db_data, $db_type, App::$install); + if(! DBA::$dba->connected) { system_unavailable(); } @@ -636,8 +636,8 @@ function sys_boot() { load_config('system'); load_config('feature'); - \App::$session = new \Zotlabs\Web\Session(); - \App::$session->init(); + App::$session = new Zotlabs\Web\Session(); + App::$session->init(); load_hooks(); call_hooks('init_1'); } -- cgit v1.2.3 From 0919c1eb61ed0ae16810063aabcfd620a425b22a Mon Sep 17 00:00:00 2001 From: redmatrix Date: Fri, 27 May 2016 16:09:44 -0700 Subject: check for session before querying session vars --- boot.php | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 1c3938cb4..c3036b6d7 100755 --- a/boot.php +++ b/boot.php @@ -1768,7 +1768,9 @@ function get_account_id() { * @return int|bool channel_id or false */ function local_channel() { - if((x($_SESSION, 'authenticated')) && (x($_SESSION, 'uid'))) + if(session_id() + && array_key_exists('authenticated',$_SESSION) && $_SESSION['authenticated'] + && array_key_exists('uid',$_SESSION) && intval($_SESSION['uid'])) return intval($_SESSION['uid']); return false; @@ -1799,7 +1801,9 @@ function local_user() { * @return string|bool visitor_id or false */ function remote_channel() { - if((x($_SESSION, 'authenticated')) && (x($_SESSION, 'visitor_id'))) + if(session_id() + && array_key_exists('authenticated',$_SESSION) && $_SESSION['authenticated'] + && array_key_exists('visitor_id',$_SESSION) && intval($_SESSION['visitor_id'])) return $_SESSION['visitor_id']; return false; @@ -1824,6 +1828,9 @@ function remote_user() { * @param string $s Text to display */ function notice($s) { + if(! session_id()) + return; + if(! x($_SESSION, 'sysmsg')) $_SESSION['sysmsg'] = array(); // ignore duplicated error messages which haven't yet been displayed @@ -1847,7 +1854,10 @@ function notice($s) { * @param string $s Text to display */ function info($s) { - if(! x($_SESSION, 'sysmsg_info')) $_SESSION['sysmsg_info'] = array(); + if(! session_id()) + return; + if(! x($_SESSION, 'sysmsg_info')) + $_SESSION['sysmsg_info'] = array(); if(App::$interactive) $_SESSION['sysmsg_info'][] = $s; } @@ -1933,6 +1943,10 @@ function proc_run(){ * @brief Checks if we are running on M$ Windows. * * @return bool true if we run on M$ Windows + * + * It's possible you might be able to run on WAMP or XAMPP, and this + * has been accomplished, but is not officially supported. Good luck. + * */ function is_windows() { return ((strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? true : false); @@ -1948,6 +1962,9 @@ function is_windows() { function is_site_admin() { + if(! session_id()) + return false; + if($_SESSION['delegate']) return false; @@ -1968,6 +1985,9 @@ function is_site_admin() { */ function is_developer() { + if(! session_id()) + return false; + if((intval($_SESSION['authenticated'])) && (is_array(App::$account)) && (App::$account['account_roles'] & ACCOUNT_ROLE_DEVELOPER)) @@ -1986,7 +2006,7 @@ function load_contact_links($uid) { // logger('load_contact_links'); - $r = q("SELECT abook_id, abook_flags, abook_my_perms, abook_their_perms, xchan_hash, xchan_photo_m, xchan_name, xchan_url from abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d ", + $r = q("SELECT abook_id, abook_flags, abook_my_perms, abook_their_perms, xchan_hash, xchan_photo_m, xchan_name, xchan_url, xchan_network from abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d ", intval($uid) ); if($r) { @@ -2009,6 +2029,7 @@ function load_contact_links($uid) { * * @return string */ + function build_querystring($params, $name = null) { $ret = ''; foreach($params as $key => $val) { @@ -2051,8 +2072,9 @@ function dba_timer() { /** * @brief Returns xchan_hash from the observer. * - * @return string Empty if no observer, otherwise xchan_hash from observer + * @return empty string if no observer, otherwise xchan_hash from observer */ + function get_observer_hash() { $observer = App::get_observer(); if(is_array($observer)) @@ -2109,8 +2131,6 @@ function load_pdl(&$a) { App::$comanche = new Zotlabs\Render\Comanche(); - // require_once('include/comanche.php'); - if (! count(App::$layout)) { $arr = array('module' => App::$module, 'layout' => ''); @@ -2131,13 +2151,10 @@ function load_pdl(&$a) { App::$pdl = $s; } } - } function exec_pdl(&$a) { -// require_once('include/comanche.php'); - if(App::$pdl) { App::$comanche->parse(App::$pdl,1); } -- cgit v1.2.3 From ac4688eac087854bf8cb0c893d7a79052ad63a20 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Fri, 27 May 2016 23:57:47 -0700 Subject: allow objs to represent inventory --- boot.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index c3036b6d7..fec908ce0 100755 --- a/boot.php +++ b/boot.php @@ -48,7 +48,7 @@ define ( 'PLATFORM_NAME', 'hubzilla' ); define ( 'STD_VERSION', '1.7.1' ); define ( 'ZOT_REVISION', 1.1 ); -define ( 'DB_UPDATE_VERSION', 1168 ); +define ( 'DB_UPDATE_VERSION', 1169 ); /** @@ -691,7 +691,7 @@ function startup() { class ZotlabsAutoloader { static public function loader($className) { $filename = str_replace('\\', '/', $className) . ".php"; - if (file_exists($filename)) { + if(file_exists($filename)) { include($filename); if (class_exists($className)) { return TRUE; @@ -702,7 +702,7 @@ class ZotlabsAutoloader { if(! $arr[0]) $arr = array_shift($arr); $filename = 'addon/' . lcfirst($arr[0]) . '/' . $arr[1] . ((count($arr) === 2) ? '.php' : '/' . $arr[2] . ".php"); - if (file_exists($filename)) { + if(file_exists($filename)) { include($filename); if (class_exists($className)) { return TRUE; -- cgit v1.2.3 From 3b2679db29077c33912edb085a24906708ad97ee Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sun, 29 May 2016 18:38:24 -0700 Subject: fix remote_channel(), update php minversion requirement --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index fec908ce0..a882be2eb 100755 --- a/boot.php +++ b/boot.php @@ -1803,7 +1803,7 @@ function local_user() { function remote_channel() { if(session_id() && array_key_exists('authenticated',$_SESSION) && $_SESSION['authenticated'] - && array_key_exists('visitor_id',$_SESSION) && intval($_SESSION['visitor_id'])) + && array_key_exists('visitor_id',$_SESSION) && $_SESSION['visitor_id']) return $_SESSION['visitor_id']; return false; -- cgit v1.2.3 From 6602ff83dd54d0e17c985a5f527654fc2ed83eea Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 30 May 2016 19:44:30 -0700 Subject: start removing reserved words from database column names (this run: addon and hook) --- boot.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index a882be2eb..f1aa0cf9d 100755 --- a/boot.php +++ b/boot.php @@ -48,7 +48,7 @@ define ( 'PLATFORM_NAME', 'hubzilla' ); define ( 'STD_VERSION', '1.7.1' ); define ( 'ZOT_REVISION', 1.1 ); -define ( 'DB_UPDATE_VERSION', 1169 ); +define ( 'DB_UPDATE_VERSION', 1170 ); /** @@ -1522,11 +1522,11 @@ function check_config(&$a) { if(count($installed)) { foreach($installed as $i) { - if(! in_array($i['name'], $plugins_arr)) { - unload_plugin($i['name']); + if(! in_array($i['aname'], $plugins_arr)) { + unload_plugin($i['aname']); } else { - $installed_arr[] = $i['name']; + $installed_arr[] = $i['aname']; } } } -- cgit v1.2.3 From ca78374f30bd1b3a98b8b82552741a54b131cbf8 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 30 May 2016 22:41:45 -0700 Subject: remove unused tables --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index f1aa0cf9d..4ea2dc279 100755 --- a/boot.php +++ b/boot.php @@ -48,7 +48,7 @@ define ( 'PLATFORM_NAME', 'hubzilla' ); define ( 'STD_VERSION', '1.7.1' ); define ( 'ZOT_REVISION', 1.1 ); -define ( 'DB_UPDATE_VERSION', 1170 ); +define ( 'DB_UPDATE_VERSION', 1171 ); /** -- cgit v1.2.3 From dfb6255f59980835d364402b372dd39f2b41ee7c Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 31 May 2016 17:50:47 -0700 Subject: more removal of reserved words from DB schemas --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 4ea2dc279..24ff3c5d1 100755 --- a/boot.php +++ b/boot.php @@ -48,7 +48,7 @@ define ( 'PLATFORM_NAME', 'hubzilla' ); define ( 'STD_VERSION', '1.7.1' ); define ( 'ZOT_REVISION', 1.1 ); -define ( 'DB_UPDATE_VERSION', 1171 ); +define ( 'DB_UPDATE_VERSION', 1172 ); /** -- cgit v1.2.3 From b1259876bf398880e7b0c1b44d90f94983243e72 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 31 May 2016 21:45:33 -0700 Subject: more db column renames --- boot.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 24ff3c5d1..e105560e4 100755 --- a/boot.php +++ b/boot.php @@ -45,10 +45,10 @@ require_once('include/account.php'); define ( 'PLATFORM_NAME', 'hubzilla' ); -define ( 'STD_VERSION', '1.7.1' ); +define ( 'STD_VERSION', '1.7.2' ); define ( 'ZOT_REVISION', 1.1 ); -define ( 'DB_UPDATE_VERSION', 1172 ); +define ( 'DB_UPDATE_VERSION', 1173 ); /** -- cgit v1.2.3 From a9d7acda279ebb7f2b3cd61a91a5e1d8b590dcf2 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 1 Jun 2016 21:48:54 -0700 Subject: the rest of the schema updates - WARNING: some third party plugins may fail; e.g. embedphotos and chess. $item['object'] is now $item['obj'] and $photo['type'] is $photo['mimetype'], $photo['scale'] is $photo['imgscale'] and $photo['data'] is now $photo['content']. There are a number of other changes, but these are the ones noted to cause issues with third-party plugins. The project plugins have been updated. Please note any new issues as this effort touched a lot of code in a lot of files. --- boot.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index e105560e4..5b3a614f1 100755 --- a/boot.php +++ b/boot.php @@ -45,10 +45,10 @@ require_once('include/account.php'); define ( 'PLATFORM_NAME', 'hubzilla' ); -define ( 'STD_VERSION', '1.7.2' ); +define ( 'STD_VERSION', '1.7.3' ); define ( 'ZOT_REVISION', 1.1 ); -define ( 'DB_UPDATE_VERSION', 1173 ); +define ( 'DB_UPDATE_VERSION', 1176 ); /** -- cgit v1.2.3 From f9075e2a2feca0f37fdf568be6e6e53460aa9034 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 2 Jun 2016 18:42:51 -0700 Subject: some initial emoji reaction work --- boot.php | 1 + 1 file changed, 1 insertion(+) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 5b3a614f1..16c5fed11 100755 --- a/boot.php +++ b/boot.php @@ -473,6 +473,7 @@ define ( 'NAMESPACE_YMEDIA', 'http://search.yahoo.com/mrss/' ); * activity stream defines */ +define ( 'ACTIVITY_REACT', NAMESPACE_ZOT . '/activity/react' ); define ( 'ACTIVITY_LIKE', NAMESPACE_ACTIVITY_SCHEMA . 'like' ); define ( 'ACTIVITY_DISLIKE', NAMESPACE_ZOT . '/activity/dislike' ); define ( 'ACTIVITY_AGREE', NAMESPACE_ZOT . '/activity/agree' ); -- cgit v1.2.3 From 0333dca550945ae4323bf7d361813e55e03c5d83 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Fri, 3 Jun 2016 19:46:48 -0700 Subject: App::init() should be static --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 16c5fed11..26bebe8f8 100755 --- a/boot.php +++ b/boot.php @@ -866,7 +866,7 @@ class App { /** * App constructor. */ - function init() { + public static function init() { // we'll reset this after we read our config file date_default_timezone_set('UTC'); -- cgit v1.2.3 From a6012af00d13bdab1806b7ae172d271d4ad9ebe5 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sat, 4 Jun 2016 17:06:12 -0700 Subject: For emojis in posts, extend smilies and save a lot of duplication of effort --- boot.php | 1 + 1 file changed, 1 insertion(+) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 26bebe8f8..76312ed4e 100755 --- a/boot.php +++ b/boot.php @@ -783,6 +783,7 @@ class App { public static $content; public static $data = array(); public static $error = false; + public static $emojitab = false; public static $cmd; public static $argv; public static $argc; -- cgit v1.2.3 From 2ad5010dc3f2f8d077a3228915d28a3e256f6e13 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 8 Jun 2016 20:00:36 -0700 Subject: issue #59 --- boot.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 76312ed4e..a31d98dbb 100755 --- a/boot.php +++ b/boot.php @@ -1465,6 +1465,12 @@ function check_config(&$a) { @unlink($lockfile); //send the administrator an e-mail file_put_contents($lockfile, $x); + + $r = q("select account_language from account where account_email = '%s' limit 1", + dbesc(App::$config['system']['admin_email']) + ); + push_lang(($r) ? $r[0]['account_language'] : 'en'); + $email_tpl = get_intltext_template("update_fail_eml.tpl"); $email_msg = replace_macros($email_tpl, array( @@ -1482,6 +1488,7 @@ function check_config(&$a) { . 'Content-transfer-encoding: 8bit' ); //try the logger logger('CRITICAL: Update Failed: ' . $x); + pop_lang(); } else set_config('database','update_r' . $x, 'success'); -- cgit v1.2.3 From 974ca9d526303e317e40240e40ac9a98a2540f9b Mon Sep 17 00:00:00 2001 From: redmatrix Date: Fri, 10 Jun 2016 14:26:14 -0700 Subject: move dev forward --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 8e789a77f..384376ec5 100755 --- a/boot.php +++ b/boot.php @@ -45,7 +45,7 @@ require_once('include/account.php'); define ( 'PLATFORM_NAME', 'hubzilla' ); -define ( 'STD_VERSION', '1.7.3' ); +define ( 'STD_VERSION', '1.9' ); define ( 'ZOT_REVISION', 1.1 ); define ( 'DB_UPDATE_VERSION', 1176 ); -- cgit v1.2.3