All Projects β†’ xp-framework β†’ core

xp-framework / core

Licence: other
The XP Framework is an all-purpose, object oriented PHP framework.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to core

sio-go
Authenticated encryption for streams in Go
Stars: ✭ 21 (+61.54%)
Mutual labels:  streams, io
TypeGame
πŸ‘Ύ Sokoban Game in Pure TypeScript Type System
Stars: ✭ 222 (+1607.69%)
Mutual labels:  unicode, type-system
stream-snitch
Event emitter for watching text streams with regex patterns
Stars: ✭ 19 (+46.15%)
Mutual labels:  streams
REInfer
Runtime Extended Inference for json data.
Stars: ✭ 23 (+76.92%)
Mutual labels:  type-system
PyTOUGH
A Python library for automating TOUGH2 simulations of subsurface fluid and heat flow
Stars: ✭ 64 (+392.31%)
Mutual labels:  io
libWinTF8
The library handling things related to UTF-8 and Unicode when you want to port your program to Windows
Stars: ✭ 18 (+38.46%)
Mutual labels:  unicode
swoole-futures
⏳ Futures, Streams & Async/Await for PHP's Swoole asynchronous run-time.
Stars: ✭ 100 (+669.23%)
Mutual labels:  streams
alfresco-mvc
Glue between SpringMVC @controllers and Alfresco
Stars: ✭ 22 (+69.23%)
Mutual labels:  annotations
typeql
TypeQL: the query language of TypeDB - a strongly-typed database
Stars: ✭ 157 (+1107.69%)
Mutual labels:  type-system
text-rendering-tests
Unicode’s test suite for text rendering engines
Stars: ✭ 135 (+938.46%)
Mutual labels:  unicode
tix
[WIP] A type system for nix
Stars: ✭ 59 (+353.85%)
Mutual labels:  type-system
php-amf3
PHP AMF3 extension
Stars: ✭ 54 (+315.38%)
Mutual labels:  php8
23andme2vcf
convert your 23andme raw file to VCF | DEPRECATED, please see https://github.com/plantimals/2vcf
Stars: ✭ 91 (+600%)
Mutual labels:  annotations
b2a
btoa and atob support for node.js or old browsers, with the Unicode Problems fixed
Stars: ✭ 21 (+61.54%)
Mutual labels:  unicode
jupyter-bbox-widget
A Jupyter widget for annotating images with bounding boxes
Stars: ✭ 19 (+46.15%)
Mutual labels:  annotations
quran-data
Unicode-encoded Quran data
Stars: ✭ 67 (+415.38%)
Mutual labels:  unicode
widestring-rs
A wide string Rust library for converting to and from wide Unicode strings.
Stars: ✭ 48 (+269.23%)
Mutual labels:  unicode
the schema is
ActiveRecord schema annotations done right
Stars: ✭ 44 (+238.46%)
Mutual labels:  annotations
rindow-neuralnetworks
Neural networks library for machine learning on PHP
Stars: ✭ 37 (+184.62%)
Mutual labels:  php8
ISPC-PHPCompiler
Compile and manage multiple PHP versions easily!
Stars: ✭ 35 (+169.23%)
Mutual labels:  php8

XP Framework Core

Build status on GitHub Build status on TravisCI Build status on AppVeyor BSD License Requires PHP 7.0+ Supports PHP 8.0+ Latest Stable Version

This is the XP Framework's development checkout.

Installation

If you just want to use the XP Framework, grab a release using composer require xp-framework/core. If you wish to use this development checkout, clone this repository instead.

Runners

The entry point for software written in the XP Framework is not the PHP interpreter's CLI / web server API but either a command line runner or a specialized web entry point. These runners can be installed by using the following one-liner:

$ cd ~/bin
$ curl -sSL https://baltocdn.com/xp-framework/xp-runners/distribution/downloads/i/installer/setup-8.6.2.sh | sh

Using it

To use the the XP Framework development checkout, put the following in your ~/bin/xp.ini file:

use=/path/to/xp/core

Finally, start xp -v to see it working:

$ xp -v
XP 11.1.3-dev { PHP/8.1.2 & Zend/4.1.2 } @ Windows NT SURFACE 10.0 build 22000 (Windows 10) AMD64
Copyright (c) 2001-2022 the XP group
FileSystemCL<./src/main/php>
FileSystemCL<./src/test/php>
FileSystemCL<./src/main/resources>
FileSystemCL<./src/test/resources>
FileSystemCL<.>

Basic usage

The XP Framework runs scripts or classes.

Hello World

Save the following sourcecode to a file called ageindays.script.php:

<?php namespace examples;

use util\{Date, Dates};
use util\cmd\Console;

$span= Dates::diff(new Date($argv[1]), Date::now());
Console::writeLine('Hey, you are ', $span->getDays(), ' days old');

Now run it:

$ xp ageindays.script.php 1977-12-14
Hey, you are 16015 days old

Alternatively, you can put this code inside a class and give it a static main method. This way, you can use features like inheritance, trait inclusion etcetera. This time, save the code to a file called AgeInDays.class.php.

<?php

use util\{Date, Dates};
use util\cmd\Console;

class AgeInDays {

  public static function main(array $args): int {
    $span= Dates::diff(new Date($args[0]), Date::now());
    Console::writeLine('Hey, you are ', $span->getDays(), ' days old');
    return 0;
  }
}

Note the arguments have shifted by one: If you want the class' name, simply use self::class!

$ xp AgeInDays 1977-12-14
Hey, you are 16015 days old

Contributing

To contribute, use the GitHub way - fork, hack, and submit a pull request! :octocat:

Enjoy!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].