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 | |
define('x', true); | |
$preg_mobile = preg_match('/android|mobile|iphone|avantgo|blackberry|bolt|boost|cricket|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos/i', | |
$_SERVER['HTTP_USER_AGENT']); | |
require './includes/config.php'; | |
require './includes/functions.php'; | |
require './includes/skin.php'; | |
$db = new MySQLi($CONF['host'], $CONF['user'], $CONF['pass'], $CONF['name']); | |
if (! $db) { | |
die('Falha ao conectar ao MySQL'); |
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 | |
use Money\Money; | |
use Product\Model\Prices; | |
return [ | |
Prices::class => [ | |
'type' => 'embeddedDocument', | |
'orm' => [ | |
'embedOne' => [ |
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
#!/bin/bash | |
# thanks http://www.jenssegers.be/blog/46/deploying-websites-with-git-and-composer- | |
# replace folder | |
cd "`dirname $0`/../../application/config" | |
# Check if a composer.json file is present | |
if [ -f composer.json ]; then |
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
<script> | |
function retrieveUf(latitude,longitude){ | |
var request = new XMLHttpRequest(); | |
var method = 'GET'; | |
var url = 'http://maps.googleapis.com/maps/api/geocode/json?latlng='+latitude+','+longitude+'&sensor=true'; | |
var async = true; | |
request.open(method, url, async); | |
request.send(); |
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 Router { | |
protected $routes = array(); | |
protected $namedRoutes = array(); | |
protected $basePath = ''; | |
protected $matchTypes = array( | |
'i' => '[0-9]++', | |
'a' => '[0-9A-Za-z]++', |
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
public function extract() | |
{ | |
if ($this->object instanceof Traversable) { | |
$this->object = ArrayUtils::iteratorToArray($this->object, false); | |
} | |
if (!is_array($this->object)) { | |
return array(); | |
} |
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 | |
public function addAction() | |
{ | |
$album = new Album; | |
$form = new AlbumForm($this->getEntityManager()); | |
$form->setHydrator(new DoctrineEntity($this->getEntityManager(),'Admin\Entity\Album')); |
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 | |
use Zend\Form\Fieldset; | |
use Zend\Form\Form; | |
use Zend\Form\View\Helper\Form as FormHelper; | |
use Zend\Form\View\HelperConfig; | |
use Zend\Stdlib\ArrayUtils; | |
use Zend\Stdlib\Hydrator\ObjectProperty; | |
use Zend\View\Renderer\PhpRenderer; |
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 | |
/** | |
* @author Marco Pivetta <[email protected]> | |
*/ | |
use Zend\ServiceManager\ServiceManager; | |
use Zend\Mvc\Service\ServiceManagerConfig; | |
use DoctrineORMModuleTest\Framework\TestCase; | |
use ContentTest\Util\ServiceManagerFactory; | |
use Zend\Loader\StandardAutoloader; |