View gist:9067872
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
for f in *.sql; do mysql -u root databasename < $f; done; |
View gist:9475960
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
use Zend\Db\Sql; | |
$sql = new Sql\Sql; | |
$select = $sql->select($table); | |
$select->offset(10); | |
echo $sql->getSqlStringForSqlObject($select); |
View gist:9759243
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
tar czf changed-files.tar.gz `git diff --name-only HEAD` |
View gist:514cb5333e7ed12875fe
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\Db\Sql\Sql; | |
$sql = new Sql($adapter); | |
$oSelect = $sql->select('table_test'); | |
$oSelect->columns(array('*'))->where(array('test' => 'ok')->limit(1); | |
$sqlString = $sql->getSqlStringForSqlObject($oSelect); | |
//see https://github.com/zendframework/zf2/issues/3224 |
View consoleenvzf2.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 | |
use Zend\Console\Console; | |
/** | |
* This makes our life easier when dealing with paths. Everything is relative | |
* to the application root now. | |
*/ | |
chdir(dirname(__DIR__)); |
View gist:6124a8aca370e27ffc38
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
$array = array(); | |
foreach($entities as $entity) { | |
$array[] = array( | |
'id' => $entity->getId(), | |
'municipio' => $entity->getMunicipio(), | |
); | |
} | |
return $array; |
View Module.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 | |
namespace Application; | |
use Zend\Mvc\MvcEvent; | |
use Zend\Validator\AbstractValidator; | |
class Module | |
{ | |
public function onBootstrap(MvcEvent $event) |
View EntityManagerFactory.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 | |
namespace Common\Service; | |
use Doctrine\ORM\EntityManager; | |
use DoctrineModule\Service\AbstractFactory; | |
use Zend\ServiceManager\ServiceLocatorInterface; | |
class EntityManagerFactory extends AbstractFactory | |
{ |
View 1. composer.json
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
{ | |
"name": "zendframework/skeleton-application", | |
"description": "Skeleton Application for ZF2", | |
"license": "BSD-3-Clause", | |
"keywords": [ | |
"framework", | |
"zf2" | |
], | |
"homepage": "http://framework.zend.com/", | |
"require": { |
OlderNewer