-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API Update API to suit its status as its own module #1
Merged
emteknetnz
merged 2 commits into
silverstripe:1
from
creative-commoners:pulls/1/new-repo
Nov 5, 2024
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# For more information about the properties used in | ||
# this file, please see the EditorConfig documentation: | ||
# http://editorconfig.org/ | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 4 | ||
indent_style = space | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[*.{yml,js,json,css,scss,eslintrc,feature}] | ||
indent_size = 2 | ||
indent_style = space | ||
|
||
[composer.json] | ||
indent_size = 4 | ||
|
||
# Don't perform any clean-up on thirdparty files | ||
|
||
[thirdparty/**] | ||
trim_trailing_whitespace = false | ||
insert_final_newline = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/tests/php export-ignore | ||
/.tx export-ignore | ||
/.gitattributes export-ignore | ||
/.gitignore export-ignore | ||
/.github export-ignore | ||
/*.dist export-ignore | ||
/phpcs.xml.dist export-ignore | ||
/.editorconfig export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
ci: | ||
uses: silverstripe/gha-ci/.github/workflows/ci.yml@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/vendor/ | ||
composer.lock | ||
silverstripe-cache/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"name": "silverstripe/template-engine", | ||
"description": "Template engine for rendering templates in Silverstripe CMS projects", | ||
"type": "silverstripe-vendormodule", | ||
"license": "BSD-3-Clause", | ||
"authors": [ | ||
{ | ||
"name": "Silverstripe", | ||
"homepage": "https://silverstripe.com" | ||
}, | ||
{ | ||
"name": "The Silverstripe Community", | ||
"homepage": "https://silverstripe.org" | ||
} | ||
], | ||
"require": { | ||
"php": "^8.3", | ||
"silverstripe/framework": "^6" | ||
}, | ||
"require-dev": { | ||
"silverstripe/recipe-testing": "^4", | ||
"silverstripe/standards": "^1", | ||
"squizlabs/php_codesniffer": "^3", | ||
"phpstan/extension-installer": "^1.3" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"SilverStripe\\TemplateEngine\\": "src/", | ||
"SilverStripe\\TemplateEngine\\Tests\\": "tests/php/" | ||
} | ||
}, | ||
"minimum-stability": "dev", | ||
"prefer-stable": true, | ||
"config": { | ||
"allow-plugins": { | ||
"dealerdirect/phpcodesniffer-composer-installer": true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ruleset name="SilverStripe"> | ||
<description>CodeSniffer ruleset for SilverStripe coding conventions.</description> | ||
|
||
<file>src</file> | ||
<file>tests</file> | ||
|
||
<!-- Show progress and output sniff names on violation, and add colours --> | ||
<arg value="p" /> | ||
<arg name="colors" /> | ||
<arg value="s" /> | ||
|
||
<!-- base rules are PSR-12 --> | ||
<rule ref="PSR12" > | ||
<!-- Current exclusions --> | ||
<exclude name="PSR1.Methods.CamelCapsMethodName" /> | ||
</rule> | ||
|
||
<!-- PHP-PEG generated file not intended for human consumption --> | ||
<exclude-pattern>*/SSTemplateParser.php$</exclude-pattern> | ||
</ruleset> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
parameters: | ||
paths: | ||
- src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit bootstrap="vendor/silverstripe/framework/tests/bootstrap.php" colors="true"> | ||
<testsuites> | ||
<testsuite name="Default"> | ||
<directory>tests/php</directory> | ||
</testsuite> | ||
</testsuites> | ||
</phpunit> |
4 changes: 2 additions & 2 deletions
4
src/SSViewer_BasicIteratorSupport.php → src/BasicIteratorSupport.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,29 +9,25 @@ parser. | |
It gets run through the php-peg parser compiler to have those comments turned into code that match parts of the | ||
template language, producing the executable version SSTemplateParser.php | ||
|
||
To recompile after changing this file, run this from the 'framework/View' directory via command line (in most cases | ||
this is: framework/src/View): | ||
To recompile after changing this file, run this from the 'src' directory via command line: | ||
|
||
php ../../thirdparty/php-peg/cli.php SSTemplateParser.peg > SSTemplateParser.php | ||
php ../thirdparty/php-peg/cli.php SSTemplateParser.peg > SSTemplateParser.php | ||
|
||
See the php-peg docs for more information on the parser format, and how to convert this file into SSTemplateParser.php | ||
|
||
This comment will not appear in the output | ||
*/ | ||
|
||
namespace SilverStripe\View; | ||
namespace SilverStripe\TemplateEngine; | ||
|
||
use SilverStripe\Core\Injector\Injector; | ||
use Parser; | ||
use InvalidArgumentException; | ||
use SilverStripe\TemplateEngine\Exception\SSTemplateParseException; | ||
|
||
// We want this to work when run by hand too | ||
if (defined('THIRDPARTY_PATH')) { | ||
require_once(THIRDPARTY_PATH . '/php-peg/Parser.php'); | ||
} else { | ||
$base = dirname(__FILE__); | ||
require_once($base.'/../thirdparty/php-peg/Parser.php'); | ||
} | ||
// Make sure to include the base parser code | ||
$base = dirname(__FILE__); | ||
require_once($base.'/../thirdparty/php-peg/Parser.php'); | ||
Comment on lines
-29
to
+30
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That const was pointing to the |
||
|
||
/** | ||
* This is the parser for the SilverStripe template language. It gets called on a string and uses a php-peg parser | ||
|
@@ -936,7 +932,7 @@ class SSTemplateParser extends Parser implements TemplateParser | |
$arguments = $res['arguments']; | ||
|
||
// Note: 'type' here is important to disable subTemplates in SSTemplateEngine::getSubtemplateFor() | ||
$res['php'] = '$val .= \\SilverStripe\\View\\SSTemplateEngine::execute_template([["type" => "Includes", '.$template.'], '.$template.'], $scope->getCurrentItem(), [' . | ||
$res['php'] = '$val .= \\SilverStripe\\TemplateEngine\\SSTemplateEngine::execute_template([["type" => "Includes", '.$template.'], '.$template.'], $scope->getCurrentItem(), [' . | ||
implode(',', $arguments)."], \$scope, true);\n"; | ||
|
||
if ($this->includeDebuggingComments) { // Add include filename comments on dev sites | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing
SSViewer_
prefix from any classes in this repo. They don't have anything to do withSSViewer
anymore.