gajus / xhprof.io

GUI to analyze the profiling data collected using XHProf – A Hierarchical Profiler for PHP.
http://xhprof.io/
Other
429 stars 103 forks source link

allow to inject the css/js path #25

Closed timglabisch closed 11 years ago

timglabisch commented 11 years ago

this allows to change the js / css path using the config

for example...

$config = array (
            'base_url'      => '...',
            'pdo'           => '...,'
            'template' => array(
                'base_path' => array(
                    'css' => '..../vendors/xhprofio/public/css/',
                    'js' => '..../vendors/xhprofio/public/js/',
                )
            )
        );

        require_once __DIR__.'/../vendors/xhprofio/index.php';
gajus commented 11 years ago

Hello Tim, What is the intended use for this? Custom CSS/JS should be implemented at the browser level. If there are any errors in the existing code, those should be reported.

timglabisch commented 11 years ago

here is an example use case ... http://www.pimcore.org/resources/extensions/detail/Pimxhprof

one click (cms) integration for xhprof.io using the existing (database/css/js/...) structure.

gajus commented 11 years ago

Why did you put these settings in the template variable (index.php) rather than config? I assume they are used to customise individual XHProf.io instance, in which case they'd go to config.inc.php.

timglabisch commented 11 years ago

i think the base css / js path are about the template, but i think it's not wrong if you use the config for this purpose. i merge the config with the template ... $config['template'] => $template .... because in my opinion it's the "template configuration" part of the config.

this allows you to overwrite all default template variables, like titles, paths, ...

https://github.com/gajus/xhprof.io/pull/25/files#L0R19

gajus commented 11 years ago

This has been implemented in @c6f78fbe620bdb77561a0abafe13512aee09392c. Though, I did not allow defining individual paths for different types of assets. Doing so would add unnecessary complexity to the config file. Whoever is about to mess with the static assets will not have much problem simply copying all of the existing assets to the new directory or settings up an alias path for the missing files.