X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=doc%2Fautoloader.md;h=e1588688f187443066396031e2be023205957efe;hb=6d0f6babe3387d16c768fa0f779ee65acde1b5d1;hp=1a3b9a55b1034b258e43a06bce5653140ed7cdd9;hpb=a0530d1066d7268f1b1ea67bc3c254e9f9fc5ec8;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); [...] ```