Skip to content

Instantly share code, notes, and snippets.

<VirtualHost *:80>
ServerName ams.local
ServerAlias ams.local
DocumentRoot /Library/WebServer/Documents/ams/web
<Directory /Library/WebServer/Documents/ams/web/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
$cachedirs = [ "/var/www/ams/app/cache", "/var/www/ams/app/logs" ]
file { $cachedirs :
ensure => directory,
group => "vagrant",
owner => "vagrant",
mode=> 0777,
recurse => true,
}
@Tocacar
Tocacar / default.pp
Last active December 18, 2015 08:49
The configuration below gives me this output in the VM after vagrant up: drwxrwxrwx 1 vagrant vagrant 136 Jun 10 15:50 cache/ But, when I start my app in the browser, it tries to create subdirectories inside /cache, which results in this: drwxr-xr-x 1 vagrant vagrant 68 Jun 10 15:50 dev/ Another subdirectory (/cache/dev/annotations) cannot be cr…
file { "/var/www/ams/app/cache" :
ensure => directory,
group => "vagrant",
owner => "vagrant",
mode=> 2777,
recurse => true,
}
file { "/var/www/ams/app/logs" :
ensure => directory,
$ ps aux | grep apache
70:root 1027 0.0 1.7 370548 17972 ? Ss 13:20 0:00 /usr/sbin/apache2 -k start
71:www-data 1046 0.0 1.2 370976 12940 ? S 13:20 0:00 /usr/sbin/apache2 -k start
72:www-data 1047 0.0 0.7 370596 7272 ? S 13:20 0:00 /usr/sbin/apache2 -k start
73:www-data 1048 0.0 0.6 370580 7024 ? S 13:20 0:00 /usr/sbin/apache2 -k start
74:www-data 1049 0.0 0.6 370580 7024 ? S 13:20 0:00 /usr/sbin/apache2 -k start
75:www-data 1051 0.0 0.6 370580 7024 ? S 13:20 0:00 /usr/sbin/apache2 -k start
80:www-data 1617 0.0 0.6 370580 7024 ? S 13:21 0:00 /usr/sbin/apache2 -k start
87:vagrant 1826 0.0 0.0 11676 936 pts/0 S+ 13:36 0:00 grep --color=auto -in apache
protected function customizeForm($form, $previouslySelectedObject)
{
// create the field, this is similar the $builder->add()
// field name, field type, data, options
$form->add(
$this->factory->createNamed(
'MyOtherEntity',
'entity',
null,
$formOptions = array(
$form = $this->createForm('my_form_name', $myObject);
$request = $this->getRequest();
$data = $request->request->get($form->getName());
$data['myOtherEntity'] = '';
$request->request->set($form->getName(), $data);
$form->bind($request);
$qb->select("u")
->from("YourUserBundle:User", "u")
->join("u.Group", "g")
->join("g.Role", "r")
->where("r.role = :role");
$query = $qb->getQuery();
$query->setParameter("role", $role);
$results = $query->getResult();
/**
* {@inheritdoc}
*/
public function delete($object)
{
try {
$entityManager = $this->getEntityManager($object);
$entityManager->remove($object);
$entityManager->flush();
} catch (\PDOException $e) {
} catch (ModelManagerException $e) {
//get details of the PDO or DBAL exeption that was actually thrown
$actualException = $e->getPrevious()
if ($this->isXmlHttpRequest()) {
return $this->renderJson(
array(
'result' => 'error',
'info' => '$actualException->getMessage();
/**
* @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException|\Symfony\Component\Security\Core\Exception\AccessDeniedException
*
* @param mixed $id
*
* @return Response|RedirectResponse
*/
public function deleteAction($id)
{
$id = $this->get('request')->get($this->admin->getIdParameter());