Exemple #1
0
/**
 * Create the readme.md file from the readme.txt file
 *
 * Use t2m ( php txt2md.php ) to convert the readme.txt file into a README.md file
 * The README.md file is used in GitHub
 * 
 * @param string $plugin   
 */
function doreadmemd($theme)
{
    $cwd = getcwd();
    echo __FUNCTION__ . $cwd;
    echo PHP_EOL;
    setcd("wp-content", "themes/{$theme}");
    docontinue("in theme dir");
    $return_var = null;
    $cmd = "t2m > README.md";
    echo $cmd;
    $lastline = exec($cmd, $output, $return_var);
    echo $return_var;
    //setcd( "wp-content", "plugins" );
    cd2themes();
}
Exemple #2
0
/**
 * Copy assets for the plugin
 * 
 * - Creates the assets directory if missing
 * - Copies the plugin banner and icon images
 * 
 * @TODO Source directory is currently hardcoded. Consider removing this logic when all the assets have been copied.
 *
 * @param string $plugin
 */
function doassets($plugin)
{
    setcd("wp-content", "plugins/{$plugin}");
    if (!is_dir("assets")) {
        mkdir("assets");
    }
    setcd("wp-content", "plugins/{$plugin}/assets");
    if (!file_exists("{$plugin}-banner-772x250.jpg")) {
        copy("/apache/htdocs/oik-plugins/banners/{$plugin}-banner-772x250.jpg", "{$plugin}-banner-772x250.jpg");
    }
    if (!file_exists("{$plugin}-icon-256x256.jpg")) {
        copy("/apache/htdocs/oik-plugins/icons/{$plugin}-icon-256x256.jpg", "{$plugin}-icon-256x256.jpg");
    }
    cd2plugins();
}