Constants

BASE_INDEX_ENTRY

BASE_INDEX_ENTRY

Used to make using Yioop through this index page rather than as part of a library

Functions

bootstrap()

bootstrap(object  $web_site = null, boolean  $start_new_session = true) 

Main entry point to the Yioop web app.

Initialization is done in a function to avoid polluting the global namespace with variables.

Parameters

object $web_site
boolean $start_new_session

whether to start a session or not

checkCookieConsent()

checkCookieConsent() : boolean

Checks if a cookie consent form was obtained. This This function returns true if a session cookie was received from the browser, or a form variable saying cookies are okay was received, or the cookie Yioop profile says the consent mechanism is disabled

Returns

boolean —

cookie consent (true) else false

configureRewrites()

configureRewrites(object  $web_site) 

Used to setup and handles url rewriting for the Yioop Web app

Developers can add new routes by creating a Routes class in the app_dir with a static method getRoutes which should return an associating array of incoming_path => handler function

Parameters

object $web_site

used to send error pages if configuration fails

controllerUrl()

controllerUrl(string  $name, boolean  $with_delim = false) : string

Given the name of a controller for which an easy end-user link is useful creates the url where it can be accessed on this instance of Yioop, making use of the defined variable REDIRECTS_ON. Examples of end-user controllers would be the admin, and register controllers.

Parameters

string $name

of controller

boolean $with_delim

whether it should be terminated with nothing or ? or &

Returns

string —

url for the page in question

directUrl()

directUrl(string  $name, boolean  $with_delim = false, boolean  $with_base_url = false) : string

Given the name of a fixed public group static page creates the url where it can be accessed in this instance of Yioop, making use of the defined variable REDIRECTS_ON.

Parameters

string $name

of static page

boolean $with_delim

whether it should be terminated with nothing or ? or &

boolean $with_base_url

whether to use SHORT_BASE_URL or BASE_URL (true).

Returns

string —

url for the page in question

feedsUrl()

feedsUrl(string  $type, integer  $id, boolean  $with_delim = false, string  $controller = "group", boolean  $use_short_base_url = true) : string

Given the type of feed, the identifier of the feed instance, and which controller is being used creates the url where that feed item can be accessed from the instance of Yioop. It makes use of the defined variable REDIRECTS_ON.

Parameters

string $type

of feed: group, user, thread

integer $id

the identifier for that feed.

boolean $with_delim

whether it should be terminated with nothing or ? or &

string $controller

which controller is being used to access the feed: usually admin or group

boolean $use_short_base_url

whether to create the url as a relative url using C\SHORT_BASE_URL or as a full url using C\BASE_URL (the latter is useful for mail notifications)

Returns

string —

url for the page in question

passthruYioopRequest()

passthruYioopRequest() 

Sends a request from the outer Yioop index.php file on to the inner one Marks that redirects are on

processCommandLine()

processCommandLine() 

Used to process the command line arguments to yioop when run in CLI mode as its own web server

routeAppFile()

routeAppFile(array  $route_args) : boolean

Used to handle routes that will eventually just serve files from either the APP_DIR These include files like css, scripts, suggest tries, images, and videos.

Parameters

array $route_args

of url parts (split on slash)

Returns

boolean —

whether was able to compute a route or not

routeBaseFile()

routeBaseFile(array  $route_args) : boolean

Used to handle routes that will eventually just serve files from either the BASE_DIR These include files like css, scripts, images, and robots.txt.

Parameters

array $route_args

of url parts (split on slash).

Returns

boolean —

whether was able to compute a route or not

routeBlog()

routeBlog(array  $route_args) : boolean

Used to route page requests to for the website's public blog

Parameters

array $route_args

of url parts (split on slash).

Returns

boolean —

whether was able to compute a route or not

routeController()

routeController(array  $route_args) : boolean

Used to route page requests to end-user controllers such as register, admin. urls ending with /controller_name will be routed to that controller.

Parameters

array $route_args

of url parts (split on slash).

Returns

boolean —

whether was able to compute a route or not

routeDirect()

routeDirect(array  $route_args) : boolean

Used to route page requests to pages that are fixed Public Group wiki that should always be present. For example, 404 page.

Parameters

array $route_args

of url parts (split on slash).

Returns

boolean —

whether was able to compute a route or not

routeFeeds()

routeFeeds(array  $route_args) : boolean

Used to route page requests for pages corresponding to a group, user, or thread feed. If redirects on then urls ending with /feed_type/id map to a page for the id'th item of that feed_type

Parameters

array $route_args

of url parts (split on slash).

Returns

boolean —

whether was able to compute a route or not

routeSubsearch()

routeSubsearch(array  $route_args) : boolean

Used to route page requests for subsearches such as news, video, and images (site owner can define other). Urls of the form /s/subsearch will go the page handling the subsearch.

Parameters

array $route_args

of url parts (split on slash).

Returns

boolean —

whether was able to compute a route or not

routeSuggest()

routeSuggest(array  $route_args) : boolean

Used to route requests for the suggest-a-url link on the tools page.

If redirects on, then /suggest routes to this suggest-a-url page.

Parameters

array $route_args

of url parts (split on slash).

Returns

boolean —

whether was able to compute a route or not

routeWiki()

routeWiki(array  $route_args) : boolean

Used to route page requests for pages corresponding to a wiki page of group. If it is a wiki page for the public group viewed without being logged in, the route might come in as yioop_instance/p/page_name if redirects are on. If it is for a non-public wiki or page accessed with logged in the url will look like either: yioop_instance/group/group_id?a=wiki&page_name=some_name or yioop_instance/admin/group_id?a=wiki&page_name=some_name&csrf_token_string

Parameters

array $route_args

of url parts (split on slash).

Returns

boolean —

whether was able to compute a route or not

subsearchUrl()

subsearchUrl(string  $name, boolean  $with_delim = false) : string

Given the name of a subsearch creates the url where it can be accessed on this instance of Yioop, making use of the defined variable REDIRECTS_ON.

Examples of subsearches include news, video, and images. A site owner can add to these and delete from these.

Parameters

string $name

of subsearch

boolean $with_delim

whether it should be terminated with nothing or ? or &

Returns

string —

url for the page in question

suggestUrl()

suggestUrl(boolean  $with_delim = false) : string

Return the url for the suggest-a-url link on the more tools page, making use of the defined variable REDIRECTS_ON.

Parameters

boolean $with_delim

whether it should be terminated with nothing or ? or &

Returns

string —

url for the page in question

webError()

webError() 

Used to handle rquest errors in non-cli, non-webserver redirect case

wikiUrl()

wikiUrl(string  $name, boolean  $with_delim = false, string  $controller = "static", integer  $id = \seekquarry\yioop\configs\PUBLIC_GROUP_ID) : string

Given the name of a wiki page, the group it belongs to, and which controller is being used creates the url where that feed item can be accessed from the instance of Yioop. It makes use of the defined variable REDIRECTS_ON.

Parameters

string $name

of wiki page

boolean $with_delim

whether it should be terminated with nothing or ? or &

string $controller

which controller is being used to access the feed: usually static (for the public group), admin, or group

integer $id

the group the wiki page belongs to

Returns

string —

url for the page in question