Yioop_V9.5_Source_Code_Documentation

ConfigureTool
in package

Provides a command-line interface way to configure a Yioop Instance.

Unlike the web interface this interface is English-only.

Table of Contents

$admin  : object
Used to hold an AdminController object used to manipulate the Yioop configuration
$menu  : array<string|int, mixed>
Holds the main menu data for the configuration tool
__construct()  : mixed
To change configuration parameters of Yioop, this program invokes AdminController methods. These methods expect, data passed to them in super globals set up as a result of an HTTP request. This program fakes the settings of these variables.
banner()  : mixed
Prints the banner used by this configuration tool
callConfigure()  : mixed
Used to call system components configure method. It detects if a redirect happened by the fact that $data['PROFILE'] is not set.
configureMenu()  : mixed
This is used to draw the main configuration menu and ask for a user selection
confirmChange()  : string
Used to select to confirm, cancel, or re-enter the last profile change
copyProfileFields()  : array<string|int, mixed>
Used to copy the contents of $data which are profile fields to a new array.
debugDisplay()  : mixed
Used to configure debugging information for this Yioop instance.
defaultLocale()  : mixed
Changes the default locale (language) used by Yioop when it cannot determine that information from the user's browser
drawChooseItems()  : string
Draws a list of options to the screen and gets a choice from this list from the user.
loop()  : mixed
This is the main loop where options of what the user can configure are presented, a choice is requested, and so on.
nameServer()  : mixed
Configures settings relating to the location of the name server and the salt used when communicating with it. Also, configures caching mechanisms the name server should use when returning results.
prepareGlobals()  : mixed
Sets-up the field values of the super globals used by AdminController when changing a profile or managing passwords. These particular values don't change with respect to what this tool does.
robotSetUp()  : mixed
Used to set up the name of this instance of the Yioop robot as well as its description page.
rootPassword()  : mixed
Used to change the password of the root account of this Yioop Instance
searchAccess()  : mixed
Configures which methods are allowed by this Yioop instance to access search results, (via the web, via open rss search results, via the API)
searchPageElementLinks()  : mixed
Configures which of the various links of the SERPS page such as Cache, etc should be displayed. Also, configures whether the signin links, etc should be displayed.
workDirectory()  : mixed
Used to create/change the location of this Yioop instances work directory

Properties

$admin

Used to hold an AdminController object used to manipulate the Yioop configuration

public object $admin

$menu

Holds the main menu data for the configuration tool

public array<string|int, mixed> $menu = ["workDirectory" => "Create/Set Work Directory", "rootPassword" => "Change root password", "defaultLocale" => "Set Default Locale", "debugDisplay" => "Debug Display Set-up", "searchAccess" => "Search Access Set-up", "searchPageElementLinks" => "Search Page Elements and Links", "nameServer" => "Name Server Set-up", "robotSetUp" => "Crawl Robot Set-up", "quit" => "Exit program"]

Methods

__construct()

To change configuration parameters of Yioop, this program invokes AdminController methods. These methods expect, data passed to them in super globals set up as a result of an HTTP request. This program fakes the settings of these variables.

public __construct() : mixed

To keep things simple this constructor initializes each of the relevant super globals to be empty arrays.

Return values
mixed

banner()

Prints the banner used by this configuration tool

public banner() : mixed
Return values
mixed

callConfigure()

Used to call system components configure method. It detects if a redirect happened by the fact that $data['PROFILE'] is not set.

public callConfigure() : mixed

If so it passes along the redirect message and re-calls configure()

Return values
mixed

configureMenu()

This is used to draw the main configuration menu and ask for a user selection

public configureMenu() : mixed
Return values
mixed

confirmChange()

Used to select to confirm, cancel, or re-enter the last profile change

public confirmChange(string $admin_method, string $reenter_method) : string
Parameters
$admin_method : string

to call if confirmed

$reenter_method : string

, return value if reenter chosen

Return values
string

menu name to do to next

copyProfileFields()

Used to copy the contents of $data which are profile fields to a new array.

public copyProfileFields(array<string|int, mixed> $data) : array<string|int, mixed>
Parameters
$data : array<string|int, mixed>

an array of profile and other fields

Return values
array<string|int, mixed>

a new array containing a copy of just the profile fields from the original array

debugDisplay()

Used to configure debugging information for this Yioop instance.

public debugDisplay() : mixed

i.e., whether PHP notices, warnings, errors, should be displayed, whether query statistics and info should be displayed, and whether unit tests should be viewable from the web

Return values
mixed

defaultLocale()

Changes the default locale (language) used by Yioop when it cannot determine that information from the user's browser

public defaultLocale() : mixed
Return values
mixed

drawChooseItems()

Draws a list of options to the screen and gets a choice from this list from the user.

public drawChooseItems(array<string|int, mixed> $items, string $currentView) : string
Parameters
$items : array<string|int, mixed>

as associative array (return value => description)

$currentView : string

value to return if invalid choice made

Return values
string

a choice from the user

loop()

This is the main loop where options of what the user can configure are presented, a choice is requested, and so on.

public loop() : mixed

..

Return values
mixed

nameServer()

Configures settings relating to the location of the name server and the salt used when communicating with it. Also, configures caching mechanisms the name server should use when returning results.

public nameServer() : mixed
Return values
mixed

prepareGlobals()

Sets-up the field values of the super globals used by AdminController when changing a profile or managing passwords. These particular values don't change with respect to what this tool does.

public prepareGlobals(array<string|int, mixed> $data) : mixed
Parameters
$data : array<string|int, mixed>

current profile state

Return values
mixed

robotSetUp()

Used to set up the name of this instance of the Yioop robot as well as its description page.

public robotSetUp() : mixed
Return values
mixed

rootPassword()

Used to change the password of the root account of this Yioop Instance

public rootPassword() : mixed
Return values
mixed

searchAccess()

Configures which methods are allowed by this Yioop instance to access search results, (via the web, via open rss search results, via the API)

public searchAccess() : mixed
Return values
mixed

Configures which of the various links of the SERPS page such as Cache, etc should be displayed. Also, configures whether the signin links, etc should be displayed.

public searchPageElementLinks() : mixed
Return values
mixed

workDirectory()

Used to create/change the location of this Yioop instances work directory

public workDirectory() : mixed
Return values
mixed

        

Search results