-
Notifications
You must be signed in to change notification settings - Fork 98
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
Smarty::addPluginsDir()
は非推奨になったため、Smarty::registerPlugin()
を使用するよう修正
#946
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
8399b9f
Smarty::addPluginsDir は非推奨なので registerPlugin に変更
nanasess c5cc4d7
mobile テンプレートは廃止されたため非推奨
nanasess 1445b48
Add array_key_exists to Smarty modifier
nanasess 443dd2d
Fix deprecated: Using ${var} in strings is deprecated, use {$var} ins…
nanasess f998023
remove require
nanasess a51220e
Add README.md
nanasess 0b4bd9c
Merge branch 'master' into replace-addPluginsDir
nanasess 0ccc3c6
Merge branch 'master' into replace-addPluginsDir
nanasess c29b977
Merge branch 'master' into replace-addPluginsDir
nanasess d1202bd
SC_View.php に設定を追加する旨を追記
nanasess 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
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
## このディレクトリのファイルは composer.json の autoload.classmap.files に登録することで利用可能です | ||
|
||
1. [composer.json](../../composer.json) の autoload.classmap.files に登録します。 | ||
|
||
``` json | ||
"autoload": { | ||
"classmap": [ | ||
"data/class", | ||
"data/class_extends" | ||
], | ||
"files": [ | ||
"data/smarty_extends/function.from_to.php", | ||
"data/smarty_extends/function.include_php_ex.php", | ||
"data/smarty_extends/modifier.h.php", | ||
"data/smarty_extends/modifier.n2s.php", | ||
"data/smarty_extends/modifier.nl2br_html.php", | ||
"data/smarty_extends/modifier.script_escape.php", | ||
"data/smarty_extends/modifier.u.php" | ||
] | ||
} | ||
``` | ||
2. [SC_View.php](../class/SC_View.php) のコンストラクタに modifier を設定します。 | ||
```diff | ||
--- a/data/class/SC_View.php | ||
+++ b/data/class/SC_View.php | ||
@@ -54,7 +54,13 @@ public function init() | ||
$this->_smarty->registerPlugin('modifier', 'sfMultiply', array('SC_Utils_Ex', 'sfMultiply')); | ||
$this->_smarty->registerPlugin('modifier', 'sfRmDupSlash', array('SC_Utils_Ex', 'sfRmDupSlash')); | ||
$this->_smarty->registerPlugin('modifier', 'sfCutString', array('SC_Utils_Ex', 'sfCutString')); | ||
- $this->_smarty->addPluginsDir(array('plugins', realpath(dirname(__FILE__)) . '/../smarty_extends')); | ||
+ $this->_smarty->registerPlugin('function', 'from_to', 'smarty_function_from_to'); | ||
+ $this->_smarty->registerPlugin('function', 'include_php_ex', 'smarty_function_include_php_ex'); | ||
+ $this->_smarty->registerPlugin('modifier', 'h', 'smarty_modifier_h'); | ||
+ $this->_smarty->registerPlugin('modifier', 'n2s', 'smarty_modifier_n2s'); | ||
+ $this->_smarty->registerPlugin('modifier', 'nl2br_html', 'smarty_modifier_nl2br_html'); | ||
+ $this->_smarty->registerPlugin('modifier', 'script_escape', 'smarty_modifier_script_escape'); | ||
+ $this->_smarty->registerPlugin('modifier', 'u', 'smarty_modifier_u'); | ||
$this->_smarty->registerPlugin('modifier', 'sfMbConvertEncoding', array('SC_Utils_Ex', 'sfMbConvertEncoding')); | ||
$this->_smarty->registerPlugin('modifier', 'sfGetEnabled', array('SC_Utils_Ex', 'sfGetEnabled')); | ||
$this->_smarty->registerPlugin('modifier', 'sfNoImageMainList', array('SC_Utils_Ex', 'sfNoImageMainList')); | ||
``` | ||
3. composer dump-autoload コマンドを実行することで autoload の対象となります。 | ||
``` shell | ||
composer dump-autoload | ||
``` |
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
<?php | ||
require 'data/smarty_extends/modifier.script_escape.php'; | ||
|
||
/** | ||
* (省略。アノテーションを認識されるのに必要なようなので記述している。) | ||
|
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.
data/class/SC_View.php への追記についても言及した方が良さそうに思いますが、いかがでしょうか?
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.
ありがとうございます。こちらも記載しておきますね
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.
@seasoftjapan 対応しました!