X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=doc%2Fautoloader.md;h=e1588688f187443066396031e2be023205957efe;hb=66fec8944f4af97260e4abdee4279e7cf18e5b48;hp=1a3b9a55b1034b258e43a06bce5653140ed7cdd9;hpb=c22920edba4f80fee2d828a9fe265a9cb702e81c;p=friendica.git diff --git a/doc/autoloader.md b/doc/autoloader.md index 1a3b9a55b1..e1588688f1 100644 --- a/doc/autoloader.md +++ b/doc/autoloader.md @@ -47,8 +47,10 @@ The code will be something like: // mod/network.php getAll(); // pass $items to template @@ -104,7 +106,7 @@ class Dfrn { mail_post($a){ ... - Friendica\dfrn::mail($item, $owner); + Friendica\Protocol\DFRN::mail($item, $owner); ... } ``` @@ -117,6 +119,8 @@ If your code is in same namespace as the class you need, you don't need to prepe namespace Friendica; +use Friendica\Protocol\DFRN; + // this is the same content of current include/delivery.php, // but has been declared to be in "Friendica" namespace @@ -125,12 +129,12 @@ switch($contact['network']) { case NETWORK_DFRN: if ($mail) { $item['body'] = ... - $atom = Dfrn::mail($item, $owner); + $atom = DFRN::mail($item, $owner); } elseif ($fsuggest) { - $atom = Dfrn::fsuggest($item, $owner); + $atom = DFRN::fsuggest($item, $owner); q("DELETE FROM `fsuggest` WHERE `id` = %d LIMIT 1", intval($item['id'])); } elseif ($relocate) - $atom = Dfrn::relocate($owner, $uid); + $atom = DFRN::relocate($owner, $uid); [...] ```