This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace common\components\export_wp_to_blog\helpers; | |
use yii\db\Connection; | |
/** | |
* Операции извлечения занимают длительное время, | |
* из-за этого SQL-соединение периодически отваливается. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Created by PhpStorm. | |
* User: programmer | |
* Date: 09.11.2015 | |
* Time: 15:10 | |
*/ | |
namespace common\helpers; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
count(*) as follower_count, | |
c1.created_at, | |
c1.vk_name, | |
concat('https://vk.com/club', c1.vk_id) AS url | |
from follower | |
inner join follower_club on follower_club.follower_id=follower.id | |
inner join club c1 on follower_club.club_id=c1.id | |
where exists( | |
select * from message |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/etc/mysql/mysql.conf.d/mysqld.cnf | |
[mysqld] | |
# Логирование медленных запросов. | |
# Включаем логирование медленных SQL-запросов. | |
slow_query_log = 1 | |
# Пишем лог во временный файл. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Экспорт полной структуры БД и данных без некоторых таблиц. | |
# Имя БД | |
dbname=MYDBNAME | |
# Пароль | |
dbpassword=MYDBPASSWORD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace app\components\development\profiler; | |
class Profiler | |
{ | |
/** | |
* @var float[] | |
*/ | |
private $timers = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Timestamp | |
{ | |
/** @var int */ | |
private $intTimestamp; | |
private function __construct(int $intTimestamp) | |
{ | |
$this->intTimestamp = $intTimestamp; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Money | |
{ | |
private const DECIMAL_SCALE = 2; | |
/** @var string */ | |
private $value; | |
private function __construct(string $value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Redis; | |
use Spiral\Config\ConfiguratorInterface; | |
class RedisConnection | |
{ | |
/** @var string */ | |
private $connectionId; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Создаём таблицы | |
SET foreign_key_checks = 0; | |
DROP TABLE IF EXISTS `book`; | |
CREATE TABLE `book` ( | |
`id` INT(11) NOT NULL AUTO_INCREMENT, | |
`title` VARCHAR(255) NOT NULL, | |
`copies` INT(11) NOT NULL, |
OlderNewer