User Tools

Site Tools


instance_class

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

instance_class [2019/10/21 05:54] – created sahlinstance_class [2020/02/12 21:30] (current) sahl
Line 53: Line 53:
 $instance->delete(); $instance->delete();
 </code> </code>
 +
 +===== Logging into an instance =====
 +
 +There are two easy ways of logging into an instance. A static function or a normal function.
 +
 +<code php>
 +Instance::loginToInstance($instance_title, $username, $password, $continue_url);
 +
 +$instance = new Instance();
 +$instance->loadForRead(1);
 +$instance->login($username, $password, $continue_url);
 +</code>
 +
 +The function will return false if the provided username or password is invalid. Otherwise it will redirect to the ''$continue_url''. Please note that ''$continue_url'' must be an absolute URL with no hostname for everything to work correctly, such as ///application///
 +
 +===== Multiserver environment =====
 +
 +It is possible to have a range of servers, with each server holding one or more instances. This is implemented through the [[Server class]].
 +
 +Each server should have the same copy of the source code.
 +
 +When spawning a new instance using ''Instance::initialize'' the new instance will automatically be placed on the server with the least instances already. One can also provide a server id as the fourth parameter of ''Instance::initialize'' in order to place the instance on that specific server.
instance_class.1571637268.txt.gz · Last modified: 2019/10/21 05:54 by sahl

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki