Clone wiki

ppaste / Extensions


If you'll need some extra functions, you can easily make an extension. Since ppaste has a one-php-file paradigm all config variables are set in the main file ppaste.php and not in an extra config file.

You can read out thoses settings by setting $PPASTE_CONFIG_INC to True and including ppaste.php. Take a look a extensions/example.php for best practices on how to write extensions:

    // Set this to only get the config variables
    $PPASTE_CONFIG_INC = true;
    // Now load config

    // Make sure the right php file was included
        // Now do something ...

        echo 'ppaste; version is ' . $PPASTE_VERSION . '; ';

        $pics = scandir($PPASTE_PICTURE_DIR);
        echo count($pics) . ' uploads; ';

        echo 'do something else ...';