Empowering Your Personal Weblog
Scriptlog is a simple, secure, modular, and robust personal blogging platform. It is a refactored fork of Piluscart 1.4.1, engineered to emphasize simplicity, privacy, and security without the overhead of a complex Content Management System.
Scriptlog is not designed to replace full-scale CMS frameworks. Instead, it is meticulously engineered to:
- Power personal weblogs that do not require a heavy CMS.
- Provide a secure foundation for blogging with modern security practices.
- Run fast with minimal overhead.
- Backend: PHP 7.4+ (PSR-12 compliant)
- Database: MySQL 5.7+ / MariaDB 10.3+
- Architecture: Multi-layered MVC-like (
Request→Bootstrap→Dispatcher→Controller→Service→DAO→Database) - Security: Laminas (Escaper, Crypt), Defuse PHP Encryption, voku Anti-XSS, HTMLPurifier.
Ensure your hosting environment meets the following requirements:
- PHP: 7.4+ (with extensions:
pdo,pdo_mysql,json,mbstring,curl) - Web Server: Apache (with
mod_rewriteenabled) or Nginx - Database: MySQL 5.7+ or MariaDB 10.3+
- Composer: Latest (for dependency management)
-
Clone the Repository
git clone https://github.com/ScriptLog/scriptlog.git cd scriptlog -
Install Dependencies
composer install
-
Set Permissions
chmod -R 755 public/ chmod -R 777 public/cache/ public/log/
-
Database Setup Create a new empty database (use
utf8mb4_general_cicollation). -
Run the Installer Navigate to
/install/in your web browser and follow the wizard:- Step 1: System Requirements Check (
install/index.php) - Step 2: Database Setup (
install/setup-db.php) - creates 21 tables - Step 3: Complete Setup (
install/finish.php)
- Step 1: System Requirements Check (
-
Cleanup (Critical) For security purposes, delete the
install/directory immediately after installation is complete.
After installation, two configuration files are generated:
| File | Purpose |
|---|---|
config.php |
Main configuration with $_ENV fallbacks |
.env |
Environment variables (auto-generated) |
lib/utility/.lts/lts.txt |
Defuse encryption key for authentication cookies |
Scriptlog supports both .env and config.php files for configuration. During installation, both files are automatically generated and kept in sync.
<?php
return [
'db' => [
'host' => $_ENV['DB_HOST'] ?? 'localhost',
'user' => $_ENV['DB_USER'] ?? '',
'pass' => $_ENV['DB_PASS'] ?? '',
'name' => $_ENV['DB_NAME'] ?? '',
'port' => $_ENV['DB_PORT'] ?? '3306',
'prefix' => $_ENV['DB_PREFIX'] ?? ''
],
'app' => [
'url' => $_ENV['APP_URL'] ?? 'http://example.com',
'email' => $_ENV['APP_EMAIL'] ?? '',
'key' => $_ENV['APP_KEY'] ?? '',
'defuse_key' => 'lib/utility/.lts/lts.txt'
],
'mail' => [
'smtp' => [
'host' => $_ENV['SMTP_HOST'] ?? '',
'port' => $_ENV['SMTP_PORT'] ?? 587,
'encryption' => $_ENV['SMTP_ENCRYPTION'] ?? 'tls',
'username' => $_ENV['SMTP_USER'] ?? '',
'password' => $_ENV['SMTP_PASS'] ?? '',
],
'from' => [
'email' => $_ENV['MAIL_FROM_ADDRESS'] ?? '',
'name' => $_ENV['MAIL_FROM_NAME'] ?? 'Blogware'
]
],
];| Environment | URL |
|---|---|
| Public Site | http://your-domain/ |
| Admin Panel | http://your-domain/admin/ |
| API Endpoint | http://your-domain/api/v1/ |
ScriptLog/
|-- index.php # Public front controller
|-- config.php # Application configuration
|-- .env # Environment variables
|
|-- admin/ # Admin panel
| |-- index.php # Admin entry point
| |-- login.php # Login page
| +-- ... # Other admin pages
|
|-- api/ # RESTful API
| +-- index.php # API entry point
|
|-- lib/ # Core library
| |-- main.php # Application bootstrap
| |-- common.php # Constants and functions
| +-- core/ # Core classes (Bootstrap, Dispatcher, DbFactory, etc.)
| +-- dao/ # Data Access Objects
| +-- service/ # Business logic layer
| +-- controller/ # Request controllers
| +-- model/ # Data models
| +-- utility/ # Utility functions (100+ files)
| +-- vendor/ # Composer dependencies
|
|-- public/ # Web root
| +-- themes/ # Theme templates
| +-- blog/ # Default theme
| +-- files/ # User uploads (pictures, audio, video, docs)
| +-- cache/ # Cache directory
| +-- log/ # Log directory
|
|-- install/ # Installation wizard
| +-- include/ # Installation includes
|
|-- docs/ # Developer guides
+-- DEVELOPER_GUIDE.md
+-- TESTING_GUIDE.md
+-- PLUGIN_DEVELOPER_GUIDE.md
+-- API_DOCUMENTATION.md
+-- API_OPENAPI.yaml
+-- API_OPENAPI.json
|
+-- tests/ # PHPUnit test suite
For detailed architecture and component documentation, see DEVELOPER_GUIDE.md.
Scriptlog adheres to PSR-12 coding standards and uses Conventional Commits.
Scriptlog uses a multi-layer architecture designed for maintainability and scalability:
Request → Front Controller → Bootstrap → Dispatcher → Controller → Service → DAO → Database
| Step | Component | Location |
|---|---|---|
| 1 | Front Controller | index.php |
| 2 | Bootstrap | lib/core/Bootstrap.php |
| 3 | Dispatcher | lib/core/Dispatcher.php |
| 4 | Controller | lib/controller/* |
| 5 | Service | lib/service/* |
| 6 | DAO | lib/dao/* |
| 7 | View | lib/core/View.php |
When adding features, follow the layered implementation pattern:
- Database Table: Add to
install/include/dbtable.php - DAO: Create in
lib/dao/(Database interactions) - Service: Create in
lib/service/(Business logic) - Controller: Create in
lib/controller/(Request handling) - Routes: Add to
lib/core/Bootstrap.php
WARNING: Never bypass the DAO layer when accessing the database. Always use prepared statements to prevent SQL injection.
- Run Tests:
vendor/bin/phpunit - Static Analysis:
vendor/bin/phpstan(see TESTING_GUIDE.md)
- Authentication: Custom secure session handler (
SessionMaker) with remember-me tokens and session fingerprinting. - CSRF: Protected via
csrf_defenderand form security utilities. - XSS: Multi-layered prevention using
Anti-XSS(voku) andHTMLPurifier. - Encryption: Sensitive data encrypted using
defuse/php-encryptionwith auto-generated keys. - Password Hashing: Uses PHP's built-in
password_hash()with bcrypt. - Access Control: Role-based user levels with granular permissions.
| Level | Permissions |
|---|---|
| administrator | Full access - PRIVACY, USERS, IMPORT, PLUGINS, THEMES, CONFIGURATION, PAGES, NAVIGATION, TOPICS, COMMENTS, MEDIALIB, REPLY, POSTS, DASHBOARD |
| manager | PLUGINS, THEMES, CONFIGURATION, PAGES, NAVIGATION, TOPICS, COMMENTS, MEDIALIB, REPLY, POSTS, DASHBOARD |
| editor | TOPICS, COMMENTS, MEDIALIB, REPLY, POSTS, DASHBOARD |
| author | COMMENTS, MEDIALIB, REPLY, POSTS, DASHBOARD |
| contributor | POSTS, DASHBOARD |
| subscriber | DASHBOARD only |
Contributions are welcome! Please read our Contributing Guidelines before submitting pull requests.
Please read our Code of Conduct to keep our community approachable and respectable.
For security vulnerabilities, please read our Security Policy for responsible disclosure guidelines.
Scriptlog is Open Source and Free PHP Blog Software licensed under the MIT License.
Thank you for creating with Scriptlog.
