Generate Lines Of Code And Comment Statistics Using phploc

You have been writing a lot of PHP code and want to generate statistics about the number of comment and code lines in your application. Maybe you want to generate statistics about some PHP project. You can do it with just one command.

phploc helps you quickly generate numbers about the size of a PHP project.

You can install phploc from the PEAR installer. The PHP PEAR package itself is most likely available from your distribution vendor.

Taxonomy upgrade extras: 

Tip Of The Day: Avoid Forgetting Adding Files To SVN Repository

If you are using subversion (SVN) for your source code management you may have come across this situation.

  1. You add some files to your working copy
  2. You use the command 'svn add ' to add files to the be versioned
  3. You commit using the command 'svn commit -m "message"'
  4. When other users of your project update their working copy they find some files missing

You forgot to add certain files to the repository. It happens every now and then.

Taxonomy upgrade extras: 

Programatically Change The Value Of The Environment Variable

A few months back, our friend Ben Scholzen wrote about setting up the environment variable in your Zend Framework powered application.

With the advent of Zend Framework 1.8 and the Zend_Application component the Zend Framework Quick Start guide recommends this setting.

Programming: 
FOSS Project: 

Tip Of The Day : Use A Data Generator

While developing applications creating test data can be a tedious process to the developers. You don't have to do the same things like creating a user for testing over and over again.

Use a data generator. There are numerous tools freely available online that can provide the test data for you.

Taxonomy upgrade extras: 

Tip Of The Day : Use dict

Have you fallen in love with the command line? Do you use a graphical browser to visit dictionary sites like wiktionary.org?

Use dictd.

What does dictd do?

[sudheer@localhost ~]$ yum info dictd
Loaded plugins: fastestmirror, refresh-packagekit
Installed Packages
Name       : dictd
Arch       : i386
Version    : 1.10.11
Release    : 3
Size       : 728 k
Repo       : installed
Summary    : DICT protocol (RFC 2229) command-line client
URL        : http://www.dict.org/
License    : GPL+ and zlib and MIT
Taxonomy upgrade extras: 

How To Configure Yum To Exclude A Mirror

Many of us have suffered from failing package repository mirrors. Some are slow, some won't have updated content, etc. You might want to remove/blacklist a particular mirror in your yum configuration.

Before trying to remove a mirror, install the fastest mirror plugin.

yum install yum-fastestmirror -y

The fastest mirror plugin is capable of determining mirror speeds and cache it. If that works for you well and good.

How To Set SVN_EDITOR Environment Variable To Vim

Problem: You are trying to use the command svn propedit svn:externals and you are receiving the error:

svn: None of the environment variables SVN_EDITOR, VISUAL or EDITOR are set, and no 'editor-cmd' run-time configuration option was found

Solution: Set vim as your SVN_EDITOR

Command:

export SVN_EDITOR=vim

To permanently set this environment variable put the below line in your ~/.bash_profile file.

export SVN_EDITOR=vim

Did it solve your problem?

Taxonomy upgrade extras: 

Constants In PHP

We are all familiar with variables. As the name suggests the value of the given variable tends to vary.


<?php
 $fruit 
'orange';
 print 
$foo;
 
$foo 'banana';
 print 
$foo;
?>

The above script illustrates the usage of variables. Variables in PHP are represented by a dollar sign followed by the name.

Just like variables, PHP offers constants. As the name suggests the value of the constant does not change throught the lifetime of the script.

How do you use constants?

Programming: 
Content Type: 

How To Access Action Helper In A Front Controller Plugin?


Zend_Controller_Action_HelperBroker::getStaticHelper('helpername');

For example, you can access the redirector helper from within your front controller plugin:

$redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');

FOSS Project: 
Content Type: 
Programming: 

Pages