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 | |
class Vk { | |
private $vk; | |
private $owner; | |
public function __construct( vk $vk, $user = null, $group = null ) { | |
$this->vk = $vk; | |
if ( ! $user && ! $group ) { |
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 | |
class Connect { | |
private $connection; | |
public function __construct(){ | |
$this->connect(); | |
} | |
public function connect(){ |
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 | |
/* | |
* Название класса не по psr1,psr-2, -> StaInstall | |
* Сама по себе реализация спорная. | |
* Тут 2 варианта идти по пути фреймворков (пользователя сами настраивают ) или все делает движок. | |
* в случае движка. мы должны не создавать новый файл конфигураций. я копировать config.demo.php в config.php, и уже там менять параметры. | |
* Прст, завтра мы захотим еще что-то там хранить. что будет тогда ? | |
*/ |
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 | |
$user_id = $_SESSION['user']['id']; | |
$STH = $pdo->query ( "SELECT * FROM dialog WHERE recive = $user_id OR send = $user_id ORDER by id DESC" ); | |
$STH->setFetchMode ( PDO::FETCH_OBJ ); | |
$row = $STH->fetch (); | |
$us_log1 = $row->send; | |
$us_log2 = $row->recive; | |
if ($us_log2 == $user_id) ($us_log2 = $us_log1); |
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 | |
require_once 'database_connection.php'; | |
function authorize_user($groups = NULL) { | |
// Если не создан cookie-файл, проверять группы не нужно | |
if ((!isset($_COOKIE['user_id'])) || (!strlen($_COOKIE['user_id']) > 0)) { | |
header('Location: signin.php?' . 'error_message=Для просмотра этой страницы нужно зарегистрироваться.'); | |
exit; |
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
# Virtual Hosts | |
# | |
# Required modules: mod_log_config | |
# If you want to maintain multiple domains/hostnames on your | |
# machine you can setup VirtualHost containers for them. Most configurations | |
# use only name-based virtual hosts so the server doesn't need to worry about | |
# IP addresses. This is indicated by the asterisks in the directives below. | |
# | |
# Please see the documentation at |
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
""" | |
Application router decoretor. | |
""" | |
from functools import wraps | |
ROUTES = dict() | |
def bluprint_add_routes(blueprint, routes): |
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
- hosts: all | |
vars: | |
branch: "master" | |
app_root: /www | |
app_repo: "[email protected]" | |
tasks: | |
- name: Enable maintenance mode | |
shell: php artisan down | |
args: |
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
#!/usr/bin/env bash | |
echo "php-cs-fixer pre commit hook start" | |
PHP_CS_FIXER="bin/php-cs-fixer" | |
PHP_CS_CONFIG=".php_cs" | |
CHANGED_FILES=$(git diff --cached --name-only --diff-filter=ACM -- '*.php') | |
if [ -n "$CHANGED_FILES" ]; then | |
$PHP_CS_FIXER fix --config "$PHP_CS_CONFIG" $CHANGED_FILES; | |
git add $CHANGED_FILES; |
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
image: php:7.1-fpm | |
pipelines: | |
default: | |
- step: | |
caches: | |
- composer | |
script: | |
# Update dependencies | |
- apt-get update | |
# Install dependencies |