Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compatibility with service-manager>=2.7.5 and fixed css #10

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions assets/zf-snap-php-debug-bar.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ a.phpdebugbar-restore-btn {
background-color: rgba(246, 246, 246, 0.4);
background-repeat: no-repeat;
background-position: 9px 10px;
background-size: 31px auto;
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB8AAAAPCAYAAAAceBSiAAAAAXNSR0IArs4c6QAAAAZiS0dEAH8A9wAAMkqpNAAAAAlwSFlzAAAuIwAALiMBeKU/dgAAAAd0SU1FB9wCCwIWGuaXOlYAAAJiSURBVDjLldS/i1xVFAfwz8leJxF/FdFUNjayhYpCkBATxEIwb0D/ADFpIjMgCDGQQtBCIWVAY/EmIGKbRpt9q6CFplIL8UfvL2SLqBBRUHzDsdi3O7Ozb7KbA493udz7Pff7Pd9zYtyUkumrCI/YfxzARvJgcDeeT54Mbs/cP0iBCNEB7i/SNMNxPIBPcCRu4eURMwaS2DNd908Ir0yq9sfgTRxZBN7jyw7xh4KpdA73LGaL8Lf0MoZia8tnddW+PVorgWdvQa0tipFsYHhTxqO18miEr3N29Y9J1R6GcVMCr+PfbfhZgl1Kd/9ppm8nw/ZjbiL3aK0U4TtptZMqUNVVu754drxWHhKOZjoYsYvwivTBZNhu9BpuSVzGagcWeK8v8agpDU7NG6nHYNdsSt0rxyLr0xHen6vUF3XVHtvFuClv4LUdFd0dv9ZVe/+4KSdxEY/hF5wvPYnvjXAps2OS/slwtudcZHphrlX7uyM9060v4Wi3XsWV0iPFhzgcIaXo2ur7Jb16Q/qyx9it9DMuT4bbd1/FIfyEb7ASC2zeifBSpuzYvFtX7dmlpmzKwKZC/9VVm/NmjTCd35sr1Sk0OBdzQI8H13BbpojwZ2ek6zmTcUud63XV3uic/pRwAceSg8Gh5L5J1f7ek/g41nG1rtoXS5d4Jfg0GUSHntwhNRELTtp8yQVcGTflOVyVBjk79NuSxA/jI3yOEZRuUq3jztgebGBF7Jx6He2MNOgecl4YzE0/OLOkSm/hLgwxHTfFgeB08PQe7bLTxrHpdpzoBn5E+gtn6qptllx9YnHjf9NI2tXkjbmCAAAAAElFTkSuQmCC');
}
a.phpdebugbar-tab span.phpdebugbar-badge {
Expand Down
4 changes: 2 additions & 2 deletions config/zfsnapphpdebugbar.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
'storage' => null,
),
'controllers' => array(
'invokables' => array(
'ZfSnapPhpDebugBar\Controller\Resources' => 'ZfSnapPhpDebugBar\Controller\Resources',
'factories' => array(
'ZfSnapPhpDebugBar\Controller\Resources' => 'ZfSnapPhpDebugBar\Controller\ResourcesFactory',
),
),
'router' => array(
Expand Down
27 changes: 27 additions & 0 deletions src/ZfSnapPhpDebugBar/Controller/Resources.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace ZfSnapPhpDebugBar\Controller;

use Zend\Mvc\Controller\AbstractActionController;
use Zend\ServiceManager\ServiceLocatorInterface;

/**
* Resources
Expand All @@ -11,6 +12,12 @@
*/
class Resources extends AbstractActionController
{
/**
* @var ServiceLocatorInterface
* @since 0.11.2
*/
protected $serviceLocator;

protected $extensionToContentTypeMap = array(
'css' => 'text/css; charset=UTF-8',
'js' => 'text/javascript; charset=UTF-8',
Expand Down Expand Up @@ -54,4 +61,24 @@ protected function mapExtenstionToContentType($extension)
}
return 'text/html; charset=UTF-8';
}

/**
* @param ServiceLocatorInterface $serviceLocator
* @return static
* @since 0.11.2
*/
public function setServiceLocator(ServiceLocatorInterface $serviceLocator)
{
$this->serviceLocator = $serviceLocator;
return $this;
}

/**
* @return ServiceLocatorInterface
* @since 0.11.2
*/
public function getServiceLocator()
{
return $this->serviceLocator;
}
}
26 changes: 26 additions & 0 deletions src/ZfSnapPhpDebugBar/Controller/ResourcesFactory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

namespace ZfSnapPhpDebugBar\Controller;

use Zend\ServiceManager\ServiceLocatorInterface;
use Zend\ServiceManager\FactoryInterface;

/**
* Factory of the Resources controller.
*
* @author Vasilij Belosludcev <https://github.com/bupy7>
* @since 0.11.2
*/
class ResourcesFactory implements FactoryInterface
{
/**
* {@inheritDoc}
*/
public function createService(ServiceLocatorInterface $serviceLocator)
{
$ctrl = new Resources;
$ctrl->setServiceLocator($serviceLocator->getServiceLocator());
return $ctrl;
}
}