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
############################################################################## | |
# 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 | |
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
<?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
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 | |
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
<?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
Plugin: https://github.com/martomo/SublimeTextXdebug | |
Command: phpunit -d xdebug.profiler_enable=on -d xdebug.idekey=sublime.xdebug File.php | |
Configuration Xdebug: | |
xdebug.remote_enable = 1 | |
xdebug.remote_handler = dbgp | |
xdebug.remote_host = 127.0.0.1 | |
xdebug.remote_port = 9000 |
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 | |
if (!defined('BASE_PATH')) define('BASE_PATH', realpath(dirname(__FILE__))); // Root path folder to load classes | |
function autoloader($class_name) { | |
$class_name = ltrim($class_name, '\\'); | |
$file_name = ''; | |
$namespace = ''; | |
if ($lastNsPos = strrpos($class_name, '\\')) { | |
$namespace = substr($class_name, 0, $lastNsPos); | |
$class_name = substr($class_name, $lastNsPos + 1); |
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
yum install php-pear | |
# Discovering all channels | |
pear channel-discover pear.phpunit.de | |
pear channel-discover pear.symfony-project.com | |
pear channel-discover components.ez.no | |
# Install PHPUnit with Yaml | |
pear install pear.symfony.com/Yaml | |
pear install --alldeps pear.phpunit.de/PHPUnit |