teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

3

追記

2020/09/25 04:34

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
@@ -36,4 +36,23 @@
36
36
  smartyとPHPのバージョン互換のご指摘をいただいたので、追記いたします。
37
37
  PHP7.3.22
38
38
  smarty2.6.27
39
- [こちらのサイト](https://www.smarty.net/)を確認する限り、バージョンは上げた方が良さそうなので試してみます。
39
+ [こちらのサイト](https://www.smarty.net/)を確認する限り、バージョンは上げた方が良さそうなので試してみます。
40
+ 【追記3】
41
+ smarty2.6.27から3.1.34にアップデートしました。
42
+ ```
43
+ Fatal error: Uncaught Error: Class 'Smarty_Internal_Undefined' not found in
44
+ /var/www/axia/library/Smarty/sysplugins/smarty_internal_extension_handler.php:168 Stack trace: #0
45
+ /var/www/axia/library/Smarty/sysplugins/smarty_internal_extension_handler.php(130): Smarty_Internal_Extension_Handler->__get('get_template_va...') #1
46
+ /var/www/axia/library/Smarty/sysplugins/smarty_internal_data.php(290): Smarty_Internal_Extension_Handler->_callExternalMethod(Object(Smarty), 'get_template_va...', Array) #2
47
+ /var/www/axia/application/library/Zend_View_Smarty.php(341): Smarty_Internal_Data->__call('get_template_va...', Array) #3
48
+ /var/www/axia/application/modules/default/controllers/IndexController.php(30): Zend_View_Smarty->getVar('pageInfo') #4
49
+ /var/www/axia/library/Zend/Controller/Action.php(516): IndexController->indexAction() #5
50
+ /var/www/axia/library/Zend/Controller/Dispatcher/Standard.php(308): Zend_Controller_Action->dispatch('indexAction') #6
51
+ /var/www/axia/library/Zend/Controller/Front.php(955): Zend_Controller_Dispatcher_Standard- in /var/www/axia/library/Smarty/sysplugins/smarty_internal_extension_handler.php on line 168
52
+ // エラー箇所
53
+ 168 return $this->$property_name = new Smarty_Internal_Undefined($class);
54
+ ```
55
+ Smarty_Internal_Undefinedが無いと言われているようですが、アップデート時にクラスファイルは用意されている為、なぜこのエラーが出ているのかが分かっていません。
56
+ 経路を見る限りZend Frameworkも触っているので、Zend Frameworkのバージョンが古い可能性を疑っています。
57
+ 何かお分かりの方、教えていただけますでしょうか。
58
+ Zend Frameworkのバージョンは1.12.0なので、これがPHP7とsmarty3に互換が無いと考えるべきでしょうか。

2

回答に対する追記

2020/09/25 04:34

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
@@ -30,4 +30,10 @@
30
30
  ```
31
31
  preg_replaceをpreg_replace_callbackに変更し、269行目の構文を色々修正しているのですが、おそらく上手くいっていないです。
32
32
  恐れ入りますが、こちらに関しても何かご教授いただけますでしょうか。
33
- よろしくお願いいたします。
33
+ よろしくお願いいたします。
34
+
35
+ 【追記2】
36
+ smartyとPHPのバージョン互換のご指摘をいただいたので、追記いたします。
37
+ PHP7.3.22
38
+ smarty2.6.27
39
+ [こちらのサイト](https://www.smarty.net/)を確認する限り、バージョンは上げた方が良さそうなので試してみます。

1

追記更新

2020/09/24 07:45

投稿

退会済みユーザー
title CHANGED
@@ -1,1 +1,1 @@
1
- PHPの構文エラーについて(syntax error, unexpected ''' (T_CONSTANT_ENCAPSED_STRING) )
1
+ PHPバージョンアップ後の構文エラーについて
body CHANGED
@@ -10,4 +10,24 @@
10
10
  【質問】
11
11
  '''が構文エラーの原因だと思いますが、どのように修正するのが適切か判断が出来ません。
12
12
  恐れ入りますが、ご教授いただけますでしょうか?
13
+ よろしくお願いいたします。
14
+
15
+ 【追記】
16
+ ご回答いただき、提示範囲に問題はないとの事なので、本エラー以前に修正した箇所で問題が発生したと思います。
17
+ ```
18
+ Warning: preg_replace_callback(): Requires argument 2, ''{php' . str_repeat(" ", substr_count('\0', " ")) .'}'', to be a valid callback in
19
+ /var/www/library/Smarty/Smarty_Compiler.class.php on line 272
20
+
21
+ // エラー発生箇所
22
+ 265 /* replace special blocks by "{php}" */
23
+ 266 //$source_content = preg_replace($search.'e', "'"
24
+ 267 $source_content = preg_replace_callback($search.'e', "'"
25
+ 268 . $this->_quote_replace($this->left_delimiter) . 'php'
26
+ 269 . "' . str_repeat(\"\n\", substr_count('\0', \"\n\")) .'"
27
+ 270 . $this->_quote_replace($this->right_delimiter)
28
+ 271 . "'"
29
+ 272 , $source_content);
30
+ ```
31
+ preg_replaceをpreg_replace_callbackに変更し、269行目の構文を色々修正しているのですが、おそらく上手くいっていないです。
32
+ 恐れ入りますが、こちらに関しても何かご教授いただけますでしょうか。
13
33
  よろしくお願いいたします。