Alphred
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo
  • Download

Namespaces

  • Alphred
  • None

Classes

  • Alfred
  • AppleScript
  • Choose
  • Config
  • Date
  • Dialog
  • Filter
  • Globals
  • i18n
  • Ini
  • Keychain
  • Log
  • Notification
  • Request
  • Result
  • ScriptFilter
  • Text

Interfaces

  • ConfigKeyNotSet
  • Exception
  • FileDoesNotExist
  • InvalidKeychainAccount
  • InvalidScriptFilterArgument
  • InvalidSecurityAction
  • InvalidXMLProperty
  • PasswordExists
  • PasswordNotFound
  • PluginFunctionNotFound
  • RunningOutsideOfAlfred
  • ShouldBeBool
  • TooManyArguments
  • UnknownSecurityException
  • UseOnlyAsStatic

Class Globals

A class to reteive certain Global variables

Basically, it gives you access to the subset of variables.

This class was written so that CodeClimate would stop throwing a fit because I was accessing the $_SERVER variable directly.

Namespace: Alphred
Located at Globals.php

Methods summary

public
# __construct( )

Throws an exception if you try to instantiate it

Throws an exception if you try to instantiate it

Throws

Alphred\UseOnlyAsStatic
if you try to institate a Globals object
public static string
# get( string $name )

Retrieves a variable from the global $_SERVER array

Retrieves a variable from the global $_SERVER array

Parameters

$name
name of the variable

Returns

string
value of the variable

Throws

Alphred\RunningOutsideOfAlfred

Since

1.0.0

Used by

Alphred\Alfred::light_or_dark()
public static string
# bundle( )

Retrieves the bundle id of the workflow from the global $_SERVER array

Retrieves the bundle id of the workflow from the global $_SERVER array

Returns

string
the bundle id of the running workflow

Since

1.0.0
public static string
# data( )

Retrieves the data directory of the running workflow

Retrieves the data directory of the running workflow

Returns

string
path to the workflow's data directory

Since

1.0.0
public static string
# cache( )

Retrieves the cache directory of the running workflow

Retrieves the cache directory of the running workflow

Returns

string
path to the workflow's cache directory

Since

1.0.0
public static boolean
# is_background( )

Checks if the script is running in the background

Checks if the script is running in the background

This is aware only of a script running in the background if it was launched by the Alphred wrapper's background() method.

Returns

boolean
[description]

Since

1.0.0

See

\Alphred::background() To see how to launch a background script.

Magic methods summary

Properties summary

private static array $variables

An array of Global variables that can be accessed

An array of Global variables that can be accessed

Since

1.0.0
# [ 'alfred_theme_background', 'alfred_theme_subtext', 'alfred_version', 'alfred_version_build', 'alfred_workflow_bundleid', 'alfred_workflow_cache', 'alfred_workflow_data', 'alfred_workflow_name', 'alfred_workflow_uid', 'ALPHRED_IN_BACKGROUND', // This is internal for background awareness 'PWD', 'USER' ]
Alphred API documentation generated by ApiGen