Posts Tagged ‘configuration’

Php:Variable variables

Tuesday, July 1st, 2008

A variable variable looks like this: $$var

So, if $var = ‘foo’ and $foo = ‘bar’ then $$var would contain the value ‘bar’ because $$var can be
thought of as $’foo’ which is simply $foo which has the value ‘bar’.

Variable variables sound like a cryptic a useless concept, but they can be useful sometimes. For
example, if we have a configuration file consisting of configuration directives and values in this
format:

foo=bar
abc=123
Then it is very easy to read this file and create corresponding variables:

<?php
$fp = fopen(’config.txt’,'r’);
while(true) {
$line = fgets($fp,80);
if(!feof($fp)) {
if($line[0]==’#’ || strlen($line)<2) continue;
list($name,$val)=explode(’=',$line,2);
$$name=trim($val);
} else break;
}
fclose($fp);
?>
Along the same lines as variable variables, you can create compound variables and variable
functions.

<?php
$str = ‘var’;
$var_toaster = “Hello World”;
echo ${$str.’_toaster’};
$str(); // Calls a function named var()
${$str.’_abc’}(); // Calls a function named var_abc()
?>

PHP:Change/modify configuration values for ‘include_path’ in php ini configuration runtime

Monday, June 30th, 2008

ini_set(’include_path’, ‘/usr/share/code’ . PATH_SEPARATOR . ini_get(’include_path’));

PHP:Advanced PHP debugger configuration on windows (win32)

Monday, June 30th, 2008

Configuration & Activation ( Windows ):
1) uncomment in php.ini
— php.ini —
extension=php_apd.dll
— php.ini —
2)
specifying [[apd.dumpdir = .]] indicates that dump files will be
stored in the current dir where the tested
php script resides
— php.ini —
zend_extension = d:/php/extensions/php_apd.dll
apd.dumpdir = .
apd.statement_trace = 1
— php.ini —

5 Stress Reducing Computer Tips

Monday, June 23rd, 2008

For most entrepreneurs computers are an intrical part of our business. An entrepreneur can not afford for their computer to be inoperable even for a minute. Implement some of these quick and affordable computer tips to keep your computer healthy and making money for your business.

1  Double Internet Speed

Comcast recently doubled cable modem download speeds. Now you can surf the Internet and download files twice as fast. However, you need to power cycle your cable modem [unplug it for 30 seconds and reboot computer] for the new configuration to be automatically downloaded to your modem.

2  Connecting to Work from Home

Having trouble with your corporate VPN connection when working from home? Oftentimes this can be fixed with a simple firmware upgrade to your network router or a slight change in settings.

3  Sudden Lost Connection

Has your Internet connection suddenly stopped working? Frequently computer users with software based firewalls suddenly find their Internet connection no longer available. Oftentimes when you download a software update, it can change your original configurations. As a quick test, disable the software firewall. If connectivity returns, it’s a misconfiguration issue.

4  Slow E mail and Internet Browsing

Has your computer been working wonderfully, but suddenly e mail or Internet browsing is painfully slow? It could be your cable connection went out. And although the connection has returned, your computer and the cable modem may be having difficulty communicating. Try power cycling your modem.

5  Eliminate Popups

Google offers a free popup blocker with its toolbar. Download the toolbar at www.toolbar.google.com. System requirements: Microsoft Windows 95/98/ME/NT/2000/XP, Microsoft Internet Explorer 5.0 or later. The popup blocker requires Internet Explorer 5.5 or later.

Firefox Speed Tweaks

Wednesday, June 18th, 2008

Yes, firefox is already pretty damn fast but did you know that you can tweak it and improve the speed even more?

That’s the beauty of this program being open source.
Here’s what you do:
In the URL bar, type “about:config” and press enter. This will bring up the configuration “menu” where you can change the parameters of Firefox.

Note that these are what I’ve found to REALLY speed up my Firefox significantly - and these settings seem to be common among everybody else as well. But these settings are optimized for broadband connections - I mean with as much concurrent requests we’re going to open up with pipelining… lol… you’d better have a big connection.

Double Click on the following settins and put in the numbers below - for the true / false booleans - they’ll change when you double click.

Code:
browser.tabs.showSingleWindowModePrefs – true
network.http.max-connections – 48
network.http.max-connections-per-server – 16
network.http.max-persistent-connections-per-proxy – 8
network.http.max-persistent-connections-per-server – 4
network.http.pipelining – true
network.http.pipelining.maxrequests – 100
network.http.proxy.pipelining – true
network.http.request.timeout – 300

One more thing… Right-click somewhere on that screen and add a NEW -> Integer. Name it “nglayout.initialpaint.delay” and set its value to “0”. This value is the amount of time the browser waits before it acts on information it receives. Since you’re broadband - it shouldn’t have to wait.

Now you should notice you’re loading pages MUCH faster now!