mongofill / mongofill-hhvm

A mix of the original Mongofill extension + BSON implementation in C++
MIT License
32 stars 19 forks source link

MongoCursorException can't loaded #29

Closed shumkov closed 9 years ago

shumkov commented 9 years ago

I'm build mongofill-hhvm as extension, and install PHPUnit via composer.

If Mongo send error response, then in this line start to working autoloader for looking MongoCursorException class:

    [message":protected] => "File not found: MongoCursorException.php"
    [string":"Exception":private] => ""
    [code":protected] => 2
    [file":protected] => "/usr/local/www/geometria/vendor/bombayworks/zendframework1/library/Zend/Loader.php"
    [line":protected] => 134
    [trace":"Exception":private] => Array
        (
            [0] => Array
                (
                    [file] => "/usr/local/www/geometria/vendor/bombayworks/zendframework1/library/Zend/Loader.php"
                    [line] => 134
                    [function] => "handleError"
                    [class] => "PHPUnit_Util_ErrorHandler"
                    [type] => "::"
                    [args] => Array
                        (
                            [0] => 2
                            [1] => "File not found: MongoCursorException.php"
                            [2] => "/usr/local/www/geometria/vendor/bombayworks/zendframework1/library/Zend/Loader.php"
                            [3] => 134
                        )

                )

            [1] => Array
                (
                    [file] => "/usr/local/www/geometria/vendor/bombayworks/zendframework1/library/Zend/Loader.php"
                    [line] => 82
                    [function] => "loadFile"
                    [class] => "Zend_Loader"
                    [type] => "::"
                    [args] => Array
                        (
                            [0] => "MongoCursorException.php"
                            [1] => null
                            [2] => true
                        )

                )

            [2] => Array
                (
                    [file] => "/usr/local/www/geometria/vendor/bombayworks/zendframework1/library/Zend/Loader/Autoloader.php"
                    [line] => 479
                    [function] => "loadClass"
                    [class] => "Zend_Loader"
                    [type] => "::"
                    [args] => Array
                        (
                            [0] => "MongoCursorException"
                        )

                )

            [3] => Array
                (
                    [file] => "/usr/local/www/geometria/vendor/bombayworks/zendframework1/library/Zend/Loader/Autoloader.php"
                    [line] => 124
                    [function] => "_autoload"
                    [class] => "Zend_Loader_Autoloader"
                    [type] => "->"
                    [args] => Array
                        (
                            [0] => "MongoCursorException"
                        )

                )

            [4] => Array
                (
                    [function] => "autoload"
                    [class] => "Zend_Loader_Autoloader"
                    [type] => "::"
                    [args] => Array
                        (
                            [0] => "MongoCursorException"
                        )

                )

            [5] => Array
                (
                    [function] => "throwExceptionIfError"
                    [class] => "Mongofill\\Socket"
                    [type] => "->"
                    [args] => Array
                        (
                            [0] => Array
                                (
                                    [err] => "Cannot apply \$addToSet modifier to non-array"
                                    [code] => 12591
                                    [n] => 0
                                    [connectionId] => 99
                                    [ok] => 1
                                )

                        )

                )

            [6] => Array
                (
                    [function] => "getMessage"
                    [class] => "Mongofill\\Socket"
                    [type] => "->"
                    [args] => Array
                        (
                            [0] => 1523
                            [1] => 30000
                        )

                )
...

This mean that MongoCursorException not in extenstion. What's wrong?

giboow commented 9 years ago

I've the same problem ..

berryfl commented 9 years ago

I have a similar problem, that MongoConnectionException is not found. And I looked at the merged file src/ext_mongo.php during the ./build.sh script, I found MongoException is defined after MongoConnectionException.

So, I rearranged the order in file, comment out merge process in ./build.sh, then rerun ./build.sh. And it works for me.

mcuadros commented 9 years ago

closing due to inactivity