Skip to content
slopjong edited this page Feb 18, 2013 · 3 revisions

Some snippets

// iterate over the directory and load all the JSONs
$directory = json_decode(file_get_contents("path/to/file"), true);
foreach($directory as $space => $url)
{
    // try to fork the process to speed up the caching
    if(function_exists("pcntl_fork"))
    {
        //trigger_error ( string $error_msg [, int $error_type = E_USER_NOTICE ] )
        
        // fork the current process
        switch($pid = pcntl_fork()){
        
            case -1:

                // @fail
                
                die('could not fork');
                break;
            
            case 0:

                // @child

                cache($space, $url);																			
                break;
            
            default:

                // @parent
                
                pcntl_wait($status); //Protect against Zombie children
        }
    }
    else
        cache($space, $url);
}

lat & lon

Where to find lat and lon for a space?

=> http://cccmz.de/matekate/drink_club-mate.txt

Clone this wiki locally