Skip to content

Instantly share code, notes, and snippets.

View lpj145's full-sized avatar
๐Ÿ˜
Good Feeling!

Marcos Dantas lpj145

๐Ÿ˜
Good Feeling!
View GitHub Profile
<?php
namespace FiremonPHP\Storage;
class FileStorage
{
private $files = [];
public function __construct(array $files)
{
$this->storeInternal($files);
@lpj145
lpj145 / Core.php
Last active September 15, 2017 16:22
<?php
namespace App\Core;
class Core {
public function run() {
$url = '/';
if (isset($_GET['url'])) {
$url .= $_GET['url'];
}
$params = array();
if (!empty($url) && $url != '/') {
<?php
require 'vendor/autoload.php';
use Mongolid\Manager;
use Mongolid\Connection\Connection;
$manager = new Manager(new Connection('mongodb://localhost:27017'));
class Post extends Mongolid\ActiveRecord {
<?php
function validate($data) {
if (empty($data['nome'])) {
return 'nome nรฃo pode ser vazio';
}
if (empty($data['email'])) {
return 'email nรฃo pode ser branco';
}
<?php
/*
* This file is part of the CORS middleware package
*
* Copyright (c) 2016 Mika Tuupola
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/mit-license.php
*
trait DispatchAction
{
public function process(ServerRequestInterface $request, DelegateInterface $delegate)
{
$dictionary = [
'GET' => 'index',
'POST' => 'create',
'PUT' => 'edit',
'DELETE' => 'delete'
];
class Logger {
/**
* @var array
*/
private $config;
public function __construct(array $config)
{
$this->config = $config;
}
<?php
namespace NFePHP\Common\Soap;
use NFePHP\Common\Certificate;
use NFePHP\Common\Soap\SoapInterface;
use NFePHP\Common\Exception\SoapException;
use NFePHP\Common\Exception\RuntimeException;
use NFePHP\Common\Strings;
use League\Flysystem\Filesystem;
use League\Flysystem\Adapter\Local;
require 'vendor/autoload.php';
$exemplo = file_get_contents('exemplo.xml');
$service = new \Sabre\Xml\Service();
$xmlArray = $service->parse($exemplo);
$adicionar = [
[
<?php
namespace ExpressiveProvider;
use Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory;
abstract class BaseProvider
{
/**
* @var array
*/