Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Data Fields
Locales Class Reference

Public Member Functions

 __construct (CurlTransport $transport)
 
 getList ($type=self::TYPE_ALL)
 

Data Fields

const TYPE_ALL = 'all'
 
const TYPE_DEPLOYED = 'deployed'
 
const URL = 'dev/tests/functional/utils/locales.php'
 

Detailed Description

Returns array of locales depends on fetching type.

Definition at line 14 of file Locales.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( CurlTransport  $transport)
Parameters
CurlTransport$transportCurl transport protocol

Definition at line 41 of file Locales.php.

42  {
43  $this->transport = $transport;
44  }

Member Function Documentation

◆ getList()

getList (   $type = self::TYPE_ALL)

Returns array of locales depends on fetching type.

Parameters
string$typelocales fetching type
Returns
array of locale codes, for example: ['en_US', 'fr_FR']

Definition at line 52 of file Locales.php.

53  {
54  $url = $_ENV['app_frontend_url'] . self::URL . '?type=' . $type;
55  $curl = $this->transport;
56  $curl->write($url, [], CurlInterface::GET);
57  $result = $curl->read();
58  $curl->close();
59 
60  return explode('|', $result);
61  }
$type
Definition: item.phtml:13

Field Documentation

◆ TYPE_ALL

const TYPE_ALL = 'all'

Type key for fetching all configuration locales.

Definition at line 19 of file Locales.php.

◆ TYPE_DEPLOYED

const TYPE_DEPLOYED = 'deployed'

Type key for fetching locales that have deployed static content.

Definition at line 24 of file Locales.php.

◆ URL

const URL = 'dev/tests/functional/utils/locales.php'

Url to locales.php.

Definition at line 29 of file Locales.php.


The documentation for this class was generated from the following file: