writeProxyClass example

if (!is_readable($proxyFile)) {
            if (!file_exists($this->proxyDir)) {
                if (!mkdir($concurrentDirectory = $this->proxyDir) && !is_dir($concurrentDirectory)) {
                    throw new \RuntimeException(sprintf('Directory "%s" was not created', $concurrentDirectory));
                }
            }
            if (!is_writable($this->proxyDir)) {
                throw new \RuntimeException(sprintf('The directory "%s" is not writable.', $this->proxyDir));
            }

            $content = $this->generateProxyClass($class);
            $this->writeProxyClass($proxyFile$content);
        } elseif (!method_exists($proxy, 'executeParent')) {
            @unlink($proxyFile);
        }

        return $proxy;
    }

    /** * Returns proxy class name * * @param string $class * * @return string */
Home | Imprint | This part of the site doesn't use cookies.