Overview

Packages

  • AlfredBundler
  • None

Classes

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

Class AlfredBundlerInternalClass

Internal API Class for 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 wrapper will continue to work with the bundler API for the remainder of this major version.

Package: AlfredBundler
Copyright: The Alfred Bundler Team 2014
License: MIT
Since: Class available since Taurus 1
Located at AlfredBundler.php
Methods summary
public boolean
# __construct( string $options = [] )

The class constructor

The class constructor

Sets necessary variables.

Parameters

$options
string
$options a list of options to configure the instance

Returns

boolean
Return 'true' regardless
public mixed
# load( string $type, string $name, string $version, string $json = '' )

Load an asset using a generic function

Load an asset using a generic function

Parameters

$type
string
$type Type of asset
$name
string
$name Name of asset
$version
string
$version Version of asset to load
$json
string
$json = '' Path to json file

Returns

mixed
Returns path to utility on success, FALSE on failure

Since

Taurus 1
public
# icon( mixed $font, mixed $name, mixed $color = '000000', mixed $alter = FALSE )
public mixed
# utility( string $name, string $version = 'latest', string $json = '' )

Loads a utility

Loads a utility

Parameters

$name
string
$name Name of utility
$version
string
$version = 'latest' Version of utility
$json
string
$json = '' File path to json

Returns

mixed
Path to utility on success, FALSE on failure

Since

Taurus 1
public boolean
# library( string $name, string $version = 'latest', string $json = '' )

Loads / requires a library

Loads / requires a library

Parameters

$name
string
$name Name of library
$version
string
$version = 'latest' Version of library
$json
string
$json = '' File path to json

Returns

boolean
TRUE on success, FALSE on failure

Since

Taurus 1
public object
# wrapper( string $wrapper, boolean $debug = FALSE )

Loads a wrapper object

Loads a wrapper object

Parameters

$wrapper
string
$wrapper name of wrapper to load
$debug
boolean
$debug turn debugging off / on

Returns

object
a wrapper object
public boolean
# composer( array $packages )

Loads / requires composer packages

Loads / requires composer packages

Parameters

$packages
array
$packages An array of packages to load in composer

Returns

boolean
True on success, false on failure
public string
# icns( )

Creates an icns file out of the workflow's 'icon.png' file

Creates an icns file out of the workflow's 'icon.png' file

Returns

string
Path to generated icns file
public boolean
# installAsset( string $json, string $version = 'latest' )

Installs an asset based on JSON information

Installs an asset based on JSON information

Parameters

$json
string
$json File path to json
$version
string
$version = 'latest' Version of asset to install

Returns

boolean
TRUE on success, FALSE on failure
public string
# bundle( )

Returns bundle id of workflow using bundler

Returns bundle id of workflow using bundler

Returns

string
Bundle id
public boolean
# download( string $url, string $file, integer $timeout = '5' )

Wraps a cURL function to download files

Wraps a cURL function to download files

Parameters

$url
string
$url A URL to the file
$file
string
$file The destination file
$timeout
integer
$timeout = '3' A timeout variable (in seconds)

Returns

boolean
True on success and error code / false on failure

Since

Taurus 1
public
# log( string $message, mixed $level = 'INFO', string $destination = '' )

Log function for the user to employ

Log function for the user to employ

Parameters

$message
string
$message message to log
$level
mixed
$level='INFO' level of the log message
$destination
string
$destination='' destination ( file, console, both ) an empty argument will use the default destination set at instantiation

Since

Taurus 1

See

AlfredBundlerLogger:log
public
# debug( string $message, string $destination = '' )

Wraps around 'log' to level 'DEBUG'

Wraps around 'log' to level 'DEBUG'

Parameters

$message
string
$message message to log
$destination
string
$destination='' destination ( file, console, both ) an empty argument will use the default destination set at instantiation

Since

Taurus 1

See

AlfredBundlerLogger:log
AlfredBundlerInternalClass:log
public
# info( string $message, string $destination = '' )

Wraps around 'log' to level 'INFO'

Wraps around 'log' to level 'INFO'

Parameters

$message
string
$message message to log
$destination
string
$destination='' destination ( file, console, both ) an empty argument will use the default destination set at instantiation

Since

Taurus 1

See

