mirror of
https://github.com/friendica/friendica
synced 2025-05-09 09:44:10 +02:00
Update use statement lists with new Friendica\Database\dba class
- Remove unused use statement - Remove superfluous use statements (classes in the same namespace) - Add missing use statements
This commit is contained in:
parent
c316c5ae30
commit
daa1177e3a
128 changed files with 262 additions and 259 deletions
|
@ -36,10 +36,9 @@ namespace Friendica\Util;
|
|||
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\PConfig;
|
||||
use Friendica\Database\dba;
|
||||
use Friendica\Database\DBM;
|
||||
use Friendica\Model\User;
|
||||
use Friendica\Util\Network;
|
||||
use dba;
|
||||
|
||||
require_once 'include/dba.php';
|
||||
|
||||
|
|
|
@ -6,16 +6,14 @@
|
|||
namespace Friendica\Util;
|
||||
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Database\dba;
|
||||
use Friendica\Database\DBM;
|
||||
use Friendica\Util\Crypto;
|
||||
use Friendica\Util\HTTPHeaders;
|
||||
use dba;
|
||||
|
||||
/**
|
||||
* @brief Implements HTTP Signatures per draft-cavage-http-signatures-07.
|
||||
*
|
||||
* Ported from Hubzilla: https://framagit.org/hubzilla/core/blob/master/Zotlabs/Web/HTTPSig.php
|
||||
*
|
||||
*
|
||||
* @see https://tools.ietf.org/html/draft-cavage-http-signatures-07
|
||||
*/
|
||||
|
||||
|
@ -26,13 +24,13 @@ class HTTPSignature
|
|||
*
|
||||
* Disabled until Friendica's ActivityPub implementation
|
||||
* is ready.
|
||||
*
|
||||
*
|
||||
* @see https://tools.ietf.org/html/rfc5843
|
||||
*
|
||||
* @param string $body The value to create the digest for
|
||||
* @param boolean $set (optional, default true)
|
||||
* If set send a Digest HTTP header
|
||||
*
|
||||
*
|
||||
* @return string The generated digest of $body
|
||||
*/
|
||||
// public static function generateDigest($body, $set = true)
|
||||
|
@ -174,7 +172,7 @@ class HTTPSignature
|
|||
|
||||
/**
|
||||
* Fetch the public key for Activity Pub contact.
|
||||
*
|
||||
*
|
||||
* @param string|int The identifier (contact addr or contact ID).
|
||||
* @return string|boolean The public key or false on failure.
|
||||
*/
|
||||
|
@ -222,7 +220,7 @@ class HTTPSignature
|
|||
* @param string $alg (optional, default 'sha256')
|
||||
* @param string $crypt_key (optional, default null)
|
||||
* @param string $crypt_algo (optional, default 'aes256ctr')
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function createSig($request, $head, $prvkey, $keyid = 'Key', $send_headers = false, $auth = false, $alg = 'sha256', $crypt_key = null, $crypt_algo = 'aes256ctr')
|
||||
|
@ -285,7 +283,7 @@ class HTTPSignature
|
|||
* @param array $head
|
||||
* @param string $prvkey
|
||||
* @param string $alg (optional) default 'sha256'
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private static function sign($request, $head, $prvkey, $alg = 'sha256')
|
||||
|
@ -315,7 +313,7 @@ class HTTPSignature
|
|||
|
||||
$ret['headers'] = $fields;
|
||||
$ret['signature'] = $sig;
|
||||
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
@ -367,7 +365,7 @@ class HTTPSignature
|
|||
*
|
||||
* @param string $header
|
||||
* @param string $prvkey (optional), if not set use site private key
|
||||
*
|
||||
*
|
||||
* @return array|string associative array, empty string if failue
|
||||
* - \e string \b iv
|
||||
* - \e string \b key
|
||||
|
|
|
@ -5,15 +5,12 @@
|
|||
*/
|
||||
namespace Friendica\Util;
|
||||
|
||||
use DOMDocument;
|
||||
use DOMXPath;
|
||||
use Friendica\Content\OEmbed;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Database\dba;
|
||||
use Friendica\Object\Image;
|
||||
use Friendica\Util\Network;
|
||||
use Friendica\Util\XML;
|
||||
|
||||
use dba;
|
||||
use DOMXPath;
|
||||
use DOMDocument;
|
||||
|
||||
require_once 'include/dba.php';
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue