streams/Code/Module
2022-08-05 08:05:50 +10:00
..
Admin rename include/text -> include/misc 2022-06-17 16:59:11 -07:00
Dev deprecate zoturl 2022-06-28 22:19:12 -07:00
Settings add mention and tag count limits to reduce abuse when bypassing permissions 2022-06-23 03:47:35 -07:00
Acloader.php deprecate z_fetch_url() and friends. Now use Code\Lib\Url::{fetch|get}() 2022-06-23 00:38:34 -07:00
Activity.php
Admin.php
Affinity.php
Album.php
Api.php begin hubloc refactor 2022-06-16 19:46:54 -07:00
Appman.php refactor app sync logic 2022-05-11 03:57:37 -07:00
Apporder.php unit tests 2022-02-20 00:12:31 -08:00
Apps.php
Apschema.php
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
Block.php
Blocks.php
Ca.php Rename Stdio::fpipe => Stdio::fcopy and remove some cruft that is no longer needed. 2022-06-24 13:28:29 -07: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
Cards.php deprecate block_public 2022-06-01 14:18:51 -07:00
Categories.php
Cdav.php begin hubloc refactor 2022-06-16 19:46:54 -07:00
Changeaddr.php
Channel.php slightly more aggressive/proactive hubloc filtering 2022-06-16 14:48:13 -07:00
Chanview.php begin hubloc refactor 2022-06-16 19:46:54 -07:00
Chat.php
Chatsvc.php
Clients.php
Cloud.php
Cloud_tiles.php
Comment_control.php
Common.php typos 2022-02-15 22:10:50 -08:00
Communities.php ui tweaks 2022-03-21 14:29:13 -07:00
Connac.php
Connect.php slightly more aggressive/proactive hubloc filtering 2022-06-16 14:48:13 -07:00
Connections.php
Connedit.php deprecate z_fetch_url() and friends. Now use Code\Lib\Url::{fetch|get}() 2022-06-23 00:38:34 -07:00
Contactgroup.php
Content_filter.php
Conversation.php
Cover_photo.php Store only the smallest cover_photos (425x239 or scale '9') in cache/xp . 2022-06-26 17:17:04 -07:00
Dav.php move os_mkdir to Stdio 2022-06-22 03:19:52 -07:00
Defperms.php
Dev.php Move technical tools to /dev as submodules 2022-05-03 03:41:08 -07:00
Dircensor.php deprecate directory stuff 2022-06-06 20:41:40 -07:00
Directory.php Change the default cover photo and the default_cover_photo logic. 2022-06-26 15:40:09 -07:00
Dirsearch.php fix anomoly in search results when principal exists on multiple networks 2022-06-19 13:27:14 -07:00
Display.php remove tracking info from feeds 2022-07-20 14:15:56 -07:00
Drafts.php
Dreport.php
Editblock.php
Editlayout.php
Editpost.php hidden mentions not being preserved across edits. 2022-07-05 19:13:38 -07:00
Editwebpage.php
Email_resend.php used wrong path by mistake 2022-03-07 16:03:32 -08:00
Email_validation.php
Embed.php
Embedphotos.php
Event.php
Events.php deprecate the interactive argument to drop_item() 2022-06-26 01:36:02 -07:00
Expire.php
Fastping.php
Fbrowser.php
Fedi_id.php
Feed.php deprecate block_public 2022-06-01 14:18:51 -07:00
File_upload.php
Filer.php
Filerm.php
Filestorage.php
Follow.php cleaner display urls 2022-07-20 04:26:28 -07:00
Followers.php deprecate block_public 2022-06-01 14:18:51 -07:00
Following.php deprecate block_public 2022-06-01 14:18:51 -07:00
Future.php
Getfile.php unit test failure 2022-06-24 14:08:59 -07:00
Hashtags.php
Help.php
Home.php begin hubloc refactor 2022-06-16 19:46:54 -07:00
Id.php
Impel.php
Import.php missing paren 2022-08-05 08:05:50 +10:00
Import_items.php deprecate z_fetch_url() and friends. Now use Code\Lib\Url::{fetch|get}() 2022-06-23 00:38:34 -07:00
Inbox.php whitespace 2022-08-03 19:52:05 +10:00
Inspect.php begin hubloc refactor 2022-06-16 19:46:54 -07:00
Invite.php
Item.php cleaner display urls 2022-07-20 04:26:28 -07:00
Jwks.php
Lang.php
Layouts.php
Like.php cleaner display urls 2022-07-20 04:26:28 -07:00
Linkinfo.php fix black youtube previews 2022-07-11 19:39:31 -07:00
Lists.php wrap nohtml content from html purification by simply escaping it. add attribution to lists. 2022-04-09 18:44:23 -07:00
Lockview.php php 8.1 changes 2022-03-15 01:42:34 -07:00
Locs.php hubloc refactor continued - hubloc_delete() 2022-06-17 19:24:50 -07:00
Login.php
Logout.php
Lostpass.php
Magic.php change request method for owa 2022-07-01 18:52:59 -07:00
Manage.php mod_pubstream: regression including non-existent file. mod_manage: flag the system channel. 2022-04-14 22:15:51 -07:00
Manifest.php
Markup.php
Menu.php
Mitem.php
Moderate.php cleaner display urls 2022-07-20 04:26:28 -07:00
Mood.php
New_channel.php
Notes.php
Notifications.php
Notify.php
Nullbox.php
Oauthinfo.php
Oembed.php
Oep.php cleaner display urls 2022-07-20 04:26:28 -07:00
Online.php
Outbox.php begin hubloc refactor 2022-06-16 19:46:54 -07:00
Owa.php begin hubloc refactor 2022-06-16 19:46:54 -07:00
Page.php
Pconfig.php
Pdledit.php
Permcat.php
Photo.php Rename Stdio::fpipe => Stdio::fcopy and remove some cruft that is no longer needed. 2022-06-24 13:28:29 -07:00
Photomap.php
Photos.php rename include/text -> include/misc 2022-06-17 16:59:11 -07:00
Pin.php
Ping.php
Plike.php deprecate the interactive argument to drop_item() 2022-06-26 01:36:02 -07:00
Poco.php
Poke.php
Poster.php
Pretheme.php
Profile.php deprecate block_public 2022-06-01 14:18:51 -07:00
Profile_photo.php fixes from upstream 2022-06-06 18:55:58 -07:00
Profiles.php Remove some dead code and associated defines. 2022-06-21 16:13:01 -07:00
Profperm.php
Pubstream.php deprecate block_public 2022-06-01 14:18:51 -07:00
Q.php begin hubloc refactor 2022-06-16 19:46:54 -07:00
Randprof.php
React.php
README.md
Register.php deprecate directory stuff 2022-06-06 20:41:40 -07:00
Regmod.php
Regver.php
Removeaccount.php
Removeme.php
Rmagic.php begin hubloc refactor 2022-06-16 19:46:54 -07:00
Rpost.php deprecate z_fetch_url() and friends. Now use Code\Lib\Url::{fetch|get}() 2022-06-23 00:38:34 -07:00
Safe.php
Search.php cleaner display urls 2022-07-20 04:26:28 -07:00
Search_ac.php
Secrets.php
Service_limits.php
Settings.php
Setup.php Cleanup setup/install 2022-07-20 07:57:55 +10:00
Share.php
Sharedwithme.php rename include/text -> include/misc 2022-06-17 16:59:11 -07:00
Siteinfo.php remove all remote tracking services and their enablers 2022-06-08 16:48:07 -07:00
Smilies.php
Sources.php
Sslify.php deprecate z_fetch_url() and friends. Now use Code\Lib\Url::{fetch|get}() 2022-06-23 00:38:34 -07:00
Starred.php
Stream.php add 'received' stream order 2022-05-25 16:00:59 -07:00
Subthread.php cleaner display urls 2022-07-20 04:26:28 -07:00
Suggestions.php
Superblock.php sync xchans for superblock 2022-03-22 12:45:55 -07:00
Tagadelic.php
Tagger.php cleaner display urls 2022-07-20 04:26:28 -07:00
Tagrm.php
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
Toggle_safesearch.php
Token.php
Uexport.php deprecate ostatus:conversation 2022-05-19 13:47:30 -07:00
Update.php try/catch module construction in mod_update to catch bad input without throwing execptions 2022-06-01 22:32:29 -07:00
Userinfo.php
View.php
Viewconnections.php deprecate block_public 2022-06-01 14:18:51 -07:00
Viewsrc.php
Vote.php
Wall_attach.php
Wall_upload.php
Webfinger.php more webfinger service edits, cloned channels are missing xchan_photo_mimetype. 2022-06-28 22:48:02 -07:00
Webpages.php
Well_known.php
Xp.php Change the default cover photo and the default_cover_photo logic. 2022-06-26 15:40:09 -07:00
Xref.php
Zot.php file renames 2022-02-15 20:50:35 -08: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.