The webstream class
A class to manage buffering, cacheing, processing and output of the content to the user agent. This is the entity which manages the Php buffering mechanism, starting and stopping buffering and sending the buffer to the client's browser. It also manages any cacheing of the webpage. This class extends the session, since the whole point of the session is to output content back to the user agent.
Located in /webpage-defs.php (line 58)
user | --session | --webstream
Class | Description |
---|---|
![]() |
The webpage page class. |
![]() |
The templated webpage page class |
Whether to use Php buffering
Page is cached or dynamic
Seconds expiry for cached webpages
Path to use to save cached version of webpage
If true, force regeneration of cached webpage
The content to send to browser
Replacements to make in template
Inherited from session
session::$cookiename
session::$db_backed
session::$error_message
session::$guest_browser_lifetime
session::$last_logintime
session::$lifetime
session::$logins_exceeded_msg
session::$logins_exceeded_option
session::$logins_exceeded_redirect
session::$login_type
session::$session_id
session::$session_record
Inherited from user
user::$auth_code
user::$email
user::$enabled
user::$encrypted_passwords
user::$group_info
user::$group_names
user::$hasgroups
user::$hasIPlist
user::$IP
user::$limit_logins
user::$name
user::$password
user::$total_logins
user::$userid
user::$user_groups_cnt
user::$user_record
user::$user_type
user::$valid
Constructor
Create a new webstream object. When this object is created it always starts buffering with the ob_start() call. The Phplib system always uses the Php buffering mechanism. This allows us to process the output content and do 'clever things' right up to the point of sending it all to the user.
Cache this webpage Causes the current webpage to be regarded as a cached page.
This means we look for a file of the same name but with extension 'cached' in the $CACHEDIR directory, and check the modification time. If it isn't expired then we set the page content to that file, and send it. Otherwise we behave as if it is a normal dynamic Php page.
Close the webstream. Return any current webpage content. Clear the current content. This method clears content, but leaves any replacement definitions untouched for further processing. It is designed to be called as part of the final webpage rendering process.
Discard all webpage content For discarding the content so far with immediate effect.
Length of output buffer
Returns the length of our output buffer. Be careful when this is called, since the buffer might not be filled by make_content() yet!
Replace pattern in webpage content
Replaces multiple occurrences of the given tag (pattern) in the body content with the specified new stuff. NB: when you call this method the replacement isn't actually done there and then. It is simply flagged as something to be done just before all of the content is delivered to the user browser.
Replace all webpage content For replacing the total contents of the buffer so far with a new content. Throw buffer away and start anew with immediate effect.
Reset the webstream. This method clears any current content, and also clears any stored replacement definitions. This resets the stream to the point at which it was created - a virgin webstream.
Send HTTP error code and die Generic function to abort and send an error code notification to the user. These are lookalike errors for generic ones like 404: Page not found etc. This function will not return.
Send error and die Generic function to abort and send an error notification to the user instead. This function is a one-way trip to oblivion.
Send content to user browser
Deliver the content to the browser. First check if the page is cached and if so whether we are going to update the cache. Next we get the current buffer and aply any compression required. Then we send the output on its way using the simple echo() function. NOTE: If the page is not cached then we always send headers which will make the user browser avoid cacheing it locally. This makes sure that our dynamic pages will always be requested by it.
Send content to file Deliver the content to a given file.
Make our buffer content, and then deliver it to a file.
Return webpage content Builds all of the webpage content and returns it to the caller.
Inherited From session
session::session()
session::delete_cookie()
session::identify_user()
session::on_logins_exceeded()
session::recover()
session::session_clear()
session::session_create()
session::session_delete()
session::session_valid()
session::set_cookie()
session::set_cookiename()
session::set_guest_browser_lifetime()
session::set_lifetime()
session::set_sessiontype()
Inherited From user
user::user()
user::authenticate()
user::authenticate_authid()
user::authenticate_ipaddress()
user::authenticate_userid()
user::friendlyName()
user::get_auth_code()
user::get_groups()
user::get_user_by_auth_code()
user::get_user_by_id()
user::get_user_by_ip()
user::group_ids_list()
user::group_names_list()
user::ismemberof_group()
user::ismemberof_group_in()
user::ismemberof_group_with_id()
user::isvalid()
user::set_encrypted_passwords()
user::set_password()
Documentation generated by phpDocumentor 1.3.0RC3