A collection of resources to learn object-oriented programming and related concepts for PHP developers. Original Please see CONTRIBUTING for details and contribute. ;)
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 A { | |
private function teste() { | |
return 'teste ab'; | |
} | |
} | |
$class = new A(); |
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 | |
function removerAcento($string) { | |
$from = "áàãâéêíóôõúüçÁÀÃÂÉÊÍÓÔÕÚÜÇ"; | |
$to = "aaaaeeiooouucAAAAEEIOOOUUC"; | |
$keys = array(); | |
$values = array(); | |
preg_match_all('/./u', $from, $keys); | |
preg_match_all('/./u', $to, $values); | |
$mapping = array_combine($keys[0], $values[0]); | |
return strtr($string, $mapping); |
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
syntax enable | |
set encoding=utf-8 | |
set t_Co=256 | |
set tabstop=4 | |
set shiftwidth=4 | |
set expandtab | |
set lazyredraw | |
set laststatus=2 | |
set nocompatible |
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 Vaga | |
{ | |
private $requisitos = []; | |
private $to = []; | |
public function __construct() {} |
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 Thumb | |
{ | |
private $proportional; | |
public function make(UploadedFile $file, $path , $name, $maxWidth, $maxHeight) | |
{ | |
if (!File::isDirectory(public_path() . $path)) { | |
File::makeDirectory(public_path() . $path, $mode = 0777, true, true); |
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 isolated PHP 5.6 ZTS (Thread-safe) with pthreads on Ubuntu 14.04 ### | |
############################################################################## | |
1) Install necessary bison version | |
apt-get install m4 | |
wget http://launchpadlibrarian.net/140087283/libbison-dev_2.7.1.dfsg-1_amd64.deb | |
wget http://launchpadlibrarian.net/140087282/bison_2.7.1.dfsg-1_amd64.deb |
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 FileComponent; | |
/** | |
* Class File | |
* @package FileComponent | |
*/ | |
class File | |
{ |
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
#!/bin/sh | |
path_project="$1" | |
DISTRO="unknown" | |
if [[ -z $path_project ]]; then | |
echo "Please add the path of project" | |
exit 1 | |
fi |
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
# lsusb to get bus and id | |
# https://weluse.de/blog/test-your-bootable-usb-drive-with-qemu.html | |
sudo qemu-system-x86_64 -m 512 -enable-kvm -usb -device usb-host,hostbus=1,hostaddr=8 |