@@ -43,17 +43,6 @@ Basics
43
43
- [ Use your own extended types] ({{ site.doc_baseurl }}/#use-your-own-extended-types)
44
44
- [ Create your own property validator] ({{ site.doc_baseurl }}/#create-your-own-property-validator)
45
45
- [ Dialects management] ({{ site.doc_baseurl }}/activitypub-dialects-management.html)
46
- - [ Server] ( #server )
47
- - [ Server instance configuration] ({{ site.doc_baseurl }}/activitypub-server-usage.html)
48
- - [ Verify HTTP signatures] ({{ site.doc_baseurl }}/activitypub-server-verify-http-signatures.html)
49
- - [ WebFinger] ({{ site.doc_baseurl }}/#webfinger)
50
- - [ WebFinger::toArray()] ({{ site.doc_baseurl }}/#webfingertoarray)
51
- - [ WebFinger::getSubject()] ({{ site.doc_baseurl }}/#webfingergetsubject)
52
- - [ WebFinger::getProfileId()] ({{ site.doc_baseurl }}/#webfingergetprofileid)
53
- - [ WebFinger::getHandle()] ({{ site.doc_baseurl }}/#webfingergethandle)
54
- - [ WebFinger::getAliases()] ({{ site.doc_baseurl }}/#webfingergetaliases)
55
- - [ WebFinger::getLinks()] ({{ site.doc_baseurl }}/#webfingergetlinks)
56
- - [ Examples] ({{ site.doc_baseurl }}/#server-examples)
57
46
58
47
________________________________________________________________________
59
48
@@ -68,7 +57,7 @@ Install
68
57
-------
69
58
70
59
``` sh
71
- composer require landrok /activitypub
60
+ composer require rtio /activitypub-core
72
61
```
73
62
________________________________________________________________________
74
63
77
66
78
67
### Type factory
79
68
80
- You can instanciate ActivityStreams types using their short name.
69
+ You can instantiate ActivityStreams types using their short name.
81
70
82
71
``` php
83
72
use ActivityPhp\Type;
@@ -87,7 +76,7 @@ $note = Type::create('Note');
87
76
88
77
```
89
78
90
- Instanciating a type and setting properties is possible with the second
79
+ Instantiate a type and setting properties is possible with the second
91
80
parameter.
92
81
93
82
``` php
@@ -100,7 +89,7 @@ $note = Type::create('Note', [
100
89
```
101
90
102
91
Starting from an array with a 'type' key, it's even possible to directly
103
- instanciate your type.
92
+ instantiate your type.
104
93
105
94
``` php
106
95
use ActivityPhp\Type;
@@ -519,218 +508,17 @@ and how to use them thanks to
519
508
520
509
________________________________________________________________________
521
510
522
-
523
- Server
524
- ------
525
-
526
- A server instance is the entry point to a federation.
527
-
528
- Its purpose is to receive, send and forward activities appropriately.
529
-
530
- A minimalistic approach is:
531
-
532
- ``` php
533
- use ActivityPhp\Server;
534
-
535
- $server = new Server();
536
- ```
537
-
538
- It's sufficient to make [ some public requests] ( #server-examples ) .
539
-
540
- For more advanced server configurations, Have a look at [ Server Manual] ({{ site.doc_baseurl }}/activitypub-server-usage.html).
541
-
542
- ### WebFinger
543
-
544
- WebFinger is a protocol that allows for discovery of information about
545
- people.
546
-
547
- Given a handle, ActivityPub instances can discover profiles using this
548
- protocol.
549
-
550
- ``` php
551
- use ActivityPhp\Server;
552
-
553
- $server = new Server();
554
-
555
- $handle = 'bob@example.org';
556
-
557
- // Get a WebFinger instance
558
- $webfinger = $server->actor($handle)->webfinger();
559
- ```
560
-
561
- In this implementation, we can use an Object Identifier (URI) instead of
562
- a WebFinger handle.
563
-
564
-
565
- ``` php
566
- use ActivityPhp\Server;
567
-
568
- $server = new Server();
569
-
570
- $handle = 'https://example.org/users/bob';
571
-
572
- // Get a WebFinger instance
573
- $webfinger = $server->actor($handle)->webfinger();
574
- ```
575
- ________________________________________________________________________
576
-
577
- ### WebFinger::toArray()
578
-
579
- Get all WebFinger data as an array.
580
-
581
- ``` php
582
- use ActivityPhp\Server;
583
-
584
- $server = new Server();
585
-
586
- $handle = 'bob@example.org';
587
-
588
- // Get a WebFinger instance
589
- $webfinger = $server->actor($handle)->webfinger();
590
-
591
- // Dumps all properties
592
- print_r($webfinger->toArray());
593
-
594
- // A one line call
595
- print_r(
596
- $server->actor($handle)->webfinger()->toArray()
597
- );
598
- ```
599
-
600
- Would output something like:
601
-
602
- ```
603
- Array
604
- (
605
- [subject] => acct:bob@example.org
606
- [aliases] => Array
607
- (
608
- [0] => http://example.org/users/bob
609
- )
610
- [links] => Array
611
- (
612
- [0] => Array
613
- (
614
- [rel] => self
615
- [type] => application/activity+json
616
- [href] => http://example.org/users/bob
617
- )
618
- )
619
- )
620
- ```
621
- ________________________________________________________________________
622
-
623
- ### WebFinger::getSubject()
624
-
625
- Get a WebFinger resource.
626
-
627
- ``` php
628
- echo $webfinger->getSubject();
629
-
630
- // Would output 'acct:bob@example.org'
631
- ```
632
- ________________________________________________________________________
633
-
634
- ### WebFinger::getProfileId()
635
-
636
- Get ActivityPub object identifier (URI).
637
-
638
- ``` php
639
- echo $webfinger->getProfileId();
640
-
641
- // Would output 'http://example.org/users/bob'
642
- ```
643
- ________________________________________________________________________
644
-
645
- ### WebFinger::getHandle()
646
-
647
- Get a profile handle.
648
-
649
- ``` php
650
- echo $webfinger->getHandle();
651
-
652
- // Would output 'bob@example.org'
653
- ```
654
- ________________________________________________________________________
655
-
656
- ### WebFinger::getAliases()
657
-
658
- Get all aliases entries for this profile.
659
-
660
- ``` php
661
- print_r(
662
- $webfinger->getAliases()
663
- );
664
- ```
665
-
666
- Would output something like:
667
-
668
- ```
669
- Array
670
- (
671
- [0] => http://example.org/users/bob
672
- )
673
- ```
674
-
675
- ________________________________________________________________________
676
-
677
- ### WebFinger::getLinks()
678
-
679
- Get all links entries for this profile.
680
-
681
- ``` php
682
-
683
- print_r(
684
- $webfinger->getLinks()
685
- );
686
-
687
- ```
688
-
689
- Would output something like:
690
-
691
- ```
692
- Array
693
- (
694
- [0] => Array
695
- (
696
- [rel] => self
697
- [type] => application/activity+json
698
- [href] => http://example.org/users/bob
699
- )
700
- )
701
-
702
- ```
703
-
704
- ________________________________________________________________________
705
-
706
-
707
- Server examples
708
- ---------------
709
-
710
- - [ Fetch Peertube Outbox activities] ({{ site.doc_baseurl }}/fetch-peertube-outbox-activities.html)
711
- - [ A better way to fetch Peertube Outbox activities] ({{ site.doc_baseurl }}/fetch-peertube-outbox-activities-using-dialects.html)
712
- - [ An even better way to fetch Peertube Outbox activities] ({{ site.doc_baseurl }}/fetch-peertube-outbox-activities-using-ontologies.html)
713
-
714
- ________________________________________________________________________
715
-
716
-
717
511
More
718
512
----
719
513
720
- - [ Contribute on Github] ( https://github.com/landrok/activitypub )
721
-
722
- - To discuss new features, make feedback or simply to share ideas, you
723
- can contact me on Mastodon at
724
- [ https://cybre.space/@landrok ] ( https://cybre.space/@landrok )
514
+ - [ Contribute on Github] ( https://github.com/rtio/activitypub-core )
725
515
726
516
- [ ActivityPub] ( https://www.w3.org/TR/activitypub/ )
727
517
728
518
- [ ActivityStreams 2.0] ( https://www.w3.org/TR/activitystreams-core/ )
729
519
730
520
- [ JSON-LD] ( https://www.w3.org/TR/json-ld/ )
731
521
732
- - [ WebFinger] ( https://tools.ietf.org/html/rfc7033 )
733
-
734
522
________________________________________________________________________
735
523
736
524
0 commit comments