Download the PHP package ascio/ascio-framework without Composer
On this page you can find all versions of the php package ascio/ascio-framework. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ascio/ascio-framework
More information about ascio/ascio-framework
Files in ascio/ascio-framework
Package ascio-framework
Short Description PHP Framework for the Ascio-API. Sync, AutoQueue, Update, REST-API
License MIT
Informations about the package ascio-framework
Ascio-Framework
A php framework with docker to sync and connect to the ascio-api. Scalable, based on docker and kafka.
It makes make domain-management-processes easear like:
- Sync all data from ascio to the local databases in realtime.
- Auto-Queue blocking orders
- Scalable architecture
- Consume the poll-queue with multiple orders
- Provide one $domain->update functions. Change data, update, and all orders will be queued
- Auto unlock-relock
- REST-API: https://app.swaggerhub.com/apis/rendermani/Ascio-Framework/1.0.0-oas3
Requirements
The only requirement is docker. It can be downloaded here: https://www.docker.com/
Installation
- Clone repository:
git clone https://github.com/rendermani/ascio-framework.git ascio-framework
cd ascio-framework
chmod u+x bin/init.sh
- Run
bin/init.sh <<github token>>
. The github-token can be used optionally to extend quotas (Could not authenticate against github.com). It can be obtained here: https://github.com/settings/tokens - Set missing passwords in the .env
- Enter the ascio-credentials in config/accounts/default.json
- Run
bin/up.sh
Initial database sync: ascio > local
At the beginning the database is empty. As Ascio-messages are sent, when something changes, an initial sync must be done at the beginning. The sync-orders script syncs all orders and data that belongs to the orders, like Domains or SSL-Certificates.
- make sure the installation is complete, and default.json contains valid credentials and environment
- run
bin/sync-orders.sh
Testing the installation
At the beginning there will be a Kafka exception in the logs. This will be gone as soon as Kafka has fully loaded. There is no dependancy on Kafka, because the Kafka could run somewhere else.
- run
bin/logs.sh
. Look for 401 Authentification failed - run
bin/php sandbox/create-order.php
- observe the logs for poll complete.
- check the database: http://localhost:8001/
Locations
- phpmyadmin: http://localhost:8001/
- REST-API: http://localhost:8000/
Commands
- Init framework, create tables, build:
bin/init.sh
- Initials sync orders:
bin/sync-orders.sh
- Start:
bin/up.sh
- Stop:
bin/down.sh
- Restart framework:
bin/restart-framework.sh
- View logs:
bin/logs.sh
- Docker shell:
docker exec -it ascio-framework-php bash
- Execute php:
docker exec ascio-framework-php php sandbox/my-example.php
Example Code
Examples are in the sandbox directory. Here some examples:
Autoqueue the next order when blocked
First a register-order is created and a domain is registered. By setting $submitOptions->setQueue(false) the order is directly submitted. After that a expire-order is sent. But as the asynchronous register orders is still running, the expire order is queued in the database and started when the register is completed.
The update() method
Normally it's required to know the order-type when changing data. With the update method of the domain, it's possible to change any data and the order-type will be automatically selected. If multiple order-types are required, orders are queued like in the example above.
Some order-types can change 2 different objects. Like the owner-change can change the registrant and the admin-contact in one request. In this case, the update method only uses necessary objects.
Store data into databases
All data is auto-stored in the database. If data should be stored manually, please use $object->produce()
to store data into all databases. This function should be use carefully, because data could get out of sync.
Read data from the database
Database can be read from any database. Objects like domains have a serialize and deserialize data. Please use $object->deserialize()
to import data. And $object->serialize($data)
or $object->toJson()
to serialize.
Here an example of retrieving data from the database:
Example database connector
Database connectors listen on the Kafka-service and write data into the database. It's possible to include own connectors. Right now Redis and Couch are included as examples. This is the Redit-connector.
The process of creating connectors is:
- create the connector in the
docker/docker-compose.yml
. Duplicate the redis-connector, and change the script-name to your file - create the connector file
bin/down.sh
bin/up.sh
This is an example Redis connector which is in the services directory.
Read order from the API
Reads an Order from the API. When reading from the API, data is automatically synced to all databases.
Read domain by handle from the API
Reads an Domain from the API. When reading from the API, data is automatically synced to all databases.
Read domain by domain-name from the API
Reads an Domain from the API. When reading from the API, data is automatically synced to all databases.
Update data from the API
Workflow with AutoUnlock
Sometimes locks can prevent updates. This can be an issue when updating thousands of domains, and a few fail because they are locked. They would need to be unlocked and relocked again, after all operations are finished. The AutoUnlock makes this process easier
AutoUnlock before expiring (Delete_Lock)
AutoUnlock before update
This example is the same like the example above, only that the declarative way is used. Instead of adding a $domain->getOrderRequest()->expire()
task, a $domain->getUpdateOrders()
task is added. There could be more changes like $domain->getRegistrant()->setName("Manuel L")
and an OwnerChange would be created. And the UpdateLock released if necessary.
All versions of ascio-framework with dependencies
ext-soap Version *
ext-pdo Version *
illuminate/database Version >=5.9@dev
predis/predis Version ^1.1
io-developer/php-whois Version dev-master
giggsey/libphonenumber-for-php Version ^8.12
doctrine/couchdb Version @dev
monolog/monolog Version ^1.23