Overview

Packages

  • AlfredBundler
  • None

Classes

  • AlfredBundler
  • AlfredBundlerIcon
  • AlfredBundlerInternalClass
  • AlfredBundlerLogger
  • Overview
  • Package
  • Class
  • Tree

Class AlfredBundler

The PHP interface for the Alfred Bundler

This class is the only one that you should interact with. The rest of the magic that the bundler performs happens under the hood. Also, the backend of the bundler (here the 'AlfredBundlerInternalClass') may change; however, this bundlet will continue to work with the bundler API for the remainder of this major version (Taurus). Limited documentation is below, for more detailed documentation, see http://shawnrice.github.io/alfred-bundler.

Example usage:

require_once( 'alfred.bundler.php' );
$b = new AlfredBundler;

// Downloads and requires David Ferguson's PHP Workflows library
$b->library( 'Workflows' );

// Download icons
$icon1 = $b->icon( 'elusive', 'dashboard', 'ab332c', TRUE );
$icon2 = $b->icon( 'fontawesome', 'adjust', 'aabbcc', '998877');
$icon3 = $b->icon( 'fontawesome, 'bug' );
$icon4 = $b->icon( 'system', 'Accounts' );

// Send a message to the console (shows up in Alfred's debugger)
$b->log( 'Loaded icons', 'INFO', 'console' );
// Log a message to a logfile found in the workflow's data directory
$b->log( 'Initial bootstrap complete, check the log file', 'DEBUG', 'log' );
// Send the same message to the console and the log file
$b->log( 'Bootstrap completed.', 'INFO', 'both' );


// Get Pashua to use later
$pashua = $b->utility( 'Pashua' );

// Get an asset not included in the "defaults"
$myAsset = $b->load( 'utility', 'myAsset', 'latest', '/path/to/json' );

// Load 'cocoadialog' with the bundler's wrappers
$cocoadialog = $b->wrapper( 'cocoadialog' );

// Load/install composer packages
$bundler->composer( array(
  "monolog/monolog" => "1.10.*@dev"
));

Package: AlfredBundler
Copyright: The Alfred Bundler Team 2014
License: MIT
Since: Class available since Taurus 1
See: AlfredBundlerInternalClass
Located at alfred.bundler.php
Methods summary
public boolean
# __construct( )

The class constructor

The class constructor

Returns

boolean
Returns successful/failed instantiation
public mixed
# __call( string $method, array $args )

Passes calls to the internal object

Passes calls to the internal object

Wrapper function that passes all other calls to the internal object when the method has not been found in this class

Parameters

$method
string
$method Name of method
$args
array
$args An array of args passed

Returns

mixed
Whatever the internal function sends back

Since

Taurus 1
public mixed &
# __get( string $name )

Gets variables from the AlfredBundlerInternalClass

Gets variables from the AlfredBundlerInternalClass

Parameters

$name
string
$name name of variable to get

Returns

mixed
the variable from the internal class object

Since

Taurus 1
Properties summary
protected object $bundler
#

An internal object that interfaces with the PHP Bundler API

An internal object that interfaces with the PHP Bundler API

Alfred Bundler API documentation generated by ApiGen 2.8.0