static function executeCompilation( $tpl, &$textElements, $key, &$resourceData,
                                 $rootNamespace, $currentNamespace )
     {
        if ( !eZTemplateCompiler::isCompilationEnabled() )
            return false;
        if ( !eZTemplateCompiler::isExecutionEnabled() )
            return false;
        $cacheFileName = eZTemplateCompiler::compilationFilename( $key, $resourceData );
        $resourceData['use-comments'] = eZTemplateCompiler::isCommentsEnabled();

        $directory = eZTemplateCompiler::compilationDirectory();
        $phpScript = eZDir::path( array( $directory, $cacheFileName ) );
        if ( file_exists( $phpScript ) )
        {
            $text = false;
            $helperStatus = eZTemplateCompiler::executeCompilationHelper( $phpScript, $text,
                                                                          $tpl, $key, $resourceData,
                                                                          $rootNamespace, $currentNamespace );
            if ( $helperStatus )
            {
                $textElements[] = $text;
                return true;
            }
            else
            {
                eZDebug::writeError(
                    "Failed executing compiled template '$phpScript',"
                        . " if this file is valid, then the error is probably"
                        . "  related to APC usage, try restarting the webserver",
                    __METHOD__
                );
                throw new eZTemplateFailedExecutingCompiledTemplate(
                    "Failed executing a compiled template, see error.log for details"
                );
            }
        }
        else
            eZDebug::writeError( "Unknown compiled template '$phpScript'", __METHOD__ );
        return false;
    }