Coder Social home page Coder Social logo

laminas / laminas-developer-tools Goto Github PK

View Code? Open in Web Editor NEW
23.0 19.0 13.0 950 KB

Module for developer and debug tools for use with laminas-mvc applications.

License: BSD 3-Clause "New" or "Revised" License

PHP 68.49% HTML 24.21% CSS 4.23% JavaScript 3.07%
developer-tools debug-tools mvc-application

laminas-developer-tools's Introduction

Laminas Developer Tools

Build Status type-coverage Psalm level

🇷🇺 Русским гражданам

Мы, участники Laminas, родились и живем в разных странах. У многих из нас есть друзья, родственники и коллеги как в России, так и в Украине. Некоторые из нас родились в России. Некоторые из нас живут в России. У некоторых бабушки и дедушки сражались с фашистами во Второй мировой войне. Здесь никто не поддерживает фашизм.

У одного из нас есть украинская родственница, которая спаслась из дома вместе с сыном. Поезд задержался из-за бомбежки на дороге впереди. У нас есть друзья, которые прячутся в бомбоубежищах. Мы с тревогой ждем весточки от них после воздушных налетов, которые беспорядочно наносят удары и попадают по больницам, школам, детским садам и домам. Мы не берем это из каких-либо СМИ. Мы наблюдаем это напрямую.

Вы доверяете нам достаточно, чтоб использовать наши программы, и мы просим вас довериться нам вновь. Мы нуждаемся в помощи. Выходите и протестуйте против этой бесполезной войны. Остановите кровопролитие. Скажите "Нет войне!"

🇺🇸 To Citizens of Russia

We at Laminas come from all over the world. Many of us have friends, family and colleagues in both Russia and Ukraine. Some of us were born in Russia. Some of us currently live in Russia. Some have grandparents who fought Nazis in World War II. Nobody here supports fascism.

One team member has a Ukrainian relative who fled her home with her son. The train was delayed due to bombing on the road ahead. We have friends who are hiding in bomb shelters. We anxiously follow up on them after the air raids, which indiscriminately fire at hospitals, schools, kindergartens and houses. We're not taking this from any media. These are our actual experiences.

You trust us enough to use our software. We ask that you trust us to say the truth on this. We need your help. Go out and protest this unnecessary war. Stop the bloodshed. Say "stop the war!"

Module providing debug tools for use with laminas-mvc applications.

Installation

  1. Install the module via composer by running:

    $ composer require --dev laminas/laminas-developer-tools

    or download it directly from github and place it in your application's module/ directory.

  2. Add the Laminas\\DeveloperTools module to the module section of your config/application.config.php. Starting with version 1.1.0, if you are using laminas-component-installer, this will be done for you automatically.

  3. Copy ./vendor/laminas/laminas-developer-tools/config/laminas-developer-tools.local.php.dist to ./config/autoload/laminas-developer-tools.local.php. Change any settings in it according to your needs.

Extensions

laminas-developer-tools's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laminas-developer-tools's Issues

PHP 8.0 support

Feature Request

Q A
New Feature yes

Summary

To be prepared for the december release of PHP 8.0, this repository has some additional TODOs to be tested against the new major version.

In order to make this repository compatible, one has to follow these steps:

  • Modify composer.json to provide support for PHP 8.0 by adding the constraint ~8.0.0
  • Modify composer.json to drop support for PHP less than 7.3
  • Modify composer.json to implement phpunit 9.3 which supports PHP 7.3+
  • Modify .travis.yml to ignore platform requirements when installing composer dependencies (simply add --ignore-platform-reqs to COMPOSER_ARGS env variable)
  • Modify .travis.yml to add PHP 8.0 to the matrix (NOTE: Do not allow failures as PHP 8.0 has a feature freeze since 2020-08-04!)
  • Modify source code in case there are incompatibilities with PHP 8.0

Page for background-collection

this PR sets up a page, where you can view former collected toolbar entries by accessing the route /zdt-background-reque.

Known Bugs:

  • It’s ugly
  • If you scroll to the page’s bottom, it’s horrible to read the bar’s content
  • it uses a very high amount of memory

