streams/Code/Module
2023-04-27 12:57:29 -07:00
..
Admin part of issue #64. 2023-03-28 19:23:25 +11:00
Dev add custom accepts to libzot 2023-03-19 20:50:04 +11:00
Settings identity manager (wip) 2023-04-25 14:47:05 +10:00
Acloader.php Acloader: auto-complete remove duplicate addrs as well as portable_ids. 2023-02-16 11:51:46 -08:00
Activity.php rename function 2023-01-21 09:35:14 +11:00
Admin.php
Affinity.php
Album.php
Api.php
Appman.php
Apporder.php
Apps.php
Apschema.php
Attach.php don't process markdown on inbound bbcode messages 2023-04-20 19:44:54 +10:00
Authorize.php cleanup 2022-12-31 05:41:02 +11:00
Block.php
Blocks.php
Ca.php
Cal.php
Calendar.php
Card_edit.php
Cards.php
Categories.php
Cdav.php improve the logic 2023-01-28 08:10:07 +11:00
Changeaddr.php
Channel.php search hashtags by configurable min or max total hashtags 2023-03-09 12:19:40 +11:00
Chanview.php
Chat.php
Chatsvc.php
Clients.php
Cloud.php
Cloud_tiles.php
Comment_control.php
Common.php
Communities.php
Connac.php
Connect.php
Connections.php add photo dropdown to connections page 2023-01-27 07:09:37 +11:00
Connedit.php
Contactgroup.php
Content_filter.php
Conversation.php
Cover_photo.php
Dav.php improve the logic 2023-01-28 08:10:07 +11:00
Defperms.php
Dev.php
Dircensor.php
Directory.php
Dirsearch.php
Display.php search hashtags by configurable min or max total hashtags 2023-03-09 12:19:40 +11:00
Drafts.php
Dreport.php
Editblock.php
Editlayout.php
Editpost.php
Editwebpage.php
Email_resend.php
Email_validation.php
Embed.php
Embedfiles.php Update Embedfiles.php 2023-03-13 16:05:47 -04:00
Embedphotos.php yet more work on preventing duplicate videos 2023-04-17 12:25:16 -07:00
Event.php
Events.php
Expire.php
Export_follows.php add rejections to $hidden_activities 2023-01-02 14:02:11 +11:00
Fastping.php
Fbrowser.php
Fedi_id.php
Feed.php
File_upload.php
Filer.php
Filerm.php
Filestorage.php
Follow.php federation fixes for lemmy 2023-02-25 07:32:36 +11:00
Followers.php
Following.php
Future.php
Getfile.php check all hublocs 2023-01-26 12:43:23 -08:00
Hashtags.php
Help.php queue work 2023-02-13 21:51:17 +11:00
Home.php filter appropriately 2023-04-28 05:48:45 +10:00
Id.php rename function 2023-01-21 09:35:14 +11:00
Impel.php
Import.php
Import_items.php
Inbox.php getting arrays in actor 2023-04-23 17:22:00 +10:00
Inspect.php cleanup 2023-01-02 19:49:52 +11:00
Invite.php
Item.php yet more work on preventing duplicate videos 2023-04-17 12:25:16 -07:00
Jwks.php
Lang.php
Layouts.php
Legal.php
Like.php add timestamp to like activities 2023-02-17 19:22:34 -08:00
Linkinfo.php
Lists.php
Lockview.php
Locs.php
Login.php
Logout.php
Lostpass.php
Magic.php missing class 2023-03-19 21:44:21 +11:00
Manage.php more work on identity manageer 2023-04-27 21:06:01 +10:00
Manifest.php
Markup.php
Menu.php
Mitem.php
Moderate.php
Mood.php
New_channel.php
Nomad.php
Notes.php
Notifications.php
Notify.php
Nullbox.php
Oauthinfo.php
Oembed.php
Oep.php
Online.php
Outbox.php make the same changes to the C2S subsystem 2023-01-02 19:02:23 +11:00
Owa.php fix a few more places where hubloc_addr confusion can potentially occur. 2023-01-01 07:02:03 +11:00
Page.php
Pconfig.php preliminary mfa 2023-03-01 18:08:09 +11:00
Pdledit.php
Permcat.php
Photo.php
Photomap.php
Photos.php Merge branch 'bootstrap' of codeberg.org:streams/streams into dev 2023-01-30 21:11:01 +11:00
Pin.php
Ping.php enotify anomaly 2023-04-19 11:47:23 +10:00
Plike.php
Poco.php
Poke.php
Poster.php
Pretheme.php
Profile.php postgres errors 2023-04-26 22:37:54 -07:00
Profile_photo.php
Profperm.php
Pubstream.php search hashtags by configurable min or max total hashtags 2023-03-09 12:19:40 +11:00
Q.php
Randprof.php
React.php
README.md
Register.php sites->communities and increase max supported thread depth 2023-03-18 08:29:31 +11:00
Regmod.php
Regver.php
Removeaccount.php
Removeme.php
Rmagic.php fix a few more places where hubloc_addr confusion can potentially occur. 2023-01-01 07:02:03 +11:00
Rpost.php cleanup 2023-03-18 11:29:56 +11:00
Safe.php
Search.php add dns search to search module 2023-04-20 09:07:46 +10:00
Search_ac.php
Secrets.php
Service_limits.php
Settings.php
Setup.php
Share.php
Sharedwithme.php
Smilies.php
Sources.php don't process markdown on inbound bbcode messages 2023-04-20 19:44:54 +10:00
Sslify.php
Starred.php
Stream.php postgres errors 2023-04-26 22:37:54 -07:00
Subthread.php
Suggestions.php
Superblock.php white screen after unblocking a superblocked channel. 2023-01-31 14:31:35 +11:00
Tagadelic.php
Tagger.php
Tagrm.php
Tasks.php
Theme_info.php
Thing.php
Toggle_safesearch.php
Token.php
Totp_check.php fixes mfa escape from form 2023-03-08 22:33:33 +11:00
Uexport.php
Update.php
Userinfo.php
View.php
Viewconnections.php
Viewsrc.php
Vote.php
Wall_attach.php Search permissions part 2 with the dev doco. 2023-01-22 12:28:38 +11:00
Wall_upload.php
Webfinger.php
Webpages.php
Well_known.php
Xp.php
Xref.php
Zot.php

