Skip to content

Latest commit

 

History

History
94 lines (67 loc) · 1.47 KB

README.md

File metadata and controls

94 lines (67 loc) · 1.47 KB

Canary

Canary is a cleaner version of the PHP language, for a faster development.

Warning: The current version is highly unstable, and is under development by SaguiTech's team. Don't use it for production.

Build Status

Features

  • Code without annoying semicolons;
  • and the $ preceding variables.

Installation

You can be cloning this repository and build a PHP Archive (PHAR) using the box-project

$ git clone https://github.com/SaguiTech/Canary.git
$ composer update
$ php vendor/bin/box build
$ chmod +x canary.phar
$ mv canary.phar /usr/local/bin/canary

Check the installation:

$ canary --version

Example

file.cap

echo "hello!\n"

variableWithNumbers10 = 10

VariableA = 'yes'
varB = 'no'

if (VariableA == varB)
	echo 'yes!'
else
	echo 'no!'

Then run:

$ canary run file.cap

The output is (file.php):

<?php
echo "hello!\n";

$variableWithNumbers10 = 10;

$VariableA = 'yes';
$varB = 'no';

if ($VariableA == $varB)
	echo 'yes!';
else
	echo 'no!';

Other commands

$ canary run -h

Running the tests

$ php vendor/bin/phpunit --bootstrap vendor/autoload.php tests/

Warning

This code is not tested with many cases. It's under development.

Next steps

  • Implement unit tests;
  • Lexical analysis.