Welcome to mirror list, hosted at ThFree Co, Russian Federation.

CDNService.php « ObjectStore « OpenCloud « lib « php-opencloud « 3rdparty « files_external « apps - github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 132d5f47ad6d6f5e2a7fc12d747c7d9b202e50c2 (plain)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
/**
 * PHP OpenCloud library.
 * 
 * @copyright Copyright 2013 Rackspace US, Inc. See COPYING for licensing information.
 * @license   https://www.apache.org/licenses/LICENSE-2.0 Apache 2.0
 * @version   1.6.0
 * @author    Glen Campbell <glen.campbell@rackspace.com>
 * @author    Jamie Hannaford <jamie.hannaford@rackspace.com>
 */

namespace OpenCloud\ObjectStore;

use OpenCloud\OpenStack;
use OpenCloud\Common\Exceptions;

/**
 * This is the CDN version of the ObjectStore service. 
 */
class CDNService extends AbstractService
{

    /**
     * Creates a new CDNService object.
     *
     * This is a simple wrapper function around the parent Service construct,
     * but supplies defaults for the service type.
     *
     * @param OpenCloud\OpenStack $connection    The connection object
     * @param string              $serviceName   The name of the service
     * @param string              $serviceRegion The service's region
     * @param string              $urlType       The type of URL (normally 'publicURL')
     */
    public function __construct(
        OpenStack $connection,
        $serviceName = RAXSDK_OBJSTORE_NAME,
        $serviceRegion = RAXSDK_OBJSTORE_REGION,
        $urltype = RAXSDK_URL_PUBLIC
    ) {
        $this->getLogger()->info('Initializing CDN Service...');
        
        parent::__construct(
            $connection,
            'rax:object-cdn',
            $serviceName,
            $serviceRegion,
            $urltype
        );
    }

    /**
     * Helps catch errors if someone calls the method on the
     * wrong object
     */
    public function CDN()
    {
        throw new Exceptions\CdnError(
        	'Invalid method call; no CDN() on the CDN object'
        );
    }

}