Skip to content

Instantly share code, notes, and snippets.

# .gitignore
###################
development/
cms/filestore/
apache_pb.gif
apache_pb.png
apache_pb2.gif
apache_pb2.png
apache_pb2_ani.gif
favicon_.ico
foreach ($elements as $elementCode => $elementData) {
if ($configuratorService->isCompoundElement($country, $elementCode)) {
echo $elementCode . ' is compound<br>';
$scooterElements[$accessoryDescription[$elementData['accessoryType']]][$elementData['description']] = $configuratorService->getCompoundOptions($country, $elementCode);
$universesConfigurationNames[$elementData['description']] = $configuratorService->getCompoundDescription($country, $elementCode, $configuratorService->getValues($country, $universSelected, $elementCode));
}
}
'configure' => array(
'type' => 'Zend\Mvc\Router\Http\Segment',
'options' => array(
'route' => '/configure[/:id[/:motor]]',
'constraints' => array(
'id' => '[0-9]*[a-zA-Z][a-zA-Z0-9_-]*',
'motor' => '[0-9]*[a-zA-Z][a-zA-Z0-9_-]*',
),
'defaults' => array(
'controller' => 'Application\Controller\Application',
$rowset = $this->tableGateway->select(function (\Zend\Db\Sql\Select $select) use ($pictureSrc, $country) {
$select->columns(array('count' => new \Zend\Db\Sql\Expression('COUNT(*)')));
$select->where(array('country_code' => $country, 'picture' => $pictureSrc));
});
vmamp@AMP30:/users/cfs00/web> php composer.phar self-update
Fatal error: Class 'Phar' not found in /users/cfs00/web/composer.phar on line 13
vmamp@AMP30:/users/cfs00/web> curl -sS https://getcomposer.org/installer | php
#!/usr/bin/env php
Some settings on your machine make Composer unable to work properly.
Make sure that you fix the issues listed below and run this script again:
// -----------------------------------------------------------------------
// ... generate the image dinamically: renderScooterAction method
// -----------------------------------------------------------------------
ob_start();
/// file.png has the image data
ImagePng($imgPng,'/tmp/file.png');
$imageData = ob_get_clean();
public function renderScooterAction()
{
$contentService = $this->getServiceLocator()->get('ContentService');
$strImagePath = $contentService->getDestinationBase().'/'.$this->getRequest()->getPost()->img;
$imgName = explode("/",$this->getRequest()->getPost()->img);
list($width, $height, $type, $attr) = getimagesize($strImagePath);
$required_memory = Round($width * $height * 24);
$new_limit = memory_get_usage() + $required_memory;
public function renderScooterAction()
{
$contentService = $this->getServiceLocator()->get('ContentService');
$strImagePath = $contentService->getDestinationBase().'/'.$this->getRequest()->getPost()->img;
$imgName = explode("/",$this->getRequest()->getPost()->img);
list($width, $height, $type, $attr) = getimagesize($strImagePath);
$required_memory = Round($width * $height * 24);
$new_limit = memory_get_usage() + $required_memory;
## controller
public function renderScooterAction()
{
$response = $this->getResponse();
$im = ImageCreateTrueColor(640, 480);
$azul = ImageColorAllocate($im, 128, 128, 255);
$azul2 = ImageColorAllocate($im, 64, 64, 230);
$verde = ImageColorAllocate($im, 0, 64, 0);
<IfModule mod_php5.c>
EnableMMAP Off
EnableSendfile Off
######
</IfModule>