Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-4970

PHP tutorial doesn't work with Thrift v0.12.0+

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 0.13.0
    • Tutorial
    • None

    Description

      THRIFT-4474 made PSR-4 the default loader, but the tutorial doesn't seem to be updated. It works with neither -gen php nor -gen php:classmap, as follows:

      thrift$ cd tutorial
      thrift/tutorial$ ../compiler/cpp/thrift -r -gen php:server tutorial.thrift
      thrift/tutorial$ php/PhpServer.php
      PHP Fatal error:  Interface 'tutorial\CalculatorIf' not found in /home/sekikn/repos/thrift/tutorial/php/PhpServer.php on line 55
      Fatal error: Interface 'tutorial\CalculatorIf' not found in /home/sekikn/repos/thrift/tutorial/php/PhpServer.php on line 55
      thrift/tutorial$ php/PhpClient.php
      PHP Fatal error:  Uncaught Error: Class 'Thrift\Transport\TSocket' not found in /home/sekikn/repos/thrift/tutorial/php/PhpClient.php:49
      Stack trace:
      #0 {main}
        thrown in /home/sekikn/repos/thrift/tutorial/php/PhpClient.php on line 49
      
      thrift/tutorial$ rm -rf gen-php
      thrift/tutorial$ ../compiler/cpp/thrift -r -gen php:classmap,server tutorial.thrift
      thrift/tutorial$ php/PhpServer.php
      
      PHP Fatal error:  Uncaught Error: Class 'Thrift\Transport\TBufferedTransport' not found in /home/sekikn/repos/thrift/tutorial/php/PhpServer.php:125
      Stack trace:
      #0 {main}
        thrown in /home/sekikn/repos/thrift/tutorial/php/PhpServer.php on line 125
      Fatal error: Uncaught Error: Class 'Thrift\Transport\TBufferedTransport' not found in /home/sekikn/repos/thrift/tutorial/php/PhpServer.php:125
      Stack trace:
      #0 {main}
        thrown in /home/sekikn/repos/thrift/tutorial/php/PhpServer.php on line 125
      thrift/tutorial$ php/PhpClient.php
      PHP Fatal error:  Uncaught Error: Class 'Thrift\Transport\TSocket' not found in /home/sekikn/repos/thrift/tutorial/php/PhpClient.php:49
      Stack trace:
      #0 {main}
        thrown in /home/sekikn/repos/thrift/tutorial/php/PhpClient.php on line 49
      

      Attachments

        Issue Links

          Activity

            People

              sekikn Kengo Seki
              sekikn Kengo Seki
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m