Canary
Canary is a cleaner version of the PHP language, for a faster development., (*1)
Warning: The current version is highly unstable, and is under development by SaguiTech's team. Don't use it for production., (*2)
, (*3)
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, (*4)
$ 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:, (*5)
$ canary --version
Example
file.cap, (*6)
echo "hello!\n"
variableWithNumbers10 = 10
VariableA = 'yes'
varB = 'no'
if (VariableA == varB)
echo 'yes!'
else
echo 'no!'
Then run:, (*7)
$ canary run file.cap
, (*8)
The output is (file.php):, (*9)
<?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., (*10)
Next steps
- Implement unit tests;
- Lexical analysis.