PHP Classes

File: application/modules/extensions/aws/Aws/Command.php

Recommend this page to a friend!
  Classes of Tran Tuan   Pretty PHP S3 Files Manager   application/modules/extensions/aws/Aws/Command.php   Download  
File: application/modules/extensions/aws/Aws/Command.php
Role: Application script
Content type: text/plain
Description: Initial
Class: Pretty PHP S3 Files Manager
Web based interface to manage files in Amazon S3
Author: By
Last change:
Date: 7 years ago
Size: 1,230 bytes
 

Contents

Class file image Download
<?php
namespace Aws;

/**
 * AWS command object.
 */
class Command implements CommandInterface
{
    use
HasDataTrait;

   
/** @var string */
   
private $name;

   
/** @var HandlerList */
   
private $handlerList;

   
/**
     * Accepts an associative array of command options, including:
     *
     * - @http: (array) Associative array of transfer options.
     *
     * @param string $name Name of the command
     * @param array $args Arguments to pass to the command
     * @param HandlerList $list Handler list
     */
   
public function __construct($name, array $args = [], HandlerList $list = null)
    {
       
$this->name = $name;
       
$this->data = $args;
       
$this->handlerList = $list ?: new HandlerList();

        if (!isset(
$this->data['@http'])) {
           
$this->data['@http'] = [];
        }
    }

    public function
getName()
    {
        return
$this->name;
    }

    public function
hasParam($name)
    {
        return
array_key_exists($name, $this->data);
    }

    public function
getHandlerList()
    {
        return
$this->handlerList;
    }

   
/** @deprecated */
   
public function get($name)
    {
        return
$this[$name];
    }
}