Code/Module

This directory contains controller modules for handling web requests. The lowercase class name indicates the head of the URL path which this module handles. There are other methods of attaching (routing) URL paths to controllers, but this is the primary method used in this project.

Module controllers MUST reside in this directory and namespace to be autoloaded (unless other specific routing methods are employed). They typically use and extend the class definition in Code/Web/Controller as a template.

Template:

<?php

namespace Code\Web;


class Controller {

	function init() {}
	function post() {}
	function get() {}

}

Typical Module declaration for the '/foo' URL route:

<?php
namespace Code\Module;

class Foo extends \Code\Web\Controller {

	function init() {
		// init() handler goes here
	}

	function post() {
		// post handler goes here
	}

	function get() {
		return 'Hello world.' . EOL;
	}

}

This model provides callbacks for public functions named init(), post(), and get(). init() is always called. post() is called if $_POST variables are present, and get() is called if none of the prior functions terminated the handler. The get() method typically retuns a string which represents the contents of the content region of the resulting page. Modules which emit json, xml or other machine-readable formats typically emit their contents inside the init() function and call 'killme()' to terminate the Module.

Modules are passed the URL path as argc,argv arguments. For a path such as

https://mysite.something/foo/bar/baz

The app will typically invoke the Module class 'Foo' and pass it

$x = argc(); // $x = 3

$x = argv(0); // $x = 'foo'
$x = argv(1); // $x = 'bar'
$x = argv(2); // $x = 'baz'

These are handled in a similar fashion to their counterparts in the Unix shell or C/C++ languages. Do not confuse the argc(),argv() functions with the global variables $argc,$argv which are passed to command line programs. These are handled separately by command line and Code/Daemon class functions.