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
sudo apt-get update | |
sudo apt-get install apt-transport-https ca-certificates -y | |
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D | |
sudo echo deb https://apt.dockerproject.org/repo ubuntu-xenial main >> /etc/apt/sources.list.d/docker.list | |
sudo apt-get update | |
sudo apt-get purge lxc-docker | |
sudo apt-get install linux-image-extra-$(uname -r) -y | |
sudo apt-get install docker-engine cgroup-lite apparmor -y | |
sudo usermod -a -G docker $USER | |
sudo service docker start |
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
require_once __DIR__ . '/pages/template/header.php' | |
// Use aqui em baixa alguma lógica para incluir as outras páginas do seu site, a que eu vou mostrar é apenas um | |
// exemplo de como você pode fazer, porém você pode usar algo mais avançado usando bibliotecas de template tal como | |
// twig (https://twig.sensiolabs.org/). | |
// Lembrando que esse exemplo é algo bem simplório pois hoje em dia é usado outras técnias com a ajuda de libs | |
$page = filter_input(INPUT_GET, 'search', FILTER_SANITIZE_SPECIAL_CHARS); |
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 | |
declare(strict_types=1); | |
namespace MeuFramework\Container; | |
use ArrayAccess; | |
/** | |
* @author André Teles |
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 | |
declare(strict_types=1); | |
namespace MeuFramework\Application; | |
use MeuFramework\Container\Container; | |
/** | |
* @author André Teles | |
*/ | |
class Application |
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 | |
require_once __DIR__ .'/../vendor/autoload.php'; |
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 | |
ini_set('display_errors',1); | |
require __DIR__ .'/../bootstrap/app.php'; |
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 Usuarios { | |
private $db; | |
public function __construct() { | |
try { | |
// TROCAR DOS PARAMETROS ABAIXO PARA O DO SEU BANCO | |
$this->db = new PDO("mysql:dbname=code_dbal;host=localhost", "root", ""); |
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 | |
/** | |
* Conn.class [ CONEXÃO ] | |
* Classe abstrata de conexão. Padrão SingleTon. | |
* Retorna um objeto PDO pelo método estático getConn(); | |
* | |
* @copyright (c) 2013, Robson V. Leite UPINSIDE TECNOLOGIA | |
*/ | |
abstract class Conn { |