AlfredBundlerLogger:log
AlfredBundlerInternalClass:log
public
# warning( string $message, string $destination = '' )

Wraps around 'log' to level 'WARNING'

Wraps around 'log' to level 'WARNING'

Parameters

$message
string
$message message to log
$destination
string
$destination='' destination ( file, console, both ) an empty argument will use the default destination set at instantiation

Since

Taurus 1

See

AlfredBundlerLogger:log
AlfredBundlerInternalClass:log
public
# error( string $message, string $destination = '' )

Wraps around 'log' to level 'ERROR'

Wraps around 'log' to level 'ERROR'

Parameters

$message
string
$message message to log
$destination
string
$destination='' destination ( file, console, both ) an empty argument will use the default destination set at instantiation

Since

Taurus 1

See

AlfredBundlerLogger:log
AlfredBundlerInternalClass:log
public
# critical( string $message, string $destination = '' )

Wraps around 'log' to level 'CRITICAL'

Wraps around 'log' to level 'CRITICAL'

Parameters

$message
string
$message message to log
$destination
string
$destination='' destination ( file, console, both ) an empty argument will use the default destination set at instantiation

Since

Taurus 1

See

AlfredBundlerLogger:log
AlfredBundlerInternalClass:log
public
# console( string $message, mixed $level = 'INFO' )

Wraps around 'log' to send to 'console'

Wraps around 'log' to send to 'console'

Parameters

$message
string
$message message to log
$level
mixed
$level level of log

Since

Taurus 1

See

AlfredBundlerLogger:log
AlfredBundlerInternalClass:log
public
# rrmdir( string $path )

Recursively removes a folder along with all its files and directories

Recursively removes a folder along with all its files and directories

Parameters

$path
string
$path Path to directory to remove

Since

Taurus 1

Link

http://php.net/manual/en/function.rmdir.php#110489
public mixed
# gatekeeper( string $name, string $path, string $message = '', string $icon = '' )

Queries Gatekeeper to whitelist apps

Queries Gatekeeper to whitelist apps

Invokes the Gatekeeper script if the path has not already been called. The call, if successful, is cached. If the cache file is present, then return the path from there instead of calling the cache again.

Parameters

$name
string
$name The name of the utility
$path
string
$path The fullpath to the utility
$message
string
$message The "permissions" message from the JSON
$icon
string
$icon The workflow icon file (if exists)

Returns

mixed
FALSE on failure, path to utility on success

Since

Taurus 1
public boolean
# register( string $asset, string $version )

Registers an asset

Registers an asset

The Bundler keeps a registry of which workflows use which assets.

Parameters

$asset
string
$asset Name of the asset to be registered
$version
string
$version Version of asset to use

Returns

boolean
Returns TRUE on success, FALSE on failure

Since

Taurus 1
public boolean
# notify( string $title, string $message, string $icon = null )

Uses CocoaDialog to display a notification

Uses CocoaDialog to display a notification

Parameters

$title
string
$title Title for notification
$message
string
$message Message of notification
$icon
string
$icon = null An array of options that Terminal Notifer takes

Returns

boolean
TRUE on success, FALSE on failure
Properties summary
public string $data
#

A filepath to the bundler directory

A filepath to the bundler directory

public string $cache
#

A filepath to the bundler cache directory

A filepath to the bundler cache directory

public string $major_version
#

The MAJOR version of the bundler (which API to use)

The MAJOR version of the bundler (which API to use)

public string $minor_version
#

The MINOR version of the bundler

The MINOR version of the bundler

public string $bundle
#

The Bundle ID of the workflow using the bundler

The Bundle ID of the workflow using the bundler

public string $name
#

The name of the workflow using the bundler

The name of the workflow using the bundler

public string $workflowData
#

The data directory of the workflow using the bundler

The data directory of the workflow using the bundler

public string $background
#

The background 'color' of the user's current theme in Alfred (light or dark)

The background 'color' of the user's current theme in Alfred (light or dark)

public mixed $finfo
#
public mixed $alfredVersion
#
public object $log
#

Desc

Desc

public object $userLog
#

Desc

Desc

public boolean $env
#

Whether or not enviromental variables are present

Whether or not enviromental variables are present

Alfred Bundler API documentation generated by ApiGen 2.8.0