Esempio n. 1
0
 /**
  * The Content-Length entity-header field indicates the size of the
  * entity-body, in decimal number of OCTETs, sent to the recipient or, in
  * the case of the HEAD method, the size of the entity-body that would
  * have been sent had the request been a GET.
  *
  * Content-Length    = "Content-Length" ":" 1*DIGIT
  *
  * @param  int     $value
  */
 public function __construct($length = null)
 {
     /**
      * @todo: Basic implementation. Add validation?
      */
     parent::__construct('Content-Length', $length);
 }
Esempio n. 2
0
 public function __construct($type = 'text/html;', $charset = 'UTF-8')
 {
     /**
      * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
      * @todo: Make it more configurable.
      *
      * This will have to do it for now:
      */
     $content_type = $type . $charset;
     parent::__construct('Content-Type', $type);
 }
Esempio n. 3
0
 /**
  * Loads the section $section from the config file $filename for
  * access facilitated by nested object properties.
  *
  * If the section name contains a ":" then the section name to the right
  * is loaded and included into the properties. Note that the keys in
  * this $section will override any keys of the same
  * name in the sections that have been included via ":".
  *
  * If the $section is null, then all sections in the ini file are loaded.
  *
  * If any key includes a ".", then this will act as a separator to
  * create a sub-property.
  *
  * example ini file:
  *      [all]
  *      db.connection = database
  *      hostname = live
  *
  *      [staging : all]
  *      hostname = staging
  *
  * after calling $data = new Yaf_Config_Ini($file, 'staging'); then
  *      $data->hostname === "staging"
  *      $data->db->connection === "database"
  *
  * @param  string        $filename
  * @param  mixed         $section
  * @param  boolean $readonly
  * @throws Yaf_Config_Exception
  * @return void
  */
 public function __construct($filename, $section = null)
 {
     if (empty($filename)) {
         \Yaf\Exception::trigger_error('Unable to find config file ' . $filename, E_USER_ERROR);
         //throw new Yaf_Config_Exception('Filename is not set');
     }
     if (is_array($filename)) {
         $this->_config = $filename;
     } elseif (is_string($filename)) {
         $iniArray = $this->_loadIniFile($filename);
         if (null === $section) {
             // Load entire file
             $dataArray = array();
             foreach ($iniArray as $sectionName => $sectionData) {
                 if (!is_array($sectionData)) {
                     $dataArray = $this->_arrayMergeRecursive($dataArray, $this->_processKey(array(), $sectionName, $sectionData));
                 } else {
                     $dataArray[$sectionName] = $this->_processSection($iniArray, $sectionName);
                 }
             }
             parent::__construct($dataArray, true);
         } else {
             // Load one or more sections
             if (!is_array($section)) {
                 $section = array($section);
             }
             $dataArray = array();
             foreach ($section as $sectionName) {
                 if (!isset($iniArray[$sectionName])) {
                     throw new Exception("There is no section '{$sectionName}' in '{$filename}'");
                 }
                 $dataArray = $this->_arrayMergeRecursive($this->_processSection($iniArray, $sectionName), $dataArray);
             }
             parent::__construct($dataArray, true);
         }
     } else {
         throw new \Yaf\Exception\TypeError('Invalid parameters provided, must be path of ini file');
     }
 }
 /**
  * The Transfer-Encoding general-header field indicates what (if any) type
  * of transformation has been applied to the message body in order to
  * safely transfer it between the sender and the recipient. This differs
  * from the content-coding in that the transfer-coding is a property of
  * the message, not of the entity.
  *
  * If multiple encodings have been applied to an entity,
  * the transfer- codings MUST be listed in the order in which they were
  * applied. Additional information about the encoding parameters MAY be
  * provided by other entity-header fields not defined by this
  * specification.
  *
  * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
  *
  * @param  string     $transfer_encoding
  */
 public function __construct($transfer_encoding = 'chunked')
 {
     parent::__construct('Transfer-Encoding', $transfer_encoding);
 }
Esempio n. 5
0
 /**
  *
  * @param  string     $response
  */
 public function __construct($response = null)
 {
     parent::__construct('response', $response);
 }
Esempio n. 6
0
 /**
  *
  * @param  string     $message
  */
 public function __construct($message)
 {
     parent::__construct('message', $message);
 }
Esempio n. 7
0
 protected function __construct($registry)
 {
     $this->setPage('register');
     parent::__construct($registry);
 }
Esempio n. 8
0
 /**
  *
  * @param  string     $errors
  */
 public function __construct(array $errors = array())
 {
     parent::__construct('errors', $errors);
 }
Esempio n. 9
0
 public function __construct()
 {
     parent::__construct();
 }
Esempio n. 10
0
 public function __construct($options)
 {
     parent::__construct($options);
     $this->setJs(preg_replace('/%msSearchable%/', (int) $this->msSearchable, $this->js));
 }
Esempio n. 11
0
 /**
  *
  * @param  int     $code
  */
 public function __construct($code)
 {
     parent::__construct('code', $code);
 }
Esempio n. 12
0
 protected function __construct($registry, $settingsId = 0)
 {
     $this->setPage('checkout');
     $this->_settingsId = $settingsId;
     parent::__construct($registry);
 }