Skip to content

Commit 70a4830

Browse files
authored
Merge pull request #25 from contentstack/feature/live-preview
Feature/live preview
2 parents 7191eb4 + 6411685 commit 70a4830

File tree

16 files changed

+136
-36
lines changed

16 files changed

+136
-36
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ test/ImageTransformreport.html
1313
examples/index.php
1414
.DS_Store
1515
tmp/
16+
test/result.json
1617
stdout

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11

22
## CHANGELOG
33
------------------------------------------------
4+
## Version 2.1.0
5+
###### Date: 29-Oct-2021
6+
### New Feature
7+
- Live Preview feature support added
8+
- Content branching feature support added
9+
------------------------------------------------
410

511
## Version 2.0.0
612
###### Date: 02-Apr-2021

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2012-2020 Contentstack (http://app.contentstack.com). All Rights Reserved
3+
Copyright (c) 2012-2021 Contentstack (http://app.contentstack.com). All Rights Reserved
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

src/Config/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @package Contentstack
99
* @author Uttam K Ukkoji <[email protected]>
1010
* @author Rohit Mishra <[email protected]>
11-
* @copyright 2012-2020 Contentstack. All Rights Reserved
11+
* @copyright 2012-2021 Contentstack. All Rights Reserved
1212
* @license https://github.com/contentstack/contentstack-php/blob/master/LICENSE.txt MIT Licence
1313
* @link https://pear.php.net/package/contentstack
1414
* */

src/Contentstack.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @package Contentstack
99
* @author Uttam K Ukkoji <[email protected]>
1010
* @author Rohit Mishra <[email protected]>
11-
* @copyright 2012-2020 Contentstack. All Rights Reserved
11+
* @copyright 2012-2021 Contentstack. All Rights Reserved
1212
* @license https://github.com/contentstack/contentstack-php/blob/master/LICENSE.txt MIT Licence
1313
* @link https://pear.php.net/package/contentstack
1414
*/
@@ -26,7 +26,7 @@
2626
* @package Contentstack
2727
* @author Uttam K Ukkoji <[email protected]>
2828
* @author Rohit Mishra <[email protected]>
29-
* @copyright 2012-2020 Contentstack. All Rights Reserved
29+
* @copyright 2012-2021 Contentstack. All Rights Reserved
3030
* @license https://github.com/contentstack/contentstack-php/blob/master/LICENSE.txt MIT Licence
3131
* @link https://pear.php.net/package/contentstack
3232
*/
@@ -46,7 +46,7 @@ abstract class Contentstack
4646
public static function Stack($api_key = '',
4747
$access_token = '',
4848
$environment = '',
49-
$config = array('region'=> '')
49+
$config = array('region'=> '', 'branch'=> '', 'live_preview' => array('enable' => false, 'host' => 'api.contentstack.io'))
5050
) {
5151
return new Stack($api_key, $access_token, $environment, $config);
5252
}

src/ContentstackRegion.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @package Contentstack
99
* @author Uttam K Ukkoji <[email protected]>
1010
* @author Rohit Mishra <[email protected]>
11-
* @copyright 2012-2020 Contentstack. All Rights Reserved
11+
* @copyright 2012-2021 Contentstack. All Rights Reserved
1212
* @license https://github.com/contentstack/contentstack-php/blob/master/LICENSE.txt MIT Licence
1313
* @link https://pear.php.net/package/contentstack
1414
* */
@@ -21,7 +21,7 @@
2121
* @package Contentstack
2222
* @author Uttam K Ukkoji <[email protected]>
2323
* @author Rohit Mishra <[email protected]>
24-
* @copyright 2012-2020 Contentstack. All Rights Reserved
24+
* @copyright 2012-2021 Contentstack. All Rights Reserved
2525
* @license https://github.com/contentstack/contentstack-php/blob/master/LICENSE.txt MIT Licence
2626
* @link https://pear.php.net/package/contentstack
2727
* */

src/Error/CSException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* @package Contentstack
1010
* @author Uttam K Ukkoji <[email protected]>
1111
* @author Rohit Mishra <[email protected]>
12-
* @copyright 2012-2020 Contentstack. All Rights Reserved
12+
* @copyright 2012-2021 Contentstack. All Rights Reserved
1313
* @license https://github.com/contentstack/contentstack-php/blob/master/LICENSE.txt MIT Licence
1414
* @link https://pear.php.net/package/contentstack
1515
* */
@@ -24,7 +24,7 @@
2424
* @package Contentstack
2525
* @author Uttam K Ukkoji <[email protected]>
2626
* @author Rohit Mishra <[email protected]>
27-
* @copyright 2012-2020 Contentstack. All Rights Reserved
27+
* @copyright 2012-2021 Contentstack. All Rights Reserved
2828
* @license https://github.com/contentstack/contentstack-php/blob/master/LICENSE.txt MIT Licence
2929
* @link https://pear.php.net/package/contentstack
3030
* */

src/Stack/Assets.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* @package Contentstack
1111
* @author Uttam K Ukkoji <[email protected]>
1212
* @author Rohit Mishra <[email protected]>
13-
* @copyright 2012-2020 Contentstack. All Rights Reserved
13+
* @copyright 2012-2021 Contentstack. All Rights Reserved
1414
* @license https://github.com/contentstack/contentstack-php/blob/master/LICENSE.txt MIT Licence
1515
* @link https://pear.php.net/package/contentstack
1616
* */
@@ -31,7 +31,7 @@
3131
* @package Contentstack
3232
* @author Uttam K Ukkoji <[email protected]>
3333
* @author Rohit Mishra <[email protected]>
34-
* @copyright 2012-2020 Contentstack. All Rights Reserved
34+
* @copyright 2012-2021 Contentstack. All Rights Reserved
3535
* @license https://github.com/contentstack/contentstack-php/blob/master/LICENSE.txt MIT Licence
3636
* @link https://pear.php.net/package/contentstack
3737
* */

src/Stack/BaseQuery.php

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* @package Contentstack
1010
* @author Uttam K Ukkoji <[email protected]>
1111
* @author Rohit Mishra <[email protected]>
12-
* @copyright 2012-2020 Contentstack. All Rights Reserved
12+
* @copyright 2012-2021 Contentstack. All Rights Reserved
1313
* @license https://github.com/contentstack/contentstack-php/blob/master/LICENSE.txt MIT Licence
1414
* @link https://pear.php.net/package/contentstack
1515
* */
@@ -27,7 +27,7 @@
2727
* @package Contentstack
2828
* @author Uttam K Ukkoji <[email protected]>
2929
* @author Rohit Mishra <[email protected]>
30-
* @copyright 2012-2020 Contentstack. All Rights Reserved
30+
* @copyright 2012-2021 Contentstack. All Rights Reserved
3131
* @license https://github.com/contentstack/contentstack-php/blob/master/LICENSE.txt MIT Licence
3232
* @link https://pear.php.net/package/contentstack
3333
* */
@@ -143,6 +143,7 @@ public function includeReference($field_uids = array())
143143
/**
144144
* To search the given string in the entries
145145
*
146+
* @deprecated since verion 2.2.0
146147
* @param $search - string to be search in entries
147148
*
148149
* @return Query
@@ -307,6 +308,23 @@ public function includeFallback()
307308

308309
return $this->queryObject;
309310
}
311+
312+
/**
313+
* To include branch of publish content.
314+
*
315+
* @return Query
316+
*/
317+
public function includeBranch()
318+
{
319+
$this->queryObject->_query = call_user_func(
320+
'contentstackAddBoolean',
321+
'include_branch',
322+
$this->queryObject->_query
323+
);
324+
325+
return $this->queryObject;
326+
}
327+
310328
/**
311329
* To include schema along with entries
312330
*

src/Stack/ContentType.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* @package Contentstack
1111
* @author Uttam K Ukkoji <[email protected]>
1212
* @author Rohit Mishra <[email protected]>
13-
* @copyright 2012-2020 Contentstack. All Rights Reserved
13+
* @copyright 2012-2021 Contentstack. All Rights Reserved
1414
* @license https://github.com/contentstack/contentstack-php/blob/master/LICENSE.txt MIT Licence
1515
* @link https://pear.php.net/package/contentstack
1616
* */
@@ -27,7 +27,7 @@
2727
* @package Contentstack
2828
* @author Uttam K Ukkoji <[email protected]>
2929
* @author Rohit Mishra <[email protected]>
30-
* @copyright 2012-2020 Contentstack. All Rights Reserved
30+
* @copyright 2012-2021 Contentstack. All Rights Reserved
3131
* @license https://github.com/contentstack/contentstack-php/blob/master/LICENSE.txt MIT Licence
3232
* @link https://pear.php.net/package/contentstack
3333
* */

0 commit comments

Comments
 (0)