Is there a way to specify Doctrine2 Entitymanager implementation class in Symfony2?

After Doctrine 2.4 (Doctrine 2.4 release) you need to use decorator for this. Do not extend EntityManager directly. First you need to implement you own entity manager decorator that extends Doctrine\ORM\Decorator\EntityManagerDecorator (like @Dana) But you can’t just change doctrine.orm.entity_manager.class to your new decorator because EntityManagerDecorator requires EntityManagerInterface in it’s constructor: public function __construct(EntityManagerInterface $wrapped) You … Read more

notepad++ user defined regions with folding

For version 6.5.5 and above: Under the menu “Language” there is a menuitem called “Define your language…“ In the tab “Folder & Default” is a group called “Folding in code” where you can enter an “Open”- and a “Close”-Keyword. For versions older than 6.5.5: Under the menu “View” there is a menuitem called “User-Defined Dialog…“ … Read more

How to change Vagrant ‘default’ machine name?

I found the multiple options confusing, so I decided to test all of them to see exactly what they do. I’m using VirtualBox 4.2.16-r86992 and Vagrant 1.3.3. I created a directory called nametest and ran vagrant init precise64 http://files.vagrantup.com/precise64.box to generate a default Vagrantfile. Then I opened the VirtualBox GUI so I could see what … Read more

Externalizing Grails Datasource configuration

You can use a properties file specified in the grails.config.locations as a way to externalize the datasource configuration. Below is how I typically set up a Grails project: In my DataSource.groovy I specify this for the production environment: …. …. production { dataSource { dbCreate = “update” driverClassName = “com.myorg.jdbcDriverNotExists” url = “” username = … Read more

Enable tcp\ip remote connections to sql server express already installed database with code or script(query)

I tested below code with SQL Server 2008 R2 Express and I believe we should have solution for all 6 steps you outlined. Let’s take on them one-by-one: 1 – Enable TCP/IP We can enable TCP/IP protocol with WMI: set wmiComputer = GetObject( _ “winmgmts:” _ & “\\.\root\Microsoft\SqlServer\ComputerManagement10”) set tcpProtocols = wmiComputer.ExecQuery( _ “select * … Read more

How to share common properties among several maven projects?

What you can do is to use the Properties Maven plugin. This will let you define your properties in an external file, and the plugin will read this file. With this configuration : <build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>properties-maven-plugin</artifactId> <version>1.0-alpha-1</version> <executions> <execution> <phase>initialize</phase> <goals> <goal>read-project-properties</goal> </goals> <configuration> <files> <file>my-file.properties</file> </files> </configuration> </execution> </executions> </plugin> </plugins> </build> … Read more

Disable Maven central repository

Agreed. No direct downloads from external repositories should be allowed in your release builds. The specific answer to your question is the second part of my answer 🙂 Setup a repository manager I’d recommend setting up a local Maven repository manager. Good options are the following: Nexus Artifactory Archiva Reposilite All of these are capable … Read more