Skip to content
This repository was archived by the owner on Apr 6, 2021. It is now read-only.

Commit e9dc48d

Browse files
author
chrisisbeef
committed
updating dist in repo
1 parent 0fc1694 commit e9dc48d

File tree

11 files changed

+4976
-1286
lines changed

11 files changed

+4976
-1286
lines changed

build-functions.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function rmdirr($dirname)
3737
$dir = dir($dirname);
3838
while (false !== $entry = $dir->read()) {
3939
// Skip pointers
40-
if ($entry == '.' || $entry == '..') {
40+
if ($entry == '.' || $entry == '..' || $entry == '.svn' ) {
4141
continue;
4242
}
4343

@@ -47,7 +47,7 @@ function rmdirr($dirname)
4747

4848
// Clean up
4949
$dir->close();
50-
return rmdir($dirname);
50+
return;// rmdir($dirname);
5151
}
5252

5353
/**
@@ -231,14 +231,16 @@ function copydir( $src, $dst, $allow_extensions = array( 'js' ), $ignore_files =
231231
$filelist = get_files($src, $allow_extensions, $ignore_files, $ignore_regex, $ignore_dirs);
232232
foreach($filelist as $i=>$file) {
233233
$dir_name = substr( $file, 0, strrpos( $file, '/' ) );
234-
if ( !is_dir($dir_name) ) {
235-
echo("- Creating Directory: $dir_name\n");
236-
mkdir($dir_name);
234+
$dir_name = substr( $dir_name, strlen($src)+1 );
235+
if ( !is_dir($dst.$dir_name) ) {
236+
echo("- Creating Directory: $dst$dir_name\n");
237+
mkdir($dst.$dir_name);
237238
}
238239

239240
$dst_file = substr( $file, strlen( $src )+1 );
240241
echo("- $file (".filesize($file)." bytes) => $dst$dst_file");
241242
copy( $file, $dst.$dst_file );
243+
usleep(5000);
242244
if ( filesize($file) == filesize($dst.$dst_file) )
243245
echo("\t[OK]\n");
244246
else

build-properties.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
$OUTPUT_LIBS = "lib/";
2323
$OUTPUT_FILE = "esapi.js";
2424
$OUTPUT_FILE_COMPRESSED = "esapi-compressed.js";
25+
$OUTPUT_SRC = "src/";
2526

2627
$JDK_HOME = "/home/cschmidt/jdk1.6.0_14/";
2728
$YUI_COMPRESSOR_JAR = "lib/yuicompressor-2.4.2.jar";

build.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@
1717

1818
$build_start = microtime_float();
1919

20+
echo("Cleaning up Distribution Directory");
2021
rmdirr($OUTPUT_DIR);
21-
if ( !is_dir($TMP_DIR) ) mkdir($TMP_DIR, 0700);
22-
mkdir($OUTPUT_DIR, 0700);
22+
if ( !is_dir($TMP_DIR ) ) mkdir($TMP_DIR, 0700);
23+
if ( !is_dir($OUTPUT_DIR ) ) mkdir($OUTPUT_DIR, 0700);
2324

2425
echo("Building Uncompressed File: $OUTPUT_DIR$OUTPUT_FILE\n\r");
2526
$time_start = microtime_float();
@@ -66,16 +67,20 @@
6667
echo("Finished building $OUTPUT_DIR$OUTPUT_FILE_COMPRESSED (".filesize($OUTPUT_DIR.$OUTPUT_FILE_COMPRESSED)." bytes): Took ".( microtime_float() - $time_start )."s\n" );
6768

6869
echo("\nCopying Resources to $OUTPUT_DIR$OUTPUT_RESOURCES\n");
69-
mkdir($OUTPUT_DIR.'resources');
70+
if (!is_dir($OUTPUT_DIR.$OUTPUT_RESOURCES))mkdir($OUTPUT_DIR.'resources');
7071
copydir($RESOURCES_DIR,$OUTPUT_DIR.$OUTPUT_RESOURCES);
7172

7273
echo("\nCopying Documentation to $OUTPUT_DIR$OUTPUT_DOCUMENTATION\n");
73-
mkdir($OUTPUT_DIR.$OUTPUT_DOCUMENTATION);
74+
if (!is_dir($OUTPUT_DIR.$OUTPUT_DOCUMENTATION))mkdir($OUTPUT_DIR.$OUTPUT_DOCUMENTATION);
7475
copydir($DOCUMENTATION_DIR,$OUTPUT_DIR.$OUTPUT_DOCUMENTATION, '*' );
7576

7677
echo("\nCopying Libraries to $OUTPUT_DIR$OUTPUT_LIBS\n");
77-
mkdir($OUTPUT_DIR.$OUTPUT_LIBS);
78+
if (!is_dir($OUTPUT_DIR.$OUTPUT_LIBS))mkdir($OUTPUT_DIR.$OUTPUT_LIBS);
7879
copydir($LIB_DIR,$OUTPUT_DIR.$OUTPUT_LIBS);
80+
81+
echo("\nCopying Build Files and LICENSE\n");
82+
copy( "LICENSE", $OUTPUT_DIR."/LICENSE");
83+
7984
echo("\nCleaning Up\n\n");
8085
rmdir($TMP_DIR);
8186

dist/LICENSE

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
The BSD License
2+
3+
Copyright (c) 2007, The OWASP Foundation
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
7+
8+
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
9+
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
10+
Neither the name of the OWASP Foundation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
11+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
12+

dist/docs/README

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
======================================================================================
2+
OWASP Enterprise Security API (ESAPI)
3+
4+
This file is part of the Open Web Application Security Project (OWASP)
5+
Enterprise Security API (ESAPI) project. For details, please see
6+
http://www.owasp.org/index.php/ESAPI.
7+
8+
Copyright (c) 2008 - The OWASP Foundation
9+
10+
The ESAPI is published by OWASP under the BSD license. You should read and accept the
11+
LICENSE before you use, modify, and/or redistribute this software.
12+
======================================================================================
13+
14+
Installation:
15+
1. Download the distribution zip from http://owasp-esapi-js.googlecode.com
16+
2. Unzip the distribution zip
17+
3. Create a directory on your server, under the web root called esapi4js
18+
4. Copy either esapi.js or esapi-compressed.js from dist/ to your esapi4js directory
19+
5. Create a lib directory under the esapi4js called lib and copy the contents of dist/lib to that directory
20+
6. Create a resources directory under the esapi4js called resources and copy the contents of dist/resources to that directory
21+
22+
Quick Start:
23+
24+
<!-- esapi4js dependencies -->
25+
<script type="text/javascript" language="JavaScript" src="{your_installation_path}/esapi4js/lib/log4js.js"></script>
26+
<!-- esapi4js configuration -->
27+
<script type="text/javascript" language="JavaScript" src="{your_installation_path}/esapi4js/resources/Base.esapi.properties.js"></script>
28+
<!-- esapi4js core -->
29+
<script type="text/javascript" language="JavaScript" src="{your_installation_path}/esapi4js/esapi.js"></script>
30+
31+
<script type="text/javascript" language="JavaScript">
32+
// Set any custom configuration options here or in an external js file that gets sourced in above.
33+
Base.esapi.properties.logging['ApplicationLogger'] = {
34+
Level: org.owasp.esapi.Logger.ALL,
35+
Appenders: [ new Log4js.ConsoleAppender() ],
36+
LogUrl: true,
37+
LogApplicationName: true,
38+
EncodingRequired: true
39+
};
40+
41+
Base.esapi.properties.application.Name = "My Application v1.0";
42+
43+
// Initialize the api
44+
org.owasp.esapi.ESAPI.initialize();
45+
46+
// Using the logger
47+
$ESAPI.logger().getLogger('ApplicationLogger').info(org.owasp.esapi.Logger.EventType.EVENT_SUCCESS, 'This is a test message');
48+
49+
// Using the encoder
50+
document.writeln( $ESAPI.encoder().encodeForHTML( "<a href=\"http://owasp-esapi-js.googlecode.com\">Check out esapi4js</a>" ) );
51+
52+
// Using the validator
53+
var validateCreditCard = function() {
54+
return $ESAPI.validator().isValidCreditCard( $('CreditCard').value );
55+
}
56+
</script>
57+

0 commit comments

Comments
 (0)