<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
- <component name="PublishConfigData" remoteFilesAllowedToDisappearOnAutoupload="false">
+ <component name="PublishConfigData" autoUpload="Always" serverName="workshop.fluidbook.com" remoteFilesAllowedToDisappearOnAutoupload="false" autoUploadExternalChanges="true">
<serverData>
<paths name="apps.fluidbook.com">
<serverdata>
<paths name="workshop.fluidbook.com">
<serverdata>
<mappings>
- <mapping local="$PROJECT_DIR$" web="/" />
+ <mapping deploy="/vendor/cubist/matomo" local="$PROJECT_DIR$" web="/" />
</mappings>
+ <excludedPaths>
+ <excludedPath local="true" path="$PROJECT_DIR$/vendor" />
+ </excludedPaths>
</serverdata>
</paths>
<paths name="www.adangelis.com">
</serverdata>
</paths>
</serverData>
+ <option name="myAutoUpload" value="ALWAYS" />
</component>
</project>
\ No newline at end of file
*/
protected $client;
+ /**
+ * @var null|array
+ */
+ protected $_allSites = null;
+
public function __construct($baseURL, $token)
{
$this->token = $token;
$this->client = new Client(['base_uri' => $baseURL]);
}
- protected function getAllSites()
+ /**
+ * @return array
+ */
+ public function getAllSites()
{
- $allSites = $this->_apicall('SitesManager.getAllSites');
- print_r($allSites);
+ if (null === $this->_allSites) {
+ $a = $this->_apicall('SitesManager.getAllSites');
+ $this->_allSites = [];
+ foreach ($a as $item) {
+ $this->_allSites[$item['idsite']] = $item;
+ }
+ }
+ return $this->_allSites;
}
public function getSiteIdByURL($url)
{
-
+ return $this->_apicall('SitesManager.getSitesIdFromSiteUrl',['url'=>$url]);
}
$default = [
'method' => $method,
'module' => 'API',
- 'token' => $this->token,
+ 'token_auth' => $this->token,
'format' => 'JSON'
];
$defaultOptions = ['query' => array_merge($default, $params)];
- $response = $this->client->get(null, array_merge($defaultOptions, $options));
- return json_decode($response->getBody()->getContents());
+ $response = $this->client->get('/', array_merge($defaultOptions, $options));
+ return json_decode($response->getBody()->getContents(), true);
}
}
\ No newline at end of file