DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

EXT: Oblady - PHP JS

Created:2010-02-18T17:33:18
Changed:2011-06-21T10:11:34
Classification:oblady_phpjs
Description:The keywords help with categorizing and tagging of the manuals. You can combine two or more keywords and add additional keywords yourself. Please use at least one keyword from both lists. If your manual is NOT in english, see next tab "language" ---- forEditors (use this for editors / german "Redakteure") forAdmins (use this for Administrators) forDevelopers (use this for Developers) forBeginners (manuals covering TYPO3 basics) forIntermediates (manuals going into more depth) forAdvanced (covering the most advanced TYPO3 topics) see more: http://wiki.typo3.org/doc_template#tags ----
Keywords:oblady_phpjs
Author:Adrien LUCAS
Email:adrien@oblady.fr
Info 4:
Language:en

img-1 img-2 EXT: Oblady - PHP JS - oblady_phpjs

EXT: Oblady - PHP JS

Extension Key: oblady_phpjs

Language: en

Keywords: oblady_phpjs

Copyright 2000-2010, Adrien LUCAS, <adrien@oblady.fr>

Contributions :

Sebastien Thibault

Vincent Barral

This document is published under the Open Content License

available from http://www.opencontent.org/opl.shtml

The content of this document is related to TYPO3

a GNU/GPL CMS/Framework available from www.typo3.org

Introduction

What does it do?

This extension adds to TYPO3 a collection of javascript written PHP functions. This mean you can call some PHP core functions directly from your javascript codes.

Administration

  • Install “oblady_phpjs” using the Extension Manager. No database updates needed.

  • Configure the extension in the Extension Manager too.

  • Add the extension's plugin as an element of your PAGE object :

    page.headerData.22 = USER
    page.headerData.22.includeLibs = EXT:oblady_phpjs/pi1/class.tx_obladyphpjs_pi1.php
    page.headerData.22.userFunc = tx_obladyphpjs_pi1->main
    

Optional : Update the sources (re-generate compiled/minified files), point your browser to:

http://www.domainname.com/typo3conf/ext/oblady_phpjs/Resources/phpjs.org/tools/compile.php

Configuration

Here are the available configuration options :

set_function_loader

Property

set_function_loader

Data type

boolean

Description

If set, the plugin will print some javascript to declare the “libphp_i()” function wich is the function loader.

Default

true

preload_functions

Property

preload_functions

Data type

string

Description

A list of functions to preload, You have to set the previous option to true.

Default

Override configuration by TS

Coming soon...

Example

<script>
libphp_i('echo');
libphp_i('md5');

$(function(){
    echo(md5('myText'));
 });
</script>

Note : The md5 function depends on the utf8_encode function which is then automatically loaded.

ChangeLog

1.0

Version

1.0

Changes

June 13th 2011 - First beta release

ToDo list :

Stable release,

Configuration overriding by Typoscript.

Independent functions pre-loading.

Better integration of the “update sources” feature.

List of supported functions

All function's codes are from phpjs.org

Arrays

array_intersect_ukey

a

array_intersect_ukey

array_key_exists

array_keys

array_map

array_merge

array_merge_recursive

array_multisort

array_pad

array_pop

array_product

array_push

array_rand

array_reduce

array_replace

array_replace_recursive

array_reverse

array_search

array_shift

array_slice

array_splice

b

array_sum

array_udiff

array_udiff_assoc

array_udiff_uassoc

array_uintersect

array_uintersect_assoc

array_uintersect_uassoc

array_unique

array_unshift

array_values

array_walk

array_walk_recursive

arsort

asort

compact

count

current

each

end

extract

c

in_array

key

krsort

ksort

natcasesort

natsort

next

pos

prev

range

reset

rsort

shuffle

sizeof

sort

uasort

uksort

usort

BCMath Arbitrary Precision Mathematics

bcadd

a

bcadd

bccomp

bcdiv

bcmul

b

bcround

bcscale

bcsub

Character type checking

ctype_alnum

a

ctype_alnum

ctype_alpha

ctype_cntrl

ctype_digit

ctype_graph

ctype_lower

b

ctype_print

ctype_punct

ctype_space

ctype_upper

ctype_xdigit

Class/Object Information

class_alias

a

class_alias

class_exists

get_class

get_class_methods

get_class_vars

b

get_declared_classes

get_object_vars

method_exists

property_exists

Classkit

classkit_import

a

classkit_import

classkit_method_add

classkit_method_copy

b

classkit_method_redefine

classkit_method_remove

classkit_method_rename

Date and Time

checkdate

a

checkdate

date

date_default_timezone_get

date_default_timezone_set

date_parse

getdate

gettimeofday

gmdate

gmmktime

gmstrftime

b

localtime

microtime

mktime

strftime

strptime

strtotime

time

timezone_abbreviations_list

timezone_identifiers_list

idate

Error Handling and Logging

error_get_last

error_reporting

trigger_error

user_error

Filesystem

basename

a

basename

dirname

fclose

feof

fgetc

fgetcsv

fgets

fgetss

file

file_exists

file_get_contents

filemtime

filesize

