Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom tmp dir is not respected #264

Closed
esler opened this issue Feb 17, 2018 · 2 comments
Closed

Custom tmp dir is not respected #264

esler opened this issue Feb 17, 2018 · 2 comments

Comments

@esler
Copy link

esler commented Feb 17, 2018

Hello,
I need to create all tmp files into "non-standard" tmp folder, but options given to constructor are created to standard tmp dir.

Following test will not pass

<?php
    public function testThatTmpDirIsSetupBeforeCreatingTmpFile()
    {
        mkdir($tmpDir = realpath(sys_get_temp_dir()) . DIRECTORY_SEPARATOR . uniqid());

        $pdf = new Pdf(array(
            'tmpDir' => $tmpDir,
            'header-html' => "<p>I'm a content</p>",
        ));

        $this->assertInstanceOf('mikehaertl\tmp\File', $pdf->getOptions()['header-html']);
        $this->assertEquals($tmpDir, dirname($pdf->getOptions()['header-html']));
    }
@mikehaertl
Copy link
Owner

@esler I've modified your fix and the tests a little. Can you check if this also works for you?

@mikehaertl
Copy link
Owner

Fixed in 2.3.1. Thanks for you help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants