Skip to content

Commit d5660f7

Browse files
committed
Update site
1 parent 31bf312 commit d5660f7

File tree

27 files changed

+50
-50
lines changed

27 files changed

+50
-50
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ site:
1414
rake deploy ; \
1515
cd .. ; \
1616
git add . ; \
17-
git commit -am "${MSG}" ; \
17+
git commit -am "Update site" ; \
1818
git push origin master
1919

2020
site-clean:

_octopress/_config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
url: http://phpjs.org
66
title: php.js
7-
subtitle: A resource of php functions in JavaScript
7+
subtitle: A community effort to implement PHP functions in JavaScript
88
author: Kevin van Zonneveld
99
simple_search: http://google.com/search
10-
description:
10+
description: Learn how to do it in JavaScript. Explore boundaries. Use the functions that turn out to be great.
1111

1212
# Default date format is "ordinal" (resulting in "July 22nd 2007")
1313
# You can customize the format as defined in

_octopress/source/_includes/custom/header.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ <h1><a href="{{ root_url }}/">php.js</a></h1>
55
</div>
66

77
{% if site.subtitle %}
8-
<h2>{{ site.subtitle }}</h2>
8+
<h2><strong>{{ site.subtitle }}</strong> - {{ site.description }}</h2>
99
{% endif %}
1010
<div class="clear"></div>
1111
</hgroup>

