Skip to content

Instantly share code, notes, and snippets.

View alexeymorozov's full-sized avatar

Alexey Morozov alexeymorozov

  • Novi Sad, Serbia
View GitHub Profile
<?php
private function getErrorMessages(\Symfony\Component\Form\Form $form) {
$errors = array();
foreach ($form->getErrors() as $key => $error) {
$errors[$key] = $error->getMessage();
}
if ($form->hasChildren()) {
foreach ($form->getChildren() as $child) {
@weotch
weotch / gist:1959748
Created March 2, 2012 17:16
Running PHP scripts from CLI on Heroku
# Add this config
$ heroku config:add LD_LIBRARY_PATH=/app/php/ext:/app/apache/lib
# Login to Heroku CLI
$ heroku run bash
# The second argument here is the path to your script
~ $ ~/php/bin/php -f ~/www/index.php
@jakzal
jakzal / deploy.rb
Created October 25, 2011 11:41
parameters.yml configuration during capifony deployment for Symfony2
set :shared_files, [app_path + "/config/parameters.yml"]
namespace :symfony do
namespace :configure do
def shared_parameters_path
"#{shared_path}/#{app_path}/config/parameters.yml"
end
def app_parameters_path
"#{latest_release}/#{app_path}/config/parameters.yml"