Oroboros Core
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo

Namespaces

  • None
  • oroboros
    • core
      • abstracts
        • adapters
        • bootstrap
        • controllers
        • libraries
          • auth
          • bootstrap
          • cache
          • codex
          • config
          • container
          • data
          • database
          • dns
          • entity
          • enum
          • error
          • event
          • extension
          • file
          • flags
          • hooks
          • job
          • logger
          • manager
          • message
          • prototype
          • request
          • response
          • routine
          • shell
          • startup
          • stream
          • template
          • uri
          • utility
          • validation
            • workers
          • worker
        • models
        • patterns
          • behavioral
          • creational
        • utilities
          • exception
            • cache
            • container
          • http
        • views
      • interfaces
        • adapters
          • interpreters
          • sdk
        • api
          • adapters
          • bootstrap
          • controllers
          • psr
        • contract
          • adapters
          • bootstrap
          • codex
          • components
          • controllers
          • data
          • entities
          • errors
          • events
          • extensions
          • jobs
          • libraries
            • auth
            • cache
            • config
            • container
            • enum
            • file
            • flags
            • hooks
            • module
            • promise
            • record
            • request
            • response
            • server
            • shutdown
            • site
            • stream
            • template
            • theme
            • uri
          • models
          • patterns
            • behavioral
            • concurrency
            • creational
            • structural
          • routes
          • routines
            • bootload
            • declarative
            • procedural
            • subsystem
          • services
            • consumer
              • cgi
              • rest
                • local
                • remote
                  • authenticated
                  • unauthenticated
            • provider
              • cgi
              • rest
                • local
                • remote
                  • authenticated
                  • unauthenticated
          • utilities
            • datetime
            • exception
              • cache
              • container
            • filebase
            • http
            • math
            • parser
            • regex
            • session
          • views
        • enumerated
          • environment
          • flags
          • http
          • views
        • libraries
          • manager
          • worker
      • libraries
        • api
        • codex
        • container
        • enum
          • http
        • file
        • hooks
        • logger
        • math
        • psr4
        • request
        • response
        • stream
        • uri
      • patterns
        • creational
      • traits
        • adapters
        • bootstrap
        • codex
        • components
        • controllers
        • data
        • entities
        • events
        • extensions
        • jobs
        • libraries
          • container
          • file
          • request
          • response
          • stream
          • uri
        • models
        • modules
        • patterns
          • behavioral
          • concurrency
          • creational
          • structural
        • routes
        • services
        • utilities
          • core
            • api
            • config
            • contract
              • contract
            • enum
            • environment
            • routines
          • datetime
          • error
          • exception
          • filebase
          • hooks
          • html
          • http
          • logic
          • math
          • parsers
          • regex
          • session
        • views
      • utilities
        • exception
          • cache
          • container
        • http
      • views
    • tests
      • patterns
        • creational
      • psr
        • psr7
      • utilities
        • exception
  • PasswordCompat
    • binary
  • PHP

Interfaces

  • FileContract
  • UploadedFileContract

Interface FileContract


Contract interfaces enforce expected behavior in a non-colliding way. They are tasked with enforcing methods, and extending interfaces provided by standards and other packages for compatibility.

All valid oroboros classes MUST extend at

least one Contract Interface to be considered valid.

oroboros\core\interfaces\contract\libraries\file\FileContract implements oroboros\core\interfaces\contract\libraries\LibraryContract

Direct known implementers

oroboros\core\abstracts\libraries\file\AbstractFile

Indirect known implementers

oroboros\core\libraries\file\File

Namespace: oroboros\core\interfaces\contract\libraries\file
Package: oroboros\core\file
Category: contract-interfaces
License: The MIT License (MIT)
Author: Brian Dayhoff mopsyd@me.com
Version: 0.2.4-alpha
Since: 0.2.4-alpha
Link: bitbucket.org/oroborosframework/oroboros-core/wiki/development/api/contract_interface.md
Located at core/interfaces/contract/libraries/file/FileContract.php

Methods summary

public
# __construct( string $file = null, string $type = null, string $temp_alias = null )

This constructor should accept three optional parameters, $file, $path, and $type. All three are optional.

The object MUST NOT automatically initialize unless $file is provided.

The object MUST NOT be considered functionally useable unless initialized.

The object MAY provide an internal mechanism for initialization that is protected.

If $file is passed, it MUST represent the string name of the fully qualified filepath, or a string name of a resource pointer that can be directly used to create a resource to the file.

If $type is supplied, it MUST represent either a file extension or mime type that corresponds to the file name. This value MUST only be used to identify the file type, and MUST NOT be used to build a path to the actual file, which prevents temp files that do not have extensions from accidentally not being identified on disk.

If $type is not supplied, it SHOULD be attempted to determine based on $file as an extension if it exists, and MUST default to binary if it cannot be determined to maximize portability.

If $temp_alias is supplied, the file MUST be renamed to this name if it is retained or moved from the temp directory to another location and no other name for it is provided. This only applies if it is actually a temp file, and otherwise this parameter has no effect, even if provided.

The object should interpret the file as a temp file if it's directory corresponds to the runtime value of: \oroboros\core\interfaces\enumerated\environment\CoreEnvironmentInterface::TEMP_DIRECTORY, which will determine the fully qualified location of the system temp directory at runtime if not overridden manually. This value will be false if it is not set or is not readable and writeable.

If any arguments cannot be determined, this method MUST throw a RuntimeException that implements \oroboros\core\interfaces\contract\utilities\exception\ExceptionContract either directly or indirectly.

Parameters

$file
(optional)
$type
(optional)
$temp_alias
(optional)
Oroboros Core API documentation generated by ApiGen