Serializer component from Zend Framework

Overview
Comments
  • Serialized data must be a string containing serialized PHP code; received: NULL

    Serialized data must be a string containing serialized PHP code; received: NULL

    After updating to version 2.7.2 I got following error on my login page.

    PHP Fatal error: Uncaught exception 'Zend\\Serializer\\Exception\\RuntimeException' with message 'Serialized data must be a string containing serialized PHP code; received: NULL' in vendor/zendframework/zend-serializer/src/Adapter/PhpSerialize.php:75\nStack trace:\n#0 vendor/zendframework/zend-cache/src/Storage/Plugin/Serializer.php(72): Zend\\Serializer\\Adapter\\PhpSerialize->unserialize(NULL)\n#1 [internal function]: Zend\\Cache\\Storage\\Plugin\\Serializer->onReadItemPost(Object(Zend\\Cache\\Storage\\PostEvent))\n#2 vendor/zendframework/zend-eventmanager/src/EventManager.php(490): call_user_func(Array, Object(Zend\\Cache\\Storage\\PostEvent))\n#3 vendor/zendframework/zend-eventmanager/src/EventManager.php(251): Zend\\EventManager\\EventManager->triggerListeners('getItem.post', Object(Zend\\Cache\\Storage\\PostEvent))\n#4 vendor/zendframework/ in vendor/zendframework/zend-serializer/src/Adapter/PhpSerialize.php on line 75

    opened by CreativeNative 16
  • Feature/add covers to tests

    Feature/add covers to tests

    @Maks3w

    Following discussion, is this what we are after? Do not merge, until rest are complete for this component. This is just a sample - please add tag WIP.

    What are your thoughts on group tag?

    opened by levelfivehub 8
  • Removed skipped unit test and the use of eval.  Enhancement

    Removed skipped unit test and the use of eval. Enhancement

    Hi,

    This is my second contribution towards ZF2. I hope it suits this module well.

    There was a skipped test (commented out) as well as the use of eval(). I did notice a comment with a warning so thought I put my contribution forward. Please review and let me know if it is acceptable.

    Awaiting your comments. Unit tests and builds passing.

    Also did php-cs-fixes.

    Ps. There may be other scenarios I can cover in this branch. But ideally I want to get some feedback before continuing.

    opened by levelfivehub 8
  • PhpSerialize: Add options for a unserialize() class-whitelist

    PhpSerialize: Add options for a unserialize() class-whitelist

    The PhpSerialize adapter uses unserialize() (see PhpSerialize.php#L88) to convert a string into a PHP Object (array, string, class-instance. ...).

    PHP 7.0 added an option to only allow the deserialization of whitelisted classes via the "options['allowed_classes']" parameter to combat code-injection.

    I'm proposing adding an options to PhpSerialize class to uses this whitelist.

    Practical application: this could be used in "zend-i18n" (using "zend-cache" and "zend-serializer") for the translation-cache. It should only allow the deserialization of objects that are instance of Zend\I18n\Translator\TextDomain (or plain arrays).

    opened by MatthiasKuehneEllerhold 5
  • Failed test with PHP 7.x

    Failed test with PHP 7.x

    Discovered in Fedora CI, https://apps.fedoraproject.org/koschei/package/php-zendframework-zend-serializer?collection=f25

    There was 1 failure:
    1) ZendTest\Serializer\Adapter\WddxTest::testUnserializeFalse
    Failed asserting that true matches expected false.
    /builddir/build/BUILD/zend-serializer-ff74ea020f5f90866eb28365327e9bc765a61a6e/test/Adapter/WddxTest.php:136
    FAILURES!
    

    Not detected by travis as wddx extension is not available, and not yet covered by PHP test suite. Can you please enable it ?

    This is an upstream bug, see https://bugs.php.net/bug.php?id=72564 Fix will be in 7.0.10

    So mostly for your information

    opened by remicollet 5
  • More aliases, fewer factories

    More aliases, fewer factories

    • Aliases typically need to be in each of:
      • lowercase
      • camelCase
      • TitleCase
    • Factories mapping to the InvokableFactory must be FQCNs only. The normalized version used in v2 (stripping special characters and lowercasing) will likely never be used to retrieve a service, and can be skipped.
    enhancement 
    opened by weierophinney 4
  • Class 'Zend\Serializer\Serializer' not found

    Class 'Zend\Serializer\Serializer' not found

    Apache/2.4.20 (Win32) PHP/5.6.21 Exception in …\vendor\zendframework\zend-cache\src\Storage\Plugin\PluginOptions.php:215

    $cache = StorageFactory::factory([
    			'adapter' => [
    				'name' => 'filesystem',
    				'options'=>[
    					'cache_dir'=>'.\filessys\local\tabletka\',
    				]
    			],
    			'plugins' => [
    				// Don't throw exceptions on cache errors
    				'exception_handler' => [
    					'throw_exceptions' => false
    				],
    				'serializer',
    			],
    		]);
    
    invalid 
    opened by newbie78 3
  • Updated to php-coveralls/php-coveralls

    Updated to php-coveralls/php-coveralls

    With version 2 package has been renamed from satooshi/php-coveralls to php-coveralls/php-coveralls, and the script has been renamed from coveralls to php-coveralls

    opened by michalbundyra 1
  • Updated docs and fixed deps

    Updated docs and fixed deps

    Release 2.8.1 fixes failing tests in PR https://github.com/zendframework/zend-serializer/pull/32 There is added redundant doctrine dependency. In other repositories we handled this situation by updating legacy deps on testing with locked dependencies to make sure we have installed correct dependencies on each PHP version.

    This PR provides also changes to the documentation of the library done by zf-maintainer tool (see maintainers repo) and adds support for PHPUnit 6.4.

    Travis CI configuration is now updated - dropped HHVM support and added PHP 7.1 & 7.2 builds.

    opened by michalbundyra 1
  • Updated dependencies

    Updated dependencies

    • Use ^ operator when possible
    • Updated zend-stdlib to ^2.7 || ^3.0, as the changes in zend-stdlib 3.0 will not affect the functionality in this repository. This allows it to be used as a dev dependency for zend-stdlib v3 as well.
    enhancement 
    opened by weierophinney 1
  • unserialize should raise exception on not serialized input

    unserialize should raise exception on not serialized input

    Every adapter should raise an exception if the input for unserialize is not a serialized string.

    The bug was introduced on Dec 16, 2011 here https://github.com/zendframework/zf2/commit/64f4d52f40873996a6b21aeee82cdedb047ceb53#diff-4ae37c6308a6960757fa49d2da5f1485R106

    bug BC Break 
    opened by marc-mabe 1
  • Remove adapter PhpCode

    Remove adapter PhpCode

    ... because it's using eval.

    It's only useful for testing/debugging but to dangerous to use for wrong purpose. Because of that I propose to remove this adapter as it's also really simple to write it byself in case someone really needs it.

    See #5

    PS: The serializer can't use PHP's opcache as that would be another possible use as pointed out by @Ocramius - but as told it cant be done by serializer component and would live better in zend-cache.

    BC Break 
    opened by marc-mabe 1
