This file contains hidden or 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
/* | |
EXTR_OVERWRITE Если переменная с таким именем существует, она будет перезаписана. | |
EXTR_SKIP Если переменная с таким именем существует, ее текущее значение не будет перезаписано. | |
EXTR_PREFIX_SAME сли переменная с таким именем существует, к её имени будет добавлен префикс, определённый параметром prefix | |
EXTR_PREFIX_ALL Добавить префикс prefix ко всем именам переменных. | |
EXTR_PREFIX_INVALID Добавить префикс prefix только к некорректным/числовым именам переменных. |
This file contains hidden or 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
create table customers | |
( | |
id int auto_increment, | |
user_name varchar(255) null, | |
constraint customers_id_uindex | |
unique (id) | |
); | |
alter table customers | |
add primary key (id); |
This file contains hidden or 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
########## Install NGINX ############## | |
# Install software-properties-common package to give us add-apt-repository package | |
sudo apt-get install -y software-properties-common | |
# Install latest nginx version from community maintained ppa | |
sudo add-apt-repository ppa:nginx/stable | |
# Update packages after adding ppa |
This file contains hidden or 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
steps install composer: | |
1. curl -sS https://getcomposer.org/installer | php | |
2. sudo mv composer.phar /usr/local/bin/composer | |
3. sudo chmod +x /usr/local/bin/composer | |
4. PATH=/usr/local/bin:$PATH |
This file contains hidden or 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 orders.id as 'номер заказа', | |
orders.total as `сумма всего заказа`, | |
s.name as 'магазин покупки', | |
c.user_name as 'имя покупателя', | |
p.name as 'товар', | |
o.qt as 'кол-во' | |
from orders | |
join orders_details o on orders.id = o.order_id | |
join stores s on s.id = o.store_id |
This file contains hidden or 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(orders.id), u.name | |
from orders | |
join users u on orders.user_id = u.id | |
group by u.name | |
order by count(orders.id) desc; | |
/* сколько найти магазины в которых было сделанно 3 заказа*/ |
This file contains hidden or 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
server { | |
listen 80; | |
server_name domain_name.com www.domain_name.com; | |
return 301 https://domain_name.com$request_uri; | |
} | |
server { | |
listen 443 ssl; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
ssl_certificate /etc/nginx/ssl/domain_name.com.cert; | |
ssl_certificate_key /etc/nginx/ssl/domain_name.key; |
This file contains hidden or 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 Deployer; | |
require 'recipe/laravel.php'; | |
// Project name | |
set('application', 'qian'); | |
// Project repository | |
set('repository', '[email protected]:chine_shop/backend.git'); |
This file contains hidden or 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
Очистка файла: | |
echo -n > laravel.log |
This file contains hidden or 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
server { | |
server_name wp.com; | |
root /var/www/wp; # путь к WP | |
index index.php; | |
gzip on; # включаем сжатие gzip | |
gzip_disable "msie6"; | |
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript; | |
location ~ /\. { |