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
Mario 873b20677e fix duplicate attachment and regression with audio file upload
(cherry picked from commit 4cfb965881df2be181aab6020c9df78c0a86fd9f)
2019-11-04 10:34:24 +01:00
..
Admin fix bitrot in util/zotsh 2019-08-15 16:28:06 -07:00
Settings
Achievements.php
Acl.php
Admin.php
Affinity.php
Api.php
Appman.php
Apporder.php
Apps.php
Apschema.php add hashtag to appschema and bump appschema rev 2019-07-18 14:19:32 +02:00
Article_edit.php fix missing summary in mod article_edit 2019-10-02 11:05:24 +02:00
Articles.php Revert "Remove visible channels list from pubstream tags cloud creation procedure" 2019-10-13 14:27:54 +02:00
Attach.php
Authorize.php
Authtest.php
Block.php
Blocks.php
Bookmarks.php
Branchtopic.php
Cal.php apply calendar encoding fixes to mod cal 2019-06-20 18:44:23 +02:00
Card_edit.php
Cards.php
Cdav.php calendar: revert back to UTC strings for dates due to better legibility. Strip timezone info from UTC string and always treat values as UTC. 2019-07-11 11:12:27 +02:00
Changeaddr.php
Channel_calendar.php calendar: revert back to UTC strings for dates due to better legibility. Strip timezone info from UTC string and always treat values as UTC. 2019-07-11 11:12:27 +02:00
Channel.php Revert "Remove visible channels list from pubstream tags cloud creation procedure" 2019-10-13 14:27:54 +02:00
Chanview.php
Chat.php
Chatsvc.php
Cloud_tiles.php
Cloud.php fix bitrot in util/zotsh 2019-08-15 16:28:06 -07:00
Common.php
Connect.php
Connections.php Fix channel address in follow link 2019-10-15 22:37:03 +02:00
Connedit.php
Contactgroup.php
Cover_photo.php
Dav.php fix bitrot in util/zotsh 2019-08-15 16:28:06 -07:00
Defperms.php
Directory.php More nofollow tags to discourage backlink farmers 2019-09-03 14:32:52 +02:00
Dirsearch.php fix typo 2019-07-03 22:13:14 +02:00
Display.php
Dreport.php
Editblock.php
Editlayout.php
Editpost.php
Editwebpage.php
Email_resend.php
Email_validation.php
Embed.php
Embedphotos.php
Events.php Merge branch 'dev' into 'dev' 2019-06-20 17:32:10 +02:00
Fbrowser.php
Feed.php
Fhublocs.php
File_upload.php
Filer.php
Filerm.php
Filestorage.php
Follow.php
Getfile.php http signature consolidation 2019-06-26 21:45:21 -07:00
Go.php
Group.php hz core issue #1386 - function name must be a string 2019-07-28 23:46:38 -07:00
Hashtags.php
Hcard.php
Help.php
Home.php
Hostxrd.php
Hq.php
Id.php http signature consolidation 2019-06-26 21:45:21 -07:00
Impel.php
Import_items.php
Import.php
Invite.php
Item.php fix duplicate attachment and regression with audio file upload 2019-11-04 10:34:24 +01:00
Lang.php
Layouts.php
Like.php
Linkinfo.php linkinfo: only allow to embed public items 2019-08-11 10:55:38 +02:00
Lockview.php changes to support direct messages in zot6 (set item.item_private = 2 when private mentions are used and federate with zot:directMessage attribute which aligns with litepub:directMessage) 2019-06-19 17:32:38 -07:00
Locs.php
Login.php
Logout.php
Lostpass.php
Magic.php http signature consolidation 2019-06-26 21:45:21 -07:00
Mail.php
Manage.php
Menu.php fix issue #1402 2019-11-03 11:15:12 +01:00
Message.php
Mitem.php
Moderate.php
Mood.php
Network.php
New_channel.php
Notes.php
Notifications.php
Notify.php
Oauth2.php
Oauth2testvehicle.php
Oauth.php
Oauthinfo.php
Ochannel.php
Oembed.php
Oep.php
Oexchange.php
Ofeed.php
Online.php
Owa.php http signature consolidation 2019-06-26 21:45:21 -07:00
Page.php
Pconfig.php
Pdledit.php
Permcat.php
Permcats.php
Photo.php Update Photo.php 2019-10-26 12:24:23 +02:00
Photos.php
Ping.php decode encoded mid 2019-06-28 13:09:44 +02:00
Poco.php
Poke.php
Post.php
Poster.php
Prate.php
Pretheme.php
Probe.php
Profile_photo.php
Profile.php
Profiles.php
Profperm.php
Pubsites.php
Pubstream.php
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
Share.php reflect repeats in notifications, use force flag for import_xchan_photo() in cron 2019-07-22 19:11:52 +02: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
Viewsrc.php
Wall_attach.php fix duplicate attachment and regression with audio file upload 2019-11-04 10:34:24 +01:00
Wall_upload.php
Webfinger.php
Webpages.php
Well_known.php Update Well_known.php 2019-08-30 00:55:36 +02:00
Wfinger.php
Wiki.php
Xchan.php
Xpoco.php
Xrd.php
Xref.php
Zfinger.php http signature consolidation 2019-06-26 21:45:21 -07:00
Zot_probe.php http signature consolidation 2019-06-26 21:45:21 -07:00
Zot.php
Zotfeed.php issues with image import to zot6 - wrong mid. Also label source project of zotfeed since it is not completely compatible across projects. 2019-08-22 19:39:11 -07:00
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.