cs50 / php
CS50 library for PHP
v6.0.1
2020-12-05 18:06 UTC
Requires
- php: >=5.4
- league/oauth2-client: ^1.1
- league/uri: ^4.0
- ramsey/uuid: ^3.1
This package is not auto-updated.
Last update: 2024-12-21 19:10:58 UTC
README
Development
Requires Docker Toolbox.
docker-compose run cli # runs CS50 CLI
Installation
Ubuntu:
$ curl -s https://packagecloud.io/install/repositories/cs50/repo/script.deb.sh | sudo bash
$ sudo apt-get install php-cs50
Fedora
$ curl -s https://packagecloud.io/install/repositories/cs50/repo/script.rpm.sh | sudo bash
$ sudo yum install php-cs50
From Source
- Download the latest release from https://github.com/cs50/php-cs50/releases
- Extract
php-cs50*
- cd
php-cs50
make install # may require sudo
By default, we install to /usr/local/share/php
. If you'd like to change the installation location, run DESTDIR=/path/to/install make install
as desired.
Usage
// assumes CS50.php is in include_path
require("CS50.php");
...
$c = CS50\get_char();
$f = CS50\get_float();
$i = CS50\get_int();
$s = CS50\get_string();
TODO
- Decide whether to add
CS50.eprintf
. - Add tests.
- Review
ID.php
,Database.php
, etc.