Overview

Namespaces

  • Charcoal
    • App
      • Action
      • Config
      • Handler
      • Middleware
      • Module
      • Route
      • Script
      • ServiceProvider
      • Template

Classes

  • Charcoal\App\Action\AbstractAction
  • Charcoal\App\App
  • Charcoal\App\AppConfig
  • Charcoal\App\AppContainer
  • Charcoal\App\Config\CacheConfig
  • Charcoal\App\Config\DatabaseConfig
  • Charcoal\App\Config\FilesystemConfig
  • Charcoal\App\Config\LoggerConfig
  • Charcoal\App\Config\MemcacheCacheConfig
  • Charcoal\App\Config\MemcacheCacheServerConfig
  • Charcoal\App\Handler\AbstractHandler
  • Charcoal\App\Handler\Error
  • Charcoal\App\Handler\HandlerConfig
  • Charcoal\App\Handler\NotAllowed
  • Charcoal\App\Handler\NotFound
  • Charcoal\App\Handler\PhpError
  • Charcoal\App\Handler\Shutdown
  • Charcoal\App\Middleware\CacheMiddleware
  • Charcoal\App\Module\AbstractModule
  • Charcoal\App\Module\ModuleConfig
  • Charcoal\App\Module\ModuleManager
  • Charcoal\App\Route\ActionRoute
  • Charcoal\App\Route\ActionRouteConfig
  • Charcoal\App\Route\RouteConfig
  • Charcoal\App\Route\RouteManager
  • Charcoal\App\Route\ScriptRoute
  • Charcoal\App\Route\ScriptRouteConfig
  • Charcoal\App\Route\TemplateRoute
  • Charcoal\App\Route\TemplateRouteConfig
  • Charcoal\App\Script\AbstractScript
  • Charcoal\App\ServiceProvider\AppServiceProvider
  • Charcoal\App\ServiceProvider\CacheServiceProvider
  • Charcoal\App\ServiceProvider\DatabaseServiceProvider
  • Charcoal\App\ServiceProvider\FilesystemServiceProvider
  • Charcoal\App\ServiceProvider\LoggerServiceProvider
  • Charcoal\App\ServiceProvider\ViewServiceProvider
  • Charcoal\App\Template\AbstractTemplate
  • Charcoal\App\Template\AbstractWidget
  • Charcoal\App\Template\WidgetBuilder

Interfaces

  • Charcoal\App\Action\ActionInterface
  • Charcoal\App\AppAwareInterface
  • Charcoal\App\Handler\HandlerInterface
  • Charcoal\App\Module\ModuleInterface
  • Charcoal\App\Route\RouteInterface
  • Charcoal\App\Script\CronScriptInterface
  • Charcoal\App\Script\ScriptInterface
  • Charcoal\App\Template\TemplateInterface
  • Charcoal\App\Template\WidgetInterface

Traits

  • Charcoal\App\AppAwareTrait
  • Charcoal\App\CallableResolverAwareTrait
  • Charcoal\App\Script\ArgScriptTrait
  • Charcoal\App\Script\CronScriptTrait
  • Charcoal\App\Script\PathScriptTrait
  • Overview
  • Namespace
  • Class
 1: <?php
 2: 
 3: namespace Charcoal\App\Script;
 4: 
 5: // PSR-7 (http messaging) dependencies
 6: use \Psr\Http\Message\RequestInterface;
 7: use \Psr\Http\Message\ResponseInterface;
 8: 
 9: // Dependencies from `Pimple`
10: use \Pimple\Container;
11: 
12: /**
13:  * Script are actions called from the CLI.
14:  *
15:  * Typically, with the `charcoal` bin.
16:  */
17: interface ScriptInterface
18: {
19: 
20:     /**
21:      * Give an opportunity to children classes to inject dependencies from a Pimple Container.
22:      *
23:      * Does nothing by default, reimplement in children classes.
24:      *
25:      * The `$container` DI-container (from `Pimple`) should not be saved or passed around, only to be used to
26:      * inject dependencies (typically via setters).
27:      *
28:      * @param Container $container A dependencies container instance.
29:      * @return void
30:      */
31:     public function setDependencies(Container $container);
32: 
33:     /**
34:      * @param string $ident The script identifier string.
35:      * @return ScriptInterface Chainable
36:      */
37:     public function setIdent($ident);
38: 
39:     /**
40:      * @return string
41:      */
42:     public function ident();
43: 
44:     /**
45:      * @param string $description The script description.
46:      * @return ScriptInterface Chainable
47:      */
48:     public function setDescription($description);
49: 
50:     /**
51:      * @return string
52:      */
53:     public function description();
54: 
55:     /**
56:      * @param array $arguments The script arguments array, as [key=>value].
57:      * @return ScriptInterface Chainable
58:      */
59:     public function setArguments(array $arguments);
60: 
61:     /**
62:      * @param string $argumentIdent The argument identifier.
63:      * @param array  $argument      The argument options.
64:      * @return ScriptInterface Chainable
65:      */
66:     public function addArgument($argumentIdent, array $argument);
67: 
68:     /**
69:      * @return array $arguments
70:      */
71:     public function arguments();
72: 
73:     /**
74:      * @param string $argumentIdent The argument identifier to retrieve options from.
75:      * @return array
76:      */
77:     public function argument($argumentIdent);
78: 
79:     /**
80:      * Run the script.
81:      *
82:      * @param  RequestInterface  $request  A PSR-7 compatible Request instance.
83:      * @param  ResponseInterface $response A PSR-7 compatible Response instance.
84:      * @return ResponseInterface
85:      */
86:     public function run(RequestInterface $request, ResponseInterface $response);
87: }
88: 
API documentation generated by ApiGen