GithubHelp home page GithubHelp logo

meldiron / php-runtimes Goto Github PK

View Code? Open in Web Editor NEW

This project forked from appwrite/runtimes

0.0 2.0 0.0 4.06 MB

Appwrite configuration for Cloud Function runtimes settings ๐ŸŒฉ

Home Page: https://appwrite.io

License: BSD 3-Clause "New" or "Revised" License

Shell 22.56% Dockerfile 7.30% PHP 47.15% Dart 2.79% TypeScript 2.75% C# 7.23% JavaScript 2.36% Python 2.39% Ruby 2.14% Java 1.86% Kotlin 1.47%

php-runtimes's Introduction

Appwrite Runtimes

Build Status Total Downloads Discord

Appwrite repository for Cloud Function runtimes that contains the configurations and tests for all of the Appwrite runtime environments. This library is maintained by the Appwrite team.

Getting Started

Install using composer:

composer require appwrite/php-runtimes
<?php

require_once '../vendor/autoload.php';

use Appwrite\Runtimes\Runtimes;

$runtimes = new Runtime();

// returns all supported cloud function runtimes
Runtimes::getAll();

Adding a new Runtime

1. Docker

The first thing to do is to create a Dockerfile under runtimes/.

Important features for a base image are small sizes (Alpine preferred), multi-architecture (x86, ARM, PPC) and active maintenance.

Example for a Dockerfile looks like this:

# Base image
FROM mcr.microsoft.com/dotnet/runtime:5.0-alpine
# Maintainer label
LABEL maintainer="[email protected]"
# Add tar (required for uncompressing functions)
RUN apk add tar
# Set working directory to /usr/local/src/
WORKDIR /usr/local/src/

After that the build command must be added to the build.sh script.

2. Add Runtime

After the Docker image is created, this must be added to the main class of this library.

References to this must be added to the constructor of src/Runtimes/Runtimes.php.

Example:

$dotnet = new Runtime('dotnet', '.NET');
$dotnet->addVersion('5.0', 'mcr.microsoft.com/dotnet/runtime:5.0-alpine', 'appwrite/env-dotnet-5.0:1.0.0', [System::X86, System::ARM]);
$runtimes[] = $dotnet;

3. Add Tests

First of all, a script for the runtime environment must be created. Plenty of examples can be found under tests/resources.

After that start options must be added to the setUp() method found in tests/Runtimes/RuntimesTest.php.

Authors

Torsten Dittmann

Copyright and license

BSD 3-Clause License https://opensource.org/licenses/BSD-3-Clause

php-runtimes's People

Contributors

torstendittmann avatar lohanidamodar avatar eldadfux avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.