This repository has been archived on 2024-08-19. You can view files and clone it, but cannot push or open issues or pull requests.
core/Zotlabs/Module
2019-03-18 21:58:18 +01:00
..
Admin Merge branch 'exclude_addon_common' into 'dev' 2019-02-15 22:03:33 +01:00
Settings affinity tool fixes 2019-02-14 11:06:52 +01:00
Achievements.php
Acl.php
Admin.php MySQL 8 admin summary compatibility 2019-02-17 22:47:08 +01:00
Affinity.php missing use app 2019-02-14 14:48:16 +01:00
Api.php
Appman.php
Apporder.php
Apps.php
Article_edit.php
Articles.php
Attach.php
Authorize.php
Authtest.php
Block.php
Blocks.php
Bookmarks.php
Branchtopic.php
Cal.php
Card_edit.php
Cards.php
Cdav.php
Changeaddr.php
Channel.php fix typos 2019-03-18 21:58:18 +01:00
Chanview.php
Chat.php
Chatsvc.php
Cloud_tiles.php
Cloud.php
Common.php
Connect.php
Connections.php use urlencode 2019-03-18 13:29:08 +01:00
Connedit.php add zot6 to clonable networks 2019-03-13 17:48:00 +01:00
Contactgroup.php
Cover_photo.php
Dav.php
Defperms.php
Directory.php use urlencode 2019-03-18 13:29:08 +01:00
Dirsearch.php
Display.php some more xss prevention 2019-03-18 21:30:25 +01:00
Dreport.php clone systems apps to the extent possible, auto-configure imagick thumbnail binary during setup if possible 2019-03-18 09:35:53 +01:00
Editblock.php
Editlayout.php
Editpost.php
Editwebpage.php
Email_resend.php
Email_validation.php
Embed.php work on repeat/share for Hubzilla 2019-02-06 17:26:09 -08:00
Embedphotos.php
Events.php fix linkify_tags() so it works with xchans across multiple protocols, also some fixes to activity parsing from upstream. 2019-02-03 16:53:49 -08:00
Fbrowser.php
Feed.php
Fhublocs.php
File_upload.php
Filer.php
Filerm.php
Filestorage.php fix ability for file storage creators (visitors) to be able to delete their own content 2019-02-19 13:14:19 -08:00
Follow.php
Getfile.php
Go.php
Group.php
Hashtags.php
Hcard.php
Help.php
Home.php
Hostxrd.php
Hq.php some more xss prevention 2019-03-18 21:30:25 +01:00
Id.php hubzilla has uuid - use that instead of wildcard 2019-02-19 13:36:53 -08:00
Impel.php
Import_items.php
Import.php clone systems apps to the extent possible, auto-configure imagick thumbnail binary during setup if possible 2019-03-18 09:35:53 +01:00
Invite.php
Item.php limit 1 2019-03-13 13:21:04 +11:00
Lang.php
Layouts.php
Like.php
Linkinfo.php
Lockview.php
Locs.php
Login.php
Logout.php
Lostpass.php
Magic.php
Mail.php fix linkify_tags() so it works with xchans across multiple protocols, also some fixes to activity parsing from upstream. 2019-02-03 16:53:49 -08:00
Manage.php
Menu.php
Message.php
Mitem.php
Moderate.php
Mood.php
Network.php some more xss prevention 2019-03-18 21:30:25 +01:00
New_channel.php
Notes.php
Notifications.php
Notify.php
Oauth2.php
Oauth2testvehicle.php
Oauth.php
Oauthinfo.php
Ochannel.php
Oembed.php
Oep.php mod_oep: photos/album/xxxxx is no longer hex2bin/bin2hex but the album hash and is throwing php warnings when trying to decode 2019-03-04 20:07:01 -08:00
Oexchange.php
Ofeed.php
Online.php
Owa.php
Page.php
Pconfig.php
Pdledit.php
Permcat.php
Permcats.php
Photo.php
Photos.php use urlencode 2019-03-18 13:29:08 +01:00
Ping.php
Poco.php
Poke.php
Post.php
Prate.php
Pretheme.php
Probe.php
Profile_photo.php
Profile.php
Profiles.php fix linkify_tags() so it works with xchans across multiple protocols, also some fixes to activity parsing from upstream. 2019-02-03 16:53:49 -08:00
Profperm.php
Pubsites.php
Pubstream.php some more xss prevention 2019-03-18 21:30:25 +01:00
Randprof.php
Rate.php
Ratings.php
Ratingsearch.php
Rbmark.php
React.php
README.md
Regdir.php
Register.php
Regmod.php
Regver.php
Removeaccount.php
Removeme.php
Rmagic.php
Rpost.php
Search_ac.php
Search.php
Service_limits.php
Settings.php
Setup.php clone systems apps to the extent possible, auto-configure imagick thumbnail binary during setup if possible 2019-03-18 09:35:53 +01:00
Share.php disable repeat unless mid is a resolvable uri since this will do radically different things on different network stacks (e.g. Diaspora) and it turns out there is no possible way to make Diaspora reshares compatible with ActivityPub or Zot6 repeat/announce/boost/whatever. 2019-02-07 14:38:05 -08:00
Sharedwithme.php
Siteinfo.php
Sitelist.php
Smilies.php
Snap.php
Sources.php
Sslify.php
Starred.php
Subthread.php
Suggest.php
Tagger.php
Tagrm.php
Tasks.php
Theme_info.php
Thing.php
Toggle_mobile.php
Toggle_safesearch.php
Token.php
Tokens.php
Uexport.php
Update.php
Userinfo.php
View.php
Viewconnections.php use urlencode 2019-03-18 13:29:08 +01:00
Viewsrc.php fix summary and use item_normal_search() for viewsrc so we can also view the source for articles, cards, etc. 2019-02-21 08:48:47 +01:00
Wall_attach.php
Wall_upload.php
Webfinger.php
Webpages.php
Well_known.php
Wfinger.php
Wiki.php
Xchan.php
Xpoco.php
Xrd.php
Xref.php
Zfinger.php
Zot_probe.php
Zot.php
Zotfeed.php
Zping.php

Zotlabs/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 Zotlabs/Web/Controller as a template.

Template:

<?php

namespace Zotlabs\Web;


class Controller {

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

}

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

<?php
namespace Zotlabs\Module;

class Foo extends \Zotlabs\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 Zotlabs/Daemon class functions.