{
inHistory: [1,6,8,10],
inBook:[7,8,9,10,12]
}
{
inHistory: [ [ 1, 6 ], [ 8 ], [ 10 ] ],
inBook: [ [ 7 ], [ 8, 9 ], [ 10, 12 ] ]
}
{
"scripts": {
"precommit": "lint-staged"
},
"lint-staged": {
"linters": {
"app-src/**/*.{scss,css,sass}": [
"stylelint"
]
}
},
"devDependencies": {
"husky": "^0.14.3",
"lint-staged": "^4.0.4",
"stylelint": "^8.1.1"
}
}
private static $connection;
public static function getConnection()
{
if (self::$connection) {
return self::$connection;
}
$start = microtime(true);
$paramsPath = ROOT . '/config/db_params.php';
$params = include ($paramsPath);
$dsn = "mysql:host={$params['host']};dbname={$params['dbname']}";
$db = new PDO($dsn, $params['user'], $params['password']);
$db->exec("set names utf8");
echo 'Время выполнения скрипта: '.(microtime(true) - $start).' сек.';
// Обратите внимание на этот участок кода
return self::$connection = $db;
}