-
Notifications
You must be signed in to change notification settings - Fork 0
Core Components
liseli edited this page Feb 19, 2026
·
1 revision
- Purpose: Smarty template engine wrapper
- Extends: Smarty
-
Key Methods:
-
__construct()- Sets up template directories, registers functions -
assign()- Assign variables to templates -
display()- Render template
-
- Purpose: Session management for VuFind
- Extends: DSession
-
Singleton Pattern:
VFSession::instance() -
Key Methods:
-
instance()- Get/create session instance - (Inherits from DSession: set, get, delete, is_set)
-
- Purpose: Database-backed session storage
-
Storage: MySQL
sessionstable -
Key Features:
- UUID-based session IDs
- HttpOnly secure cookies
- Automatic session expiration
- Data serialization
-
Key Methods:
-
singleton()- Get/create session -
set($var, $val)- Store data -
is_set($var, $val)- Check existence -
get($var)- Retrieve data -
delete($var)- Remove data -
write()- Persist to database -
kill()- Destroy session
-
- Purpose: Solr search interface
-
Key Methods:
-
__construct($host, $index)- Connect to Solr -
simplesearch($query)- Execute search -
standardSearchComponents()- Construct Solr query -
getRecord($id)- Fetch single record
-
- Purpose: HTTP client for Solr
- Uses: HTTP_Request2 (PEAR)
-
Key Methods:
-
send($url)- Execute HTTP request - Response parsing and error handling
-
- Purpose: HathiTrust user access status
-
Data Source:
HTstatuscookie (set by Shibboleth SSO) -
Key Properties:
-
$logged_in- Boolean -
$institution_code- Institution identifier -
$auth_type- Authentication method -
$emergency_access- Emergency access flag -
$mapped_institution_code- Mapped institution for consortia
-
- Purpose: IP geolocation
- Database: MaxMind GeoIP2
-
Key Methods:
-
ip_to_iso($ip)- Get country code from IP
-
- Purpose: Record-specific business logic
-
Key Methods:
- Access determination
- Rights interpretation
- Format detection
- URL generation
All controllers (service/Record/Record.php and service/Search/Home.php) extend base Action class (if it existed):
class Home extends Action { // `Search/Home.php`
function setup() {
// Initialize dependencies
}
function launch() {
// Main entry point
}
// Additional methods for business logic
}- Home.php - Search results page
- Advanced.php - Advanced search form
- Reserves.php - Course reserves
- Suggest.php - Autocomplete suggestions
- SearchExport.php - RSS feed generation
- Error.php - Error action
- Home.php - Record display
- Export.php - Citation export formats
- RecordUtils.php - Record utility functions . . .