mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 15:55:13 +00:00
cleanup
This commit is contained in:
parent
dd0f43307c
commit
8803be2ca3
13 changed files with 224 additions and 516 deletions
|
@ -48,7 +48,7 @@ class Url {
|
|||
|
||||
curl_setopt($ch, CURLOPT_HEADER, true);
|
||||
curl_setopt($ch, CURLINFO_HEADER_OUT, true);
|
||||
curl_setopt($ch, CURLOPT_CAINFO, get_capath());
|
||||
curl_setopt($ch, CURLOPT_CAINFO, self::get_capath());
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_ENCODING, '');
|
||||
|
@ -275,7 +275,7 @@ class Url {
|
|||
|
||||
curl_setopt($ch, CURLOPT_HEADER, true);
|
||||
curl_setopt($ch, CURLINFO_HEADER_OUT, true);
|
||||
curl_setopt($ch, CURLOPT_CAINFO, get_capath());
|
||||
curl_setopt($ch, CURLOPT_CAINFO, self::get_capath());
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
|
||||
|
@ -457,7 +457,15 @@ class Url {
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Returns path to CA file.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
static public function get_capath()
|
||||
{
|
||||
return 'include/library/cacert.pem';
|
||||
}
|
||||
|
||||
static public function format_error($ret, $verbose = false)
|
||||
{
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
|
||||
namespace Code\Lib;
|
||||
|
||||
use Code\Lib\Url;
|
||||
|
||||
/**
|
||||
* @brief Fetch and return a webfinger for a resource
|
||||
*
|
||||
|
@ -12,7 +10,6 @@ use Code\Lib\Url;
|
|||
*/
|
||||
class Webfinger
|
||||
{
|
||||
|
||||
private static $server = EMPTY_STR;
|
||||
private static $resource = EMPTY_STR;
|
||||
|
||||
|
@ -99,7 +96,7 @@ class Webfinger
|
|||
if (is_array($arr) && array_key_exists('links', $arr)) {
|
||||
foreach ($arr['links'] as $link) {
|
||||
if (array_key_exists('rel',$link) && in_array($link['rel'], [ PROTOCOL_NOMAD, PROTOCOL_ZOT6 ])) {
|
||||
if (array_key_exists('href', $link) && $link['href'] !== EMPTY_STR) {
|
||||
if (!empty($link['href'])) {
|
||||
return $link['href'];
|
||||
}
|
||||
}
|
||||
|
|
11
boot.php
11
boot.php
|
@ -2398,15 +2398,6 @@ function construct_page() {
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns appplication root directory.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function appdirpath() {
|
||||
return dirname(__FILE__);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set a pageicon.
|
||||
*
|
||||
|
@ -2421,7 +2412,7 @@ function head_set_icon($icon) {
|
|||
/**
|
||||
* @brief Get the pageicon.
|
||||
*
|
||||
* @return string absolut path to pageicon
|
||||
* @return string absolute path to pageicon
|
||||
*/
|
||||
function head_get_icon() {
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
},
|
||||
"require-dev" : {
|
||||
"phpunit/phpunit" : "@stable",
|
||||
"behat/behat" : "@stable",
|
||||
"behat/behat" : "~3.11",
|
||||
"behat/mink-extension": "@stable",
|
||||
"behat/mink-goutte-driver": "@stable",
|
||||
"php-mock/php-mock-phpunit": "@stable"
|
||||
|
|
653
composer.lock
generated
653
composer.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -13,7 +13,6 @@ use Code\Lib\Channel;
|
|||
|
||||
function get_help_fullpath($path, $suffix = null)
|
||||
{
|
||||
|
||||
return find_docfile($path, App::$language);
|
||||
}
|
||||
|
||||
|
@ -47,12 +46,6 @@ function find_docfile($name, $language)
|
|||
*/
|
||||
function get_help_content($tocpath = false)
|
||||
{
|
||||
|
||||
|
||||
$doctype = 'multicode';
|
||||
|
||||
$text = '';
|
||||
|
||||
$path = '';
|
||||
if (argc() > 1) {
|
||||
for ($x = 1; $x < argc(); $x++) {
|
||||
|
@ -74,22 +67,6 @@ function get_help_content($tocpath = false)
|
|||
return translate_projectname($content);
|
||||
}
|
||||
|
||||
function preg_callback_help_include($matches)
|
||||
{
|
||||
|
||||
if ($matches[1]) {
|
||||
$include = str_replace($matches[0], load_doc_file($matches[1]), $matches[0]);
|
||||
if (preg_match('/\.bb$/', $matches[1]) || preg_match('/\.txt$/', $matches[1])) {
|
||||
require_once('include/bbcode.php');
|
||||
$include = zidify_links(bbcode($include));
|
||||
$include = str_replace(' target="_blank"', '', $include);
|
||||
} elseif (preg_match('/\.md$/', $matches[1])) {
|
||||
$include = MarkdownExtra::defaultTransform($include);
|
||||
}
|
||||
return $include;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
|
@ -97,7 +74,6 @@ function preg_callback_help_include($matches)
|
|||
*/
|
||||
function determine_help_language()
|
||||
{
|
||||
|
||||
require_once('library/text_languagedetect/Text/LanguageDetect.php');
|
||||
|
||||
$lang_detect = new Text_LanguageDetect();
|
||||
|
|
|
@ -49,7 +49,6 @@ function hubloc_store_lowlevel($arr)
|
|||
|
||||
function site_store_lowlevel($arr)
|
||||
{
|
||||
|
||||
$store = [
|
||||
'site_url' => ((array_key_exists('site_url', $arr)) ? $arr['site_url'] : ''),
|
||||
'site_access' => ((array_key_exists('site_access', $arr)) ? $arr['site_access'] : 0),
|
||||
|
@ -73,10 +72,6 @@ function site_store_lowlevel($arr)
|
|||
return create_table_from_array('site', $store);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function prune_hub_reinstalls()
|
||||
{
|
||||
|
||||
|
@ -303,13 +298,11 @@ function hubloc_delete($hubloc) {
|
|||
|
||||
function locations_by_netid($netid)
|
||||
{
|
||||
|
||||
$locs = q(
|
||||
"select hubloc_addr as location from hubloc left join site on hubloc_url = site_url where hubloc_hash = '%s' and hubloc_deleted = 0 and site_dead = 0",
|
||||
dbesc($netid)
|
||||
);
|
||||
|
||||
|
||||
return array_elm_to_str($locs, 'location', ', ', 'trim_and_unpunify');
|
||||
}
|
||||
|
||||
|
@ -333,7 +326,6 @@ function ping_site($url)
|
|||
|
||||
function get_hubloc_addrs_by_hash($hash)
|
||||
{
|
||||
|
||||
return q(
|
||||
"select hubloc_addr from hubloc where hubloc_hash = '%s' and hubloc_deleted = 0",
|
||||
dbesc($hash)
|
||||
|
|
|
@ -23,15 +23,6 @@ use Code\Storage\Stdio;
|
|||
* @brief Network related functions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Returns path to CA file.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function get_capath()
|
||||
{
|
||||
return appdirpath() . '/library/cacert.pem';
|
||||
}
|
||||
|
||||
|
||||
function json_return_and_die($x, $content_type = 'application/json', $debug = false)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
The folder tests/ contains resources for automated testing tools.
|
||||
|
||||
Here you will find PHPUnit, Behat, etc. files to test the functionaly
|
||||
of Hubzilla. Right now it only contains some basic tests to see if feasable
|
||||
of this software. Right now it only contains some basic tests to see if feasable
|
||||
this can help improve the project.
|
||||
|
||||
# Contents
|
||||
|
|
|
@ -2,7 +2,7 @@ default:
|
|||
suites:
|
||||
default:
|
||||
paths:
|
||||
- %paths.base%/features
|
||||
- '%paths.base%/features'
|
||||
contexts:
|
||||
- Behat\MinkExtension\Context\MinkContext
|
||||
admin_features:
|
||||
|
@ -11,7 +11,7 @@ default:
|
|||
- AdminContext
|
||||
api_features:
|
||||
paths:
|
||||
- %paths.base%/features/api
|
||||
- '%paths.base%/features/api'
|
||||
filters:
|
||||
tags: "@api"
|
||||
contexts:
|
||||
|
|
|
@ -15,4 +15,4 @@ Feature: Local login
|
|||
When I fill in "id_username" with "behat"
|
||||
And I fill in "id_password" with "behat"
|
||||
And I press "submit"
|
||||
Then I should be on "/apps"
|
||||
Then I should be on "/stream"
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
beStrictAboutOutputDuringTests="true"
|
||||
beStrictAboutTodoAnnotatedTests="true"
|
||||
verbose="true">
|
||||
<testsuite name="Hubzilla default Test Suite">
|
||||
<testsuite name="Default Test Suite">
|
||||
<directory suffix="Test.php">./unit/</directory>
|
||||
</testsuite>
|
||||
<testsuite name="API Test Suite">
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
beStrictAboutOutputDuringTests="true"
|
||||
beStrictAboutTodoAnnotatedTests="true"
|
||||
verbose="true">
|
||||
<testsuite name="Hubzilla default Test Suite">
|
||||
<testsuite name="Default Test Suite">
|
||||
<directory suffix="Test.php">./unit/</directory>
|
||||
</testsuite>
|
||||
<testsuite name="API Test Suite">
|
||||
|
|
Loading…
Reference in a new issue