Skip to content

Commit

Permalink
tried to get the extension to work..
Browse files Browse the repository at this point in the history
I've updated the raffle script (test.php) in order to dynamically read the given file, add the names.

The problem is... all it currently does is return "yes"
?
  • Loading branch information
fruitl00p committed Jul 5, 2016
1 parent dfcddbd commit 3de8680
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
20 changes: 20 additions & 0 deletions jaytaph-php7-extension/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM alpine:3.4
MAINTAINER [email protected]

# build it and they will com.. pile
RUN apk add --no-cache autoconf gcc g++ make

# Create working dir
RUN mkdir -p /var/app
COPY . /var/app
WORKDIR /var/app

# compile it and they will raffle
RUN phpize && \
./configure && \
make && \
make install &&
echo "extension=domcode.so" >> /usr/local/etc/php/conf.d/domcode.ini

CMD ["php", "test.php", "/var/names/current"]

14 changes: 9 additions & 5 deletions jaytaph-php7-extension/test.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<?php

$d = new DomCode();
$d->addname('foo');
$d->addname('bar');
$d->addname('baz');
$filename = !empty($argv[1]) && is_readable($argv[1]) ? realpath($argv[1]) : '';
if (empty($filename)) {
die('please use `php test.php path_to_file`');
}

echo $d->raffle();
$d = new DomCode();
foreach (array_filter(file($filename)) as $name) {
$d->addname($name);
}
echo $d->raffle().PHP_EOL;

0 comments on commit 3de8680

Please sign in to comment.