Hoa central
Public Member Functions | Protected Attributes | List of all members
Hoa\Devtools\Bin\State Class Reference
Inheritance diagram for Hoa\Devtools\Bin\State:

Public Member Functions

 main ()
 
 usage ()
 
- Public Member Functions inherited from Hoa\Console\Dispatcher\Kit
 __construct (Router $router, Dispatcher $dispatcher, View\Viewable $view=null)
 
 getOption (&$optionValue, $short=null)
 
 setOptions (Array $options)
 
 makeUsageOptionsList (Array $definitions=[])
 
 resolveOptionAmbiguity (Array $solutions)
 
 status ($text, $status)
 
 readLine ($prefix=null)
 
 readPassword ($prefix=null)
 
- Public Member Functions inherited from Hoa\Dispatcher\Kit
 __construct (Router $router, Dispatcher $dispatcher, View\Viewable $view=null)
 
 construct ()
 

Protected Attributes

 $options
 
- Protected Attributes inherited from Hoa\Console\Dispatcher\Kit
 $options = null
 
 $_options = null
 

Additional Inherited Members

- Public Attributes inherited from Hoa\Console\Dispatcher\Kit
 $parser = null
 
- Public Attributes inherited from Hoa\Dispatcher\Kit
 $router = null
 
 $dispatcher = null
 
 $view = null
 
 $data = null
 

Detailed Description

Class .

Get state of a library.

Definition at line 49 of file State.php.

Member Function Documentation

Hoa\Devtools\Bin\State::main ( )

The entry method.

Returns
int

Definition at line 68 of file State.php.

69  {
70  $library = null;
71 
72  while (false !== $c = $this->getOption($v)) {
73  switch ($c) {
74  case '__ambiguous':
75  $this->resolveOptionAmbiguity($v);
76 
77  break;
78 
79  case 'h':
80  case '?':
81  default:
82  return $this->usage();
83  }
84  }
85 
86  $this->parser->listInputs($library);
87 
88  if (empty($library)) {
89  return $this->usage();
90  }
91 
92  $library = ucfirst(strtolower($library));
93  $path = 'hoa://Library/' . $library;
94 
95  if (false === file_exists($path)) {
96  throw new Console\Exception(
97  'The %s library does not exist.',
98  0,
99  $library
100  );
101  }
102 
103  $status = 'beta';
104  $path .= '/.State';
105 
106  if (true === file_exists($path)) {
107  $status = trim(file_get_contents($path));
108  }
109 
110  echo $status;
111 
112  return;
113  }
getOption(&$optionValue, $short=null)
Definition: Kit.php:104
resolveOptionAmbiguity(Array $solutions)
Definition: Kit.php:190

Here is the call graph for this function:

Hoa\Devtools\Bin\State::usage ( )

The command usage.

Returns
int

Definition at line 120 of file State.php.

121  {
122  echo
123  'Usage : devtools:state <options> library', "\n",
124  'Options :', "\n",
125  $this->makeUsageOptionsList([
126  'help' => 'This help.'
127  ]), "\n";
128 
129  return;
130  }
makeUsageOptionsList(Array $definitions=[])
Definition: Kit.php:149

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

Hoa\Devtools\Bin\State::$options
protected
Initial value:

Definition at line 56 of file State.php.


The documentation for this class was generated from the following file: