PHP Package: flix-tech/avro-php
Avro-PHP is a powerful PHP library for Avro serialization and deserialization, allowing seamless data exchange in Avro format.
Package Description
Avro-PHP is a feature-rich PHP library designed for efficient Avro schema processing and data serialization. It offers robust support for Avro data structures, enabling developers to streamline data exchange processes. With Avro-PHP, users can effortlessly handle complex data formats and enhance interoperability across systems, making it a valuable tool for modern PHP applications.
- (so throw an error? or ignore?) * - schema may contain multiple definitions of a named schema * if definitions are equivalent (?) * - Cleanup default namespace and named schemata handling. * - For one, it appears to be *too* global. According to the spec, * we should only be referencing schemas that are named within the * *enclosing* schema, so those in sibling schemas (say, unions or fields) * shouldn't be referenced, if I understand the spec correctly. * - Also, if a named schema is defined more than once in the same schema, * it must have the same definition: so it appears we *do* need to keep * track of named schemata globally as well. (And does this play well * with the requirements regarding enclosing schema? * - default values for bytes and fixed fields are JSON strings, * where unicode code points 0-255 are mapped to unsigned 8-bit byte values 0-255 * - make sure other default values for other schema are of appropriate type * - Should AvroField really be an AvroSchema object? Avro Fields have a name * attribute, but not a namespace attribute (and the name can't be namespace * qualified). It also has additional attributes such as doc, which named schemas * enum and record have (though not fixed schemas, which also have names), and * fields also have default and order attributes, shared by no other schema type. */ /** * Exceptions associated with parsing JSON schema representations * @package Avro */ class AvroSchemaParseException extends AvroException {}\AvroSchemaParseException
- (so throw an error? or ignore?) * - schema may contain multiple definitions of a named schema * if definitions are equivalent (?) * - Cleanup default namespace and named schemata handling. * - For one, it appears to be *too* global. According to the spec, * we should only be referencing schemas that are named within the * *enclosing* schema, so those in sibling schemas (say, unions or fields) * shouldn't be referenced, if I understand the spec correctly. * - Also, if a named schema is defined more than once in the same schema, * it must have the same definition: so it appears we *do* need to keep * track of named schemata globally as well. (And does this play well * with the requirements regarding enclosing schema? * - default values for bytes and fixed fields are JSON strings, * where unicode code points 0-255 are mapped to unsigned 8-bit byte values 0-255 * - make sure other default values for other schema are of appropriate type * - Should AvroField really be an AvroSchema object? Avro Fields have a name * attribute, but not a namespace attribute (and the name can't be namespace * qualified). It also has additional attributes such as doc, which named schemas * enum and record have (though not fixed schemas, which also have names), and * fields also have default and order attributes, shared by no other schema type. */ /** * Exceptions associated with parsing JSON schema representations * @package Avro */ class AvroSchemaParseException extends AvroException {}\AvroSchema
- (so throw an error? or ignore?) * - schema may contain multiple definitions of a named schema * if definitions are equivalent (?) * - Cleanup default namespace and named schemata handling. * - For one, it appears to be *too* global. According to the spec, * we should only be referencing schemas that are named within the * *enclosing* schema, so those in sibling schemas (say, unions or fields) * shouldn't be referenced, if I understand the spec correctly. * - Also, if a named schema is defined more than once in the same schema, * it must have the same definition: so it appears we *do* need to keep * track of named schemata globally as well. (And does this play well * with the requirements regarding enclosing schema? * - default values for bytes and fixed fields are JSON strings, * where unicode code points 0-255 are mapped to unsigned 8-bit byte values 0-255 * - make sure other default values for other schema are of appropriate type * - Should AvroField really be an AvroSchema object? Avro Fields have a name * attribute, but not a namespace attribute (and the name can't be namespace * qualified). It also has additional attributes such as doc, which named schemas * enum and record have (though not fixed schemas, which also have names), and * fields also have default and order attributes, shared by no other schema type. */ /** * Exceptions associated with parsing JSON schema representations * @package Avro */ class AvroSchemaParseException extends AvroException {}\AvroPrimitiveSchema
- (so throw an error? or ignore?) * - schema may contain multiple definitions of a named schema * if definitions are equivalent (?) * - Cleanup default namespace and named schemata handling. * - For one, it appears to be *too* global. According to the spec, * we should only be referencing schemas that are named within the * *enclosing* schema, so those in sibling schemas (say, unions or fields) * shouldn't be referenced, if I understand the spec correctly. * - Also, if a named schema is defined more than once in the same schema, * it must have the same definition: so it appears we *do* need to keep * track of named schemata globally as well. (And does this play well * with the requirements regarding enclosing schema? * - default values for bytes and fixed fields are JSON strings, * where unicode code points 0-255 are mapped to unsigned 8-bit byte values 0-255 * - make sure other default values for other schema are of appropriate type * - Should AvroField really be an AvroSchema object? Avro Fields have a name * attribute, but not a namespace attribute (and the name can't be namespace * qualified). It also has additional attributes such as doc, which named schemas * enum and record have (though not fixed schemas, which also have names), and * fields also have default and order attributes, shared by no other schema type. */ /** * Exceptions associated with parsing JSON schema representations * @package Avro */ class AvroSchemaParseException extends AvroException {}\AvroArraySchema
- (so throw an error? or ignore?) * - schema may contain multiple definitions of a named schema * if definitions are equivalent (?) * - Cleanup default namespace and named schemata handling. * - For one, it appears to be *too* global. According to the spec, * we should only be referencing schemas that are named within the * *enclosing* schema, so those in sibling schemas (say, unions or fields) * shouldn't be referenced, if I understand the spec correctly. * - Also, if a named schema is defined more than once in the same schema, * it must have the same definition: so it appears we *do* need to keep * track of named schemata globally as well. (And does this play well * with the requirements regarding enclosing schema? * - default values for bytes and fixed fields are JSON strings, * where unicode code points 0-255 are mapped to unsigned 8-bit byte values 0-255 * - make sure other default values for other schema are of appropriate type * - Should AvroField really be an AvroSchema object? Avro Fields have a name * attribute, but not a namespace attribute (and the name can't be namespace * qualified). It also has additional attributes such as doc, which named schemas * enum and record have (though not fixed schemas, which also have names), and * fields also have default and order attributes, shared by no other schema type. */ /** * Exceptions associated with parsing JSON schema representations * @package Avro */ class AvroSchemaParseException extends AvroException {}\AvroMapSchema
- (so throw an error? or ignore?) * - schema may contain multiple definitions of a named schema * if definitions are equivalent (?) * - Cleanup default namespace and named schemata handling. * - For one, it appears to be *too* global. According to the spec, * we should only be referencing schemas that are named within the * *enclosing* schema, so those in sibling schemas (say, unions or fields) * shouldn't be referenced, if I understand the spec correctly. * - Also, if a named schema is defined more than once in the same schema, * it must have the same definition: so it appears we *do* need to keep * track of named schemata globally as well. (And does this play well * with the requirements regarding enclosing schema? * - default values for bytes and fixed fields are JSON strings, * where unicode code points 0-255 are mapped to unsigned 8-bit byte values 0-255 * - make sure other default values for other schema are of appropriate type * - Should AvroField really be an AvroSchema object? Avro Fields have a name * attribute, but not a namespace attribute (and the name can't be namespace * qualified). It also has additional attributes such as doc, which named schemas * enum and record have (though not fixed schemas, which also have names), and * fields also have default and order attributes, shared by no other schema type. */ /** * Exceptions associated with parsing JSON schema representations * @package Avro */ class AvroSchemaParseException extends AvroException {}\AvroUnionSchema
- (so throw an error? or ignore?) * - schema may contain multiple definitions of a named schema * if definitions are equivalent (?) * - Cleanup default namespace and named schemata handling. * - For one, it appears to be *too* global. According to the spec, * we should only be referencing schemas that are named within the * *enclosing* schema, so those in sibling schemas (say, unions or fields) * shouldn't be referenced, if I understand the spec correctly. * - Also, if a named schema is defined more than once in the same schema, * it must have the same definition: so it appears we *do* need to keep * track of named schemata globally as well. (And does this play well * with the requirements regarding enclosing schema? * - default values for bytes and fixed fields are JSON strings, * where unicode code points 0-255 are mapped to unsigned 8-bit byte values 0-255 * - make sure other default values for other schema are of appropriate type * - Should AvroField really be an AvroSchema object? Avro Fields have a name * attribute, but not a namespace attribute (and the name can't be namespace * qualified). It also has additional attributes such as doc, which named schemas * enum and record have (though not fixed schemas, which also have names), and * fields also have default and order attributes, shared by no other schema type. */ /** * Exceptions associated with parsing JSON schema representations * @package Avro */ class AvroSchemaParseException extends AvroException {}\AvroNamedSchema
- (so throw an error? or ignore?) * - schema may contain multiple definitions of a named schema * if definitions are equivalent (?) * - Cleanup default namespace and named schemata handling. * - For one, it appears to be *too* global. According to the spec, * we should only be referencing schemas that are named within the * *enclosing* schema, so those in sibling schemas (say, unions or fields) * shouldn't be referenced, if I understand the spec correctly. * - Also, if a named schema is defined more than once in the same schema, * it must have the same definition: so it appears we *do* need to keep * track of named schemata globally as well. (And does this play well * with the requirements regarding enclosing schema? * - default values for bytes and fixed fields are JSON strings, * where unicode code points 0-255 are mapped to unsigned 8-bit byte values 0-255 * - make sure other default values for other schema are of appropriate type * - Should AvroField really be an AvroSchema object? Avro Fields have a name * attribute, but not a namespace attribute (and the name can't be namespace * qualified). It also has additional attributes such as doc, which named schemas * enum and record have (though not fixed schemas, which also have names), and * fields also have default and order attributes, shared by no other schema type. */ /** * Exceptions associated with parsing JSON schema representations * @package Avro */ class AvroSchemaParseException extends AvroException {}\AvroName
- (so throw an error? or ignore?) * - schema may contain multiple definitions of a named schema * if definitions are equivalent (?) * - Cleanup default namespace and named schemata handling. * - For one, it appears to be *too* global. According to the spec, * we should only be referencing schemas that are named within the * *enclosing* schema, so those in sibling schemas (say, unions or fields) * shouldn't be referenced, if I understand the spec correctly. * - Also, if a named schema is defined more than once in the same schema, * it must have the same definition: so it appears we *do* need to keep * track of named schemata globally as well. (And does this play well * with the requirements regarding enclosing schema? * - default values for bytes and fixed fields are JSON strings, * where unicode code points 0-255 are mapped to unsigned 8-bit byte values 0-255 * - make sure other default values for other schema are of appropriate type * - Should AvroField really be an AvroSchema object? Avro Fields have a name * attribute, but not a namespace attribute (and the name can't be namespace * qualified). It also has additional attributes such as doc, which named schemas * enum and record have (though not fixed schemas, which also have names), and * fields also have default and order attributes, shared by no other schema type. */ /** * Exceptions associated with parsing JSON schema representations * @package Avro */ class AvroSchemaParseException extends AvroException {}\AvroNamedSchemata
- (so throw an error? or ignore?) * - schema may contain multiple definitions of a named schema * if definitions are equivalent (?) * - Cleanup default namespace and named schemata handling. * - For one, it appears to be *too* global. According to the spec, * we should only be referencing schemas that are named within the * *enclosing* schema, so those in sibling schemas (say, unions or fields) * shouldn't be referenced, if I understand the spec correctly. * - Also, if a named schema is defined more than once in the same schema, * it must have the same definition: so it appears we *do* need to keep * track of named schemata globally as well. (And does this play well * with the requirements regarding enclosing schema? * - default values for bytes and fixed fields are JSON strings, * where unicode code points 0-255 are mapped to unsigned 8-bit byte values 0-255 * - make sure other default values for other schema are of appropriate type * - Should AvroField really be an AvroSchema object? Avro Fields have a name * attribute, but not a namespace attribute (and the name can't be namespace * qualified). It also has additional attributes such as doc, which named schemas * enum and record have (though not fixed schemas, which also have names), and * fields also have default and order attributes, shared by no other schema type. */ /** * Exceptions associated with parsing JSON schema representations * @package Avro */ class AvroSchemaParseException extends AvroException {}\AvroEnumSchema
- (so throw an error? or ignore?) * - schema may contain multiple definitions of a named schema * if definitions are equivalent (?) * - Cleanup default namespace and named schemata handling. * - For one, it appears to be *too* global. According to the spec, * we should only be referencing schemas that are named within the * *enclosing* schema, so those in sibling schemas (say, unions or fields) * shouldn't be referenced, if I understand the spec correctly. * - Also, if a named schema is defined more than once in the same schema, * it must have the same definition: so it appears we *do* need to keep * track of named schemata globally as well. (And does this play well * with the requirements regarding enclosing schema? * - default values for bytes and fixed fields are JSON strings, * where unicode code points 0-255 are mapped to unsigned 8-bit byte values 0-255 * - make sure other default values for other schema are of appropriate type * - Should AvroField really be an AvroSchema object? Avro Fields have a name * attribute, but not a namespace attribute (and the name can't be namespace * qualified). It also has additional attributes such as doc, which named schemas * enum and record have (though not fixed schemas, which also have names), and * fields also have default and order attributes, shared by no other schema type. */ /** * Exceptions associated with parsing JSON schema representations * @package Avro */ class AvroSchemaParseException extends AvroException {}\AvroFixedSchema
- (so throw an error? or ignore?) * - schema may contain multiple definitions of a named schema * if definitions are equivalent (?) * - Cleanup default namespace and named schemata handling. * - For one, it appears to be *too* global. According to the spec, * we should only be referencing schemas that are named within the * *enclosing* schema, so those in sibling schemas (say, unions or fields) * shouldn't be referenced, if I understand the spec correctly. * - Also, if a named schema is defined more than once in the same schema, * it must have the same definition: so it appears we *do* need to keep * track of named schemata globally as well. (And does this play well * with the requirements regarding enclosing schema? * - default values for bytes and fixed fields are JSON strings, * where unicode code points 0-255 are mapped to unsigned 8-bit byte values 0-255 * - make sure other default values for other schema are of appropriate type * - Should AvroField really be an AvroSchema object? Avro Fields have a name * attribute, but not a namespace attribute (and the name can't be namespace * qualified). It also has additional attributes such as doc, which named schemas * enum and record have (though not fixed schemas, which also have names), and * fields also have default and order attributes, shared by no other schema type. */ /** * Exceptions associated with parsing JSON schema representations * @package Avro */ class AvroSchemaParseException extends AvroException {}\AvroRecordSchema
- (so throw an error? or ignore?) * - schema may contain multiple definitions of a named schema * if definitions are equivalent (?) * - Cleanup default namespace and named schemata handling. * - For one, it appears to be *too* global. According to the spec, * we should only be referencing schemas that are named within the * *enclosing* schema, so those in sibling schemas (say, unions or fields) * shouldn't be referenced, if I understand the spec correctly. * - Also, if a named schema is defined more than once in the same schema, * it must have the same definition: so it appears we *do* need to keep * track of named schemata globally as well. (And does this play well * with the requirements regarding enclosing schema? * - default values for bytes and fixed fields are JSON strings, * where unicode code points 0-255 are mapped to unsigned 8-bit byte values 0-255 * - make sure other default values for other schema are of appropriate type * - Should AvroField really be an AvroSchema object? Avro Fields have a name * attribute, but not a namespace attribute (and the name can't be namespace * qualified). It also has additional attributes such as doc, which named schemas * enum and record have (though not fixed schemas, which also have names), and * fields also have default and order attributes, shared by no other schema type. */ /** * Exceptions associated with parsing JSON schema representations * @package Avro */ class AvroSchemaParseException extends AvroException {}\AvroField
- = $avro["namespace"]\AvroProtocol
- = $avro["namespace"]\AvroProtocolMessage
- = $avro["namespace"]\AvroProtocolParseException
Download Latest Version: 5.1.1

Code Integration Example
Make sure to include the correct namespace and class paths for proper usage.
<?php
// Example from PHPlibraries.com
require_once 'libs/flix-tech/avro-php/5.1.1/loader.php';
require_once 'libs/flix-tech/avro/{lib_version}/loader.php';
require_once 'libs/php-avro/avro/{lib_version}/loader.php';
use Avro\Schema;
use Avro\DataIO\AvroDataIO;
$obj = new Schema();
echo '✅ Test OK: ' . get_class($obj);
?>
We aim to make using PHP packages easier without Composer. If something doesn't work, let us know — we'll fix it promptly.
Community Discussion
Ask questions, share tips, or report issues below.