Skip to content

Instantly share code, notes, and snippets.

View apoca's full-sized avatar
🚀
Working hard with microservices infrastructure

Miguel Vieira apoca

🚀
Working hard with microservices infrastructure
View GitHub Profile
server {
listen 80;
root /var/www/esolidar/public;
error_log /var/www/error.solidar.log;
index index.php index.html index.htm;
# Make site accessible from http://esolidar.com
server_name esolidar.com www.esolidar.com;
if ($http_x_forwarded_proto = http) {
I'm using all this components:
"zendframework/zend-authentication": "^2.5.3",
"zendframework/zend-cache": "^2.7.1",
"zendframework/zend-console": "^2.6",
"zendframework/zend-db": "^2.8.1",
"zendframework/zend-debug": "^2.5.1",
"zendframework/zend-dom": "^2.6",
"zendframework/zend-eventmanager": "^3.0.1",
"zendframework/zend-feed": "^2.7",
"zendframework/zend-file": "^2.7",
public function getServiceConfig()
{
return [
'factories' => [
'Application\Model\UserTable' => function ($sm) {
$dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
if (getenv('APPLICATION_ENV') === 'production') {
$cacheAdapter = null;
} else {
$cacheAdapter = null; // $sm->get('memcached');
<?php
/*
* To change this template, choose Tools | Templates and open the template in the editor.
*/
namespace Application\Model;
use Zend\Cache\Storage\Adapter\AbstractAdapter;
use Zend\Db\Adapter\Adapter;
use Zend\Db\Sql\Select;
<?php
namespace Application\Service\Factory;
use Aws\Sdk as AwsSdk;
use Interop\Container\ContainerInterface;
use Zend\ServiceManager\AbstractPluginManager;
/**
* Class AwsFactory
public function __construct(Adapter $adapter, AbstractAdapter $cacheAdapter = null)
{
$this->table = 'categories';
$this->adapter = $adapter;
$this->cacheAdapter = $cacheAdapter;
$this->featureSet = new Feature\FeatureSet();
$this->initialize();
}
public function addCat($data)
<pre class='xdebug-var-dump' dir='ltr'>
<b>object</b>(<i>Zend\Db\ResultSet\ResultSet</i>)[<i>1150</i>]
<i>protected</i> 'allowedReturnTypes' <font color='#888a85'>=&gt;</font>
<b>array</b> <i>(size=2)</i>
0 <font color='#888a85'>=&gt;</font> <small>string</small> <font color='#cc0000'>'arrayobject'</font> <i>(length=11)</i>
1 <font color='#888a85'>=&gt;</font> <small>string</small> <font color='#cc0000'>'array'</font> <i>(length=5)</i>
<i>protected</i> 'arrayObjectPrototype' <font color='#888a85'>=&gt;</font>
<b>object</b>(<i>ArrayObject</i>)[<i>1153</i>]
<i>private</i> 'storage' <font color='#888a85'>=&gt;</font>
<b>array</b> <i>(size=0)</i>
<select name="cause" class="causes">
<option value=""><?= $this->translate('Selecione um item'); ?></option>
<?php foreach ($this->npoCategories as $key => $category) : ?>
<option
value="<?= $category->id; ?>"><?= (isset($this->Lang()->key) && ($this->Lang()->key == 'pt' || $this->Lang()->key == 'br')) ? $category->name : $category->name_en; ?></option>
<?php endforeach; ?>
</select>
<?php
namespace Application\Controller;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\Session\Container as SessionManager;
use Zend\Mvc\I18n\Translator as TranslatorService;
use Zend\View\Model\ViewModel;
// Models
use Application\Model\UsersTable;
use Application\Model\AuctionsTable;
<?php
/**
* Created by PhpStorm.
* User: apoca
* Date: 29/04/16
* Time: 17:38
*/
namespace Application\Controller\Factory;