Missing:

  • Tests
  • Some cookie-stuff to assign and filter the requests (that’s, what the :uuid in the route is for)
  • A way to cleanup the cache
  • Review

Originally posted by @Blaimi at zendframework/zend-developer-tools#211

Feature: CSS Markup

Would it be possible to add all the CSS Markup into a CSS File so that when you view the source in a browser you don't have to scroll to find your code?

Right now I have to scroll past all the ZDT CSS Markup in the source to look at my own source and it can be quite annoying at times.


Originally posted by @diemuzi at zendframework/zend-developer-tools#118

Uncaught exception 'Exception' with message 'Serialization of 'Closure' is not allowed'

in the application config ,i have a route its type is 'Zend\Mvc\Router\Http\Chain', this type need a parameter 'route_plugins', so i new it in the application config.
but in the \Zend\Mvc\Router\RoutePluginManager, the initializer propery store some closures. so when the application config is serialized, the error happend.

i think we need a method named makeObjectProperySerializable in the class Collector\ConfigCollector


Originally posted by @h3110w0r1d at zendframework/zend-developer-tools#153

Tooltip in icons to show info or show title

I believe a good addition to ZendDeveloperTools, is to add a tooltip so that when you mouse over any icon or information, it displays information about what that is talking (or title of that information).
Presented the ZendDeveloper for some friends, but they felt a bit of trouble to use, because they do not know what were some of the information displayed.

zenddeveloper1

If the hover, it showed the title of that information, the example below, I think it would be easier for anyone to notice. And this extender title display all items in this wonderful bar.

zenddeveloper2


Originally posted by @apiweb at zendframework/zend-developer-tools#137

DeveloperTools fatal error when using named Adapters

Bug Report

Summary

I was using named Adapter in my database configuration as shown in https://docs.laminas.dev/tutorials/db-adapter/#configuring-named-adapters:

    'db' => [
        'adapters' => [
            'Application\Db\ApplicationAdapter' => [
                'driver' => 'Pdo',
                'dsn'    => 'mysql:dbname=database;host=localhost;charset=utf8',
                'username' => 'username',
                'password' => 'password',
            ],
        ],
    ],

But the Laminas\DeveloperTools module send a Fatal error that tells no 'driver' key present

Current behavior

