Skip to content

Instantly share code, notes, and snippets.

View DeRain's full-sized avatar
🏠
Working from home

Kirill Beresnev DeRain

🏠
Working from home
View GitHub Profile
@DeRain
DeRain / test.php
Created July 22, 2016 09:09
Test task initial code
<?php
/**
* Class Item
*/
class Item
{
/**
* @return array
*/
<?php
include_once __DIR__ . '/vendor/autoload.php';
$main = new \DeRain\Primodialer\Api\Main([
'apiUrl' => 'http://ocere.avatardialler.com/adminpanel/api.php',
'username' => 'admin',
'password' => 'dLzo4pny'
]);
$method = new \DeRain\Primodialer\Api\Methods\AddLead();
@DeRain
DeRain / sendfile.sh
Created August 3, 2016 16:07 — forked from falexandrou/sendfile.sh
Turn Sendfile to "off" for vagrant boxes
# A VirtualBox bug forces vagrant to serve
# corrupt files via Apache or nginx
# The solution to that would be to turn off
# the SendFile option in apache or nginx
#
# If you use apache as your main web server
# add this directive in your httpd.conf (or apache.conf)
# configuration file name may vary in various systems
#
EnableSendfile off
@DeRain
DeRain / README.md
Created August 15, 2016 08:44 — forked from cornernote/README.md
How to use PsySH with a Yii2 application

Using PsySH (GitHub) as the Yii2 shell

  • Issue the following commands from the command line in your Yii application directory:
    • chmod +x psyii
    • mkdir extensions/yiishell
    • wget -O extensions/yiishell/psysh psysh.org/psysh
    • chmod +x extensions/yiishell/psysh
  • Copy the file init.php below to psysh/init.php and update any paths to work with your application configuration
  • Copy the file config.php below to psysh/config.php. Change or add to the config array with the options you'd like to use (available options)
  • Now you can start PsySH with the command ./psyii psysh/init.php --config psysh/config.php
@DeRain
DeRain / PsySH_with_Yii.md
Created August 15, 2016 09:39 — forked from mrdziuban/PsySH_with_Yii.md
How to use PsySH with a Yii application

Using PsySH (GitHub) as the Yii shell

  • Issue the following commands from the command line in your Yii application directory:
    • chmod +x shell
    • mkdir extensions/yiishell
    • wget -O extensions/yiishell/psysh psysh.org/psysh
    • chmod +x extensions/yiishell/psysh
  • Copy the file init.php below to extensions/yiishell/init.php and update any paths to work with your application configuration
  • Copy the file config.php below to extensions/yiishell/config.php. Change or add to the config array with the options you'd like to use (available options)
  • Now you can start PsySH with the command extensions/yiishell/psysh extensions/yiishell/init.php --config extensions/yiishell/config.php
<?php
class UniusHttpRequest extends CHttpRequest
{
/**
* @var string Redirect path, should be configured in nginx virtual host
* @link http://kovyrin.net/2010/07/24/nginx-fu-x-accel-redirect-remote/
*/
public $outerRedirectUrl = '/outer_redirect';
@DeRain
DeRain / ddd_cqrs_event-sourcing_in_php.md
Created August 26, 2016 18:56 — forked from jsor/ddd_cqrs_event-sourcing_in_php.md
DDD, CQRS and Event Sourcing in PHP

DDD, CQRS and Event Sourcing in PHP

  • Broadway - Infrastructure and testing helpers for creating CQRS and event sourced applications
  • EventCentric.Core - Event Sourcing and CQRS in PHP
  • LiteCQRS - Small convention based CQRS library for PHP
  • predaddy - Common DDD classes including an annotation driven message bus and tools for CQRS and Event Sourcing
  • ProophEventSourcing - Provides basic functionality for event-sourced aggregates
  • ProophEventStore - PHP 5.4+ EventStore Implementation
  • ProophServiceBus - PHP Enterprise Service Bus Implementation supporting CQRS and DDD
@DeRain
DeRain / create_host_php.sh
Created September 16, 2016 20:25 — forked from Nks/create_host_php.sh
Automatically creating new virtual hosts for nginx with support of the php-fpm
#!/bin/bash
# @author: Seb Dangerfield
# http://www.sebdangerfield.me.uk/?p=513
# Created: 11/08/2011
# Modified: 07/01/2012
# Modified: 27/11/2012
# @author Zhdanov Vladislav
# https://github.com/nks
# Modified 16/09/2016
@DeRain
DeRain / README.md
Last active November 14, 2016 09:57 — forked from tjamps/README.md
Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

The API we are creating in this gist will follow these rules :

  • The API only returns JSON responses
  • All API routes require authentication
  • Authentication is handled via OAuth2 with password Grant Type only (no need for Authorization pages and such).
  • API versioning is managed via a subdomain (e.g. v1.api.example.com)

The API will be written in PHP with the Symfony 2 framework. The following SF2 bundles are used :

const DataType = new GraphQLObjectType({
name: 'data',
fields: {
paymentLoanOtherBank: {type: GraphQLString},
paymentLoanBridePhoneMobile: {type: GraphQLString}
}
});