Commit graph

62 commits

Author SHA1 Message Date
Roland Häder
61693419e8 Cleanups: isResult() more used, readability improved (#5608)
* [diaspora]: Maybe SimpleXMLElement is the right type-hint?

* Changes proposed + pre-renaming:
- pre-renamed $db -> $connection
- added TODOs for not allowing bad method invocations (there is a
  BadMethodCallException in SPL)

* If no record is found, below $r[0] will fail with a E_NOTICE and the code
doesn't behave as expected.

* Ops, one more left ...

* Continued:
- added documentation for Contact::updateSslPolicy() method
- added type-hint for $contact of same method
- empty lines added + TODO where the bug origins that $item has no element 'body'

* Added empty lines for better readability

* Cleaned up:
- no more x() (deprecated) usage but empty() instead
- fixed mixing of space/tab indending
- merged else/if block goether in elseif() (lesser nested code blocks)

* Re-fixed DBM -> DBA switch

* Fixes/rewrites:
- use empty()/isset() instead of deprecated x()
- merged 2 nested if() blocks into one
- avoided nested if() block inside else block by rewriting it to elseif()
- $contact_id is an integer, let's test on > 0 here
- added a lot spaces and some empty lines for better readability

* Rewrite:
- moved all CONTACT_* constants from boot.php to Contact class

* CR request:
- renamed Contact::CONTACT_IS_* -> Contact::* ;-)

* Rewrites:
- moved PAGE_* to Friendica\Model\Profile class
- fixed mixure with "Contact::* rewrite"

* Ops, one still there (return is no function)

* Rewrite to Proxy class:
- introduced new Friendica\Network\Proxy class for in exchange of proxy_*()
  functions
- moved also all PROXY_* constants there as Proxy::*
- removed now no longer needed mod/proxy.php loading as composer's auto-load
  will do this for us
- renamed those proxy_*() functions to better names:
  + proxy_init()           -> Proxy::init()         (public)
  + proxy_url()            -> Proxy::proxifyUrl()   (public)
  + proxy_parse_html()     -> Proxy::proxifyHtml()  (public)
  + proxy_is_local_image() -> Proxy::isLocalImage() (private)
  + proxy_parse_query()    -> Proxy::parseQuery()   (private)
  + proxy_img_cb()         -> Proxy::replaceUrl()   (private)

* CR request:
- moved all PAGE_* constants to Friendica\Model\Contact class
- fixed all references of both classes

* Ops, need to set $a here ...

* CR request:
- moved Proxy class to Friendica\Module
- extended BaseModule

* Ops, no need for own instance of $a when self::getApp() is around.

* Proxy-rewrite:
- proxy_url() and proxy_parse_html() are both non-module functions (now
  methods)
- so they must be splitted into a seperate class
- also the SIZE_* and DEFAULT_TIME constants are both not relevant to module

* No instances from utility classes

* Fixed error:
- proxify*() is now located in `Friendica\Util\ProxyUtils`

* Moved back to original place, ops? How did they move here? Well, it was not
intended by me.

* Removed duplicate (left-over from split) constants and static array. Thank to
MrPetovan finding it.

* Renamed ProxyUtils -> Proxy and aliased it back to ProxyUtils.

* Rewrite:
- stopped using deprecated NETWORK_* constants, now Protocol::* should be used
- still left them intact for slow/lazy developers ...

* Ops, was added accidentally ...

* Ops, why these wrong moves?

* Ops, one to much (thanks to MrPetovan)

* Ops, wrong moving ...

* moved back to original place ...

* spaces added

* empty lines add for better readability.

* convertered spaces -> tab for code indenting.

* CR request: Add space between if and brace.

