/** * Sets the needed static variables * * @return void */ private static function _setStaticVars() { // Gets the instance of the string utilities self::$_str = Woops_String_Utils::getInstance(); // Gets the instance of the string utilities self::$_array = Woops_Array_Utils::getInstance(); // Gets the instance of the file types class self::$_fileTypes = Woops_File_Types::getInstance(); // Gets the instance of the environment object self::$_env = Woops_Core_Env_Getter::getInstance(); // Sets the newline character (CR-LF) self::$_CRLF = self::$_str->CR . self::$_str->LF; // Sets the boundary for multipart/form-data self::$_boundary = 'WOOPS-' . self::$_str->uniqueId(); // Static variables are set self::$_hasStatic = true; }
/** * Gets the unique class instance * * This method is used to get the unique instance of the class * (singleton). If no instance is available, it will create it. * * @return Woops_File_Types The unique instance of the class * @see __construct */ public static function getInstance() { // Checks if the unique instance already exists if (!is_object(self::$_instance)) { // Creates the unique instance self::$_instance = new self(); } // Returns the unique instance return self::$_instance; }