`Fatal error: Uncaught Laminas\Db\Adapter\Exception\InvalidArgumentException: createDriver expects a "driver" key to be present inside the parameters in /domain/domain.name/vendor/laminas/laminas-db/src/Adapter/Adapter.php:276 
Stack trace: 
#0 /domain/domain.name/vendor/laminas/laminas-db/src/Adapter/Adapter.php(73): Laminas\Db\Adapter\Adapter->createDriver(Array) 
#1 /domain/domain.name/vendor/laminas/laminas-db/src/Adapter/AdapterServiceFactory.php(21): Laminas\Db\Adapter\Adapter->__construct(Array) 
#2 /domain/domain.name/vendor/laminas/laminas-servicemanager/src/ServiceManager.php(645): Laminas\Db\Adapter\AdapterServiceFactory->__invoke(Object(Laminas\ServiceManager\ServiceManager), 'Laminas\\Db\\Adap...', NULL) 
#3 /domain/domain.name/vendor/laminas/laminas-servicemanager/src/ServiceManager.php(218): Laminas\ServiceManager\ServiceManager->doCreate('Laminas\\Db\\Adap...') 
#4 /domain/domain.name/vendor/laminas/laminas-developer-tools/src/Module.php(221): Laminas\ServiceManager\ServiceManager->get('Laminas\\Db\\Adap...') 
#5 /domain/domain.name/vendor/laminas/laminas-servicemanager/src/ServiceManager.php(645): Laminas\DeveloperTools\Module->Laminas\DeveloperTools\{closure}(Object(Laminas\ServiceManager\ServiceManager), 'Laminas\\Develop...', NULL) 
#6 /domain/domain.name/vendor/laminas/laminas-servicemanager/src/ServiceManager.php(218): Laminas\ServiceManager\ServiceManager->doCreate('Laminas\\Develop...') 
#7 /domain/domain.name/vendor/laminas/laminas-developer-tools/src/Listener/ProfilerListener.php(75): Laminas\ServiceManager\ServiceManager->get('Laminas\\Develop...') 
#8 /domain/domain.name/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\DeveloperTools\Listener\ProfilerListener->onFinish(Object(Laminas\Mvc\MvcEvent)) 
#9 /domain/domain.name/vendor/laminas/laminas-eventmanager/src/EventManager.php(171): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent)) 
#10 /domain/domain.name/vendor/laminas/laminas-mvc/src/Application.php(364): Laminas\EventManager\EventManager->triggerEvent(Object(Laminas\Mvc\MvcEvent)) 
#11 /domain/domain.name/vendor/laminas/laminas-mvc/src/Application.php(341): Laminas\Mvc\Application->completeRequest(Object(Laminas\Mvc\MvcEvent)) 
#12 /domain/domain.name/public/index.php(61): Laminas\Mvc\Application->run() 
#13 {main} 

Next Laminas\ServiceManager\Exception\ServiceNotCreatedException: Service with name "Laminas\Db\Adapter\AdapterInterface" could not be created. Reason: createDriver expects a "driver" key to be present inside the parameters in /domain/domain.name/vendor/laminas/laminas-servicemanager/src/ServiceManager.php:652 
Stack trace: 
#0 /domain/domain.name/vendor/laminas/laminas-servicemanager/src/ServiceManager.php(218): Laminas\ServiceManager\ServiceManager->doCreate('Laminas\\Db\\Adap...') 
#1/domain/domain.name/vendor/laminas/laminas-developer-tools/src/Module.php(221): Laminas\ServiceManager\ServiceManager->get('Laminas\\Db\\Adap...') 
#2 /domain/domain.name/vendor/laminas/laminas-servicemanager/src/ServiceManager.php(645): Laminas\DeveloperTools\Module->Laminas\DeveloperTools\{closure}(Object(Laminas\ServiceManager\ServiceManager), 'Laminas\\Develop...', NULL) 
#3 /domain/domain.name/vendor/laminas/laminas-servicemanager/src/ServiceManager.php(218): Laminas\ServiceManager\ServiceManager->doCreate('Laminas\\Develop...') 
#4 /domain/domain.name/vendor/laminas/laminas-developer-tools/src/Listener/ProfilerListener.php(75): Laminas\ServiceManager\ServiceManager->get('Laminas\\Develop...') 
#5 /domain/domain.name/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\DeveloperTools\Listener\ProfilerListener->onFinish(Object(Laminas\Mvc\MvcEvent)) 
#6 /domain/domain.name/vendor/laminas/laminas-eventmanager/src/EventManager.php(171): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent)) 
#7 /domain/domain.name/vendor/laminas/laminas-mvc/src/Application.php(364): Laminas\EventManager\EventManager->triggerEvent(Object(Laminas\Mvc\MvcEvent)) 
#8 /domain/domain.name/vendor/laminas/laminas-mvc/src/Application.php(341): Laminas\Mvc\Application->completeRequest(Object(Laminas\Mvc\MvcEvent)) 
#9/domain/domain.name/public/index.php(61): Laminas\Mvc\Application->run() 
#10 {main} thrown in/domain/domain.name/vendor/laminas/laminas-servicemanager/src/ServiceManager.php on line 652`

How to reproduce

Expected behavior

Use with ZF2

The project page (url below) starts with the line "Module for developer and debug tools for working with the ZF2 MVC layer". (url: https://github.com/zendframework/ZendDeveloperTools )

The line makes you wonder if the module is compatible (or applicable for) with in ZF3 MVC projects.

I feel this should be changed to show that this module will work in ZF2 and ZF3, perhaps like this:
"Module for developer and debug tools for working with the ZF2 MVC layer, works with ZF3"


Originally posted by @rbroen at zendframework/zend-developer-tools#226

CSS box-sizing

I know, that this is not an error at all, but:

If I use bootstratp CSS, for example - there present this style definition:

/* bootstrap.css #259 */
* {
  -webkit-box-sizing: border-box;
     -moz-box-sizing: border-box;
          box-sizing: border-box;
}

So with this borders I've got some irritating behavior when mouseover on some ZendTools button and popup content showed over button and I'm trying move my mouse to this content - it disappears!

Because of borders adds some extra space and mouseover event brokes.
Works if I move mouse over green arrow :)

