Skip to content

Instantly share code, notes, and snippets.

View gocom's full-sized avatar

Jukka Svahn gocom

View GitHub Profile
@gocom
gocom / register.php
Last active December 16, 2015 11:58
<?php
/**
* Symlinks executable binaries in the current working directory to /usr/bin.
*
* I've used this to conditionally register and test different PHP versions,
* and as a helper when updating.
*
* Renames and keeps any existing colliding files it finds. Prefixes
* them with the current UNIX timestamp.
@gocom
gocom / abc_plugin_update.php
Created October 12, 2012 18:11
An example Textpattern plugin with an updater
<?php
/**
* The plugin class.
*/
class abc_plugin
{
/**
* The plugin version.
@gocom
gocom / checksum_generate.php
Created October 12, 2012 16:24
Generates new checksums.txt
<?php
/**
* Generates a new checksum file.
*/
foreach (check_file_integrity(INTEGRITY_MD5) as $file => $md5)
{
if ($md5)
{
@gocom
gocom / abc_plugin_options.php
Created September 21, 2012 06:58
An example skeleton that adds Options link to the plugins panel
<?php
/**
* An example skeleton that adds Options link to the plugins panel.
* The class is named after the plugin.
*
* To the link to show up, the plugin needs to be armed with a
* "PLUGIN_HAS_PREFS" flag. Flags can be distributed/added using the
* "flags" field in the compiled plugin package and are stored in the
* txp_plugins table's "flags" column.