Skip to content

Commit

Permalink
PHP examples & updates to pom files
Browse files Browse the repository at this point in the history
  • Loading branch information
teverett committed Aug 3, 2015
1 parent a403e02 commit 0206fb6
Show file tree
Hide file tree
Showing 54 changed files with 326 additions and 36 deletions.
2 changes: 1 addition & 1 deletion FOL/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<artifactId>antlr4test-maven-plugin</artifactId>
<configuration>
<verbose>false</verbose>
<showTree>true</showTree>
<showTree>false</showTree>
<entryPoint>condition</entryPoint>
<grammarName>FOL</grammarName>
<packageName></packageName>
Expand Down
2 changes: 1 addition & 1 deletion MPS/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<artifactId>antlr4test-maven-plugin</artifactId>
<configuration>
<verbose>false</verbose>
<showTree>true</showTree>
<showTree>false</showTree>
<entryPoint>modell</entryPoint>
<grammarName>MPS</grammarName>
<packageName></packageName>
Expand Down
2 changes: 1 addition & 1 deletion abnf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<artifactId>antlr4test-maven-plugin</artifactId>
<configuration>
<verbose>false</verbose>
<showTree>true</showTree>
<showTree>false</showTree>
<entryPoint>rulelist</entryPoint>
<grammarName>Abnf</grammarName>
<packageName></packageName>
Expand Down
2 changes: 1 addition & 1 deletion arithmetic/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<artifactId>antlr4test-maven-plugin</artifactId>
<configuration>
<verbose>false</verbose>
<showTree>true</showTree>
<showTree>false</showTree>
<entryPoint>equation</entryPoint>
<grammarName>arithmetic</grammarName>
<packageName></packageName>
Expand Down
2 changes: 1 addition & 1 deletion asm6502/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<artifactId>antlr4test-maven-plugin</artifactId>
<configuration>
<verbose>false</verbose>
<showTree>true</showTree>
<showTree>false</showTree>
<entryPoint>prog</entryPoint>
<grammarName>asm6502</grammarName>
<packageName></packageName>
Expand Down
2 changes: 1 addition & 1 deletion basic/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<artifactId>antlr4test-maven-plugin</artifactId>
<configuration>
<verbose>false</verbose>
<showTree>true</showTree>
<showTree>false</showTree>
<entryPoint>prog</entryPoint>
<grammarName>jvmBasic</grammarName>
<packageName></packageName>
Expand Down
2 changes: 1 addition & 1 deletion bnf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<artifactId>antlr4test-maven-plugin</artifactId>
<configuration>
<verbose>false</verbose>
<showTree>true</showTree>
<showTree>false</showTree>
<entryPoint>rulelist</entryPoint>
<grammarName>bnf</grammarName>
<packageName></packageName>
Expand Down
2 changes: 1 addition & 1 deletion c/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<artifactId>antlr4test-maven-plugin</artifactId>
<configuration>
<verbose>false</verbose>
<showTree>true</showTree>
<showTree>false</showTree>
<entryPoint>primaryExpression</entryPoint>
<grammarName>C</grammarName>
<packageName></packageName>
Expand Down
2 changes: 1 addition & 1 deletion calculator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<artifactId>antlr4test-maven-plugin</artifactId>
<configuration>
<verbose>false</verbose>
<showTree>true</showTree>
<showTree>false</showTree>
<entryPoint>equation</entryPoint>
<grammarName>calculator</grammarName>
<packageName></packageName>
Expand Down
2 changes: 1 addition & 1 deletion cpp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<artifactId>antlr4test-maven-plugin</artifactId>
<configuration>
<verbose>false</verbose>
<showTree>true</showTree>
<showTree>false</showTree>
<entryPoint>translationunit</entryPoint>
<grammarName>CPP14</grammarName>
<packageName>grammar</packageName>
Expand Down
2 changes: 1 addition & 1 deletion creole/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<artifactId>antlr4test-maven-plugin</artifactId>
<configuration>
<verbose>false</verbose>
<showTree>true</showTree>
<showTree>false</showTree>
<entryPoint>document</entryPoint>
<grammarName>creole</grammarName>
<packageName></packageName>
Expand Down
2 changes: 1 addition & 1 deletion csv/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<artifactId>antlr4test-maven-plugin</artifactId>
<configuration>
<verbose>false</verbose>
<showTree>true</showTree>
<showTree>false</showTree>
<entryPoint>file</entryPoint>
<grammarName>CSV</grammarName>
<packageName></packageName>
Expand Down
2 changes: 1 addition & 1 deletion dot/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<artifactId>antlr4test-maven-plugin</artifactId>
<configuration>
<verbose>false</verbose>
<showTree>true</showTree>
<showTree>false</showTree>
<entryPoint>graph</entryPoint>
<grammarName>DOT</grammarName>
<packageName></packageName>
Expand Down
2 changes: 1 addition & 1 deletion erlang/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<artifactId>antlr4test-maven-plugin</artifactId>
<configuration>
<verbose>false</verbose>
<showTree>true</showTree>
<showTree>false</showTree>
<entryPoint>forms</entryPoint>
<grammarName>Erlang</grammarName>
<packageName></packageName>
Expand Down
2 changes: 1 addition & 1 deletion fasta/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<artifactId>antlr4test-maven-plugin</artifactId>
<configuration>
<verbose>false</verbose>
<showTree>true</showTree>
<showTree>false</showTree>
<entryPoint>sequence</entryPoint>
<grammarName>fasta</grammarName>
<packageName></packageName>
Expand Down
2 changes: 1 addition & 1 deletion gff3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<artifactId>antlr4test-maven-plugin</artifactId>
<configuration>
<verbose>false</verbose>
<showTree>true</showTree>
<showTree>false</showTree>
<entryPoint>document</entryPoint>
<grammarName>gff3</grammarName>
<packageName></packageName>
Expand Down
2 changes: 1 addition & 1 deletion html/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<configuration>
<enabled>false</enabled>
<verbose>false</verbose>
<showTree>true</showTree>
<showTree>false</showTree>
<entryPoint>htmlDocument</entryPoint>
<grammarName>HTML</grammarName>
<packageName></packageName>
Expand Down
2 changes: 1 addition & 1 deletion idl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<artifactId>antlr4test-maven-plugin</artifactId>
<configuration>
<verbose>false</verbose>
<showTree>true</showTree>
<showTree>false</showTree>
<entryPoint>specification</entryPoint>
<grammarName>IDL</grammarName>
<packageName></packageName>
Expand Down
2 changes: 1 addition & 1 deletion json/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<artifactId>antlr4test-maven-plugin</artifactId>
<configuration>
<verbose>false</verbose>
<showTree>true</showTree>
<showTree>false</showTree>
<entryPoint>json</entryPoint>
<grammarName>JSON</grammarName>
<packageName></packageName>
Expand Down
2 changes: 1 addition & 1 deletion logo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<artifactId>antlr4test-maven-plugin</artifactId>
<configuration>
<verbose>false</verbose>
<showTree>true</showTree>
<showTree>false</showTree>
<entryPoint>prog</entryPoint>
<grammarName>logo</grammarName>
<packageName></packageName>
Expand Down
2 changes: 1 addition & 1 deletion lua/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<artifactId>antlr4test-maven-plugin</artifactId>
<configuration>
<verbose>false</verbose>
<showTree>true</showTree>
<showTree>false</showTree>
<entryPoint>chunk</entryPoint>
<grammarName>Lua</grammarName>
<packageName></packageName>
Expand Down
2 changes: 1 addition & 1 deletion mumath/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<artifactId>antlr4test-maven-plugin</artifactId>
<configuration>
<verbose>false</verbose>
<showTree>true</showTree>
<showTree>false</showTree>
<entryPoint>program</entryPoint>
<grammarName>mumath</grammarName>
<packageName></packageName>
Expand Down
2 changes: 1 addition & 1 deletion mumps/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<artifactId>antlr4test-maven-plugin</artifactId>
<configuration>
<verbose>false</verbose>
<showTree>true</showTree>
<showTree>false</showTree>
<entryPoint>program</entryPoint>
<grammarName>mumps</grammarName>
<packageName></packageName>
Expand Down
2 changes: 1 addition & 1 deletion objc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<artifactId>antlr4test-maven-plugin</artifactId>
<configuration>
<verbose>false</verbose>
<showTree>true</showTree>
<showTree>false</showTree>
<entryPoint>translation_unit</entryPoint>
<grammarName>ObjC</grammarName>
<packageName></packageName>
Expand Down
2 changes: 1 addition & 1 deletion pascal/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<artifactId>antlr4test-maven-plugin</artifactId>
<configuration>
<verbose>false</verbose>
<showTree>true</showTree>
<showTree>false</showTree>
<entryPoint>program</entryPoint>
<grammarName>pascal</grammarName>
<packageName></packageName>
Expand Down
2 changes: 1 addition & 1 deletion pgn/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<artifactId>antlr4test-maven-plugin</artifactId>
<configuration>
<verbose>false</verbose>
<showTree>true</showTree>
<showTree>false</showTree>
<entryPoint>parse</entryPoint>
<grammarName>PGN</grammarName>
<packageName></packageName>
Expand Down
29 changes: 29 additions & 0 deletions php/examples/colors.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php



