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
daemon --name=mms-agent --user=mongod --pidfile=/var/run/mongodb/mms-agent.pid "/usr/bin/python /usr/local/lib/mms-agent/agent.py > /var/log/mongo/mms-agent.log 2>&1 &" |
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 MyNamespace\Controller; | |
use JMS\DiExtraBundle\Annotation\Inject; | |
class PostsController | |
{ | |
/** | |
* @Inject("my_namespace.post_repository") |
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
<services> | |
<service id="my_bundle.twig.string.loader" class="Twig_Loader_String" /> | |
<service id="my_bundle.twig.string" class="Twig_Environment"> | |
<argument type="service" id="my_bundle.twig.string.loader" /> | |
</service> | |
</services> |
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 ...\Bundle\MyBuyndle\Tests; | |
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase as BaseWebTestCase; | |
use Symfony\Component\HttpFoundation\Response; | |
/** | |
* @author Tyler Stroud <tyler@tylerstroud.com> | |
*/ |
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
# Clear APC caches | |
after "deploy:finalize_update" do | |
pretty_print "--> Clearing APC caches" | |
run "cd #{release_path} && php app/console apc:clear --env=prod" | |
puts_ok | |
end |
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 Doctrine\ODM\MongoDB\Configuration; | |
use Doctrine\ODM\MongoDB\Mapping\Driver\AnnotationDriver; | |
use Doctrine\ODM\MongoDB\DocumentManager; | |
use Doctrine\Common\Annotations\AnnotationReader; | |
use Doctrine\Common\Annotations\AnnotationRegistry; | |
use Doctrine\MongoDB\Connection; | |
/** |
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
<parameters> | |
<parameter key="my_bundle.my_model.form.type.class">My\Bundle\RestBundle\Form\Type\MyModelFormType</parameter> | |
<parameter key="my_bundle.my_model.form.handler.class">My\Bundle\RestBundle\Form\Handler\MyModelFormHandler</parameter> | |
</parameters> | |
<services> | |
<service id="my_bundle.my_model.form.type" class="%my_bundle.my_model.form.type.class%"/> | |
<service id="my_bundle.my_model.form" factory-method="create" factory-service="form.factory" class="Symfony\Component\Form\Form"> | |
<argument type="service" id="my_bundle.my_model.form.type"/> | |
</service> |
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 | |
protected function getErrorsForForm(Form $form) | |
{ | |
$errors = []; | |
foreach ($form->all() as $child) { | |
foreach ($child->getErrors() as $error) { | |
$errors[$child->getName()][] = $error->getMessage(); | |
} | |
if ($child->count() > 0) { | |
$childErrors = $this->getErrorsForForm($child); |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<project name="my-project" default="build"> | |
<target name="build" depends="prepare,install-dependencies,lint,phploc,pdepend,phpmd-ci,phpcs-ci,phpcpd,phpdoc,phpunit,phpcb"/> | |
<target name="build-parallel" depends="prepare,lint,tools-parallel,phpunit,phpcb"/> | |
<target name="tools-parallel" description="Run tools in parallel"> | |
<parallel threadCount="2"> | |
<sequential> |
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
from daemon import runner | |
from time import sleep | |
class App(): | |
def __init__(self): | |
self.stdin_path = '/dev/null' | |
self.stdout_path = '/dev/tty' | |
self.stderr_path = '/dev/tty' | |
self.pidfile_path = '/tmp/hello_world_daemon.pid' | |
self.pidfile_timeout = 5 |