Чтение RSS каналов

changelog

Фильтр и поиск

Всего: 127 Коммитов в репозитории | Отфильтровано: 127 Коммиты | Страница: 9 / 13
04.12.2025
Refactor: URL schema modernization - Phase 2 Complete
Автор: Eduard Laas | Дата: 10:14 04.12.2025
Converted all 13 remaining admin modules to RESTful URL structure:
Core modules:
• changelog.php: name=changelog&op={show|conf|saveconf|info}
• comments.php: name=comments&op={show|edit|editsave|conf|save}
• config.php: name=config&op={show|save|info}
• database.php: name=database&op={show|dump|del|info}
• editor.php: name=editor&op={function|header|rewrite|htaccess|robots}
Content modules:
• messages.php: name=messages&op={show|add|save|status|delete}
• newsletter.php: name=newsletter&op={show|add|save|delete}
System modules:
• favorites.php: name=favorites&op={show|conf|confsave}
• fields.php: name=fields&op={show|saveconf}
• groups.php: name=groups&op={show|add|save|del|points}
• lang.php: name=lang&op={main|file|save|conf|confsave}
• modules.php: name=modules&op={show|status|edit|editsave|add}
• privat.php: name=privat&op={show|conf|confsave}
All modules now follow consistent pattern:
✓ URL: ?name={module}&op={action}
✓ Simplified switch cases (show vs moduleShow)
✓ Updated navigation, forms, and redirects
✓ Consistent with admins, blocks, categories
Refactor: URL schema modernization - Phase 1
Автор: Eduard Laas | Дата: 10:02 04.12.2025
Converted 3 admin modules + menu to RESTful URL structure:
• admin/links/links.admin.php: Updated all menu links
• admin/modules/admins.php: name=admins&op={action}
• admin/modules/blocks.php: name=blocks&op={action}
• admin/modules/categories.php: name=categories&op={action}
New URL pattern: ?name={module}&op={action}
• Separates resource (module) from action (operation)
• Simplified switch cases: 'show', 'add', 'save' vs 'moduleShow', 'moduleAdd'
• Updated all forms, redirects, and navigation
03.12.2025
Refactor: Global language system modernization
Автор: Eduard Laas | Дата: 15:33 03.12.2025
Complete language system refactoring across the entire SLAED CMS:
Language File Standardization:
• Renamed all language files from lang-{language}.php to {iso}.php
* lang-english.php → en.php
* lang-german.php → de.php
* lang-french.php → fr.php
* lang-polish.php → pl.php
* lang-russian.php → ru.php
* lang-ukrainian.php → uk.php
• Applied to admin/language/ and language/ directories
• Converted all language files to single quotes (performance optimization)
• Proper escaping of apostrophes in translations
Configuration Updates:
• Migrated from config_lang.php to config/lang.php
• Updated all language loading references across core files
• Modified language selection blocks and user preferences
Core System Changes:
• Updated core/core.php language loading mechanism
• Modified admin/admin.php for new language structure
• Updated all admin modules to use new language constants
• Refactored block-languages.php for ISO code support
• Updated user preference handling in core/user.php
Module Updates:
• account, contact, forum, voting, whois modules adapted
• All modules now use standardized language system
• Improved language switching functionality
Benefits:
• ISO 639-1 compliant naming convention
• Better internationalization standard compliance
• Cleaner, more maintainable codebase
• Performance improvements through single quotes
Modernize: setup.php - Complete PDO refactoring & optimization
Автор: Eduard Laas | Дата: 15:31 03.12.2025
Major changes:
• PDO-only architecture (removed mysqli support)
• All SQL queries converted to prepared statements with named placeholders
• Single quotes throughout for performance optimization
• Language files standardized (lang-english.php → en.php)
• PHP 8.1 version check enforced
• sprintf format specifiers fixed (%1$s not %1\$s)
• Dead code elimination:
* Removed buildSelect() function (unused)
* Removed 6 unused dropdown variable assignments
• Code cleanup:
* Extracted checkWritableConfig() helper to reduce duplication
* Improved maintainability and DRY compliance
Security improvements:
• PDO parameter binding prevents SQL injection
• Automatic type handling and escaping
29.11.2025
Extend checkConfigFile pattern to language files
Автор: Eduard Laas | Дата: 01:32 29.11.2025
Applied modern file validation pattern to language files, replacing
legacy end_chmod() permission checks with checkConfigFile() helper.
Changes in admin/modules/lang.php:
• Replace end_chmod() with checkConfigFile() for language file validation
• Remove redundant opendir() error handling (relying on checkConfigFile)
• Consistent with config file modernization approach
Updated .
• Renamed section 2.10 to "System File Validation and Config Modernization"
• Added language file example demonstrating checkConfigFile() usage
• Clarified that pattern applies to all editable system files, not just configs
This change extends the modern permission validation pattern established
for config files to language files and any other writable system files,
improving code consistency and maintainability.
Refactor getLangPath helper function for clarity
Автор: Eduard Laas | Дата: 01:19 29.11.2025
Improve the language path helper function to return a complete path
instead of an array of path segments, making the code more intuitive.
## Changes
### Function Signature:
BEFORE:
``php
function lang_get_path(string $mod, string $typ): array {
$mod_dir = $mod ? 'modules/'.$mod.'/' : '';
$lng_wh = $typ ? $typ.'/' : '';
return [$mod_dir, $lng_wh];
}
`
AFTER:
`php
function getLangPath(string $mod = '', string $typ = ''): string {
$base = BASE_DIR;
$module = $mod ? '/modules/'.$mod : '';
$type = $typ ? '/'.$typ : '';
return $base.$module.$type.'/language';
}
`
### Usage Simplification:
BEFORE (complex):
`php
[$mod_dir, $lng_wh] = lang_get_path($mod, $typ);
$lang_path = BASE_DIR.'/'.$mod_dir.$lng_wh.'language';
$lng_src = BASE_DIR.'/'.$mod_dir.$lng_wh.'language/lang-'.$lng_cn[$j].'.php';
`
AFTER (clean):
`php
$lang_path = getLangPath($mod, $typ);
$lng_src = $lang_path.'/lang-'.$lng_cn[$j].'.php';
`
## Benefits
✅ Single source of truth for language directory paths
✅ No array destructuring needed
✅ Follows verbNoun naming convention (getLangPath)
✅ Default parameters allow optional mod/typ
✅ Returns complete path - more intuitive API
✅ Reduced code duplication (3 places simplified)
✅ Easier to understand and maintain
## Files Modified
• admin/modules/lang.php:
- Renamed:
lang_get_path()getLangPath()
- Updated: 3 call sites (lang_file, lang_save)
- Removed: Array destructuring
[$mod_dir, $lng_wh]
- Simplified: Path construction logic
## Testing
• Syntax check: ✅ No errors
• Path construction works for:
- System languages:
getLangPath()BASE_DIR/language
- Admin languages:
getLangPath('', 'admin')BASE_DIR/admin/language
- Module languages:
getLangPath('news')BASE_DIR/modules/news/language
- Module admin:
getLangPath('news', 'admin')BASE_DIR/modules/news/admin/language`
Rename config file and update language files to LF
Автор: Eduard Laas | Дата: 01:12 29.11.2025
Complete the lang.php module refactoring by renaming the config file
and ensuring all admin language files use LF line endings.
## Config File Migration
### Renamed:
config/config_lang.phpconfig/lang.php
Rationale:
• Follows new naming convention (remove config_ prefix)
• Consistent with other refactored config files (users.php, fields.php)
• Used by require_once CONFIG_DIR.'/lang.php' in admin/modules/lang.php
Config variable: $confla (unchanged)
Config structure: Same (key, lang, count, per_page)
## Language Files Line Ending Normalization
### Updated to LF (6 files):
• admin/language/lang-english.php
• admin/language/lang-french.php
• admin/language/lang-german.php
• admin/language/lang-polish.php
• admin/language/lang-russian.php
• admin/language/lang-ukrainian.php
Changes:
• CRLF → LF line endings
• All files now comply with .editorconfig (end_of_line = lf)
• Consistent with PSR-12 and SLAED coding standards
## Impact
✅ Config loading works with new path: CONFIG_DIR.'/lang.php'
✅ All admin language files use Unix line endings
✅ Consistent with rest of codebase after LF normalization
✅ No functional changes - only file formatting
## Related Commits
• 3ccf1d5: Normalize line endings to LF (initial CRLF→LF conversion)
• 2a84c79: Refactor lang.php module (config path update)
Refactor lang.php module and update refactoring rules
Автор: Eduard Laas | Дата: 01:11 29.11.2025
Modernize language management admin module to PHP 8.4+ standards
and document new refactoring patterns discovered during migration.
## admin/modules/lang.php Changes
### Navigation Function Modernization:
• Replace navi_gen() with getAdminTabs()
• Simplify function signature: remove unused $opt and $legacy parameters
lang_navi(int $opt, int $tab, int $subtab, int $legacy)lang_navi(int $tab, int $subtab)
• Update all 5 function calls throughout the module
### Config Include Modernization:
• Replace include('config/config_lang.php') with require_once CONFIG_DIR.'/lang.php'
• Use checkConfigFile('lang.php') instead of end_chmod() for permission checking
• Update config file reference: config_lang.phplang.php in setConfigFile()
### Error Handling Improvements:
• Remove @ error suppression from opendir() call
• Add explicit false check: if ($dir === false) { ... }
• Proper error handling with early return
### Code Style Improvements:
• Compact one-liners for simple if statements (following 120 char limit):
- if ($file !== '.' && $file !== '...' && is_file(...)) $mod[] = $file;
- if (is_dir(...)) $eadmin = '<a...';
- while (($file = readdir($dir)) !== false) if (preg_match(...)) $lng_cn[] = ...;
- for ($j = 0; $j < $cj; $j++) $cont .= '<input...';
• Improved readability while maintaining consistency
### Language File Generation Fix:
• Remove \r\n (CRLF) → use PHP_EOL (LF) for line endings
• Remove closing ?> tag from generated language files
• Replace double quotes with single quotes: "define(...)"'define(...)'
• Generated files now fully comply with PSR-12 and SLAED standards
### Minor Cleanups:
• Remove unnecessary comment "// Redirect back to same page"
• Consistent spacing and formatting
## .
Added three new refactoring patterns based on lang.php migration:
### Section 2.8: Remove Error Suppression Operator (@)
• Never use @ operator - handle errors properly
• Examples: @opendir() → explicit opendir() + if ($dir === false)
• Rule: Remove @ and check return values explicitly
### Section 2.9: Compact Code Style (One-liners)
• For simple conditions, use compact syntax (max 120 chars)
• Examples:
- if (condition) $var = value; (instead of multi-line)
- foreach ($arr as $item) if (check) $result[] = $item;
• Rule: Single-statement conditions can be one-liners
### Section 2.10: Config File Modernization
• Use require_once CONFIG_DIR.'/filename.php' instead of include()
• Use checkConfigFile('filename.php') instead of end_chmod()
• Remove config_ prefix: config_lang.phplang.php
• Consistent config handling across modules
### Updated Checklist (Section 14):
Added new items to migration checklist:
• [ ] Remove all @ error suppression operators
• [ ] Use compact one-liners for simple if/for/while (max 120 chars)
• [ ] Update config includes to use CONFIG_DIR constant
• [ ] Use checkConfigFile() instead of end_chmod()
• [ ] Rename config files: remove config_ prefix where applicable
## Benefits
✅ Cleaner navigation function signature (2 params instead of 4)
✅ Proper error handling without suppression
✅ Modern config file organization
✅ Generated language files comply with LF line endings
✅ More compact, readable code style
✅ Documented patterns for future refactoring
## Testing
• Syntax check: ✅ No errors (php -l admin/modules/lang.php)
• Config file loading: Uses new CONFIG_DIR constant
• Language file generation: Now creates LF files without closing tag
• All 5 lang_navi() calls updated and working
Normalize line endings to LF and update documentation
Автор: Eduard Laas | Дата: 00:37 29.11.2025
Convert all project files from CRLF (Windows) to LF (Unix) line endings
for better cross-platform compatibility and adherence to PHP standards.
## Line Endings Normalization
### Changed:
• Converted 470+ PHP files from CRLF to LF
• Converted all JS, CSS, HTML, JSON, MD, XML files to LF
• Converted configuration files (.htaccess, .editorconfig, .gitignore) to LF
• Created .gitattributes to enforce LF line endings in repository
### Rationale:
• PHP standard (PSR-12) recommends LF line endings
• Production servers run Linux (native LF)
• Reduces Git diff noise and merge conflicts
• Consistent across all platforms (Windows/Linux/Mac)
• Smaller file sizes (LF = 1 byte vs CRLF = 2 bytes)
## Documentation Updates
### .
• Merged migration-patterns.md into refactoring-rules.md
• Added real-world migration examples (Section 10)
• Added quote style consistency rules (Section 2.3)
• Added array syntax modernization (Section 2.4)
• Expanded input validation with getVar() examples (Section 2.6)
• Added complete migration checklist (Section 14)
• Added performance considerations (Section 15)
• Document now 1030+ lines comprehensive
### .
• Created detailed migration progress article for website
• User-friendly explanation of 6.2 → 6.3 changes
• Security improvements documentation
• Performance benefits explanation
• FAQ section for end users
• 400+ lines ready for publication
### .gitignore:
• Added .
• Added nul file (Windows artifact)
• Prevents IDE-specific files from entering repository
### .gitattributes (NEW):
• Enforces LF line endings for all text files
• Declares binary file types explicitly
• Ensures consistent behavior across platforms
• Auto-normalizes files on checkout/commit
## Technical Details
Files affected: 470+ PHP files, 100+ other text files
Line ending change: CRLF → LF throughout entire codebase
Impact: All modified files show as changed due to line ending normalization
Tool used: dos2unix for safe conversion
Compatibility: No functional changes, only line ending formatting
## Benefits
✅ PHP 8.4 standard compliance (PSR-12)
✅ Linux production server compatibility
✅ Reduced Git conflicts in team environment
✅ Smaller file sizes
✅ Consistent IDE behavior across platforms
✅ Better integration with CI/CD pipelines
28.11.2025
Add comprehensive refactoring rules and spread operator guidelines
Автор: Eduard Laas | Дата: 21:38 28.11.2025
Created detailed refactoring documentation to prevent AI hallucinations
and ensure consistent PHP 8.4+ modernization approach.
New documentation:
• .
- Safety principles and anti-hallucination rules
- PHP 8.4+ migration patterns with examples
- Database best practices (MySQL 8.0+/MariaDB 10+)
- Security hardening guidelines
- Function naming conventions
- Step-by-step refactoring workflow
- Common patterns with before/after examples
- Testing and validation procedures
- Git commit strategies
- Complete checklist for each refactoring
Updated coding rules:
• .
- Explicitly forbid func_get_args() usage (outdated since PHP 5.6)
- Promote spread operator for variadic functions
- Provide examples: explicit parameters vs variadic
- Show when to use spread operator appropriately
Key improvements:
• Clear distinction between preferred (explicit params) and variadic approaches
• Type-safe variadic functions: function sum(int ...$nums): int
• Examples demonstrating modern PHP patterns
• Guidance on when spread operator is truly needed
Anti-hallucination measures:
• Never invent functions that don't exist
• Always verify before modifying
• Search for usage before renaming
• Check constants in language files
• Document breaking changes
• Ask developer when in doubt
Benefits:
• Consistent refactoring across entire codebase
• Reduced errors from AI misunderstandings
• Clear guidelines prevent code quality regression
• Systematic approach ensures nothing is missed
• Complete audit trail with detailed commits
Impact:
• Establishes foundation for systematic PHP 8.4 migration
• Prevents common refactoring mistakes
• Ensures security and type safety throughout
• Improves long-term code maintainability
Files modified:
• .
• .

Всего: 127 на 13 страницах по 10 на каждой странице

Хотите опробовать SLAED CMS в действии?

Технологии

PHP MySQL HTML 5 CSS 3 jQuery jQuery UI

Контакты

  • D-49179, Deutschland
    Ostercappeln, Im Siek 6
  • +49 176 61966679

  • https://slaed.net
Идеи и предложения
Обратная связь