$FavoriteColor = "green";



if ($FavoriteColor == "blue") {



print ("I like blue too!");



} elseif ($FavoriteColor = green) {



print ("MMMmmmmmmmmmm, green!");



}



?>
16 changes: 16 additions & 0 deletions php/examples/datetime.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<head>
<?
print(Date("l F d, Y"));
?>
</head>
<body>
<?
print("hi");
?>

This is body text

</body>



77 changes: 77 additions & 0 deletions php/examples/db.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?
/*
Copyright 2000-2001 KMR Enterprises
Scripted by TDavid @ https://www.tdscripts.com/
php-scripts.com Example #27
Purpose: to add and remove users from a mySQL table
This code is made available freely to modify as long as
this COMPLETE header is not removed. If you decide to use this
code then please put up a reciprocal link back to our site at
https://www.tdscripts.com/
We cannot, and will not, be held liable for any use or misuse
of the code contained herein. Any upload or execution of the
code implies understanding and agreement of these terms of use.
*/

$db = "DATABASE NAME";
$admin = "MYSQL USER NAME";
$adpass = "MYSQL PASSWORD";
$mysql_link = mysql_connect("localhost", $admin, $adpass);
mysql_select_db($db, $mysql_link);

?>
<HTML>
<BODY>
<?
if($react == "delete_user") {
if($user) {
$query = "DELETE from login WHERE user='$user' ";
$result = mysql_query($query, $mysql_link);
if(mysql_num_rows($result)) {
print("<strong>$user</strong> successfully deleted<p>");
}
} else {
print("<strong>no users are available to delete yet, sorry.</strong><p>");
}
}
elseif ($react == "add_user") {
if(($user) and ($pass)) {
$query = "INSERT into login VALUES ( ";
$query .= "0, SYSDATE(), '$username', '$password' )";
mysql_query($query, $mysql_link);
} else {
print("<strong>either your user or password field was left blank</strong><p>");
}
}
else {
print("<center>Administration Area - Choose your option</center>");
}?>
<form method="POST" action="admin.php3"><div align="center"><center><p>Delete Users
<input type="hidden" name="react" value="delete_user">
<select name="user" size="1">
<?
$query = "SELECT user FROM login ORDER BY user";
$result = mysql_query($query, $mysql_link);
if(mysql_num_rows($result)) {
// we have at least one user, so show all users as options in select form
while($row = mysql_fetch_row($result))
{
print("<option value=\"$row[0]\">$row[0]</option>");
}
} else {
print("<option value=\"\">No users created yet</option>");
}
?>
</select><input type="submit" value="Submit"></p></center></div>
</form>
<form method="POST" action="admin.php3">
<input type="hidden" name="react" value="add_user">
<div align="center"><center><p>ADD A New User<br>
User: <input type="text" name="user" size="20"><br>
Pass: <input type="text" name="pass" size="20"><br>
<input type="submit" value="Submit"></p></center></div>
</form>
</BODY>
</HTML>
7 changes: 7 additions & 0 deletions php/examples/dowhile.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php
$i = 0;
do {
echo $i;
} while ($i > 0);
?>

6 changes: 6 additions & 0 deletions php/examples/for.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?
for ($j=0; $j<=10; $j++)
{
echo "The number is: $j <br>";
}
?>
6 changes: 6 additions & 0 deletions php/examples/foreach.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php
$arr = array(1, 2, 3, 4);
foreach ($arr as &$value) {
$value = $value * 2;
}
?>
3 changes: 3 additions & 0 deletions php/examples/hello.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?
echo '<p>Hello World</p>';
?>
4 changes: 4 additions & 0 deletions php/examples/if.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?
if ($a > $b)
echo "a is bigger than b";
?>
5 changes: 5 additions & 0 deletions php/examples/if2.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

if ( $status_obj->publics ) {
}
?>
Loading

0 comments on commit 0206fb6

Please sign in to comment.