Skip to content
This repository has been archived by the owner on Jul 3, 2020. It is now read-only.

Fix a bug with zend developer tools ZDT #296

Closed
wants to merge 1 commit into from
Closed

Fix a bug with zend developer tools ZDT #296

wants to merge 1 commit into from

Conversation

belgattitude
Copy link
Contributor

Latest ZDT update comes breaks ability to profile zfcrbac. Their commit can be seen :

zendframework/zend-developer-tools@d343268#commitcomment-11090423

After a quick look, their fix seems relevant as relying on serializable behaviour is not very clear.

This PR seems to fix the issue, by correctly returning collection as an array.

Latest ZDT update comes breaks ability to profile zfcrbac. Their commit can be seen :

zendframework/zend-developer-tools@d343268#commitcomment-11090423

After a quick look, their fix seems relevant as relying on serializable behaviour is not very clear. 

This PR seems to fix the issue, by correctly returning collection as an array.





Since beginning of may, the latest zend developer tools includes a changes in the profiler process, see zendframework/zend-developer-tools@d343268#commitcomment-11090423
belgattitude referenced this pull request in zendframework/zend-developer-tools May 12, 2015
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) to 93.62% when pulling 9555253 on belgattitude:patch-1 into dd46259 on ZF-Commons:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) to 93.62% when pulling 9555253 on belgattitude:patch-1 into dd46259 on ZF-Commons:master.

@bakura10
Copy link
Member

Hi,

Thank you for this. Tests are failing though, they need to be updated too ?

@belgattitude
Copy link
Contributor Author

@bakura10

not so sure... I should have been more attentive to unserialize method. the collection should be restored to individual attributes, like

    /**
     * @return array|string[]
     */
    public function getCollection()
    {
        return [
            'guards'      => $this->collectedGuards,
            'roles'       => $this->collectedRoles,
            'permissions' => $this->collectedPermissions,
            'options'     => $this->collectedOptions
        ];
    }
    /**
     * {@inheritDoc}
     */
    public function serialize()
    {
        return serialize($this->getCollection());
    }
    /**
     * {@inheritDoc}
     */
    public function unserialize($serialized)
    {
        $collection = unserialize($serialized);
        $this->collectedGuards = $collection['options'];
        $this->collectedRoles  = $collection['roles'];
        $this->collectedPermissions =  $collection['permissions'];
        $this->collectedOptions =  = $collection['guards'];
    }

Looks a bit weird to me, but should do the trick. Have you an idea ?

@belgattitude
Copy link
Contributor Author

My first PR and removed my fork after making it, see this one instead :
#297

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants