Coding

Remember notes in php – 5 cache booster php

Everybody needs a script case to speed the development applications. One of the site i just visited is scriptcase.net

Cache to booster your script in PHP

Memcached
APC
XCache
Zend Cache
eAccelerator

 

If using in drupal apps the i need to add on the module ;

 

<?php ob_end_flush(); ?>     ; Entry point to speed-up your php

01
02
03
04
05
06
07
08
09
10
11
12
<!DOCTYPE html>
<?php ob_start('ob_gzhandler'); ?>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>untitled</title>
</head>
<body>
     
</body>
</html>
<?php ob_end_flush(); ?>

 

Shouting your entry password to the email;

echo md5('myPassword'); // renders - deahsdfasdf8u09820934809234lokjij

 

<?php phpinfo(); ?>   ; knowing the php system

 

Beginners to say in txt in PHP. 

1
2
3
4
5
6
7
<?
    echo "Hello world";
?>
<?="Hello world"; ?>
<% echo "Hello world"; %>

 

Error coding in the entry ; Placing the wrong data in the html.

 

01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
function displayEntry()
{
    $entryDisp = NULL;
    // Get the information from the database
    $sql = "SELECT title, entry FROM entries WHERE page='blog'";
    $r = mysql_query($sql) or die(mysql_error());
    while($entry = mysql_fetch_assoc($r)) {
        $title = $entry['title'];
        $text = $entry['entry'];
        // Create the text preview
        $textArray = explode(' ',$text);
        $preview = NULL;
        for($i=0; $i<24; $i++) {
            $preview .= $textArray[$i] . ' ';
        }
        $preview .= $textArray[24] . '...';
        // Format the entries
        $entryDisp .= <<<ENTRY_DISPLAY
<h2> $title </h2>
<p>
$preview
</p>
ENTRY_DISPLAY;
    }
    return $entryDisp;
}

References:

http://code.tutsplus.com/tutorials/add-power-to-your-php-with-multi-tiered-applications–net-4068

http://code.tutsplus.com/tutorials/30-php-best-practices-for-beginners–net-6194

http://ratatosk.net/drupal/tutorials/debugging-drupal.html

Add your comments

Loading Facebook Comments ...
Loading Disqus Comments ...