All posts by Mohammad Al Qersh

check if the webcam is working in ubuntu

I have Acer Aspire 4736ZG Which is a wonderful laptop. And when I installed Ubuntu every thing was working out of box.

Then I wonder if the laptop camera is working as I never thought of that before.

To check if the camera is working you just do the following:

ALT + F2
gstreamer-properties

In Video Tab Under Default Input Click Test

Get The Last Inserted ID when using Zend_Db

I was working in migration script which I am only using Zend_Db Component with the MVC (Normally I use Zend_Db_Table) and it seems that $db->insert(‘table_name’, $data); is not returning the last inserted id and after some investgation I fount that to get the last inserted id you should use the following method

$db->lastInsertId();

How to disable Layout and View in Zend Framework Controller

May be you ask why I may need to disable the layout or views. Some times I am not outputting a normal page but XML data so I do not need the Layout. Other situations for example when I do migration for the data and I just need to use the controller to do that the view or the layout is not necessary
to disable the layout and view renderer in specific action use the following methods

$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);

If you want to disable them in every action on specific controller you can add them to the init() function as it is run before any thing else in the Controller Class

How to enable modules in Zend Framework Version 1.10

Use the command line tool to create your modules

zf create module mymodule

open application/configs/application.ini

add the following lines to the end of production section of the configration file

resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.modules[] = ""

And it should be working now

You may need to create the controllers for your new modules use the following Zend_Tools syntax

zf create controller ControllerName index-action-included=1 mymodule

Starting My Blog

It was a long time ago when I decided to write in a blog. Never get the time to do that.

I am starting this blog to be my reference for the problems I face in work and life.And how I fix them.

I hope that’s help some one else.