Releases(release-2.9.1)
  • release-2.9.1(Oct 19, 2019)

  • release-2.9.0(May 14, 2018)

    Added

    • #37 adds support to the PhpSerialize adapter to allow it to support the PHP 7 $options parameter of unserialize, and, specifically, the allowed_classes parameter. A new options class, PhpSerializeOptions, now allows setting the unserialize_class_whitelist option, which may be one of true (any class may be unserialized; current behavior), false (no class may be unserialized), or an array of class names that are explicitly allowed to be unserialized. An instance of this class may now be passed to the PhpSerialize constructor in order to set the intended/expected behavior.

    Changed

    • Nothing.

    Deprecated

    • Nothing.

    Removed

    • Nothing.

    Fixed

    • #34 removes a redundant dependency on a Doctrine package.
    Source code(tar.gz)
    Source code(zip)
  • release-2.7.2(May 11, 2016)

    Added

    • #17 adds and publishes the documentation to https://zendframework.github.com/zend-serializer/

    Deprecated

    • Nothing.

    Removed

    • #16 removes the dependency on zend-math, making it optional. (This was done as the requirement is only when using the PythonPickle adapter.)

    Fixed

    • #9 fixes the behavior of the PhpSerialize adapter to raise an exception during deserialization if the value is not serialized, restoring behavior to match the other adapters.
    Source code(tar.gz)
    Source code(zip)
  • release-2.7.1(Apr 18, 2016)

    Added

    • Nothing.

    Deprecated

    • Nothing.

    Removed

    • Nothing.

    Fixed

    • #15 fixes the Module::init() method to properly receive a ModuleManager instance, and not expect a ModuleEvent.
    Source code(tar.gz)
    Source code(zip)
  • release-2.7.0(Apr 6, 2016)

    Added

    • #14 exposes the package as a ZF component and/or generic configuration provider, by adding the following:
      • AdapterPluginManagerFactory, which can be consumed by container-interop / zend-servicemanager to create and return a AdapterPluginManager instance.
      • ConfigProvider, which maps the service SerializerAdapterManager to the above factory.
      • Module, which does the same as ConfigProvider, but specifically for zend-mvc applications. It also provices a specification to Zend\ModuleManager\Listener\ServiceListener to allow modules to provide serializer configuration.

    Deprecated

    • Nothing.

    Removed

    • Nothing.

    Fixed

    • Nothing.
    Source code(tar.gz)
    Source code(zip)
  • release-2.6.1(Apr 6, 2016)

  • release-2.6.0(Feb 2, 2016)

Owner
Zend Framework
Zend Framework
Zend\Text is a component to work on text strings from Zend Framework

zend-text Repository abandoned 2019-12-31 This repository has moved to laminas/laminas-text. Zend\Text is a component to work on text strings. It cont

Zend Framework 31 Jan 24, 2021
This component, based on the Symfony serializer and async-aws, is a human-readable and quick abstraction to easily store serialized objects in DynamoDB 🚀.

DynamoDB Storable This component, based on the Symfony serializer and async-aws, is a human-readable and quick abstraction to easily store serialized

Matthieu W. 2 Jun 19, 2022
Authentication component from Zend Framework

zend-authentication Repository abandoned 2019-12-31 This repository has moved to laminas/laminas-authentication. The Zend\Authentication component pro

Zend Framework 43 Jun 13, 2021
ServiceManager component from Zend Framework

zend-servicemanager Repository abandoned 2019-12-31 This repository has moved to laminas/laminas-servicemanager. Master: Develop: The Service Locator

Zend Framework 192 Nov 21, 2022
Console component from Zend Framework

zend-console Repository abandoned 2019-12-31 This repository has moved to laminas/laminas-console. Zend\Console is a component to design and implement

Zend Framework 47 Mar 16, 2021
Cryptographic component from Zend Framework

zend-crypt Repository abandoned 2019-12-31 This repository has moved to laminas/laminas-crypt. Zend\Crypt provides support of some cryptographic tools

Zend Framework 89 Dec 4, 2021
Db component from Zend Framework

zend-db Repository abandoned 2019-12-31 This repository has moved to laminas/laminas-db. Zend\Db is a component that abstract the access to a Database

Zend Framework 98 Sep 5, 2022
Debug component from Zend Framework

zend-debug Zend\Debug is a component that help the debugging of PHP applications. In particular it offers a static method Zend\Debug\Debug::dump() tha

Zend Framework 12 Jan 29, 2020
Navigation component from Zend Framework

zend-navigation Repository abandoned 2019-12-31 This repository has moved to laminas/laminas-navigation. Zend\Navigation is a component for managing t

Zend Framework 19 Jun 30, 2021
Json component from Zend Framework

zend-json Repository abandoned 2019-12-31 This repository has moved to laminas/laminas-json. Zend\Json provides convenience methods for serializing na

Zend Framework 102 Nov 17, 2022
Flexible serializer encouraging good object design

Serializard Serializard is a library for (un)serialization of data of any complexity. Its main focus is to give user as much flexibility as possible b

Tomasz Kowalczyk 24 May 27, 2022
An HTML5 parser and serializer for PHP.

HTML5-PHP HTML5 is a standards-compliant HTML5 parser and writer written entirely in PHP. It is stable and used in many production websites, and has w

null 1.2k Dec 31, 2022
JSON:API serializer for PHP resources

kwai-jsonapi A JSON:API serializer for PHP classes using PHP attributes. Currently, this library has no support for links. Installation composer requi

Franky Braem 1 Jan 19, 2022
Igbinary is a drop in replacement for the standard php serializer.

igbinary Igbinary is a drop in replacement for the standard php serializer. Instead of the time and space consuming textual representation used by PHP

Igbinary development 727 Dec 21, 2022
A panel created based on the Zend Framework MVC framework

?? Painel MyZap2.0 Com ZendFramework 3 Descrição Esse é um painel criado como estudo pessoal do framework (Zend Framework MVC) não foi criado para fin

Jonathan Henrique 9 Jun 10, 2022
Official Zend Framework repository

Welcome to the Zend Framework 3.0 Release! RELEASE INFORMATION Zend Framework 3.0.1dev This is the first maintenance release for the Zend Framework 3

Zend Framework 5.6k Dec 29, 2022
Converts a string to a slug. Includes integrations for Symfony, Silex, Laravel, Zend Framework 2, Twig, Nette and Latte.

cocur/slugify Converts a string into a slug. Developed by Florian Eckerstorfer in Vienna, Europe with the help of many great contributors. Features Re

Cocur 2.8k Dec 22, 2022
Zend Framework cache backend for MongoDB

Zend_Cache_Backend_Mongo Author: Anton Stöckl About Zend_Cache_Backend_Mongo is a Zend Framework Cache Backend for MongoDB. It supports tags and autoc

Anton Stöckl 12 Feb 19, 2020
A skeleton application using the Zend Framework MVC

This is a skeleton application using the Zend Framework MVC layer and module systems. This application is meant to be used as a starting place for those looking to get their feet wet with Zend Framework.

Zend Framework 1.5k Dec 15, 2022
💗 C++ wrapper for Zend API

PHP-X C++ wrapper for Zend API Requirements PHP 7.2 or later Linux/MacOS/Windows GCC 4.8 or later Composer Build phpx (bin) ./build.sh sudo cp bin/php

韩天峰-Rango 815 Dec 6, 2022