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.
Files
core/Zotlabs/Module
zotlabs b13fb1cca9 command line connect utility.
Usage: util/connect uid|nick channel

uid|nick must be a local channel. The target channel can be any channel. If a nick is supplied as a target it is assumed to refer to a channel on the localhost unless @host is provided. RSS feeds and remote networks can also be connected, assuming the appropriate protocols are already enabled for the local channel. If the target channel is a non-forum on the local system and you wish bi-directional communication to be enabled you will probably need to use a second connnect command with the source and target reversed.

Examples:

	util/connect bob marketing

	Connects bob to the marketing channel

	util/connect marketing bob

	Connects the marketing channel to bob.

	util/connect 6 channelone@macgirvin.com

	Connects the channel with channel_id 6 to the Channel One public forum.

	util/connect bob https://mysite.foo/feed.rss

	Connects bob to an RSS feed if RSS feeds are allowed as connections on this site

	util/connect bob jb@diasp.org

	Connects bob to a diaspora account on diap.org (both the site and Bob's channel must previously have the Diaspora Protocol enabled).
2016-11-01 15:27:34 -07:00
..
2016-10-14 13:17:53 -07:00
2016-10-12 15:31:14 -07:00
2016-05-22 19:25:27 -07:00
2016-08-29 21:21:09 -07:00
2016-09-29 16:20:26 -07:00
2016-04-18 20:38:38 -07:00
2016-04-18 20:38:38 -07:00
2016-04-18 20:38:38 -07:00
2016-10-03 19:47:36 -07:00
2016-08-05 13:20:03 +02:00
2016-05-22 20:54:52 -07:00
2016-11-01 15:27:34 -07:00
2016-10-30 12:34:00 -07:00
2016-10-12 20:41:59 -07:00
2016-10-03 21:48:53 -07:00
2016-04-18 20:38:38 -07:00
2016-05-31 21:45:33 -07:00
2016-05-31 21:45:33 -07:00
2016-10-04 19:37:16 -07:00
2016-09-30 13:00:15 -07:00
2016-10-03 22:01:14 -07:00
2016-08-01 17:44:21 -07:00
2016-04-18 20:38:38 -07:00
2016-10-03 22:01:14 -07:00
2016-05-19 22:26:37 -07:00
2016-10-03 22:01:14 -07:00
2016-08-04 11:23:43 +02:00
2016-05-19 22:26:37 -07:00
2016-04-18 20:38:38 -07:00
2016-10-03 21:48:53 -07:00
2016-04-18 20:38:38 -07:00
2016-04-18 20:38:38 -07:00
2016-04-18 20:38:38 -07:00
2016-04-18 20:38:38 -07:00
2016-05-19 22:26:37 -07:00
2016-04-18 20:38:38 -07:00
2016-07-13 19:53:28 -07:00
2016-10-22 05:52:29 +02:00
2016-07-27 16:14:46 -07:00
2016-04-18 20:38:38 -07:00
2016-04-18 20:38:38 -07:00
2016-04-18 20:38:38 -07:00
2016-09-25 17:06:13 -07:00
2016-10-03 21:48:53 -07:00
2016-04-18 20:38:38 -07:00
2016-04-18 20:38:38 -07:00
2016-06-20 20:34:19 -07:00
2016-04-18 20:38:38 -07:00
2016-04-18 20:38:38 -07:00
2016-04-18 20:38:38 -07:00
2016-04-18 20:38:38 -07:00
2016-10-03 21:48:53 -07:00
2016-04-18 20:38:38 -07:00
2016-04-18 20:38:38 -07:00
2016-04-18 20:38:38 -07:00
2016-04-18 20:38:38 -07:00
2016-04-18 20:38:38 -07:00
2016-04-18 20:38:38 -07:00
2016-04-18 20:38:38 -07:00
2016-06-28 20:48:43 -07:00
2016-05-01 04:13:30 +10:00
2016-04-18 20:38:38 -07:00
2016-04-18 20:38:38 -07:00
2016-04-18 20:38:38 -07:00
2016-04-18 20:38:38 -07:00
2016-04-18 20:38:38 -07:00

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.