Code Monkey home page Code Monkey logo

file's People

Contributors

hywan avatar jubianchi avatar metalaka avatar shulard avatar stephpy avatar vonglasow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

file's Issues

fclose(): 16442 is not a valid stream resource

In wallabag we are using RulerZ to implement custom rule for auto-tagging.

Everything works great until few days ago (we really don't know why) when a failing test occurs in a particular environment (PHP 5.6 & PostgreSQL).
It doesn't happend in any other version of PHP and any other SGBD. And we aren't able to reproduce it in our local env with the same versions ๐Ÿ˜ž

Here is the failing build: https://travis-ci.org/wallabag/wallabag/jobs/174123711 (and here are other builds in context: https://travis-ci.org/wallabag/wallabag/builds/174008567).

For an unknown reason, closing a stream on __destruct is making the build to fail.

The test is checking that a particular operator isn't available (length is this case, see here).

Here is the plain stack trace :

[1] InvalidArgumentException: fclose(): 16442 is not a valid stream resource
    at n/a
        in /home/travis/build/wallabag/wallabag/vendor/hoa/file/File.php line 244

    at fclose(\'Resource id #16442\')
        in /home/travis/build/wallabag/wallabag/vendor/hoa/file/File.php line 244

    at Hoa\\File\\File->_close()
        in /home/travis/build/wallabag/wallabag/vendor/hoa/stream/Stream.php line 316

    at Hoa\\Stream\\Stream->close()
        in /home/travis/build/wallabag/wallabag/vendor/hoa/stream/Stream.php line 628

    at Hoa\\Stream\\Stream->__destruct()
        in /home/travis/build/wallabag/wallabag/vendor/symfony/symfony/src/Symfony/Component/Form/Util/OrderedHashMap.php line 164

    at Symfony\\Component\\Form\\Util\\OrderedHashMap->getIterator()
        in /home/travis/build/wallabag/wallabag/vendor/symfony/symfony/src/Symfony/Component/Form/Util/OrderedHashMap.php line 164

    at Symfony\\Component\\Form\\Util\\OrderedHashMap->getIterator()
        in  line 

    at IteratorIterator->__construct(object(OrderedHashMap))
        in /home/travis/build/wallabag/wallabag/vendor/symfony/symfony/src/Symfony/Component/Form/Form.php line 383

    at Symfony\\Component\\Form\\Form->setData(object(Config))
        in /home/travis/build/wallabag/wallabag/vendor/symfony/symfony/src/Symfony/Component/Form/Form.php line 477

    at Symfony\\Component\\Form\\Form->initialize()
        in /home/travis/build/wallabag/wallabag/vendor/symfony/symfony/src/Symfony/Component/Form/FormBuilder.php line 226

    at Symfony\\Component\\Form\\FormBuilder->getForm()
        in /home/travis/build/wallabag/wallabag/vendor/symfony/symfony/src/Symfony/Component/Form/FormFactory.php line 39

    at Symfony\\Component\\Form\\FormFactory->create(\'Wallabag\\CoreBundle\\Form\\Type\\RssType\', object(Config), array(\'action\' => \'/config#set2\'))
        in /home/travis/build/wallabag/wallabag/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php line 309

    at Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller->createForm(\'Wallabag\\CoreBundle\\Form\\Type\\RssType\', object(Config), array(\'action\' => \'/config#set2\'))
        in /home/travis/build/wallabag/wallabag/src/Wallabag/CoreBundle/Controller/ConfigController.php line 92

    at Wallabag\\CoreBundle\\Controller\\ConfigController->indexAction(object(Request))
        in  line 

    at call_user_func_array(array(object(ConfigController), \'indexAction\'), array(object(Request)))
        in /home/travis/build/wallabag/wallabag/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php line 153

    at Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw(object(Request), \'1\')
        in /home/travis/build/wallabag/wallabag/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php line 68

    at Symfony\\Component\\HttpKernel\\HttpKernel->handle(object(Request), \'1\', true)
        in /home/travis/build/wallabag/wallabag/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php line 169

    at Symfony\\Component\\HttpKernel\\Kernel->handle(object(Request))
        in /home/travis/build/wallabag/wallabag/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Client.php line 79

    at Symfony\\Component\\HttpKernel\\Client->doRequest(object(Request))
        in /home/travis/build/wallabag/wallabag/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Client.php line 131

    at Symfony\\Bundle\\FrameworkBundle\\Client->doRequest(object(Request))
        in /home/travis/build/wallabag/wallabag/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Client.php line 315

    at Symfony\\Component\\BrowserKit\\Client->request(\'GET\', \'/config\')
        in /home/travis/build/wallabag/wallabag/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php line 500

    at Tests\\Wallabag\\CoreBundle\\Controller\\ConfigControllerTest->testTaggingRuleCreationFail(array(\'tagging_rule[rule]\' => \'length(domainName) <= 42\', \'tagging_rule[tags]\' => \'cool tag\'), array(\'The operator\', \'does not exist.\'))
        in  line 

    at ReflectionMethod->invokeArgs(object(ConfigControllerTest), array(array(\'tagging_rule[rule]\' => \'length(domainName) <= 42\', \'tagging_rule[tags]\' => \'cool tag\'), array(\'The operator\', \'does not exist.\')))
        in /home/travis/build/wallabag/wallabag/vendor/phpunit/phpunit/src/Framework/TestCase.php line 1103

    at PHPUnit_Framework_TestCase->runTest()
        in /home/travis/build/wallabag/wallabag/vendor/phpunit/phpunit/src/Framework/TestCase.php line 954

    at PHPUnit_Framework_TestCase->runBare()
        in /home/travis/build/wallabag/wallabag/vendor/phpunit/phpunit/src/Framework/TestResult.php line 701

    at PHPUnit_Framework_TestResult->run(object(ConfigControllerTest))
        in /home/travis/build/wallabag/wallabag/vendor/phpunit/phpunit/src/Framework/TestCase.php line 909

    at PHPUnit_Framework_TestCase->run(object(PHPUnit_Framework_TestResult))
        in /home/travis/build/wallabag/wallabag/vendor/phpunit/phpunit/src/Framework/TestSuite.php line 753

    at PHPUnit_Framework_TestSuite->run(object(PHPUnit_Framework_TestResult))
        in /home/travis/build/wallabag/wallabag/vendor/phpunit/phpunit/src/Framework/TestSuite.php line 753

    at PHPUnit_Framework_TestSuite->run(object(PHPUnit_Framework_TestResult))
        in /home/travis/build/wallabag/wallabag/vendor/phpunit/phpunit/src/Framework/TestSuite.php line 753

    at PHPUnit_Framework_TestSuite->run(object(PHPUnit_Framework_TestResult))
        in /home/travis/build/wallabag/wallabag/vendor/phpunit/phpunit/src/TextUI/TestRunner.php line 465

    at PHPUnit_TextUI_TestRunner->doRun(object(PHPUnit_Framework_TestSuite), array(\'listGroups\' => false, \'loader\' => null, \'useDefaultConfiguration\' => true, \'verbose\' => true, \'testSuffixes\' => array(\'Test.php\', \'.phpt\'), \'configuration\' => \'/home/travis/build/wallabag/wallabag/phpunit.xml.dist\'))
        in phar:///home/travis/.phpenv/versions/5.6.5/bin/phpunit/phpunit/TextUI/Command.php line 152

    at PHPUnit_TextUI_Command->run(array(\'/home/travis/.phpenv/versions/5.6/bin/phpunit\', \'-v\'), true)
        in phar:///home/travis/.phpenv/versions/5.6.5/bin/phpunit/phpunit/TextUI/Command.php line 104

    at PHPUnit_TextUI_Command::main()
        in /home/travis/.phpenv/versions/5.6.5/bin/phpunit line 722

I've really now idea why a stream is opened when we create a form ... but it seems to fail when closing it.
Did you ever encountered that issue?

I was thinking of a fix in Stream.php on line 626:

    public function __destruct()
    {
+       if (false === $this->isOpened()) {
+           return;
+       }

        $this->close();
        return;
    }

What do you think?

Glob support in the finder

It would be great to support Hoa\Iterator\Glob in the finder.

The strategy would be the following: If we find a glob pattern (*, {a,b,c} etc.) when computing paths in the Finder::getIterator method, then we compute a Hoa\Iterator\Glob object to embed this path.

Thoughts @hoaproject/hoackers?

No README

Problem:
I was looking for a Composer package that allows you to create file from a template, and I came across https://packagist.org/packages/hoa/file. I was surprised that this package has a huge download count but there is no README OR any documentation for this package. This documentation https://hoa-project.net/En/Literature/Hack/File.html is not working.

Any newbie wouldn't be able to know what it does, other than just a vague idea that it does something with files.

Propsosed resolution:
This Composer package would be more helpful if there is a good documentation. Because,


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.