Skip to content

Commit

Permalink
0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
kvalood committed Jul 7, 2018
1 parent 318b51c commit 7418f58
Show file tree
Hide file tree
Showing 1,918 changed files with 13,066 additions and 295,937 deletions.
14 changes: 14 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,20 @@ ErrorDocument 404 /404
ErrorDocument 401 /password.php
RewriteEngine on

# Редирект с www на БЕз www
# Options +FollowSymLinks
# RewriteEngine On
# RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
# RewriteRule ^(.*)$ https://%1/$1 [R=301,L]

# Редирект на https
# RewriteCond %{SERVER_PORT} !^443$
# RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]


# Админка теперь по адресу /simpla
RewriteRule ^admin/?$ simpla [L]

# Каталог товаров
RewriteRule ^catalog/([^/]+)/?$ index.php?module=ProductsView&category=$1 [L,QSA]
RewriteRule ^catalog/([^/]+)/([^/]+)/?$ index.php?module=ProductsView&category=$1&brand=$2 [L,QSA]
Expand Down
108 changes: 30 additions & 78 deletions Smarty/libs/Autoloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,76 +11,35 @@
* @package Smarty
* @author Uwe Tews
* Usage:
* require_once '...path/Autoloader.php';
* Smarty_Autoloader::register();
* $smarty = new Smarty();
* Note: This autoloader is not needed if you use Composer.
* Composer will automatically add the classes of the Smarty package to it common autoloader.
* require_once '...path/Autoloader.php';
* Smarty_Autoloader::register();
* or
* include '...path/bootstrap.php';
*
* $smarty = new Smarty();
*/
class Smarty_Autoloader
{
/**
/**
* Filepath to Smarty root
*
* @var string
*/
public static $SMARTY_DIR = '';
public static $SMARTY_DIR = null;

/**
* Filepath to Smarty internal plugins
*
* @var string
*/
public static $SMARTY_SYSPLUGINS_DIR = '';
/**
* Array of not existing classes to avoid is_file calls for already tested classes
*
* @var array
*/
public static $unknown = array();
public static $SMARTY_SYSPLUGINS_DIR = null;

/**
* Array with Smarty core classes and their filename
*
* @var array
*/
public static $rootClasses = array('Smarty' => 'Smarty.class.php',
'SmartyBC' => 'SmartyBC.class.php',
);

private static $syspluginsClasses = array(
'smarty_config_source' => true,
'smarty_security' => true,
'smarty_cacheresource' => true,
'smarty_compiledresource' => true,
'smarty_cacheresource_custom' => true,
'smarty_cacheresource_keyvaluestore' => true,
'smarty_resource' => true,
'smarty_resource_custom' => true,
'smarty_resource_uncompiled' => true,
'smarty_resource_recompiled' => true,
'smarty_template_source' => true,
'smarty_template_compiled' => true,
'smarty_template_cached' => true,
'smarty_template_config' => true,
'smarty_data' => true,
'smarty_variable' => true,
'smarty_undefined_variable' => true,
'smartyexception' => true,
'smartycompilerexception' => true,
'smarty_internal_data' => true,
'smarty_internal_template' => true,
'smarty_internal_templatebase' => true,
'smarty_internal_resource_file' => true,
'smarty_internal_resource_extends' => true,
'smarty_internal_resource_eval' => true,
'smarty_internal_resource_string' => true,
'smarty_internal_resource_registered' => true,
'smarty_internal_extension_codeframe' => true,
'smarty_internal_extension_config' => true,
'smarty_internal_filter_handler' => true,
'smarty_internal_function_call_handler' => true,
'smarty_internal_cacheresource_file' => true,
'smarty_internal_write_file' => true,
);
public static $rootClasses = array('smarty' => 'Smarty.class.php', 'smartybc' => 'SmartyBC.class.php',);

/**
* Registers Smarty_Autoloader backward compatible to older installations.
Expand All @@ -95,9 +54,11 @@ public static function registerBC($prepend = false)
if (!defined('SMARTY_SPL_AUTOLOAD')) {
define('SMARTY_SPL_AUTOLOAD', 0);
}
if (SMARTY_SPL_AUTOLOAD && set_include_path(get_include_path() . PATH_SEPARATOR . SMARTY_SYSPLUGINS_DIR) !== false) {
if (SMARTY_SPL_AUTOLOAD &&
set_include_path(get_include_path() . PATH_SEPARATOR . SMARTY_SYSPLUGINS_DIR) !== false
) {
$registeredAutoLoadFunctions = spl_autoload_functions();
if (!isset($registeredAutoLoadFunctions['spl_autoload'])) {
if (!isset($registeredAutoLoadFunctions[ 'spl_autoload' ])) {
spl_autoload_register();
}
} else {
Expand All @@ -112,47 +73,38 @@ public static function registerBC($prepend = false)
*/
public static function register($prepend = false)
{
self::$SMARTY_DIR = defined('SMARTY_DIR') ? SMARTY_DIR : dirname(__FILE__) . '/';
self::$SMARTY_SYSPLUGINS_DIR = defined('SMARTY_SYSPLUGINS_DIR') ? SMARTY_SYSPLUGINS_DIR : self::$SMARTY_DIR . 'sysplugins/';
if (version_compare(phpversion(), '5.3.0', '>=')) {
self::$SMARTY_DIR = defined('SMARTY_DIR') ? SMARTY_DIR : dirname(__FILE__) . DIRECTORY_SEPARATOR;
self::$SMARTY_SYSPLUGINS_DIR = defined('SMARTY_SYSPLUGINS_DIR') ? SMARTY_SYSPLUGINS_DIR :
self::$SMARTY_DIR . 'sysplugins' . DIRECTORY_SEPARATOR;
if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
spl_autoload_register(array(__CLASS__, 'autoload'), true, $prepend);
} else {
spl_autoload_register(array(__CLASS__, 'autoload'));
}
}

/**
* Handles autoloading of classes.
* Handles auto loading of classes.
*
* @param string $class A class name.
*/
public static function autoload($class)
{
// Request for Smarty or already unknown class
if (isset(self::$unknown[$class])) {
if ($class[ 0 ] !== 'S' && strpos($class, 'Smarty') !== 0) {
return;
}
$_class = strtolower($class);
if (isset(self::$syspluginsClasses[$_class])) {
$_class = (self::$syspluginsClasses[$_class] === true) ? $_class : self::$syspluginsClasses[$_class];
if (isset(self::$rootClasses[ $_class ])) {
$file = self::$SMARTY_DIR . self::$rootClasses[ $_class ];
if (is_file($file)) {
include $file;
}
} else {
$file = self::$SMARTY_SYSPLUGINS_DIR . $_class . '.php';
require_once $file;
return;
} elseif (0 !== strpos($_class, 'smarty_internal_')) {
if (isset(self::$rootClasses[$class])) {
$file = self::$SMARTY_DIR . self::$rootClasses[$class];
require_once $file;
return;
if (is_file($file)) {
include $file;
}
self::$unknown[$class] = true;
return;
}
$file = self::$SMARTY_SYSPLUGINS_DIR . $_class . '.php';
if (is_file($file)) {
require_once $file;
return;
}
self::$unknown[$class] = true;
return;
}
}
Loading

0 comments on commit 7418f58

Please sign in to comment.