-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tried to get the extension to work..
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
Showing
2 changed files
with
29 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |