Skip to content

Commit e761c6d

Browse files
committed
sast-scan.yml
1 parent 66338b9 commit e761c6d

File tree

15 files changed

+248
-176
lines changed

15 files changed

+248
-176
lines changed

.github/workflows/sast-scan.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: SAST Scan
2+
on:
3+
pull_request:
4+
types: [opened, synchronize, reopened]
5+
jobs:
6+
security-sast:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- name: Semgrep Scan
11+
run: docker run -v /var/run/docker.sock:/var/run/docker.sock -v "${PWD}:/src" returntocorp/semgrep semgrep scan --config auto

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
## Version 1.6.1
106106
###### Date: 08-May-2020
107107
### Bug
108-
- Stack api *** and access token moved to header
108+
- Stack api key and access token moved to header
109109
------------------------------------------------
110110

111111
## Version 1.6.0

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "Contentstack is a headless CMS with an API-first approach that puts content at the centre. It is designed to simplify the process of publication by separating code from content.",
44
"type": "library",
55
"license": "MIT",
6-
"***words": [
6+
"keywords": [
77
"Contentstack", "api"
88
],
99
"authors": [

composer.lock

Lines changed: 32 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/index.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<html>
2+
<head>
3+
<title>Contentstack PHP SDK</title>
4+
</head>
5+
<body>
6+
<h1>Welcome to Contentstack PHP SDK</h1>
7+
</body>
8+
</html>
9+
<?php
10+
ini_set('display_errors', 'On');
11+
require_once __DIR__ . '/../src/contentstack.php';
12+
13+
use Contentstack\Contentstack;
14+
use Contentstack\Support\Utility;
15+
16+
$stack = Contentstack::Stack('', '', '');
17+
try {
18+
// \Contentstack\Utility\debug($stack);
19+
// $result = $stack->getContentTypes('{"include_snippet_schema": "false"}');
20+
// $result = $stack->ContentType('first_ct')->Query()->toJSON()->find();
21+
// $result = $stack->ContentType('a')->Fetch();
22+
// $result = $stack->ContentType('a')->Query()->includeSchema()->toJSON()->find();
23+
// $result = $stack->ContentType('ctwithallfields')->Query()->addParam('include_dimensions', true)->toJSON()->find();
24+
// $result = $stack->ContentType('a')->Entry('blta07130f8b344b260')->includeContentType()->toJSON()->fetch();
25+
$result = $stack->Assets()->Query()->includeFallback()->toJSON()->find();
26+
//$result = $stack->Assets('blt9b5825dd804a9067')->addParam('include_dimension', 'true')->fetch();
27+
Utility::debug(($result));
28+
29+
} catch(Exception $e) {
30+
echo "Message : ".$e->getMessage(); // returns message -> API -> error_message
31+
echo "Code : ".$e->getCode(); // returns number -> API -> error_code
32+
echo "Errors : ".print_r($e->getErrors()); // returns array -> API -> errors
33+
}

src/Config/index.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
/**
3+
* Constants for the SDK
4+
*
5+
* PHP version 5
6+
*
7+
* @category PHP
8+
* @package Contentstack
9+
* @author Uttam K Ukkoji <[email protected]>
10+
* @author Rohit Mishra <[email protected]>
11+
* @copyright 2012-2021 Contentstack. All Rights Reserved
12+
* @license https://github.com/contentstack/contentstack-php/blob/master/LICENSE.txt MIT Licence
13+
* @link https://pear.php.net/package/contentstack
14+
* */
15+
namespace Contentstack\Config;
16+
17+
// Domain relevant constants
18+
define('HOST', 'cdn.contentstack.io');
19+
define('PROTOCOL', 'https');
20+
define('VERSION', '/v3');
21+
define('PORT', 443);
22+
23+
// URL's relevant constants
24+
define('CONTENT_TYPES', '/content_types/');
25+
define('ENTRIES', '/entries/');
26+
define('ASSETS', '/assets/');
27+
define('ENVIRONMENTS', '/environments/');
28+
define('SYNC', '/stacks/sync/');

0 commit comments

Comments
 (0)