CacheClearerService.php
private function createTemporaryFile($user, $opcode)
    {
        if (!is_dir($this->webDir)) {
            throw new \InvalidArgumentException(sprintf('Web dir does not exist "%s"', $this->webDir));
        }

        if (!is_writable($this->webDir)) {
            throw new \InvalidArgumentException(sprintf('Web dir is not writable "%s"', $this->webDir));
        }

        $filename = sprintf('%s/%s', $this->webDir, 'apc-'.md5(uniqid().mt_rand(0, 9999999).php_uname()).'.php');
        $contents = strtr($this->template, array(
            '%clearer_code%' => file_get_contents(__DIR__.'/AcceleratorCacheClearer.php'),
            '%user%' => var_export($user, true),
            '%opcode%' => var_export($opcode, true),
        ));

        if (false === $handle = fopen($filename, 'w+')) {
            throw new \RuntimeException(sprintf('Can\'t open "%s"', $filename));
        }

        fwrite($handle, $contents);
        fclose($handle);

        return $filename;
    }
private function createTemporaryFile($user, $opcode)
    {
        if (!is_dir($this->webDir)) {
            throw new \InvalidArgumentException(sprintf('Web dir does not exist "%s"', $this->webDir));
        }

        if (!is_writable($this->webDir)) {
            throw new \InvalidArgumentException(sprintf('Web dir is not writable "%s"', $this->webDir));
        }

        $filename = sprintf('%s/%s', $this->webDir, 'apc-'.md5(uniqid().mt_rand(0, 9999999).php_uname()).'.php');
        $contents = strtr($this->template, array(
            '%clearer_code%' => file_get_contents(__DIR__.'/AcceleratorCacheClearer.php'),
            '%user%' => var_export($user, true),
            '%opcode%' => var_export($opcode, true),
        ));

        if (false === $handle = fopen($filename, 'w+')) {
            throw new \RuntimeException(sprintf('Can\'t open "%s"', $filename));
        }

        fwrite($handle, $contents);
        fclose($handle);

        return $filename;
    }
private function createTemporaryFile ( $ user , $ opcode ) { if ( ! is_dir ( $ this -> webDir ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Web dir does not exist "%s"' , $ this -> webDir ) ) ; } if ( ! is_writable ( $ this -> webDir ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Web dir is not writable "%s"' , $ this -> webDir ) ) ; } $ filename = sprintf ( '%s/%s' , $ this -> webDir , 'apc-' . md5 ( uniqid ( ) . mt_rand ( 0 , 9999999 ) . php_uname ( ) ) . '.php' ) ; $ contents = strtr ( $ this -> template , array ( '%clearer_code%' => file_get_contents ( __DIR__ . '/AcceleratorCacheClearer.php' ) , '%user%' => var_export ( $ user , true ) , '%opcode%' => var_export ( $ opcode , true ) , ) ) ; if ( false === $ handle = fopen ( $ filename , 'w+' ) ) { throw new \ RuntimeException ( sprintf ( 'Can\'t open "%s"' , $ filename ) ) ; } fwrite ( $ handle , $ contents ) ; fclose ( $ handle ) ; return $ filename ; }
Create the temporary file and return the filename.

@param bool $user
@param bool $opcode

@return string
Create the temporary file and return the filename .