b

fopen

fpassthru

fread

fscanf

fseek

ftell

pathinfo

pclose

popen

readfile

realpath

rewind

Function Handling

call_user_func

a

call_user_func

call_user_func_array

create_function

forward_static_call

forward_static_call_array

func_get_arg

b

func_get_args

func_num_args

function_exists

get_defined_functions

register_shutdown_function

JavaScript Object Notation

json_decode

json_encode

json_last_error

Language & Control Structures

include

include_once

require

require_once

Mail

mail

Mathematical Functions

abs

a

abs

acos

acosh

asin

asinh

atan

atan2

atanh

base_convert

bindec

ceil

cos

cosh

decbin

dechex

decoct

b

deg2rad

exp

expm1

floor

fmod

getrandmax

hexdec

hypot

is_finite

is_infinite

is_nan

lcg_value

log

log10

log1p

max

c

min

mt_getrandmax

mt_rand

octdec

pi

pow

rad2deg

rand

round

sin

sinh

sqrt

tan

tanh

Miscellaneous Functions

constant

a

constant

define

defined

pack

b

php_strip_whitespace

time_sleep_until

uniqid

Net Gopher

gopher_parsedir

Network

inet_ntop

a

inet_ntop

inet_pton

ip2long

b

long2ip

setcookie

setrawcookie

Object Aggregation/Composition

aggregate

a

aggregate

aggregate_info

aggregate_methods

aggregate_methods_by_list

aggregate_methods_by_regexp

b

aggregate_properties

aggregate_properties_by_list

aggregate_properties_by_regexp

aggregation_info

deaggregate

Output Buffering Control

ob_clean

a

ob_clean

ob_end_clean

ob_end_flush

ob_flush

ob_get_clean

ob_get_contents

b

ob_get_flush

ob_get_length

ob_get_level

ob_get_status

ob_list_handlers

ob_start

PHP Options and Information

assert

a

assert

assert_options

get_cfg_var

get_defined_constants

get_extension_funcs

get_include_path

get_included_files

get_required_files

getenv

getlastmod

ini_alter

ini_get

b

ini_get_all

ini_restore

ini_set

php_ini_loaded_file

php_ini_scanned_files

phpversion

putenv

restore_include_path

set_include_path

set_time_limit

version_compare

Program execution Functions

escapeshellarg

Regular Expressions (Perl-Compatible)

preg_grep

preg_quote

sql_regcase

Streams

stream_context_create

a

stream_context_create

stream_context_get_default

stream_context_get_options

stream_context_get_params

stream_context_set_default

b

stream_context_set_option

stream_context_set_params

stream_get_contents

stream_get_line

stream_is_local

Strings

addcslashes

a

addcslashes

addslashes

bin2hex

chop

chr

chunk_split

convert_cyr_string

convert_uuencode

count_chars

crc32

echo

explode

get_html_translation_table

html_entity_decode

htmlentities

htmlspecialchars

htmlspecialchars_decode

implode

join

lcfirst

levenshtein

localeconv

ltrim

md5

md5_file

metaphone

money_format

nl2br

nl_langinfo

str_shuffle

str_split

b

stripos

stripslashes

strcspn

strip_tags

str_word_count

strcasecmp

strchr

strcmp

strcoll

sscanf

str_getcsv

str_ireplace

str_pad

str_repeat

str_replace

str_rot13

rtrim

setlocale

sha1

sha1_file

similar_text

soundex

split

sprintf

number_format

ord

parse_str

printf

quoted_printable_decode

quoted_printable_encode

quotemeta

c

stristr

strlen

strnatcasecmp

strnatcmp

strncasecmp

strncmp

strpbrk

strpos

strrchr

strrev

strripos

strrpos

strspn

strstr

strtok

strtolower

strtoupper

strtr

substr

substr_compare

substr_count

substr_replace

trim

ucfirst

ucwords

vprintf

vsprintf

wordwrap

URLs

base64_decode

a

base64_decode

base64_encode

get_headers

get_meta_tags

http_build_query

b

parse_url

rawurldecode

rawurlencode

urldecode

urlencode

Variable handling

doubleval

a

doubleval

empty

floatval

get_defined_vars

get_resource_type

gettype

import_request_variables

intval

is_array

is_binary

is_bool

is_buffer

is_callable

is_double

is_float

is_int

is_integer

b

is_long

is_null

is_numeric

is_object

is_real

is_resource

is_scalar

is_string

is_unicode

isset

print_r

serialize

settype

strval

unserialize

var_dump

var_export

XML Parser

utf8_decode

utf8_encode

i18n

i18n_loc_get_default

i18n_loc_set_default

runkit

runkit_class_adopt

a

runkit_class_adopt

runkit_class_emancipate

runkit_function_add

runkit_function_copy

runkit_function_redefine

runkit_function_remove

runkit_function_rename

b

runkit_import

runkit_method_add

runkit_method_copy

runkit_method_redefine

runkit_method_remove

runkit_method_rename

runkit_superglobals

xdiff

xdiff_string_diff

xdiff_string_patch

TODO

launch compilation from backend.

img-2 15