Archive for November, 2012

install mongodb on redhat centos or fedora linux

by on Thursday, November 29th, 2012

install mongo on linux/ubuntu:
1. sudo apt-get install mongodb
2. sudo pecl install mongo
3. echo “extension=mongo.so” >> /etc/php5/apache2/php.ini
4. restart apache
5. restart mongodb ( sudo service mongodb restart/start )
install on centos centos 6.3

1. http://docs.mongodb.org/manual/tutorial/install-mongodb-on-red-hat-centos-or-fedora-linux/
2. Install php-pecl-mongo rpm package: yum install php-pecl-mongo
3. echo “extension=mongo.so” >> /etc/php.ini
4. service httpd restart
5. restart mongodb ( sudo service mongod restart/start )

set allowBlank dynamically in extjs

by on Thursday, November 8th, 2012

myField.allowBlank = true;

myField.validateValue(myField.getValue()); //force update

Convert array to object and object to array in PHP

by on Thursday, November 1st, 2012

convert array to object PHP

$obj = json_decode (json_encode ($var), FALSE);
where $var is an array.

convert object to array PHP

$arr = json_decode( json_encode($var), true);
where $var is an object