Autodoc
  • Namespace
  • Class
  • Tree

Namespaces

  • BlueTihi
    • Context
  • Brickrouge
    • Element
      • Nodes
    • Renderer
    • Widget
  • ICanBoogie
    • ActiveRecord
    • AutoConfig
    • CLDR
    • Composer
    • Core
    • Event
    • Exception
    • HTTP
      • Dispatcher
      • Request
    • I18n
      • Translator
    • Mailer
    • Modules
      • Taxonomy
        • Support
      • Thumbnailer
        • Versions
    • Object
    • Operation
      • Dispatcher
    • Prototype
    • Routes
    • Routing
      • Dispatcher
    • Session
  • Icybee
    • ActiveRecord
      • Model
    • ConfigOperation
    • Document
    • EditBlock
    • Element
      • ActionbarContextual
      • ActionbarSearch
      • ActionbarToolbar
    • FormBlock
    • Installer
    • ManageBlock
    • Modules
      • Articles
      • Cache
        • Collection
        • ManageBlock
      • Comments
        • ManageBlock
      • Contents
        • ManageBlock
      • Dashboard
      • Editor
        • Collection
      • Files
        • File
        • ManageBlock
      • Forms
        • Form
        • ManageBlock
      • I18n
      • Images
        • ManageBlock
      • Members
      • Modules
        • ManageBlock
      • Nodes
        • ManageBlock
        • Module
      • Pages
        • BreadcrumbElement
        • LanguagesElement
        • ManageBlock
        • NavigationBranchElement
        • NavigationElement
        • Page
        • PageController
      • Registry
      • Search
      • Seo
      • Sites
        • ManageBlock
      • Taxonomy
        • Terms
          • ManageBlock
        • Vocabulary
          • ManageBlock
      • Users
        • ManageBlock
        • NonceLogin
        • Roles
      • Views
        • ActiveRecordProvider
        • Collection
        • View
    • Operation
      • ActiveRecord
      • Constructor
      • Module
      • Widget
    • Rendering
  • None
  • Patron
  • PHP

Classes

  • CacheControlHeader
  • CallableDispatcher
  • ContentDispositionHeader
  • ContentTypeHeader
  • DateHeader
  • Dispatcher
  • File
  • FileList
  • Header
  • HeaderParameter
  • Headers
  • Helpers
  • RedirectResponse
  • Request
  • Response
  • WeightedDispatcher

Interfaces

  • IDispatcher

Exceptions

  • ForceRedirect
  • HTTPError
  • MethodNotSupported
  • NotFound
  • ServiceUnavailable
  • StatusCodeNotValid

Functions

  • dispatch
  • get_dispatcher
  • get_initial_request
 1 <?php
 2 
 3 /*
 4  * This file is part of the ICanBoogie package.
 5  *
 6  * (c) Olivier Laviale <olivier.laviale@gmail.com>
 7  *
 8  * For the full copyright and license information, please view the LICENSE
 9  * file that was distributed with this source code.
10  */
11 
12 namespace ICanBoogie\HTTP;
13 
14 /**
15  * A date time object that renders into a string formatted for HTTP header fields.
16  *
17  * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1
18  */
19 class DateHeader extends \ICanBoogie\DateTime
20 {
21     static public function from($source, $timezone=null)
22     {
23         if ($source === null)
24         {
25             return static::none();
26         }
27 
28         return parent::from($source, $timezone);
29     }
30 
31     /**
32      * Returns a new {@link DateHeader} object.
33      *
34      * @param string|int|\DateTime $time If time is provided as a numeric value it is used as
35      * "@{$time}" and the time zone is set to UTC.
36      * @param \DateTimeZone|string $timezone A {@link \DateTimeZone} object representing the desired
37      * time zone. If the time zone is empty `utc` is used instead.
38      */
39     public function __construct($time='now', $timezone=null)
40     {
41         if ($time instanceof \DateTime)
42         {
43             $time = $time->getTimestamp();
44         }
45 
46         if (is_numeric($time))
47         {
48             $time = '@' . $time;
49             $timezone = null;
50         }
51 
52         parent::__construct($time, $timezone ?: 'utc');
53     }
54 
55     /**
56      * Formats the instance according to the RFC 1123.
57      */
58     public function __toString()
59     {
60         return $this->is_empty ? '' : $this->utc->as_rfc1123;
61     }
62 }
Autodoc API documentation generated by ApiGen 2.8.0