Skip to main content

Posts

Symfony 2 + DoctrineMongoDBBundle + FOSUserBundle Tutorial

It's been a while I have not added an entry to my blog. I have been busy playing with Symfony 2, MongoDB, and FOSUserBundle for a while now so here is a tutorial to integrate Symfony 2, MongoDB, and FOSUserBundle. Objectives * Install DoctrineMongoDBBundle * Install FOSUserBundle * Create user model ** Utilize groups ** Add additional properties to user model * Create customized registration form and handler At this point I am going to assume that you have a running Symfony 2 and MongoDB installation in place already and a basic understanding of how to configure Symfony 2 services. I will also exclude view related steps from this tutorial. Setting Up DoctrineMongoDBBundle Add the following to your deps file: [doctrine-mongodb] git=http://github.com/doctrine/mongodb.git [doctrine-mongodb-odm] git=http://github.com/doctrine/mongodb-odm.git [DoctrineMongoDBBundle] git=http://github.com/symfony/DoctrineMongoDBBundle.git target=/bundles/Symfony/Bundle/Doctrin...

Exim posing as Sendmail: Fixing Sender and Return-Path headers

Exim If you are having problems changing the Sender and Return-Path headers, make sure that you are editing the right configuration file. On my CentOS 5.6: [root@server mail]# ll /usr/sbin/sendmail lrwxrwxrwx 1 root root 21 Oct 26 2009 /usr/sbin/sendmail -> /etc/alternatives/mta [root@server mail]# ll /etc/alternatives/mta lrwxrwxrwx 1 root root 23 Apr 9 07:48 /etc/alternatives/mta -> /usr/sbin/sendmail.exim [root@server mail]# ll /usr/sbin/sendmail.exim lrwxrwxrwx 1 root root 4 Apr 9 07:45 /usr/sbin/sendmail.exim -> exim I spent some time trying to figure out why my changes to the sendmail.mc file were being ignored. Naturally, Exim configuration is different than Sendmail. You need to edit the /etc/exim/exim.conf file: remote_smtp: driver = smtp return_path = bounce@domain.com headers_rewrite = apache@* info@domain.com s Don't forget the "s" at the end. See this page for more information: http://www.exim.org/exim-html-2.00/doc/html/spec_32.html...

PHP API for Solr

I finally had some time to finish my PHP client for Solr. It is still in alpha but I am planning to finalize testing for a beta release soon. The source code can be found at https://github.com/buraks78/Logic-Solr-API .

Netbeans performance isues surfaced again

Last week, after I upgraded to the Netbeans 7.0 Beta, scanning issues, coupled with spontaneous freezes, cropped up again. I initially thought I was running into the same heap size issue as described in one of my earlier posts. After some research, it turns out the issue was related to garbage collection this time. http://performance.netbeans.org/howto/jvmswitches/index.html http://wiki.netbeans.org/FaqScanningAndIndexingPerformanceHints#Use_different_Garbage_Collector_strategy We've had several reports from users that choosing 'Concurrent Mark And Sweep' garbage collector improves scanning performance. This may or may not make a difference on your system. The problem is that people use different hardware, different versions of JDK and they have different default GC algorithm chosen by their JVM. I added the required flags to my netbeans.conf file and performance improved to a point where it is now much better than it was previously. netbeans_default_options="...

Using Google Nexus One in Istanbul Turkey

Yes, it is possible. The device is compatible and can connect to the local 3G network (Turkcell) with minimal hassle. In addition, even though I had to purchase a two-year T-mobile subscription with my phone, the device is unlocked! Disclaimer: I purchased this phone directly from Google in May 2010. Google is no longer doing this. As soon as I landed in Istanbul, I went to the Turkcell kiosk, registered my IMEI number, purchased a prepaid card, and activated it. You MUST register your phone with the government agency or it may be banned permanently. The next step is to subscribe to the 3G internet service. There are two types of 3G services: 1. Faturali (invoiced) 3G Internet http://www.turkcell.com.tr/bireysel/3G/3Ginternet/tarifeler/faturali3Ginternet Subscription for this plan is automatically renewed every month. And there is an overuse charge which is currently 0,050 TL/MB. 2. Faturasiz (non-invoiced) 3G Internet http://www.turkcell.com.tr/bireysel/3G/3Ginternet/t...

Removing the .php extension from Symfony controller

If you wish to shorten your Symfony 1.4 URLs (http://www.yourdomain.com/symfonyApp.php/user/login) by removing the php extension from the controller (http://www.yourdomain.com/symfonyApp/user/login), then read on. 1. Update your factories.yml file and add the relative_url_root option as described below: all: request: class: sfWebRequest param: logging: %SF_LOGGING_ENABLED% path_info_array: SERVER path_info_key: PATH_INFO relative_url_root: "" formats: txt: text/plain js: [application/javascript, application/x-javascript, text/javascript] css: text/css json: [application/json, application/x-json] xml: [text/xml, application/xml, application/x-xml] rdf: application/rdf+xml atom: application/atom+xml 2. Create a symbolic link in your web directory to your controller: cd /your/symfony/project/dir/web ln -s symfonyApp.php symfonyApp 3. Update your apache c...

Netbeans scanning issue resolved

I was having problems with Netbeans 6.9 where it would just hang trying to scan my codebase which consists of around ~200.000 PHP files. Another issue was related to code completion and suggestions which caused the IDE to become unresponsive or, in some cases, hang. It looks like the issue is related to the heap size which is automatically set since version 6.0. Since NetBeans version 6.0, the default limit for heap size (-J-Xmx) is determined automatically, with respect to the amount of memory available on the system. There is no -J-Xmx option specified in netbeans.conf. However, if you specify the heap size limit (i.e. you add the -J-Xmx... option to netbeans.conf), then the limit given by you will be respected. http://wiki.netbeans.org/FaqSettingHeapSize So I ended up increasing the heap size in netbeans.conf by adding the "-J-Xmx2048m" option. Here are my current settings: netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-Xmx2048m -J-XX:PermSize=32m...