Backup
Some checks failed
Gitea Actions / Run-Tests-On-Arm64 (push) Failing after 8m35s
Gitea Actions / Run-Tests-On-Amd64 (push) Failing after 12m18s
Gitea Actions / Merge (push) Successful in 5m15s

This commit is contained in:
Thomas Peterson 2025-10-14 11:25:47 +02:00
parent da7e7ef3ef
commit 0ba96f370c
3 changed files with 179 additions and 7 deletions

View File

@ -27,7 +27,7 @@ APP_CODE_PATH_HOST=../../src
APP_HOST=app.local APP_HOST=app.local
NETWORKS_DRIVER=bridge NETWORKS_DRIVER=bridge
MYSQL_BACKUP_PATH_HOST=../../dev_db/mysql.sql MYSQL_BACKUP_PATH_HOST=../../dev_db/mariadb.sql
NGINX_HOST_HTTP_PORT=80 NGINX_HOST_HTTP_PORT=80
NGINX_HOST_HTTPS_PORT=444 NGINX_HOST_HTTPS_PORT=444
@ -36,8 +36,8 @@ PHP_IDE_CONFIG=serverName=psc
VOLUMES_DRIVER=local VOLUMES_DRIVER=local
ALPINE_VERSION=3.12 ALPINE_VERSION=3.12
COMPOSER_VERSION=2.2.5 COMPOSER_VERSION=lts
MYSQL_VERSION=11 MYSQL_VERSION=latest
MONGODB_VERSION=7 MONGODB_VERSION=7
NGINX_VERSION=1.21.5-alpine NGINX_VERSION=1.21.5-alpine
PHP_VERSION=8.2 PHP_VERSION=8.4

View File

