forked from TheUnknownOnes/phosphor7
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Benjamin Schwarze
authored and
Benjamin Schwarze
committed
Jun 1, 2017
1 parent
a6314a5
commit 64ecf7e
Showing
14 changed files
with
5,583 additions
and
0 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,44 @@ | ||
<?php | ||
|
||
function addSrc($Name, $Target) { | ||
echo "Adding " . basename($Name) . PHP_EOL; | ||
fputs($Target, PHP_EOL); | ||
$File = fopen($Name, "r"); | ||
try { | ||
while (! feof($File)) { | ||
fwrite($Target, fread($File, 102400)); | ||
} | ||
} | ||
finally { | ||
fclose($File); | ||
} | ||
} | ||
|
||
$SrcDir = realpath(dirname(__FILE__) . "/../src"); | ||
$DistDir = realpath(dirname(__FILE__) . "/../dist/one_src_file"); | ||
$TargetFile = "$DistDir/phosphor7.php"; | ||
|
||
|
||
|
||
$Target = fopen($TargetFile, "w"); | ||
try { | ||
fputs($Target,'<?php define("PHOSPHOR7_EXTERNAL_REQUIRE_MANAGEMENT", 1); ?>'); | ||
|
||
addSrc("$SrcDir/p7_global.php", $Target); | ||
addSrc("$SrcDir/p7_ctypes.php", $Target); | ||
addSrc("$SrcDir/p7_errno.php", $Target); | ||
addSrc("$SrcDir/p7_netinet_in.php", $Target); | ||
addSrc("$SrcDir/snap_sysutils.php", $Target); | ||
addSrc("$SrcDir/snap_msgsock.php", $Target); | ||
addSrc("$SrcDir/s7_isotcp.php", $Target); | ||
addSrc("$SrcDir/s7_types.php", $Target); | ||
addSrc("$SrcDir/s7_peer.php", $Target); | ||
addSrc("$SrcDir/s7_micro_client.php", $Target); | ||
addSrc("$SrcDir/phosphor7.php", $Target); | ||
} | ||
finally { | ||
fclose($Target); | ||
echo "Done!" . PHP_EOL; | ||
} | ||
|
||
?> |
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,2 @@ | ||
* | ||
!.gitignore |
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,15 @@ | ||
<?php | ||
|
||
require_once("../src/phosphor7.php"); | ||
|
||
$c = new TSnap7MicroClient(); | ||
|
||
$c->ConnectTo("10.11.6.2", 0, 0); | ||
|
||
$buffer = ""; | ||
$c->DBRead(7, 0, 12, $buffer); //reads first 12 bytes of DB07 | ||
var_dump(bin2hex($buffer)); | ||
|
||
$c->Disconnect(); | ||
|
||
?> |
Oops, something went wrong.