CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Reporting Security Issues
    • Privacy Policy
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Get Involved
    • Issues (GitHub)
    • Bakery
    • Featured Resources
    • Training
    • Meetups
    • My CakePHP
    • CakeFest
    • Newsletter
    • Linkedin
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • Help & Support
    • Forum
    • Stack Overflow
    • Slack
    • Paid Support
CakePHP

C CakePHP 2.10 API

  • Overview
  • Tree
  • Deprecated
  • Version:
    • 2.10
      • 4.2
      • 4.1
      • 4.0
      • 3.9
      • 3.8
      • 3.7
      • 3.6
      • 3.5
      • 3.4
      • 3.3
      • 3.2
      • 3.1
      • 3.0
      • 2.10
      • 2.9
      • 2.8
      • 2.7
      • 2.6
      • 2.5
      • 2.4
      • 2.3
      • 2.2
      • 2.1
      • 2.0
      • 1.3
      • 1.2

Packages

  • Cake
    • Cache
      • Engine
    • Configure
    • Console
      • Command
        • Task
    • Controller
      • Component
        • Acl
        • Auth
    • Core
    • Error
    • Event
    • I18n
    • Log
      • Engine
    • Model
      • Behavior
      • Datasource
        • Database
        • Session
      • Validator
    • Network
      • Email
      • Http
    • Routing
      • Filter
      • Route
    • TestSuite
      • Coverage
      • Fixture
      • Reporter
    • Utility
    • View
      • Helper
  • None

Classes

  • BaseShellHelper
  • ConsoleOutputStub
  • ProgressShellHelper
  • TableShellHelper
 1: <?php
 2: /**
 3:  * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
 4:  * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
 5:  *
 6:  * Licensed under The MIT License
 7:  * For full copyright and license information, please see the LICENSE.txt
 8:  * Redistributions of files must retain the above copyright notice.
 9:  *
10:  * @copyright     Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
11:  * @link          https://cakephp.org CakePHP(tm) Project
12:  * @since         2.8
13:  * @license       https://opensource.org/licenses/mit-license.php MIT License
14:  */
15: 
16: abstract class BaseShellHelper {
17: 
18: /**
19:  * Default config for this helper.
20:  *
21:  * @var array
22:  */
23:     protected $_defaultConfig = array();
24: 
25: /**
26:  * ConsoleOutput instance.
27:  *
28:  * @var ConsoleOutput
29:  */
30:     protected $_consoleOutput;
31: 
32: /**
33:  * Runtime config
34:  *
35:  * @var array
36:  */
37:     protected $_config = array();
38: 
39: /**
40:  * Whether the config property has already been configured with defaults
41:  *
42:  * @var bool
43:  */
44:     protected $_configInitialized = false;
45: 
46: /**
47:  * Constructor.
48:  *
49:  * @param ConsoleOutput $consoleOutput The ConsoleOutput instance to use.
50:  * @param array $config The settings for this helper.
51:  */
52:     public function __construct(ConsoleOutput $consoleOutput, array $config = array()) {
53:         $this->_consoleOutput = $consoleOutput;
54:         $this->config($config);
55:     }
56: 
57: /**
58:  * Initialize config & store config values
59:  *
60:  * @param null $config Config values to set
61:  * @return array|void
62:  */
63:     public function config($config = null) {
64:         if ($config === null) {
65:             return $this->_config;
66:         }
67:         if (!$this->_configInitialized) {
68:             $this->_config = array_merge($this->_defaultConfig, $config);
69:             $this->_configInitialized = true;
70:         } else {
71:             $this->_config = array_merge($this->_config, $config);
72:         }
73:     }
74: 
75: /**
76:  * This method should output content using `$this->_consoleOutput`.
77:  *
78:  * @param array $args The arguments for the helper.
79:  * @return void
80:  */
81:     abstract public function output($args);
82: }
OpenHub
Rackspace
Rackspace
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Reporting Security Issues
  • Privacy Policy
  • Logos & Trademarks
  • Community
  • Get Involved
  • Issues (GitHub)
  • Bakery
  • Featured Resources
  • Training
  • Meetups
  • My CakePHP
  • CakeFest
  • Newsletter
  • Linkedin
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • Help & Support
  • Forum
  • Stack Overflow
  • Slack
  • Paid Support

Generated using CakePHP API Docs