-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathScaleStatus.php
34 lines (29 loc) · 1.06 KB
/
ScaleStatus.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
// This example application requires the Windows Azure SDK for PHP, which can be downloaded here: http://phpazure.codeplex.com/
require_once 'Microsoft\WindowsAzure\Storage\Table.php';
include_once 'storageConfig.php';
// This Windows Azure SDK for PHP maps this class to a table of the same name.
class ScaleStatus extends Microsoft_WindowsAzure_Storage_TableEntity
{
/**
* @azure statusmessage
*/
public $statusmessage;
function __construct()
{
$this->_partitionKey = date("mdY");
$this->_rowKey = trim(com_create_guid(), "{}");
}
function send()
{
// If a Microsoft_WindowsAzure_Storage_Table clients are created with no parameters, the Storage Emulator will be used.
if(PROD_SITE)
$tableStorageClient = new Microsoft_WindowsAzure_Storage_Table('table.core.windows.net', STORAGE_ACCOUNT_NAME, STORAGE_ACCOUNT_KEY);
else
$tableStorageClient = new Microsoft_WindowsAzure_Storage_Table();
// Send message.
$tableStorageClient->createTableIfNotExists(STATUS_TABLE);
$tableStorageClient->insertEntity(STATUS_TABLE, $this);
}
}
?>