Initial commit: apps.supersam24.ru
This commit is contained in:
commit
e955e1da36
6566 files changed
+1271095
No files matched your search
+155
@@ -0,0 +1,155 @@
|
||||
<?php
|
||||
return [
|
||||
'debug' => false,
|
||||
|
||||
'Release' => "2.4.165",
|
||||
|
||||
'App' => [
|
||||
'namespace' => 'App',
|
||||
'encoding' => env('APP_ENCODING', 'UTF-8'),
|
||||
'defaultLocale' => env('APP_DEFAULT_LOCALE', 'en_US'),
|
||||
'defaultTimezone' => env('APP_DEFAULT_TIMEZONE', 'UTC'),
|
||||
'base' => false,
|
||||
'dir' => 'src',
|
||||
'webroot' => 'webroot',
|
||||
'wwwRoot' => WWW_ROOT,
|
||||
'imageBaseUrl' => 'img/',
|
||||
'cssBaseUrl' => 'css/',
|
||||
'jsBaseUrl' => 'js/',
|
||||
'paths' => [
|
||||
'plugins' => [ROOT . DS . 'plugins' . DS],
|
||||
'templates' => [APP . 'Template' . DS],
|
||||
'locales' => [APP . 'Locale' . DS],
|
||||
],
|
||||
],
|
||||
|
||||
'Security' => [
|
||||
'salt' => env('SECURITY_SALT', '2ae8d3f453c9f6a290a2fcdb173be1cf4acc871c6e656411c82aa331bbfefc18'),
|
||||
],
|
||||
|
||||
'Asset' => [
|
||||
// 'timestamp' => true,
|
||||
],
|
||||
|
||||
'Cache' => [
|
||||
'default' => [
|
||||
'className' => 'File',
|
||||
'path' => CACHE,
|
||||
'url' => env('CACHE_DEFAULT_URL', null),
|
||||
],
|
||||
|
||||
'_cake_core_' => [
|
||||
'className' => 'File',
|
||||
'prefix' => 'myapp_cake_core_',
|
||||
'path' => CACHE . 'persistent/',
|
||||
'serialize' => true,
|
||||
'duration' => '+1 years',
|
||||
'url' => env('CACHE_CAKECORE_URL', null),
|
||||
],
|
||||
|
||||
'_cake_model_' => [
|
||||
'className' => 'File',
|
||||
'prefix' => 'myapp_cake_model_',
|
||||
'path' => CACHE . 'models/',
|
||||
'serialize' => true,
|
||||
'duration' => '+1 years',
|
||||
'url' => env('CACHE_CAKEMODEL_URL', null),
|
||||
],
|
||||
],
|
||||
|
||||
|
||||
'Error' => [
|
||||
'errorLevel' => E_ALL,
|
||||
'exceptionRenderer' => 'Cake\Error\ExceptionRenderer',
|
||||
'skipLog' => [],
|
||||
'log' => true,
|
||||
'trace' => true,
|
||||
],
|
||||
|
||||
|
||||
'Datasources' => [
|
||||
'default' => [
|
||||
'className' => 'Cake\Database\Connection',
|
||||
'driver' => 'Cake\Database\Driver\Mysql',
|
||||
'persistent' => false,
|
||||
'host' => 'localhost',
|
||||
|
||||
'username' => 'supersam_apps',
|
||||
'password' => 'Ft8wV%e3Fre#ZaH-nJ',
|
||||
'database' => 'supersam_apps',
|
||||
'encoding' => 'utf8',
|
||||
'timezone' => 'UTC',
|
||||
'flags' => [],
|
||||
'cacheMetadata' => true,
|
||||
'log' => false,
|
||||
|
||||
'quoteIdentifiers' => true,
|
||||
'url' => env('DATABASE_URL', null),
|
||||
],
|
||||
],
|
||||
|
||||
'Log' => [
|
||||
'debug' => [
|
||||
'className' => 'Cake\Log\Engine\FileLog',
|
||||
'path' => LOGS,
|
||||
'file' => 'debug',
|
||||
'url' => env('LOG_DEBUG_URL', null),
|
||||
'scopes' => false,
|
||||
'levels' => ['notice', 'info', 'debug'],
|
||||
],
|
||||
'error' => [
|
||||
'className' => 'Cake\Log\Engine\FileLog',
|
||||
'path' => LOGS,
|
||||
'file' => 'error',
|
||||
'url' => env('LOG_ERROR_URL', null),
|
||||
'scopes' => false,
|
||||
'levels' => ['warning', 'error', 'critical', 'alert', 'emergency'],
|
||||
],
|
||||
'queries' => [
|
||||
'className' => 'Cake\Log\Engine\FileLog',
|
||||
'path' => LOGS,
|
||||
'file' => 'queries',
|
||||
'url' => env('LOG_QUERIES_URL', null),
|
||||
'scopes' => ['queriesLog'],
|
||||
],
|
||||
],
|
||||
|
||||
'Session' => [
|
||||
'defaults' => 'php',
|
||||
'ini' => [
|
||||
'session.cookie_lifetime' => 18*60*60, //18h
|
||||
'session.cookie_httponly' => true
|
||||
],
|
||||
'timeout' => 12 * 60 //12h
|
||||
],
|
||||
|
||||
'mpdfPageParams' => [
|
||||
'mode' => 'utf-8',
|
||||
'format' => 'A4',
|
||||
'default_font_size' => 0,
|
||||
'default_font' => 'arial',
|
||||
'margin_left' => 15,
|
||||
'margin_right' => 15,
|
||||
'margin_top' => 17,
|
||||
'margin_bottom' => 30
|
||||
],
|
||||
'smsMinimalBalance' => 50,
|
||||
|
||||
"encrypt" => [
|
||||
"key" => 'fsjlksf$#%WEtfvV34v59fHgi3rs0gBB<T58903--.we8934W$w3',
|
||||
"cipher" => "AES-128-CBC",
|
||||
"options" => OPENSSL_RAW_DATA,
|
||||
"as_binary" => true
|
||||
],
|
||||
|
||||
'ftpParams' => [
|
||||
'ip' => '188.191.27.165',
|
||||
'port' => 53530,
|
||||
'username' => 'soronorus',
|
||||
'password' => '5#NqtYB;XOC;!wAtp',
|
||||
|
||||
'acquiring24Out' => '/supersam24.ru/acquiring-in',
|
||||
'acquiring24In' => '/supersam24.ru/acquiring-out',
|
||||
'acquiring24Refund' => '/supersam24.ru/refund',
|
||||
]
|
||||
];
|
||||
@@ -0,0 +1,243 @@
|
||||
<?php
|
||||
|
||||
require __DIR__ . '/paths.php';
|
||||
|
||||
|
||||
require CORE_PATH . 'config' . DS . 'bootstrap.php';
|
||||
|
||||
use Cake\Cache\Cache;
|
||||
use Cake\Console\ConsoleErrorHandler;
|
||||
use Cake\Core\App;
|
||||
use Cake\Core\Configure;
|
||||
use Cake\Core\Configure\Engine\PhpConfig;
|
||||
use Cake\Core\Plugin;
|
||||
use Cake\Database\Type;
|
||||
use Cake\Datasource\ConnectionManager;
|
||||
use Cake\Error\ErrorHandler;
|
||||
use Cake\Http\ServerRequest;
|
||||
use Cake\Log\Log;
|
||||
use Cake\Mailer\Email;
|
||||
use Cake\ORM\TableRegistry;
|
||||
use Cake\Utility\Inflector;
|
||||
use Cake\Utility\Security;
|
||||
|
||||
try {
|
||||
Configure::config('default', new PhpConfig());
|
||||
Configure::load('app', 'default', false);
|
||||
} catch (\Exception $e) {
|
||||
exit($e->getMessage() . "\n");
|
||||
}
|
||||
|
||||
|
||||
if (Configure::read('debug')) {
|
||||
Configure::write('Cache._cake_model_.duration', '+2 minutes');
|
||||
Configure::write('Cache._cake_core_.duration', '+2 minutes');
|
||||
// disable router cache during development
|
||||
Configure::write('Cache._cake_routes_.duration', '+2 seconds');
|
||||
}
|
||||
|
||||
|
||||
date_default_timezone_set('Europe/Moscow');
|
||||
|
||||
mb_internal_encoding(Configure::read('App.encoding'));
|
||||
|
||||
|
||||
ini_set('intl.default_locale', Configure::read('App.defaultLocale'));
|
||||
|
||||
|
||||
$isCli = PHP_SAPI === 'cli';
|
||||
if ($isCli) {
|
||||
(new ConsoleErrorHandler(Configure::read('Error')))->register();
|
||||
} else {
|
||||
(new ErrorHandler(Configure::read('Error')))->register();
|
||||
}
|
||||
|
||||
|
||||
if ($isCli) {
|
||||
require __DIR__ . '/bootstrap_cli.php';
|
||||
}
|
||||
|
||||
|
||||
if (!Configure::read('App.fullBaseUrl')) {
|
||||
$s = null;
|
||||
if (env('HTTPS')) {
|
||||
$s = 's';
|
||||
}
|
||||
|
||||
$httpHost = env('HTTP_HOST');
|
||||
if (isset($httpHost)) {
|
||||
Configure::write('App.fullBaseUrl', 'http' . $s . '://' . $httpHost);
|
||||
}
|
||||
unset($httpHost, $s);
|
||||
}
|
||||
|
||||
Cache::setConfig(Configure::consume('Cache'));
|
||||
ConnectionManager::setConfig(Configure::consume('Datasources'));
|
||||
//Email::setConfigTransport(Configure::consume('EmailTransport'));
|
||||
//Email::setConfig(Configure::consume('Email'));
|
||||
Log::setConfig(Configure::consume('Log'));
|
||||
Security::setSalt(Configure::consume('Security.salt'));
|
||||
|
||||
|
||||
ServerRequest::addDetector('mobile', function ($request) {
|
||||
$detector = new \Detection\MobileDetect();
|
||||
|
||||
return $detector->isMobile();
|
||||
});
|
||||
ServerRequest::addDetector('tablet', function ($request) {
|
||||
$detector = new \Detection\MobileDetect();
|
||||
|
||||
return $detector->isTablet();
|
||||
});
|
||||
|
||||
|
||||
Type::build('time')
|
||||
->useImmutable();
|
||||
Type::build('date')
|
||||
->useImmutable();
|
||||
Type::build('datetime')
|
||||
->useImmutable();
|
||||
Type::build('timestamp')
|
||||
->useImmutable();
|
||||
|
||||
require_once(ROOT . DS . 'vendor' . DS . 'dbf' . DS . 'DBF.class.php');
|
||||
require_once(ROOT . DS . 'vendor' . DS . 'sms' . DS . 'sms.ru.php');
|
||||
require_once(ROOT . DS . 'vendor' . DS . 'browser_detection' . DS . 'BrowserDetection.php');
|
||||
//require_once(ROOT . DS . 'vendor' . DS . 'mpdf' . DS . 'mpdf.php');
|
||||
|
||||
function cmpDetailsByBothSides($a, $b) {
|
||||
if (max($a->width, $a->height) != max($b->width, $b->height)) {
|
||||
return (max($a->width, $a->height) > max($b->width, $b->height)) ? -1 : 1;
|
||||
} else {
|
||||
if (min($a->width, $a->height) != min($b->width, $b->height)) {
|
||||
return (min($a->width, $a->height) > min($b->width, $b->height)) ? -1 : 1;
|
||||
} else {
|
||||
if ($a->height != $b->height) {
|
||||
return ($a->height > $b->height ) ? -1 : 1;
|
||||
} else {
|
||||
if ($a->width == $b->width ) {
|
||||
return 0;
|
||||
}
|
||||
return ($a->width > $b->width ) ? -1 : 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function cmpDetailsByBothSidesReversed($a, $b) {
|
||||
if (max($a->width, $a->height) != max($b->width, $b->height)) {
|
||||
return (max($a->width, $a->height) > max($b->width, $b->height)) ? 1 : -1;
|
||||
} else {
|
||||
if (min($a->width, $a->height) != min($b->width, $b->height)) {
|
||||
return (min($a->width, $a->height) > min($b->width, $b->height)) ? 1 : -1;
|
||||
} else {
|
||||
if ($a->height != $b->height) {
|
||||
return ($a->height > $b->height ) ? 1 : -1;
|
||||
} else {
|
||||
if ($a->width == $b->width ) {
|
||||
return 0;
|
||||
}
|
||||
return ($a->width > $b->width ) ? 1 : -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function cmpDetailsByWidth($a, $b) {
|
||||
if ($a->width != $b->width) {
|
||||
return ($a->width > $b->width ) ? -1 : 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
function cmpDetailsByWidthReversed($a, $b) {
|
||||
if ($a->width != $b->width) {
|
||||
return ($a->width > $b->width ) ? 1 : -1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function cmpDetailsByHeight($a, $b) {
|
||||
if ($a->height != $b->height) {
|
||||
return ($a->height > $b->height ) ? -1 : 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
function cmpDetailsByHeightReversed($a, $b) {
|
||||
if ($a->height != $b->height) {
|
||||
return ($a->height > $b->height ) ? 1 : -1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
function cmpDetailsByBothSidesForToTop($a, $b) {
|
||||
if ($a->height != $b->height) {
|
||||
return ($a->height > $b->height ) ? -1 : 1;
|
||||
} else {
|
||||
if ($a->width != $b->width) {
|
||||
return ($a->width > $b->width ) ? -1 : 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('mb_ucfirst') && function_exists('mb_substr')) {
|
||||
function mb_ucfirst($string) {
|
||||
$string = mb_strtoupper(mb_substr($string, 0, 1)) . mb_substr($string, 1);
|
||||
return $string;
|
||||
}
|
||||
}
|
||||
|
||||
function toFixed2($num) {
|
||||
return str_replace(".00", "", number_format(ceil($num * 10000) / 10000, 2, ".", ""));
|
||||
}
|
||||
|
||||
function toFixed2Price($num) {
|
||||
return number_format(str_replace(" ", "", $num), 2, ".", " ");
|
||||
}
|
||||
|
||||
function cleanupPhone($phone) {
|
||||
return str_replace(["+", "-", " ", "(", ")"], "", $phone);
|
||||
}
|
||||
|
||||
function formatPhone($phone) {
|
||||
return "+7 (" . substr($phone, 1, 3) . ") " . substr($phone, 4, 3) . "-" . substr($phone, 7, 2) . "-" . substr($phone, 9, 2);
|
||||
}
|
||||
|
||||
function cleanupEmail($email) {
|
||||
return str_replace([" "], "", $email);
|
||||
}
|
||||
|
||||
function br2nl($str) {
|
||||
return preg_replace('/\<br(\s*)?\/?\>/ui', "\r\n", $str);
|
||||
}
|
||||
|
||||
function cleanupDetailLabel($label) {
|
||||
return preg_replace("/_{2,}/", "_", preg_replace("/[^\w\d\\*]/ui", "_" , $label));
|
||||
}
|
||||
|
||||
function cleanupDetailLabel2($label) {
|
||||
return preg_replace("/_{2,}/", "_", preg_replace("/[^\w\d\\*\-]/ui", "_" , $label));
|
||||
}
|
||||
|
||||
|
||||
function counterPluralForm($number, $before, $after, $echoResults = false ) {
|
||||
$cases = array(2,0,1,1,1,2);
|
||||
|
||||
$result = $before[($number % 100 > 4 && $number % 100 < 20) ? 2 : $cases[min($number % 10, 5)]] . ' ' . $number . ' ' . $after[($number % 100 > 4 && $number % 100 < 20) ? 2 : $cases[min($number % 10, 5)]];
|
||||
|
||||
if ($echoResults) {
|
||||
echo $result;
|
||||
} else {
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
use App\Application;
|
||||
use Cake\Core\Configure;
|
||||
use Cake\Core\Exception\MissingPluginException;
|
||||
use Cake\Core\Plugin;
|
||||
|
||||
|
||||
Configure::write('Log.error.file', 'cli-error');
|
||||
|
||||
try {
|
||||
Application::addPlugin('Bake');
|
||||
} catch (MissingPluginException $e) {
|
||||
|
||||
}
|
||||
|
||||
Application::addPlugin('Migrations');
|
||||
|
||||
function isLocked($lock_file) {
|
||||
# If lock file exists, check if stale. If exists and is not stale, return TRUE
|
||||
# Else, create lock file and return FALSE.
|
||||
|
||||
if( file_exists( $lock_file ) ) {
|
||||
# check if it's stale
|
||||
$lockingPID = trim( file_get_contents( $lock_file ) );
|
||||
|
||||
# Get all active PIDs.
|
||||
$pids = explode( "\n", trim( `ps -e | awk '{print $1}'` ) );
|
||||
|
||||
# If PID is still active, return true
|
||||
if( in_array( $lockingPID, $pids ) ) return true;
|
||||
|
||||
# Lock-file is stale, so kill it. Then move on to re-creating it.
|
||||
//echo "Removing stale lock file.\n";
|
||||
unlink( $lock_file );
|
||||
}
|
||||
|
||||
file_put_contents( $lock_file, getmypid() . "\n" );
|
||||
return false;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
/**
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since 3.0.0
|
||||
* @license MIT License (https://opensource.org/licenses/mit-license.php)
|
||||
*/
|
||||
|
||||
/**
|
||||
* Use the DS to separate the directories in other defines
|
||||
*/
|
||||
if (!defined('DS')) {
|
||||
define('DS', DIRECTORY_SEPARATOR);
|
||||
}
|
||||
|
||||
/**
|
||||
* These defines should only be edited if you have cake installed in
|
||||
* a directory layout other than the way it is distributed.
|
||||
* When using custom settings be sure to use the DS and do not add a trailing DS.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The full path to the directory which holds "src", WITHOUT a trailing DS.
|
||||
*/
|
||||
define('ROOT', dirname(__DIR__));
|
||||
|
||||
/**
|
||||
* The actual directory name for the application directory. Normally
|
||||
* named 'src'.
|
||||
*/
|
||||
define('APP_DIR', 'src');
|
||||
|
||||
/**
|
||||
* Path to the application's directory.
|
||||
*/
|
||||
define('APP', ROOT . DS . APP_DIR . DS);
|
||||
|
||||
/**
|
||||
* Path to the config directory.
|
||||
*/
|
||||
define('CONFIG', ROOT . DS . 'config' . DS);
|
||||
|
||||
/**
|
||||
* File path to the webroot directory.
|
||||
*/
|
||||
define('WWW_ROOT', ROOT . DS . 'webroot' . DS);
|
||||
|
||||
/**
|
||||
* Path to the tests directory.
|
||||
*/
|
||||
define('TESTS', ROOT . DS . 'tests' . DS);
|
||||
|
||||
/**
|
||||
* Path to the temporary files directory.
|
||||
*/
|
||||
define('TMP', ROOT . DS . 'tmp' . DS);
|
||||
|
||||
/**
|
||||
* Path to the logs directory.
|
||||
*/
|
||||
define('LOGS', ROOT . DS . 'logs' . DS);
|
||||
|
||||
/**
|
||||
* Path to the cache files directory. It can be shared between hosts in a multi-server setup.
|
||||
*/
|
||||
define('CACHE', TMP . 'cache' . DS);
|
||||
|
||||
/**
|
||||
* The absolute path to the "cake" directory, WITHOUT a trailing DS.
|
||||
*
|
||||
* CakePHP should always be installed with composer, so look there.
|
||||
*/
|
||||
define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'vendor' . DS . 'cakephp' . DS . 'cakephp');
|
||||
|
||||
/**
|
||||
* Path to the cake directory.
|
||||
*/
|
||||
define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS);
|
||||
define('CAKE', CORE_PATH . 'src' . DS);
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
use Cake\Core\Plugin;
|
||||
use Cake\Routing\RouteBuilder;
|
||||
use Cake\Routing\Router;
|
||||
use Cake\Routing\Route\DashedRoute;
|
||||
|
||||
Router::defaultRouteClass(DashedRoute::class);
|
||||
|
||||
|
||||
Router::scope('/', function (RouteBuilder $routes) {
|
||||
$routes->connect('/', ['controller' => 'OrderPayment', 'action' => 'display']);
|
||||
|
||||
$routes->connect('/delivery', ['controller' => 'Delivery', 'action' => 'display']);
|
||||
$routes->connect('/delivery/:city', ['controller' => 'Delivery', 'action' => 'display'], ['city' => '\w+', 'pass' => ['city']]);
|
||||
|
||||
$routes->fallbacks(DashedRoute::class);
|
||||
});
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
# Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
#
|
||||
# Licensed under The MIT License
|
||||
# For full copyright and license information, please see the LICENSE.txt
|
||||
# Redistributions of files must retain the above copyright notice.
|
||||
# MIT License (https://opensource.org/licenses/mit-license.php)
|
||||
|
||||
CREATE TABLE i18n (
|
||||
id int NOT NULL auto_increment,
|
||||
locale varchar(6) NOT NULL,
|
||||
model varchar(255) NOT NULL,
|
||||
foreign_key int(10) NOT NULL,
|
||||
field varchar(255) NOT NULL,
|
||||
content text,
|
||||
PRIMARY KEY (id),
|
||||
UNIQUE INDEX I18N_LOCALE_FIELD(locale, model, foreign_key, field),
|
||||
INDEX I18N_FIELD(model, foreign_key, field)
|
||||
);
|
||||
@@ -0,0 +1,15 @@
|
||||
# Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
#
|
||||
# Licensed under The MIT License
|
||||
# For full copyright and license information, please see the LICENSE.txt
|
||||
# Redistributions of files must retain the above copyright notice.
|
||||
# MIT License (https://opensource.org/licenses/mit-license.php)
|
||||
|
||||
CREATE TABLE `sessions` (
|
||||
`id` char(40) CHARACTER SET ascii COLLATE ascii_bin NOT NULL,
|
||||
`created` datetime DEFAULT CURRENT_TIMESTAMP, -- optional, requires MySQL 5.6.5+
|
||||
`modified` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- optional, requires MySQL 5.6.5+
|
||||
`data` blob DEFAULT NULL, -- for PostgreSQL use bytea instead of blob
|
||||
`expires` int(10) unsigned DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
Reference in new issue
Block a user