Skip to content

Commit 5c226f2

Browse files
Updated for region bases
1 parent d401401 commit 5c226f2

File tree

13 files changed

+12
-16
lines changed

13 files changed

+12
-16
lines changed

.gitignore

100644100755
File mode changed.

LICENSE.txt

100644100755
File mode changed.

src/config/index.php

100644100755
File mode changed.

src/contentstackregion.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
/*
3+
* Dependency loading
4+
* */
5+
6+
class ContentstackRegion {
7+
const EU= "eu";
8+
const US= "us";
9+
}

src/lib/models/assets.php

100644100755
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,5 @@ public function fetch() {
6363
$this->operation = __FUNCTION__;
6464
return \Contentstack\Utility\contentstackRequest($this, 'asset');
6565
}
66-
67-
6866
}
6967

src/lib/models/contentstackregion.php

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/lib/models/csexception.php

100644100755
File mode changed.

src/lib/models/stack.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77

88
require_once __DIR__."/content_type.php";
99
require_once __DIR__."/assets.php";
10-
//require_once __DIR__."/asset.php";
1110
require_once __DIR__."/../../config/index.php";
12-
require_once __DIR__."/contentstackregion.php";
1311

1412
/*
1513
* Stack Class to initialize the provided parameter Stack
@@ -31,9 +29,8 @@ class Stack {
3129
* */
3230
public function __construct($api_*** = '', $access_token = '', $environment = '', $region = '') {
3331

34-
35-
if($region && $region =="EU") {
36-
$this->host = EU.'-'.HOST;
32+
if($region && $region =="eu" && $region !== "undefined") {
33+
$this->host = $region.'-'.HOST;
3734
}
3835
$this->header = Utility\validateInput('stack', array('api_***' => $api_***, 'access_token' => $access_token, 'environment' => $environment, 'region' => $region));
3936
$this->environment = $this->header['environment'];

test/AssetsTest.php

100644100755
File mode changed.

test/EntriesTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public static function tearDownAfterClass() {
3030
}
3131

3232
public function testFind() {
33+
\Contentstack\Utility\debug(self::$Stack);
3334
$_entries = self::$Stack->ContentType(CT_ContentType)->Query()->toJSON()->find();
3435
$this->assertArrayHasKey(0, $_entries);
3536
$this->assertTrue((count($_entries[0]) === ENTRY_COUNT));

0 commit comments

Comments
 (0)