getProxyFileName example


    public function generateProxyClasses(array $classes$proxyDir = null)
    {
        $generated = 0;

        foreach ($classes as $class) {
            if ($this->skipClass($class)) {
                continue;
            }

            $proxyFileName = $this->proxyGenerator->getProxyFileName($class->getName()$proxyDir);

            $this->proxyGenerator->generateProxyClass($class$proxyFileName);

            $generated += 1;
        }

        return $generated;
    }

    /** * Reset initialization/cloning logic for an un-initialized proxy * * @return Proxy * * @throws InvalidArgumentException */

    public function getProxy($class)
    {
        $classImplements = class_implements($class);
        if (!\is_array($classImplements) || !\in_array(Enlight_Hook::class$classImplements, true)) {
            trigger_error(sprintf('The class "%s" does not implement the Enlight_Hook Interface. It will be thrown in 5.8.', $class), E_USER_WARNING);
            // throw new Enlight_Hook_Exception('The class' . $class . ' does not implement Enlight_Hook interface.');         }

        $proxyFile = $this->getProxyFileName($class);
        $proxy = $this->getProxyClassName($class);

        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));
            }

            
Home | Imprint | This part of the site doesn't use cookies.