I know, that this is behavior of bootstrap.css, but if u will add this:

#zend-developer-toolbar {
...
    -webkit-box-sizing: content-box;
    -moz-box-sizing: content-box;
    box-sizing: content-box;
...
}

then problem will be fixed on all possible CSS frameworks, I think.

Sorry for my english.
Thx


Originally posted by @man4red at zendframework/zend-developer-tools#145

default template suffix

Using composer to install zf2 skeleton along with developer tools. After enabling it I am getting server errors, like:

PHP Fatal error:  Uncaught exception 'Zend\\View\\Exception\\RuntimeException' with message 'Zend\\View\\Renderer\\PhpRenderer::render: Unable to render template "zend-developer-tools/toolbar/zendframework"; resolver could not resolve to a file' in C:\\Users\\Milan\\workspace\\HopkaupZEND\\vendor\\zendframework\\zendframework\\library\\Zend\\View\\Renderer\\PhpRenderer.php:499
Stack trace:
#0 C:\\Users\\Milan\\workspace\\HopkaupZEND\\vendor\\zendframework\\zend-developer-tools\\src\\ZendDeveloperTools\\Listener\\ToolbarListener.php(203): Zend\\View\\Renderer\\PhpRenderer->render(Object(Zend\\View\\Model\\ViewModel))
#1 C:\\Users\\Milan\\workspace\\HopkaupZEND\\vendor\\zendframework\\zend-developer-tools\\src\\ZendDeveloperTools\\Listener\\ToolbarListener.php(148): ZendDeveloperTools\\Listener\\ToolbarListener->renderEntries(Object(ZendDeveloperTools\\ProfilerEvent))
#2 C:\\Users\\Milan\\workspace\\HopkaupZEND\\vendor\\zendframework\\zend-developer-tools\\src\\ZendDeveloperTools\\Listener\\ToolbarListener.php(137): ZendDeveloperTools\\Listener\\ToolbarListener->injectToolbar(Object(ZendDe in C:\\Users\\Milan\\workspace\\HopkaupZEND\\vendor\\zendframework\\zendframework\\library\\Zend\\View\\Renderer\\PhpRenderer.php on line 499

adding 'default_template_suffix' key to module.config.php:

return array(
    'view_manager' => array(
        'default_template_suffix' => 'phtml',
        'template_path_stack' => array(
            'zenddevelopertools' => __DIR__ . '/../view',
        ),
    ),
);

fixes the issue.


Originally posted by @minow at zendframework/zend-developer-tools#94

Using this component with AngularJs

Hi, I am developing a AngularJs application and was wondering how can i get the toolbars data in each ajax request ?
All my requests return json, either a html output to replace the current toolbar or just a json object of the reports would be nice.
I looked throw the code but could not figure out where all the reports come together and injected in the view so i can hijack it and do something with it.
I've also asked it here with no response http://stackoverflow.com/questions/34183177/zf2-developer-tools-with-angularjs


Originally posted by @Exlord at zendframework/zend-developer-tools#203

ZendDeveloperTools + cache config

Hello

I enabled cache config in application.config.php:

...
        'config_cache_enabled' => true,
        'config_cache_key' => 1,
        'cache_dir' => __DIR__ . '/../data/cache',
...

And I have some errors then :

( ! ) Fatal error: Uncaught exception 'Zend\View\Exception\RuntimeException' with message 'Zend\View\Renderer\PhpRenderer::render: Unable to render template "zend-developer-tools/toolbar/zendframework"; resolver could not resolve to a file' in .../vendor/zendframework/zendframework/library/Zend/View/Renderer/PhpRenderer.php on line 493

( ! ) Zend\View\Exception\RuntimeException: Zend\View\Renderer\PhpRenderer::render: Unable to render template "zend-developer-tools/toolbar/zendframework"; resolver could not resolve to a file in .../vendor/zendframework/zendframework/library/Zend/View/Renderer/PhpRenderer.php on line 493


Originally posted by @Nirzol at zendframework/zend-developer-tools#188

Javascript location.assign brokes the toolbar

Hi!

