致命错误:未捕获错误:Class' String'用php7在cakephp-2.2.0项目中找不到

时间:2018-04-22 00:18:29

标签: php cakephp cakephp-2.3

致命错误:未捕获错误:类'字符串'在带有php7的cakephp-2.2.0项目中找不到

Project是用php-5编写的,现在系统有php-7。

完整错误:

Fatal error: Uncaught Error: Class 'String' not found in /var/www/html/allblog/lib/Cake/Model/Datasource/DboSource.php:2298 Stack trace: #0 /var/www/html/allblog/lib/Cake/Model/Datasource/DboSource.php(1050): DboSource->fields(Object(Post), 'Post', 'COUNT(*) AS `co...') #1 /var/www/html/allblog/lib/Cake/Model/Model.php(2631): DboSource->read(Object(Post), Array) #2 /var/www/html/allblog/lib/Cake/Controller/Component/PaginatorComponent.php(185): Model->find('count', Array) #3 /var/www/html/allblog/lib/Cake/Controller/Controller.php(1082): PaginatorComponent->paginate(Object(Post), Array, Array) #4 /var/www/html/allblog/app/Controller/AppController.php(66): Controller->paginate('Post') #5 /var/www/html/allblog/lib/Cake/Controller/CakeErrorController.php(74): AppController->beforeRender() #6 /var/www/html/allblog/lib/Cake/Event/CakeEventManager.php(246): CakeErrorController->beforeRender(Object(CakeEvent)) #7 /var/www/html/allblog/lib/Cake/Controller/Controller.php(922): CakeEventManager->dispatch(Object(CakeEvent)) #8 /var/ in /var/www/html/allblog/lib/Cake/Model/Datasource/DboSource.php on line 2298

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

使用Sub SalesProgress14() ' ' 14 Day Sales Chase Loop ' 'Dim Answer As VbMsgBoxResult 'Answer = MsgBox("Are you sure you want to run?", vbYesNo, "Run Macro") 'If Answer = vbYes Then Dim i As Integer, Mail_Object, Email_Subject, o As Variant, lr As Long lr = Cells(Rows.Count, "A").End(xlUp).Row Dim saledate As String Set Mail_Object = CreateObject("Outlook.Application") For i = 2 To lr With Mail_Object.CreateItem(o) .Subject = "Sales Chase" & Range("S" & i).Value & " " & Range("U" & i).Value & " " & Range("G" & i).Value .To = "test@test.com" .Body = Range("S" & i).Value & " " & Range("U" & i).Value & " " & Range("G" & i).Value '.display ' Our data below saledate = Range("F" & i).Value ' Send logic If DateDiff("d", saledate, Date) Mod 14 = 0 Then .Send If saledate = Date - 7 Then .Send End With Next i 'MsgBox "E-mails successfully sent", 64 'Application.DisplayAlerts = False Set Mail_Object = Nothing ' The End If below relates to the run yes or no box 'End If End Sub 而不是。

  建议使用

,因为它提供与PHP7和HHVM的兼容性。

请参阅:https://book.cakephp.org/2.0/en/core-utility-libraries/string.html