streams/Code/Module
2022-09-28 07:27:09 +10:00
..
Admin wrong variable in dbsync 2022-09-16 12:58:40 -07:00
Dev item decoding and preview for dev/ap_probe 2022-08-12 20:13:58 +10:00
Settings geo 2022-09-16 20:57:04 +10:00
Acloader.php WIP: revive bang tags 2022-09-28 07:27:09 +10:00
Activity.php cleanup 2022-08-21 08:30:14 +10:00
Admin.php cleanup 2022-09-04 10:20:42 +10:00
Affinity.php cleanup 2022-09-04 10:20:42 +10:00
Album.php cleanup 2022-09-04 10:20:42 +10:00
Api.php cleanup 2022-09-04 10:20:42 +10:00
Appman.php more cleanup 2022-08-27 08:37:04 +10:00
Apporder.php more cleanup 2022-08-27 08:37:04 +10:00
Apps.php cleanup 2022-09-04 10:20:42 +10:00
Apschema.php it's done 2022-02-15 20:08:28 -08:00
Attach.php Rename Stdio::fpipe => Stdio::fcopy and remove some cruft that is no longer needed. 2022-06-24 13:28:29 -07:00
Authorize.php cleanup 2022-08-21 08:30:14 +10:00
Block.php more cleanup 2022-08-27 08:37:04 +10:00
Blocks.php more cleanup 2022-08-27 08:37:04 +10:00
Ca.php code cleanup 2022-08-14 19:20:43 +10:00
Cal.php deprecate block_public 2022-06-01 14:18:51 -07:00
Calendar.php rename include/text -> include/misc 2022-06-17 16:59:11 -07:00
Card_edit.php cleanup 2022-09-04 10:20:42 +10:00
Cards.php more cleanup 2022-08-27 08:37:04 +10:00
Categories.php more cleanup 2022-08-27 08:37:04 +10:00
Cdav.php more cleanup 2022-08-27 08:37:04 +10:00
Changeaddr.php cleanup 2022-09-04 10:20:42 +10:00
Channel.php add distance support to stream queries 2022-09-17 07:55:12 +10:00
Chanview.php cleanup 2022-09-04 10:20:42 +10:00
Chat.php cleanup 2022-09-04 10:20:42 +10:00
Chatsvc.php cleanup 2022-09-04 10:20:42 +10:00
Clients.php it's done 2022-02-15 20:08:28 -08:00
Cloud.php code cleanup 2022-08-14 19:20:43 +10:00
Cloud_tiles.php it's done 2022-02-15 20:08:28 -08:00
Comment_control.php it's done 2022-02-15 20:08:28 -08:00
Common.php typos 2022-02-15 22:10:50 -08:00
Communities.php cleanup 2022-09-04 10:20:42 +10:00
Connac.php it's done 2022-02-15 20:08:28 -08:00
Connect.php cleanup 2022-09-04 10:20:42 +10:00
Connections.php cleanup 2022-09-04 10:20:42 +10:00
Connedit.php cleanup 2022-09-03 17:08:23 +10:00
Contactgroup.php it's done 2022-02-15 20:08:28 -08:00
Content_filter.php cleanup 2022-09-02 06:50:26 +10:00
Conversation.php it's done 2022-02-15 20:08:28 -08:00
Cover_photo.php add resizer class to do the cmd-line imagick resize and avoid memory exhaustion 2022-09-11 17:35:47 +10:00
Dav.php cleanup 2022-09-04 11:35:50 +10:00
Defperms.php cleanup 2022-09-04 13:01:34 +10:00
Dev.php code cleanup 2022-08-13 12:09:50 +10:00
Dircensor.php cleanup 2022-09-04 11:35:50 +10:00
Directory.php cleanup 2022-09-04 16:28:17 +10:00
Dirsearch.php cleanup 2022-09-04 11:35:50 +10:00
Display.php add distance support to stream queries 2022-09-17 07:55:12 +10:00
Drafts.php it's done 2022-02-15 20:08:28 -08:00
Dreport.php cleanup 2022-09-04 11:35:50 +10:00
Editblock.php cleanup 2022-09-04 11:35:50 +10:00
Editlayout.php cleanup 2022-09-04 11:35:50 +10:00
Editpost.php codeberg issue #9, white screen of death when editing post containing share 2022-09-11 11:10:20 +10:00
Editwebpage.php cleanup 2022-09-04 11:35:50 +10:00
Email_resend.php cleanup 2022-09-04 11:35:50 +10:00
Email_validation.php it's done 2022-02-15 20:08:28 -08:00
Embed.php it's done 2022-02-15 20:08:28 -08:00
Embedphotos.php cleanup 2022-09-04 11:35:50 +10:00
Event.php it's done 2022-02-15 20:08:28 -08:00
Events.php deprecate the interactive argument to drop_item() 2022-06-26 01:36:02 -07:00
Expire.php cleanup 2022-09-04 11:35:50 +10:00
Fastping.php cleanup 2022-09-05 08:39:58 +10:00
Fbrowser.php cleanup 2022-09-04 11:35:50 +10:00
Fedi_id.php rename discover_by_webbie() to discover_resource() 2022-09-04 07:30:13 +10:00
Feed.php deprecate block_public 2022-06-01 14:18:51 -07:00
File_upload.php cleanup 2022-09-04 11:35:50 +10:00
Filer.php cleanup 2022-09-04 11:35:50 +10:00
Filerm.php it's done 2022-02-15 20:08:28 -08:00
Filestorage.php cleanup 2022-09-04 11:35:50 +10:00
Follow.php cleanup 2022-09-04 11:35:50 +10:00
Followers.php smell: remove pesky profile hide_friends setting and from now on rely on permissions view_contacts attribute 2022-09-04 20:40:28 -07:00
Following.php smell: remove pesky profile hide_friends setting and from now on rely on permissions view_contacts attribute 2022-09-04 20:40:28 -07:00
Future.php it's done 2022-02-15 20:08:28 -08:00
Getfile.php cleanup 2022-09-04 11:35:50 +10:00
Hashtags.php it's done 2022-02-15 20:08:28 -08:00
Help.php cleanup 2022-09-04 16:28:17 +10:00
Home.php cleanup 2022-09-04 11:35:50 +10:00
Id.php cleanup 2022-09-04 11:35:50 +10:00
Impel.php cleanup 2022-09-04 11:35:50 +10:00
Import.php cleanup 2022-09-04 11:35:50 +10:00
Import_items.php cleanup 2022-09-04 11:35:50 +10:00
Inbox.php geo 2022-09-16 20:57:04 +10:00
Inspect.php begin hubloc refactor 2022-06-16 19:46:54 -07:00
Invite.php it's done 2022-02-15 20:08:28 -08:00
Item.php WIP: revive bang tags 2022-09-28 07:27:09 +10:00
Jwks.php cleanup 2022-09-03 15:23:54 +10:00
Lang.php it's done 2022-02-15 20:08:28 -08:00
Layouts.php cleanup 2022-09-04 11:35:50 +10:00
Legal.php cleanup 2022-09-04 10:01:52 +10:00
Like.php cleanup 2022-09-03 15:23:54 +10:00
Linkinfo.php cleanup 2022-09-04 11:35:50 +10:00
Lists.php cleanup 2022-09-04 11:35:50 +10:00
Lockview.php php 8.1 changes 2022-03-15 01:42:34 -07:00
Locs.php cleanup 2022-09-04 11:35:50 +10:00
Login.php it's done 2022-02-15 20:08:28 -08:00
Logout.php it's done 2022-02-15 20:08:28 -08:00
Lostpass.php cleanup 2022-09-04 11:35:50 +10:00
Magic.php cleanup 2022-09-04 11:35:50 +10:00
Manage.php cleanup 2022-09-04 11:35:50 +10:00
Manifest.php cleanup 2022-09-04 11:35:50 +10:00
Markup.php cleanup 2022-09-04 11:35:50 +10:00
Menu.php cleanup 2022-09-04 11:35:50 +10:00
Mitem.php cleanup 2022-09-04 10:01:52 +10:00
Moderate.php add moderation app 2022-09-22 20:34:28 +10:00
Mood.php cleanup 2022-09-04 11:35:50 +10:00
New_channel.php cleanup 2022-09-04 11:35:50 +10:00
Nomad.php rename endpoint 2022-08-31 13:43:07 -07:00
Notes.php cleanup 2022-09-04 11:35:50 +10:00
Notifications.php cleanup 2022-09-04 11:35:50 +10:00
Notify.php cleanup 2022-09-03 15:23:54 +10:00
Nullbox.php it's done 2022-02-15 20:08:28 -08:00
Oauthinfo.php it's done 2022-02-15 20:08:28 -08:00
Oembed.php cleanup 2022-09-04 11:35:50 +10:00
Oep.php cleaner display urls 2022-07-20 04:26:28 -07:00
Online.php it's done 2022-02-15 20:08:28 -08:00
Outbox.php geo 2022-09-16 20:57:04 +10:00
Owa.php cleanup 2022-09-04 10:01:52 +10:00
Page.php cleanup 2022-09-04 10:01:52 +10:00
Pconfig.php it's done 2022-02-15 20:08:28 -08:00
Pdledit.php cleanup 2022-09-04 10:01:52 +10:00
Permcat.php it's done 2022-02-15 20:08:28 -08:00
Photo.php cleanup 2022-09-04 10:01:52 +10:00
Photomap.php it's done 2022-02-15 20:08:28 -08:00
Photos.php deprecate format_like() 2022-09-18 09:28:33 +10:00
Pin.php it's done 2022-02-15 20:08:28 -08:00
Ping.php it's done 2022-02-15 20:08:28 -08:00
Plike.php deprecate the interactive argument to drop_item() 2022-06-26 01:36:02 -07:00
Poco.php it's done 2022-02-15 20:08:28 -08:00
Poke.php it's done 2022-02-15 20:08:28 -08:00
Poster.php it's done 2022-02-15 20:08:28 -08:00
Pretheme.php it's done 2022-02-15 20:08:28 -08:00
Profile.php cleanup 2022-09-03 15:23:54 +10:00
Profile_photo.php cleanup 2022-09-03 15:23:54 +10:00
Profiles.php smell: remove pesky profile hide_friends setting and from now on rely on permissions view_contacts attribute 2022-09-04 20:40:28 -07:00
Profperm.php it's done 2022-02-15 20:08:28 -08:00
Pubstream.php add distance support to stream queries 2022-09-17 07:55:12 +10:00
Q.php begin hubloc refactor 2022-06-16 19:46:54 -07:00
Randprof.php it's done 2022-02-15 20:08:28 -08:00
React.php it's done 2022-02-15 20:08:28 -08:00
README.md it's done 2022-02-15 20:08:28 -08:00
Register.php Finish issue #7. Theme the legal page and replace all the links pointing to the old one. 2022-08-29 22:06:51 -07:00
Regmod.php it's done 2022-02-15 20:08:28 -08:00
Regver.php it's done 2022-02-15 20:08:28 -08:00
Removeaccount.php cleanup 2022-09-02 06:50:26 +10:00
Removeme.php it's done 2022-02-15 20:08:28 -08:00
Rmagic.php begin hubloc refactor 2022-06-16 19:46:54 -07:00
Rpost.php cleanup 2022-08-21 08:07:53 +10:00
Safe.php it's done 2022-02-15 20:08:28 -08:00
Search.php add distance support to stream queries 2022-09-17 07:55:12 +10:00
Search_ac.php it's done 2022-02-15 20:08:28 -08:00
Secrets.php it's done 2022-02-15 20:08:28 -08:00
Service_limits.php it's done 2022-02-15 20:08:28 -08:00
Settings.php it's done 2022-02-15 20:08:28 -08:00
Setup.php cleanup 2022-09-27 05:42:54 +10:00
Share.php it's done 2022-02-15 20:08:28 -08:00
Sharedwithme.php rename include/text -> include/misc 2022-06-17 16:59:11 -07:00
Smilies.php it's done 2022-02-15 20:08:28 -08:00
Sources.php it's done 2022-02-15 20:08:28 -08:00
Sslify.php Sslify: URL cannot be NULL 2022-08-29 22:31:40 -07:00
Starred.php it's done 2022-02-15 20:08:28 -08:00
Stream.php add distance support to stream queries 2022-09-17 07:55:12 +10:00
Subthread.php cleaner display urls 2022-07-20 04:26:28 -07:00
Suggestions.php it's done 2022-02-15 20:08:28 -08:00
Superblock.php rename discover_by_webbie() to discover_resource() 2022-09-04 07:30:13 +10:00
Tagadelic.php it's done 2022-02-15 20:08:28 -08:00
Tagger.php more cleanup 2022-09-17 10:25:44 +10:00
Tagrm.php it's done 2022-02-15 20:08:28 -08:00
Tasks.php task sync 2022-03-17 19:26:10 -07:00
Theme_info.php code cleanup continued 2022-02-24 13:00:41 -08:00
Thing.php it's done 2022-02-15 20:08:28 -08:00
Toggle_safesearch.php it's done 2022-02-15 20:08:28 -08:00
Token.php it's done 2022-02-15 20:08:28 -08:00
Uexport.php deprecate ostatus:conversation 2022-05-19 13:47:30 -07:00
Update.php code cleanup 2022-08-13 20:57:14 +10:00
Userinfo.php it's done 2022-02-15 20:08:28 -08:00
View.php more cleanup 2022-08-27 08:37:04 +10:00
Viewconnections.php smell: remove pesky profile hide_friends setting and from now on rely on permissions view_contacts attribute 2022-09-04 20:40:28 -07:00
Viewsrc.php it's done 2022-02-15 20:08:28 -08:00
Vote.php it's done 2022-02-15 20:08:28 -08:00
Wall_attach.php it's done 2022-02-15 20:08:28 -08:00
Wall_upload.php it's done 2022-02-15 20:08:28 -08:00
Webfinger.php add openwebauth redirect endpoint to webfinger 2022-09-10 07:16:41 +10:00
Webpages.php more cleanup 2022-08-27 08:37:04 +10:00
Well_known.php more cleanup 2022-08-27 08:37:04 +10:00
Xp.php more cleanup 2022-08-27 08:37:04 +10:00
Xref.php it's done 2022-02-15 20:08:28 -08:00
Zot.php rename endpoint 2022-08-31 13:43:07 -07:00

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.