_octopress/source/functions/array_walk_recursive/index.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function array_walk_recursive (array, funcname, userdata) {
2525
// * returns 2: false
2626
var key;
2727

28-
if (typeof array != 'object') {
28+
if (typeof array !== 'object') {
2929
return false;
3030
}
3131

_octopress/source/functions/call_user_func/index.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function call_user_func (cb) {
3535
func = cb;
3636
}
3737

38-
if (typeof func != 'function') {
38+
if (typeof func !== 'function') {
3939
throw new Error(func + ' is not a valid function');
4040
}
4141

_octopress/source/functions/convert_uuencode/index.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function convert_uuencode (str) {
3030
return String.fromCharCode(c);
3131
};
3232

33-
if (!str || str == "") {
33+
if (!str || str === "") {
3434
return chr(0);
3535
} else if (!this.is_scalar(str)) {
3636
return false;

_octopress/source/functions/define/index.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function define (name, value) {
2525
// + revised by: Andrea Giammarchi (http://webreflection.blogspot.com)
2626
// + reimplemented by: Brett Zamir (http://brett-zamir.me)
2727
// * example 1: define('IMAGINARY_CONSTANT1', 'imaginary_value1');
28-
// * results 1: IMAGINARY_CONSTANT1 == 'imaginary_value1'
28+
// * results 1: IMAGINARY_CONSTANT1 === 'imaginary_value1'
2929
var defn, replace, script, that = this,
3030
d = this.window.document;
3131
var toString = function (name, value) {

_octopress/source/functions/explode/index.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ A JavaScript equivalent of PHP's explode
1818
{% codeblock strings/explode.js lang:js https://raw.github.com/kvz/phpjs/master/functions/strings/explode.js raw on github %}
1919
function explode (delimiter, string, limit) {
2020

21-
if ( arguments.length < 2 || typeof delimiter == 'undefined' || typeof string == 'undefined' ) return null;
21+
if ( arguments.length < 2 || typeof delimiter === 'undefined' || typeof string === 'undefined' ) return null;
2222
if ( delimiter === '' || delimiter === false || delimiter === null) return false;
23-
if ( typeof delimiter == 'function' || typeof delimiter == 'object' || typeof string == 'function' || typeof string == 'object'){
23+
if ( typeof delimiter === 'function' || typeof delimiter === 'object' || typeof string === 'function' || typeof string === 'object'){
2424
return { 0: '' };
2525
}
2626
if ( delimiter === true ) delimiter = '1';

_octopress/source/functions/forward_static_call/index.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function forward_static_call (cb, parameters) {
2525

2626
var func;
2727

28-
if (typeof cb == 'string') {
28+
if (typeof cb === 'string') {
2929
if (typeof this[cb] == 'function') {
3030
func = this[cb];
3131
} else {
@@ -36,7 +36,7 @@ function forward_static_call (cb, parameters) {
3636
func = eval(cb[0] + "['" + cb[1] + "']");
3737
}
3838

39-
if (typeof func != 'function') {
39+
if (typeof func !== 'function') {
4040
throw new Error(func + ' is not a valid function');
4141
}
4242

_octopress/source/functions/forward_static_call_array/index.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function forward_static_call_array (cb, parameters) {
2727

2828
var func;
2929

30-
if (typeof cb == 'string') {
30+
if (typeof cb === 'string') {
3131
if (typeof this[cb] == 'function') {
3232
func = this[cb];
3333
} else {
@@ -38,7 +38,7 @@ function forward_static_call_array (cb, parameters) {
3838
func = eval(cb[0] + "['" + cb[1] + "']");
3939
}
4040

41-
if (typeof func != 'function') {
41+
if (typeof func !== 'function') {
4242
throw new Error(func + ' is not a valid function');
4343
}
4444

_octopress/source/functions/http_build_query/index.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ function http_build_query (formdata, numeric_prefix, arg_separator) {
7070
key = String(numeric_prefix) + key;
7171
}
7272
var query=_http_build_query_helper(key, value, arg_separator);
73-
if(query != '') {
73+
if(query !== '') {
7474
tmp.push(query);
7575
}
7676
}

_octopress/source/functions/import_request_variables/index.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function import_request_variables (types, prefix) {
2525
// % note 1: especially if you want to use any of these variables in an eval()-like function (not recommended)!
2626
// * example 1: document.cookie = 'snack=yummy';
2727
// * example 1: import_request_variables('gc', 'pr_');
28-
// * results 1: pr_snack == 'yummy'
28+
// * results 1: pr_snack === 'yummy'
2929
// * example 2: ini_set('phpjs.getVarsObj', $_GET = {}); // Only works in PHP.JS, not PHP (!), though by using ini_set(), it does work as though PHP.JS were an extension to PHP
3030
// * example 2: import_request_variables('g'); // Allows $_GET['myRequestVar'] access to query string variables
3131

_octopress/source/functions/is_finite/index.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ function is_finite (val) {
3232
}
3333

3434
//Some warnings for maximum PHP compatibility
35-
if (typeof val == 'object') {
35+
if (typeof val === 'object') {
3636
warningType = (Object.prototype.toString.call(val) === '[object Array]' ? 'array' : 'object');
37-
} else if (typeof val == 'string' && !val.match(/^[\+\-]?\d/)) {
37+
} else if (typeof val === 'string' && !val.match(/^[\+\-]?\d/)) {
3838
//simulate PHP's behaviour: '-9a' doesn't give a warning, but 'a9' does.
3939
warningType = 'string';
4040
}

_octopress/source/functions/is_infinite/index.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ function is_infinite (val) {
3232
}
3333

3434
//Some warnings for maximum PHP compatibility
35-
if (typeof val == 'object') {
35+
if (typeof val === 'object') {
3636
warningType = (Object.prototype.toString.call(val) === '[object Array]' ? 'array' : 'object');
37-
} else if (typeof val == 'string' && !val.match(/^[\+\-]?\d/)) {
37+
} else if (typeof val === 'string' && !val.match(/^[\+\-]?\d/)) {
3838
//simulate PHP's behaviour: '-9a' doesn't give a warning, but 'a9' does.
3939
warningType = 'string';
4040
}

_octopress/source/functions/is_nan/index.markdown

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ function is_nan (val) {
2626
// * returns 2: false
2727
var warningType = '';
2828

29-
if (typeof val == 'number' && isNaN(val)) {
29+
if (typeof val === 'number' && isNaN(val)) {
3030
return true;
3131
}
3232

3333
//Some errors for maximum PHP compatibility
34-
if (typeof val == 'object') {
34+
if (typeof val === 'object') {
3535
warningType = (Object.prototype.toString.call(val) === '[object Array]' ? 'array' : 'object');
3636
}
37-
else if (typeof val == 'string' && !val.match(/^[\+\-]?\d/)) {
37+
else if (typeof val === 'string' && !val.match(/^[\+\-]?\d/)) {
3838
//simulate PHP's behaviour: '-9a' doesn't give a warning, but 'a9' does.
3939
warningType = 'string';
4040
}

_octopress/source/functions/is_object/index.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function is_object (mixed_var) {
3030
if (Object.prototype.toString.call(mixed_var) === '[object Array]') {
3131
return false;
3232
}
33-
return mixed_var !== null && typeof mixed_var == 'object';
33+
return mixed_var !== null && typeof mixed_var === 'object';
3434
}
3535
{% endcodeblock %}
3636

_octopress/source/functions/max/index.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ function max () {
8787
}
8888
return -1;
8989
}
90-
else if (typeof next == 'object') {
90+
else if (typeof next === 'object') {
9191
return 1;
9292
}
9393
else if (isNaN(next) && !isNaN(current)) {

_octopress/source/functions/metaphone/index.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ function metaphone (word, phones) {
170170
}
171171
} else if (x + 1 <= wordlength) {
172172
if ('EIY'.indexOf(nc) !== -1) {
173-
if (pc != 'G') {
173+
if (pc !== 'G') {
174174
metaword += 'J';
175175
}
176176
} else if (x === 0 || pc !== 'D' || 'EIY'.indexOf(nc) === -1) {

_octopress/source/functions/min/index.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ function min () {
8585
}
8686
return -1;
8787
}
88-
else if (typeof next == 'object') {
88+
else if (typeof next === 'object') {
8989
return 1;
9090
}
9191
else if (isNaN(next) && !isNaN(current)) {

_octopress/source/functions/serialize/index.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ function serialize (mixed_value) {
101101
case 'array': case 'object':
102102
val = 'a';
103103
/*
104-
if (type == 'object') {
104+
if (type === 'object') {
105105
var objname = mixed_value.constructor.toString().match(/(\w+)\(\)/);
106106
if (objname == undefined) {
107107
return;

_octopress/source/functions/sprintf/index.markdown

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ function sprintf () {
9292
var textTransform;
9393
var value;
9494

95-
if (substring == '%%') {
95+
if (substring === '%%') {
9696
return '%';
9797
}
9898

@@ -130,7 +130,7 @@ function sprintf () {
130130
// we want to ignore null, undefined and empty-string values
131131
if (!minWidth) {
132132
minWidth = 0;
133-
} else if (minWidth == '*') {
133+
} else if (minWidth === '*') {
134134
minWidth = +a[i++];
135135
} else if (minWidth.charAt(0) == '*') {
136136
minWidth = +a[minWidth.slice(1, -1)];
@@ -149,8 +149,8 @@ function sprintf () {
149149
}
150150

151151
if (!precision) {
152-
precision = 'fFeE'.indexOf(type) > -1 ? 6 : (type == 'd') ? 0 : undefined;
153-
} else if (precision == '*') {
152+
precision = 'fFeE'.indexOf(type) > -1 ? 6 : (type === 'd') ? 0 : undefined;
153+
} else if (precision === '*') {
154154
precision = +a[i++];
155155
} else if (precision.charAt(0) == '*') {
156156
precision = +a[precision.slice(1, -1)];

_octopress/source/functions/str_pad/index.markdown

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ function str_pad (input, pad_length, pad_string, pad_type) {
4444
input += '';
4545
pad_string = pad_string !== undefined ? pad_string : ' ';
4646

47-
if (pad_type != 'STR_PAD_LEFT' && pad_type != 'STR_PAD_RIGHT' && pad_type != 'STR_PAD_BOTH') {
47+
if (pad_type !== 'STR_PAD_LEFT' && pad_type !== 'STR_PAD_RIGHT' && pad_type !== 'STR_PAD_BOTH') {
4848
pad_type = 'STR_PAD_RIGHT';
4949
}
5050
if ((pad_to_go = pad_length - input.length) > 0) {
51-
if (pad_type == 'STR_PAD_LEFT') {
51+
if (pad_type === 'STR_PAD_LEFT') {
5252
input = str_pad_repeater(pad_string, pad_to_go) + input;
53-
} else if (pad_type == 'STR_PAD_RIGHT') {
53+
} else if (pad_type === 'STR_PAD_RIGHT') {
5454
input = input + str_pad_repeater(pad_string, pad_to_go);
55-
} else if (pad_type == 'STR_PAD_BOTH') {
55+
} else if (pad_type === 'STR_PAD_BOTH') {
5656
half = str_pad_repeater(pad_string, Math.ceil(pad_to_go / 2));
5757
input = half + input + half;
5858
input = input.substr(0, pad_length);

_octopress/source/functions/strnatcmp/index.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function strnatcmp (f_string1, f_string2, f_version) {
6262
text = false;
6363
}
6464
buffer += chr;
65-
} else if ((text == false) && (chr == '.') && (i < (f_string.length - 1)) && (f_string.substring(i + 1, i + 2).match(/\d/))) {
65+
} else if ((text == false) && (chr === '.') && (i < (f_string.length - 1)) && (f_string.substring(i + 1, i + 2).match(/\d/))) {
6666
result[result.length] = buffer;
6767
buffer = '';
6868
} else {

_octopress/source/functions/strtotime/index.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function strtotime (text, now) {
5353
return now === null || isNaN(now) ? new Date().getTime() / 1000 | 0 : now | 0;
5454
else if (!isNaN(parse = Date.parse(text)))
5555
return parse / 1000 | 0;
56-
if (text == 'now')
56+
if (text === 'now')
5757
return new Date().getTime() / 1000; // Return seconds, not milli-seconds
5858
else if (!isNaN(parsed = Date.parse(text)))
5959
return parsed / 1000;

_octopress/source/functions/uniqid/index.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function uniqid (prefix, more_entropy) {
2626
// * returns 2: 'fooa30285b1cd361'
2727
// * example 3: uniqid('bar', true);
2828
// * returns 3: 'bara20285b23dfd1.31879087'
29-
if (typeof prefix == 'undefined') {
29+
if (typeof prefix === 'undefined') {
3030
prefix = "";
3131
}
3232

_octopress/source/functions/version_compare/index.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ function version_compare (v1, v2, operator) {
5656
'RC': -3,
5757
'rc': -3,
5858
'#': -2,
59-
'p': -1,
60-
'pl': -1
59+
'p': 1,
60+
'pl': 1
6161
},
6262
// This function will be called to prepare each version argument.
6363
// It replaces every _, -, and + with a dot.

_octopress/source/functions/xdiff_string_diff/index.markdown

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function xdiff_string_diff (old_data, new_data, context_lines, minimal) {
5050
*Trims string
5151
*/
5252
trim = function (text) {
53-
if (typeof text != 'string') {
53+
if (typeof text !== 'string') {
5454
throw Error('String parameter required');
5555
}
5656

@@ -64,18 +64,18 @@ function xdiff_string_diff (old_data, new_data, context_lines, minimal) {
6464
args_len = arguments.length,
6565
basic_types = ['number', 'boolean', 'string', 'function', 'object', 'undefined'],
6666
basic_type, i, j, type_of_type = typeof type;
67-
if (type_of_type != 'string' && type_of_type != 'function') {
67+
if (type_of_type !== 'string' && type_of_type !== 'function') {
6868
throw new Error('Bad type parameter');
6969
}
7070

7171
if (args_len < 2) {
7272
throw new Error('Too few arguments');
7373
}
7474

75-
if (type_of_type == 'string') {
75+
if (type_of_type === 'string') {
7676
type = trim(type);
7777

78-
if (type == '') {
78+
if (type === '') {
7979
throw new Error('Bad type parameter');
8080
}
8181

@@ -128,18 +128,18 @@ function xdiff_string_diff (old_data, new_data, context_lines, minimal) {
128128
args_len = arguments.length,
129129
basic_types = ['number', 'boolean', 'string', 'function', 'object', 'undefined'],
130130
basic_type, i, j, type_of_type = typeof type;
131-
if (type_of_type != 'string' && type_of_type != 'function') {
131+
if (type_of_type !== 'string' && type_of_type !== 'function') {
132132
throw new Error('Bad type parameter');
133133
}
134134

135135
if (args_len < 2) {
136136
throw new Error('Too few arguments');
137137
}
138138

139-
if (type_of_type == 'string') {
139+
if (type_of_type === 'string') {
140140
type = trim(type);
141141

142-
if (type == '') {
142+
if (type === '') {
143143
return false;
144144
}
145145

@@ -189,7 +189,7 @@ function xdiff_string_diff (old_data, new_data, context_lines, minimal) {
189189
split_into_lines = function (text) {
190190
verify_type('string', text);
191191

192-
if (text == '') {
192+
if (text === '') {
193193
return [];
194194
}
195195
return text.split('\n');
@@ -286,7 +286,7 @@ function xdiff_string_diff (old_data, new_data, context_lines, minimal) {
286286
return '';
287287
}
288288

289-
if (typeof context_lines != 'number' || context_lines > MAX_CONTEXT_LINES || context_lines < MIN_CONTEXT_LINES) {
289+
if (typeof context_lines !== 'number' || context_lines > MAX_CONTEXT_LINES || context_lines < MIN_CONTEXT_LINES) {
290290
context_lines = DEFAULT_CONTEXT_LINES;
291291
}
292292

0 commit comments

Comments
 (0)