Download the PHP
package adityasetiono/php-functions without Composer
On this page you can find all versions of the php package
adityasetiono/php-functions. It is possible to download/install
these versions without Composer. Possible dependencies are resolved
automatically.
Vendor adityasetiono Package php-functions Short Description Function helpers for PHP License
MIT
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.
A PHP library to serialise/deserialise an array to an object or vice versa.
Installation
To install it with composer:
Usage
Import needed functions, for example:
Random String Generator
And to use it:
Serialise / Deserialise
This is a function to serialise/deserialise an array to an object and vice versa.
Because the library is built as an external function,
the class properties are required to have getters and setters.
A class example
Serialiser
Result
Serialised object are compatible with DoctrineORM Entities and can be persisted to database as is (Only tested with Doctrine so far, other ORM Entities need to be tested separately).
This is just a generic serialiser to serialise an array to an object.
Here is an example of DoctrineORM Entity Serialization
Serialiser
Uuid is a primary key and auto-generated by the DB.
Persist to DB
Deserialiser
Getting the object/entity from Database
Use the deserialise
Content of $array will be
Another example with custom fields. The second parameter accepts an associative array with key which will be the result's key and value is the property name.
The deserialiser expects the value to be exactly the same as camelCase of the getter without get.
Content of $customArray will be
The deserialiser should work with nested object and array of objects. Further example will be provided in the documentation. (It is available in the tests files).
Issues
Feel free to use GitHub Issues or email directly to [email protected] as I started this library on my own. Collaborators are welcomed.
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 adityasetiono/php-functions contains the following files
Loading the files please wait ....
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.