* CR requests fixed + move reverted
- ops, src/Module/*.php has been moved to src/Network/ accidentally
- reverted some parts in src/Database/DBA.php as pointed out by Annando
- removed internal TODO items
- added some spaces for better readability
2018-08-24 01:05:49 -04:00
Roland Häder
e06fc2aa69 Stopped using deprecated constants NETWORK_* (#5537)
* Rewrite:
- stopped using deprecated NETWORK_* constants, now Protocol::* should be used
- still left them intact for slow/lazy developers ...

* Removed deprecated NETWORK_* constants as per code reviewer's request.
2018-08-11 22:40:44 +02:00
Roland Häder
37253656e3 Moved CONTACT_* constants to Friendica\Model\Contact class, lesser in global namespace (#5490)
* Rewrite:
- moved all CONTACT_* constants from boot.php to Contact class

* CR request:
- renamed Contact::CONTACT_IS_* -> Contact::* ;-)
2018-07-24 22:53:46 -04:00
Hypolite Petovan
a6fb3568f9 Rename dbesc to DBA::escape 2018-07-23 15:30:54 -04:00
Hypolite Petovan
ecea7425f8 Rename DBA::is_result to DBA::isResult 2018-07-23 11:04:14 -04:00
Hypolite Petovan
0ec44f3e8a Rename DBM method calls to DBA method calls 2018-07-23 11:02:24 -04:00
Michael
9d83369d88 DFRN payload is receivable via the Diaspora transport layer 2018-03-23 05:08:47 +00:00
Michael
24a20fc294 Improved logging for salmon posts to check for missing contacts in item post 2018-02-22 09:57:06 +00:00
Hypolite Petovan
7a38fbf84b [Scrutinizer] Fix undeclared variables part 7: mod/ and view/
- Remove unused function `salmon_return()`
2018-02-14 00:07:26 -05:00
Adam Magness
9b8599b619 Move functions to system
move some functions to system
2018-01-27 11:59:10 -05:00
Adam Magness
cd3643d174 Move xml_status and http_status_exit
move functions
2018-01-26 23:37:55 -05:00
Hypolite Petovan
e36f2bb1fb Use short form array syntax everywhere
- Add short form array syntax to po2php.php generation
2018-01-15 14:07:17 -05:00
Adam Magness
5358f5742e Rename create
rename create function to createFromProbe and update calls.
2018-01-09 11:40:25 -05:00
Adam Magness
c81e83c500 Review changes
Update update and new functions to updateFromProbe and create. Update calls to renamed functions.
2018-01-09 11:23:26 -05:00
Adam Magness
a59ab5552e Includes and calls
Remove includes and update function calls
2018-01-09 09:59:52 -05:00
Adam Magness
9e6bf79380 Crypto to src
move Crypto to src and Friendica\Util namespace
2017-12-30 11:51:49 -05:00
Adam Magness
2b121779a6 Salmon move to src
Salmon class, update function name and function calls. Some standards as well.
2017-12-02 09:32:45 -05:00
Adam Magness
cd12de46f8 OStatus moved to src
OStatus moved to Friendica\Protocol namespace. References and function calls updated.
Related to #3878
2017-11-15 23:09:11 -05:00
Adam Magness
4ca68c7af0 Class file relocations
Issue #3878
2017-11-08 08:37:03 -05:00
Adam Magness
0dfa57948f Issue-#3873
Replace deprecated functions with new syntax.
2017-11-07 06:24:39 -05:00
Hypolite Petovan
20043914e6 Move App to src
- Add `use Friendica\App;` wherever needed
2017-05-02 22:59:36 -04:00
Michael
e16fb74b0c Reworked OStatus communication part to better support Mastodon. 2017-04-19 21:37:00 +00:00
Hypolite Petovan
7b352f3f74 Revert "Coding convention applied - part 1" 2017-03-21 12:02:59 -04:00
Roland Häder
0cd241bcbe
added spaces + some curly braces + some usage of dbm::is_result()
Signed-off-by: Roland Häder <roland@mxchange.org>
2017-03-19 00:44:40 +01:00
Hypolite Petovan
a7ce601580 Normalize App parameter declaration (mod folder, 3 out of 3) 2017-01-09 23:14:55 +11:00
Roland Häder
4dce3d8224 changed to this:
---------------------
function bla (App &$a) {
	$a->bla = 'stuff';
}
---------------------

Signed-off-by: Roland Häder <roland@mxchange.org>
2016-12-20 10:58:55 +01:00
Roland Häder
fb676335db Coding convention applied:
- space between "if" and brace
- curly braces on conditional blocks

Signed-off-by: Roland Häder <roland@mxchange.org>
2016-12-20 10:10:33 +01:00
Roland Häder
46d383369c Cleanup for #3010 - added spaces, thanks to @annando .
Signed-off-by: Roland Häder <roland@mxchange.org>
2016-12-14 09:41:33 +01:00
Roland Häder
6a8a36f12d More usage of dbm::is_result($r) instead of count($r):
- count() returns very different results and never a boolean (not even false on
  error condition).
- therefore you should NOT use it in boolean expressions. This still *can* be
  done in PHP because of its lazyness. But it is discouraged if it comes to
  more clean code.

Signed-off-by: Roland Häder <roland@mxchange.org>
2016-12-13 10:44:13 +01:00
Michael Vogel
b93e1d73a1 New OStatus implementation 2016-03-30 12:43:15 +02:00
fabrixxm
b202e02fbf Revert "Updated modules to allow for partial overrides without errors"
This reverts commit db949bb802.
2016-02-07 15:11:34 +01:00
Andrej Stieben
db949bb802 Updated modules to allow for partial overrides without errors
Only define functions if they have not been defined before, e.g. in themes. This makes it possible to override parts of a module and still use the other functions.
2016-02-05 21:52:39 +01:00
Michael Vogel
3457f85833 Salmon: Don't store contact data before the message was authenticated. 2015-07-13 14:34:28 +02:00
Michael Vogel
0398bb67be Reworked salmon import 2015-07-13 08:06:51 +02:00
Michael Vogel
184dcf75a7 Caching for scrape, keywords for remote_self, notifications for addresses that aren't in your contact list. 2015-01-20 22:54:25 +01:00
zottel
7de5c7ebe1 Changes to make contacts delete all content from the user when a user is deleted.
NOTE: I didn't add "AND account_removed = 0" to facebook.php because I don't
have a clone of the addons repository. Please someone do that for me. Thanks.

Please check carefully. I tested locally on my server, but not with other
servers.
2012-11-02 21:43:47 +01:00
friendica
0820865265 provide ability to autofriend ostatus accounts 2012-06-07 20:20:13 -07:00
Alexander Kampmann
355c42cb30 Merge branch 'master' of https://github.com/friendica/friendica
Conflicts:
	include/config.php
	update.php
2012-04-05 13:39:15 +02:00
friendica
8aa2552372 add remove_user hook (it looks like dreamhost changed all my file permissions, this will make a nasty commit) 2012-01-18 16:21:30 -08:00
Friendika
2aef98f71d cripple account when expired 2011-09-19 01:17:12 -07:00
Friendika
1bfe1283aa crypto stuff 2011-08-09 18:55:46 -07:00
Friendika
48ffa880f0 cleanup 2011-08-07 16:15:54 -07:00
Friendika
2abcf76ec1 salmon protocol changes magicsig draft-experimental, fixes to hostxrd 2011-08-04 22:37:45 -07:00
Friendika
1d7d4bf8c6 wrong path for salmon verify 2011-07-20 23:14:43 -07:00
Friendika
c23657ab6e also check for blocked 2011-07-01 17:45:00 -07:00
Friendika
9816f14d40 statusnet improvements 2011-07-01 17:39:16 -07:00
Friendika
0b221e8945 bug #96 move libraries to library - better alignment of like rotator 2011-06-28 21:11:52 -07:00
Friendika
df8ac668b8 more calendar work, undo strict_privacy flag to use different approach 2011-06-08 21:06:02 -07:00
Friendika
c0094aa4f8 strict privacy mode (Friendika-Z) - refuse to talk to networks with privacy issues 2011-06-06 16:26:11 -07:00
Friendika
b2e92e0af3 deprecate load_view_file 2011-05-11 04:37:13 -07:00