When I use window.location.assign with a download link, the toolbar does not work properly and I get this javascript error on my console: Uncaught TypeError: Cannot read property 'offsetWidth' of null

Code to simulate:

<script type="text/javascript">
    window.location.assign("https://github.com/zendframework/ZendDeveloperTools/archive/master.zip");
</script>

Thank you!


Originally posted by @quintanilhar at zendframework/zend-developer-tools#194

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Repository problems

These problems occurred while renovating this repository. View logs.

  • WARN: Use matchDepNames instead of matchPackageNames

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

composer
composer.json
  • php ~8.1.0 || ~8.2.0 || ~8.3.0
  • laminas/laminas-eventmanager ^3.4
  • laminas/laminas-http ^2.15
  • laminas/laminas-modulemanager ^2.10
  • laminas/laminas-mvc ^3.1
  • laminas/laminas-servicemanager ^3.3
  • laminas/laminas-stdlib ^3.6
  • laminas/laminas-view ^2.13.1
  • symfony/var-dumper ^6.0 || ^7.0
  • laminas/laminas-coding-standard ~2.5.0
  • phpunit/phpunit ^9.5.26
  • psalm/plugin-phpunit ^0.19.0
  • vimeo/psalm ^5.19
github-actions
.github/workflows/continuous-integration.yml
.github/workflows/release-on-milestone-closed.yml

  • Check this box to trigger a request for Renovate to run again on this repository

In HTML5, the <head> element can be omitted. The zend-developer-tools css requires it.

  • I was not able to find an open or closed issue matching what I'm seeing.
  • This is not a question. (Questions should be asked on chat (Signup here) or our forums.)

Provide a narrative description of what you are trying to accomplish.

Code to reproduce the issue

In HTML5, the <head> element can be omitted. The following code will validate as HTML5:

<!DOCTYPE html>
<html>
<title>Title of the document</title>

<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>

</html>

However, ZendDeveloperTools\Listener->injectToolbar() requires it to work

$injected = preg_replace('/<\/head>/i', $style . "\n</head>", $injected, 1);

Expected results

Styles should be displayed in the html document even if there is no <head> html element when the document is html 5 document.

Actual results

html document does not include zend-developer-tools required css, if <head> element is missing from the layout.


Originally posted by @VilleTikkanen at zendframework/zend-developer-tools#255

PHP 8.3 support

Feature Request

Q A
New Feature yes
RFC yes/no
BC Break yes/no

Summary

Make this module compatible with new php 8.3 release.

Toolbar hidden will soon not be remembered because of cookie settings

Bug Report

Q A
Version(s) 2.4.0

Summary

Firefox warns about the laminas-hidden cookie. In specific, it references the following documentation: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite#samesitenone_requires_secure

The problem is that the cookie will be rejected by future browser versions.

Current behavior

laminas-hidden cookie is set with SameSite=None and without secure.

I believe the code responsible for this behaviour is located here: https://github.com/laminas/laminas-developer-tools/blob/2.4.x/view/laminas-developer-tools/toolbar/toolbar.js

How to reproduce

Enable the laminas-developer-tools toolbar. Visit your website. Observe the console output of your browser.

Expected behavior

No warnings should be thrown.

Since not all websites under development are served over a secure connection, I propose setting SameSite=Lax.

Incorrect Content-Lenght after toolbar injection

When the Content-Lenght is set by some module for an text/html asset (think asset manager for static html files in a data directory served via standard resolver :-) ) the Content-Lenght header will be incorrect after the Toolbar is injected. This results pages in half loaded.

adding the following at https://github.com/zendframework/ZendDeveloperTools/blob/master/src/ZendDeveloperTools/Listener/ToolbarListener.php#L163 will solve this

    if (function_exists('mb_strlen')) {
        $contentLength = mb_strlen($injected, '8bit');
    } else {
        $contentLength = strlen($injected);
    }

    $response->getHeaders()
        ->addHeaderLine('Content-Transfer-Encoding',   'binary')
        ->addHeaderLine('Content-Length',              $contentLength);

I don't actually need the toolbar on static pages, and i realize this only affects development environments, still I though "lets create a record of this...".

I also wonder why the Response object does not do this automatically...


Originally posted by @basz at zendframework/zend-developer-tools#119

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.