@ -743,10 +743,10 @@ CREATE TABLE `cms` (
`language` varchar(5) DEFAULT NULL, `language` varchar(5) DEFAULT NULL,
`text1` longtext DEFAULT NULL, `text1` longtext DEFAULT NULL,
`notinmenu` tinyint(1) NOT NULL, `notinmenu` tinyint(1) NOT NULL,
`modul` varchar(255) NOT NULL, `modul` varchar(255) DEFAULT NULL,
`parent` int(8) DEFAULT NULL, `parent` int(8) DEFAULT NULL,
`parameter` text NOT NULL, `parameter` text DEFAULT NULL,
`copy_market` int(1) NOT NULL, `copy_market` int(1) DEFAULT 0,
`meta_keywords` text DEFAULT NULL, `meta_keywords` text DEFAULT NULL,
`meta_description` text DEFAULT NULL, `meta_description` text DEFAULT NULL,
`meta_author` varchar(255) DEFAULT NULL, `meta_author` varchar(255) DEFAULT NULL,

172
src/old/CLAUDE.md Normal file
View File

@ -0,0 +1,172 @@
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Project Overview
This is a legacy Zend Framework 1 application for a print shop e-commerce platform ("PrintShopCreator"). It's a multi-tenant system where each shop can have custom templates, products, and configurations.
**Important**: This is in the `/src/old` directory, suggesting there may be a newer version elsewhere in the parent project.
## Technology Stack
- **PHP Framework**: Zend Framework 1 (legacy)
- **ORM**: Doctrine 1.x
- **Primary Database**: MySQL (via PDO)
- **Secondary Database**: MongoDB (for dynamic routing)
- **Cache**: File-based Zend_Cache
- **Template Engine**: Zend_Layout + custom shop templates
## Architecture
### Multi-Tenant Structure
The application is shop-based (multi-tenant):
- Shops are identified by domain name (stored in `Domain` table)
- Each shop has its own layout directory: `application/design/clients/{shop_uid}/`
- Shop configuration is loaded in `Bootstrap::_initLayout()` based on `$_SERVER["SERVER_NAME"]`
- Database connection, cache, and translations are shop-aware
### Directory Structure
- `application/` - Zend Framework application code
- `Bootstrap.php` - Main application bootstrap with initialization methods
- `configs/` - Configuration files (application.ini, database.ini, etc.)
- `modules/` - MVC modules
- `default/` - Frontend shop module
- `production/` - Production/backend module
- `service/` - API/service endpoints
- `cli/` - CLI commands
- `articles/` - Pluggable article type definitions (Csvcalc, Market, Simple, Weblayouter, etc.)
- `queues/` - Queue processors (Booking, Computop, DPD, Heidelpay, etc.)
- `data/models/` - Doctrine ORM models
- `design/` - Shop templates and layouts
- `clients/{shop_uid}/` - Shop-specific templates
- `vorlagen/` - Template presets
- `library/` - Zend Framework libraries and custom code
- `TP/` - Custom business logic namespace
- `Doctrine/` - Doctrine ORM
- `Zend/` - Zend Framework
- `public/` - Web root
- `index.php` - Application entry point
- `temp/` - Temporary uploads
- `cache/` - File cache (per shop: `cache/{shop_id}/`)
- `logs/` - Application logs (app.log, php.error.log)
- `data/` - Data files
- `market/` - Market-related files
### Bootstrap Initialization Order
Key bootstrap methods in `application/Bootstrap.php`:
1. `_initAutoload()` - Registers namespaces (TP_, Doctrine, etc.)
2. `_initDb()` - Configures Doctrine and MySQL connection
3. `_initLog()` - Sets up Zend_Log and session handling
4. `_initLayout()` - **Critical**: Loads shop by domain, sets layout paths
5. `_initLanguage()` - Configures translations and cache
6. `_initArticleQueues()` - Loads article types and queue processors dynamically
7. `_initPlugins()` - Registers ACL and authentication plugins
8. `_initCustomRouter()` - Loads dynamic routes from MongoDB
### Article System
Articles are pluggable product types. Each article type:
- Lives in `application/articles/{ArticleType}/`
- Has an `Article.php` class that extends a base article class
- Is registered in the global `articles` registry during bootstrap
- Types include: Csvcalc, Market, Simple, Weblayouter, Wmd, etc.
### Queue System
Queues are background processors for various workflows:
- Located in `application/queues/{QueueType}/`
- Each has a `Queues.php` class
- Registered globally during bootstrap
- Types include: Booking, Computop, DPD, Heidelpay, KPExport, etc.
### Dynamic Routing
Routes are stored in MongoDB and loaded in `_initCustomRouter()`:
- Route types: Article (1), CMS (2), Overview (3), System (4)
- Mapped to controllers dynamically at runtime
- Per-shop configuration
### Custom TP_ Namespace
Business logic lives in `library/TP/`:
- `TP_Basket` - Shopping cart logic
- `TP_Calc` - Price/product calculations
- `TP_Controller_*` - Custom controller classes
- `TP_Plugin_Acl` - Access control
- `TP_Plugin_Auth` - Authentication
- `TP_Crypt` - Encryption utilities
- `TP_Util` - Utility functions
### Session Handling
Special session logic via encrypted ARTID parameter:
- Used for cross-domain article editing
- ARTID can be encrypted with server name and session ID
- Decrypted in Bootstrap to set proper session and domain context
## Running the Application
### Web Server
The application entry point is `public/index.php`. Configure your web server to point to the `public/` directory.
Environment is set via `APPLICATION_ENV` (production, staging, development, testing).
### CLI Commands
Run CLI commands via:
```bash
php public/index.php
```
CLI controllers are in `application/modules/cli/controllers/`.
### Database
Database configuration is in `application/configs/database.ini`.
For Doctrine:
- Models are in `application/data/models/`
- Schema is in `application/doctrine/schema/`
- Migrations are in `application/doctrine/migrations/`
## Configuration Files
Key configuration files in `application/configs/`:
- `application.ini` - Main Zend Framework configuration
- `database.ini` - Database connection settings
- `layout.ini` - Layout paths configuration
- `printshopcreator.ini` - Application-specific settings (market ID, image scaling)
- `navigation.xml` - Site navigation structure
- `systemdefaults.ini` - System default values
## Development Notes
### Multi-Shop Testing
When testing, be aware that the shop is determined by `$_SERVER["SERVER_NAME"]`. The system queries the `Domain` table to find the shop, then loads shop-specific:
- Layout/template from `application/design/clients/{shop_uid}/`
- Configuration values
- Custom routes from MongoDB
### Cache
File cache is stored per shop in `cache/{shop_id}/`. Clear cache by deleting these directories or using `?no_cache=1` query parameter.
### Logs
Application logs are in `logs/`:
- `app.log` - Application log via Zend_Log
- `php.error.log` - PHP errors
### Translations
Translation system uses both:
- File-based translations in `application/locale/`
- Database translations via `TP_Translate_Adapter_Db` (from `admin_translation` table)
Translations are cached and shop/locale aware.