Skip to content

Allow to use as vendor in custom project #30

@kmajzlik

Description

@kmajzlik

I have Symfony project and i would like to implement this in Symfony route. Not really easy now.

This is where i am now and it works (except of assets which can be symlinked) relative good. But all header links are pointing to /index.php?....
Workaround can be to create own class which extends "App" and use own getDefaultTemplateVariables() fuction.

<?php

namespace App\Controller;

use Clickalicious\Memcached\Client;
use Clickalicious\PhpMemAdmin\App;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

class MemcacheController extends AbstractController
{

    /**
     * @Route(
     *   "/memcache",
     *   name = "memcache"
     * );
     */
    public function memcachePage(Request $request)
    {
        define(
            'CLICKALICIOUS_PHPMEMADMIN_BASE_PATH',
            '/var/www/vendor/clickalicious/phpMemAdmin/'
        );

        $config_path = '../vendor/clickalicious/phpMemAdmin/app/.config.dist';
        $config = json_decode(file_get_contents($config_path));
        $config->cluster->hosts[0]->host = 'memcached';
        $config->render->auto = false;

        $client = new Client();
        $memcache = new App($config, $client);

        return new Response($memcache->render($_SERVER['SCRIPT_NAME'], $_GET));
    }

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions