Download the PHP package tsg/phpickle without Composer

On this page you can find all versions of the php package tsg/phpickle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package phpickle

Phpickle is a set of PHP classes that allow you to read and write the python pickle format. It is useful for integrating python and php applications together, for example to read django session data from a php application.

==============Basic usage:


$data = phpickle::loads($pickled_string);

If you want to unpickle from something that can be treated as a php stream, then:


$data = phpickle::load_stream("pickled_file.pickle"); $data = phpickle::load_stream("http://www.pickler.com/mydata"); // and others

If you want to unpickle data that was stored by the default django session handler, then:


$data = phpickle::loads_django_session($data_from_django_session_db);

If you want to pickle data, then:


$string = phpickle::dumps($data_to_pickle);

===============Current status:

Well, unpickling simple types, lists, tuples, dicts, ints, double, strings works. Unpickling class instances also works, but of course the instances are not the same as the ones in python. Instead stdClass instances are created, with all the data properties that are in the pickle and a few extra ones as well:

$inst->__python_class = "main.test"; $inst->python_construct_args__ = array();

__python_class is the package.class name for the python class that this instance represents. python_construct_args__ are the contructor arguments for creating the class instance in python.

Of course, referencing really python specific things, line REDUCE op that gives it's argument to a python method to produce a result cannot be supported.

Pickling support is there for simple types and arrays. Experimental support for objects is also there. Pickling back from previously unpickled data should produce the same result most of the time, but needs better test coverage.

===============Code setup:

tests folder has phpunit based tests for some of the modules.

Pickle is a very simple stack based language, the interpreter is in phpickle_unpickle.php and the read/write handlers for different opcodes are in the phpickle_op_handlers.pck. To generate the interpreter files, run make gen, that will generate phpickle_gen_read_ops.php and phpickle_gen_write_ops.php

To debug unpickling, call phpickle_unpickler->set_debug(true) and in the read handler code, just to if ($debug). In the handler code, you can read data from the $stream, using phpickle_stream methods and push results into $stack that is a phpickle_stack instance. $memo is for memorizing things.


All versions of phpickle with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tsg/phpickle contains the following files

Loading the files please wait ....