Servant

Initialization

initialize($json = null)

Getters

actions()
$servant->constants()->actions()
array (
  'site' => 'site',
  'error' => 'error',
)
contentTypes()
$servant->constants()->contentTypes()
array (
  'txt' => 'text/plain',
  'text' => 'text/plain',
  'csv' => 'text/csv',
  'markdown' => 'text/x-markdown',
  'html' => 'text/html',
  'xhtml' => 'application/xhtml+xml',
  'js' => 'application/javascript',
  'json' => 'application/json',
  'css' => 'text/css',
  'xml' => 'text/xml',
  'rss' => 'application/rss+xml',
  'soap' => 'application/soap+xml',
  'atom' => 'application/atom+xml',
  'pdf' => 'application/pdf',
  'zip' => 'application/zip',
  'ico' => 'image/x-icon',
  'gif' => 'image/gif',
  'jpg' => 'image/jpeg',
  'png' => 'image/png',
  'svg' => 'image/svg+xml',
  'tif' => 'image/tiff',
  'ogg' => 'application/ogg',
  'mp3' => 'audio/mpeg',
  'mpg' => 'video/mpeg',
  'eot' => 'application/vnd.ms-fontobject',
  'otf' => 'font/otf',
  'ttf' => 'font/ttf',
  'woff' => 'font/x-woff',
)
defaults()
$servant->constants()->defaults()
array (
  'action' => 'site',
  'browserCache' => '12*60',
  'contentType' => 'html',
  'language' => 'en',
  'serverCache' => '7*24*60',
  'siteName' => 'Home',
  'status' => 200,
  'template' => 'html',
)
formats()
$servant->constants()->formats()
array (
  'iconImages' => 
  array (
    0 => 'ico',
    1 => 'png',
    2 => 'gif',
    3 => 'jpg',
  ),
  'templates' => 
  array (
    'haml' => 
    array (
      0 => 'haml',
    ),
    'html' => 
    array (
      0 => 'html',
      1 => 'xhtml',
    ),
    'jade' => 
    array (
      0 => 'jade',
      1 => 'jd',
    ),
    'markdown' => 
    array (
      0 => 'md',
      1 => 'markdown',
      2 => 'txt',
      3 => 'text',
    ),
    'php' => 
    array (
      0 => 'php',
      1 => 'ph',
    ),
    'rst' => 
    array (
      0 => 'rst',
    ),
    'textile' => 
    array (
      0 => 'textile',
    ),
    'twig' => 
    array (
      0 => 'twig',
      1 => 'tw',
    ),
    'wiki' => 
    array (
      0 => 'wiki',
    ),
  ),
  'stylesheets' => 
  array (
    'css' => 
    array (
      0 => 'css',
    ),
    'less' => 
    array (
      0 => 'less',
    ),
    'scss' => 
    array (
      0 => 'scss',
    ),
  ),
  'scripts' => 
  array (
    'js' => 
    array (
      0 => 'js',
    ),
  ),
  'settings' => 
  array (
    'json' => 
    array (
      0 => 'json',
    ),
  ),
)
namingConvention()
$servant->constants()->namingConvention()
array (
  '-' => ' ',
  '+' => ' ',
  '_' => ' ',
)
patterns()
$servant->constants()->patterns()
array (
  'base64' => '^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$',
  'contentType' => '#^[-\\w]+/[-\\w]+$#',
  'safename' => '/\\A[a-z0-9]*\\z/',
  'filename' => '/\\A[a-z0-9\\-\\_\\.]*\\z/i',
  'path' => '/\\A[a-z0-9\\-\\_\\/]*\\z/i',
  'filepath' => '/\\A[a-z0-9\\-\\_\\/\\.]*\\z/i',
  'url' => '|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i',
  'email' => '/^[^0-9][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[@][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[.][a-zA-Z]{2,4}$/',
  'ip' => '^([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])$',
)
statuses()
$servant->constants()->statuses()
array (
  100 => '100 Continue',
  101 => '101 Switching Protocols',
  102 => '102 Processing',
  200 => '200 OK',
  201 => '201 Created',
  202 => '202 Accepted',
  203 => '203 Non-Authoritative Information',
  204 => '204 No Content',
  205 => '205 Reset Content',
  206 => '206 Partial Content',
  207 => '207 Multi-Status',
  208 => '208 Already Reported',
  250 => '250 Low on Storage Space',
  226 => '226 IM Used',
  300 => '300 Multiple Choices',
  301 => '301 Moved Permanently',
  302 => '302 Found',
  303 => '303 See Other',
  304 => '304 Not Modified',
  305 => '305 Use Proxy',
  306 => '306 Switch Proxy',
  307 => '307 Temporary Redirect',
  308 => '308 Permanent Redirect',
  400 => '400 Bad Request',
  401 => '401 Unauthorized',
  402 => '402 Payment Required',
  403 => '403 Forbidden',
  404 => '404 Not Found',
  405 => '405 Method Not Allowed',
  406 => '406 Not Acceptable',
  407 => '407 Proxy Authentication Required',
  408 => '408 Request Timeout',
  409 => '409 Conflict',
  410 => '410 Gone',
  411 => '411 Length Required',
  412 => '412 Precondition Failed',
  413 => '413 Request Entity Too Large',
  414 => '414 Request-URI Too Long',
  415 => '415 Unsupported Media Type',
  416 => '416 Requested Range Not Satisfiable',
  417 => '417 Expectation Failed',
  418 => '418 I\'m a teapot',
  420 => '420 Enhance Your Calm',
  422 => '422 Unprocessable Entity',
  423 => '423 Locked',
  424 => '424 Method Failure',
  425 => '425 Unordered Collection',
  426 => '426 Upgrade Required',
  428 => '428 Precondition Required',
  429 => '429 Too Many Requests',
  431 => '431 Request Header Fields Too Large',
  444 => '444 No Response',
  449 => '449 Retry With',
  450 => '450 Blocked by Windows Parental Controls',
  451 => '451 Redirect',
  452 => '452 Conference Not Found',
  453 => '453 Not Enough Bandwidth',
  454 => '454 Session Not Found',
  455 => '455 Method Not Valid in This State',
  456 => '456 Header Field Not Valid for Resource',
  457 => '457 Invalid Range',
  458 => '458 Parameter Is Read-Only',
  459 => '459 Aggregate Operation Not Allowed',
  460 => '460 Only Aggregate Operation Allowed',
  461 => '461 Unsupported Transport',
  462 => '462 Destination Unreachable',
  494 => '494 Request Header Too Large',
  495 => '495 Cert Error',
  496 => '496 No Cert',
  497 => '497 HTTP to HTTPS',
  499 => '499 Client Closed Request',
  500 => '500 Internal Server Error',
  501 => '501 Not Implemented',
  502 => '502 Bad Gateway',
  503 => '503 Service Unavailable',
  504 => '504 Gateway Timeout',
  505 => '505 HTTP Version Not Supported',
  506 => '506 Variant Also Negotiates',
  507 => '507 Insufficient Storage',
  508 => '508 Loop Detected',
  509 => '509 Bandwidth Limit Exceeded',
  510 => '510 Not Extended',
  511 => '511 Network Authentication Required',
  551 => '551 Option not supported',
  598 => '598 Network read timeout error',
  599 => '599 Network connect timeout error',
)