- Add 8 frontend methods to ArticleRepository (with Redis cache) - Create front\Views\Articles (rendering + utility methods) - Rewire front\view\Site::show() and front\controls\Site::route() to repo + Views - Update 5 article templates to use \front\Views\Articles:: - Convert front\factory\Articles and front\view\Articles to facades - Remove class.Article (entity + static methods migrated to repo + Views) - Remove front\factory\Settings facade (already migrated) - Fix: eliminate global $lang from articleNoindex(), inline page sort query - Tests: 450 OK, 1431 assertions (+13 new) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
56 lines
1.5 KiB
PHP
56 lines
1.5 KiB
PHP
<?php
|
|
error_reporting( E_ALL ^ E_NOTICE ^ E_STRICT ^ E_WARNING ^ E_DEPRECATED );
|
|
|
|
function __autoload_my_classes( $classname )
|
|
{
|
|
$q = explode( '\\', $classname );
|
|
$c = array_pop( $q );
|
|
$f = '../autoload/' . implode( '/', $q ) . '/class.' . $c . '.php';
|
|
|
|
if ( file_exists( $f ) )
|
|
require_once( $f );
|
|
else
|
|
{
|
|
$f = '../autoload/' . implode( '/', $q ) . '/' . $c . '.php';
|
|
if ( file_exists( $f ) )
|
|
require_once( $f );
|
|
}
|
|
}
|
|
|
|
spl_autoload_register( '__autoload_my_classes' );
|
|
date_default_timezone_set( 'Europe/Warsaw' );
|
|
|
|
require_once '../config.php';
|
|
require_once '../libraries/medoo/medoo.php';
|
|
require_once '../libraries/phpmailer/class.phpmailer.php';
|
|
require_once '../libraries/phpmailer/class.smtp.php';
|
|
|
|
session_start();
|
|
|
|
if ( !isset( $_SESSION[ 'check' ] ) )
|
|
{
|
|
session_regenerate_id();
|
|
$_SESSION[ 'check' ] = true;
|
|
$_SESSION[ 'ip' ] = $_SERVER[ 'REMOTE_ADDR' ];
|
|
}
|
|
|
|
if ( $_SESSION[ 'ip' ] !== $_SERVER[ 'REMOTE_ADDR' ] )
|
|
{
|
|
session_destroy();
|
|
header( 'Location: /' );
|
|
exit;
|
|
}
|
|
|
|
$mdb = new medoo( [
|
|
'database_type' => 'mysql',
|
|
'database_name' => $database[ 'name' ],
|
|
'server' => $database[ 'host' ],
|
|
'username' => $database[ 'user' ],
|
|
'password' => $database[ 'password' ],
|
|
'charset' => 'utf8'
|
|
] );
|
|
|
|
$settings = ( new \Domain\Settings\SettingsRepository( $mdb ) )->allSettings();
|
|
$lang_id = ( new \Domain\Languages\LanguagesRepository( $mdb ) )->defaultLanguage();
|
|
|
|
( new \Domain\Product\ProductRepository( $mdb ) )->generateGoogleFeedXml(); |