-
Notifications
You must be signed in to change notification settings - Fork 0
Home
wandras edited this page Feb 9, 2024
·
7 revisions
The PF is an MVC framework implementing the abstract factory pattern as the main model of relations between classes and instances and among instances with their specific roles.
$plug = Plug::getInstance();
// the Auth class may be in /fw/models/Auth.class.php or in /fw/models/Auth/Auth.class.php
$auth = $plug->getAuth();
// the User class is in /fw/models/User/User.class.php if Auth is in the models folder, otherwise:
// /fw/models/Auth/User.class.php if it is not a standalone folder, or:
// /fw/models/Auth/User/User.class.php if it is a standalone folder
$user = $auth->getUserById($id);
$user = Plug::getInstance()->getAuth()->getUserById($id);
$users = $auth->getUsersByParams($params);Folder structure
Core library
Naming conventions
Components autoloading and components folder structure
Models
Views
Child views
Controllers
Subcontrollers (HMVC)
CMS core (component)
DB abstraction layer
Session::getInstance(); // it's a singleton constructor, a single session manager
/* All the methods are protected, cannot be accessed from the public interface
What does it do?
1. safely autostarts a new session, with the session name specified in the CONFIG object and setting strictly the session lifetime both in the server and client environment
2. autorefreshes the session ID at the given timeout specified in the CONFIG object
3. saves the last request timestamp
4. autostops safely, unsetting and destroying the session if session time is expired
*/