Application
Table of Contents
Classes
Constants
- ALLOWED_VARS = ['$_SESSION', '$_POST', '$_GET', '$_SERVER', '$_COOKIE', '$_FILES', '$_ENV', '$_REQUEST', '$CONFIG', '$DB']
- Naming convention checker for helPHP converted modules.
Functions
- session_force_update() : void
- Forces the session to be closed and immediately restarted.
- convert_module() : mixed
- upgrade() : mixed
- get_string_between() : mixed
- recurse_ls() : mixed
- to get the list of file and folder
- generate_index() : mixed
- beautify_db_writing() : mixed
- install_instance() : mixed
- super_copy() : mixed
- super_mkdir() : mixed
- writeUTF8File() : mixed
- mini2() : mixed
- writeUTF8File() : mixed
- is_camel_case() : bool
- to_snake_case() : string
- bare_name() : string
- check_file() : array<string|int, mixed>
- apply_renames() : string
- interactive_rename() : void
Constants
ALLOWED_VARS
Naming convention checker for helPHP converted modules.
public
mixed
ALLOWED_VARS
= ['$_SESSION', '$_POST', '$_GET', '$_SERVER', '$_COOKIE', '$_FILES', '$_ENV', '$_REQUEST', '$CONFIG', '$DB']
Detects camelCase identifiers that should be snake_case. When run from a terminal, proposes and applies renames interactively.
Checks:
- variable names ($myVar → $my_var)
- function definitions (function getData → function get_data)
- instance method/property calls ($obj->getData → $obj->get_data)
- static method calls (Class::getData → Class::get_data)
Usage: php test_naming_convention.php path/to/Module.php [more.php|dir/]
Functions
session_force_update()
Forces the session to be closed and immediately restarted.
session_force_update() : void
Useful for updating session data and cookie.
convert_module()
convert_module(mixed $module_path, mixed $module_name) : mixed
Parameters
- $module_path : mixed
- $module_name : mixed
upgrade()
upgrade(mixed $public_admin, mixed $old_module_name, mixed $module_name, mixed $old_file, mixed $new_file) : mixed
Parameters
- $public_admin : mixed
- $old_module_name : mixed
- $module_name : mixed
- $old_file : mixed
- $new_file : mixed
get_string_between()
get_string_between(mixed $string, mixed $start, mixed $end) : mixed
Parameters
- $string : mixed
- $start : mixed
- $end : mixed
recurse_ls()
to get the list of file and folder
recurse_ls(mixed $path[, mixed $base_path = '' ]) : mixed
modified version of filesystem.php to also be used by CLI call
Parameters
- $path : mixed
- $base_path : mixed = ''
generate_index()
generate_index(mixed $module_name, mixed $path, mixed $public) : mixed
Parameters
- $module_name : mixed
- $path : mixed
- $public : mixed
beautify_db_writing()
beautify_db_writing(mixed $str) : mixed
Parameters
- $str : mixed
install_instance()
install_instance(mixed $home_folder, mixed $admin_user, mixed $admin_pass, mixed $db_root_user, mixed $db_root_pass, mixed $db_root_user_central, mixed $db_root_password_central, mixed $db_root_user_slave, mixed $db_root_password_slave) : mixed
Parameters
- $home_folder : mixed
- $admin_user : mixed
- $admin_pass : mixed
- $db_root_user : mixed
- $db_root_pass : mixed
- $db_root_user_central : mixed
- $db_root_password_central : mixed
- $db_root_user_slave : mixed
- $db_root_password_slave : mixed
super_copy()
super_copy(mixed $source, mixed $target, mixed $user, mixed $groupe) : mixed
Parameters
- $source : mixed
- $target : mixed
- $user : mixed
- $groupe : mixed
super_mkdir()
super_mkdir(mixed $target, mixed $right, mixed $user, mixed $groupe) : mixed
Parameters
- $target : mixed
- $right : mixed
- $user : mixed
- $groupe : mixed
writeUTF8File()
writeUTF8File(mixed $filename, mixed $content) : mixed
Parameters
- $filename : mixed
- $content : mixed
mini2()
mini2(mixed $buffer) : mixed
Parameters
- $buffer : mixed
writeUTF8File()
writeUTF8File(mixed $filename, mixed $content) : mixed
Parameters
- $filename : mixed
- $content : mixed
is_camel_case()
is_camel_case(string $name) : bool
Parameters
- $name : string
Return values
boolto_snake_case()
to_snake_case(string $name) : string
Parameters
- $name : string
Return values
stringbare_name()
bare_name(string $kind, string $display) : string
Parameters
- $kind : string
- $display : string
Return values
stringcheck_file()
check_file(string $path) : array<string|int, mixed>
Parameters
- $path : string
Return values
array<string|int, mixed>apply_renames()
apply_renames(string $content, array<string|int, mixed> $renames) : string
Parameters
- $content : string
- $renames : array<string|int, mixed>
Return values
stringinteractive_rename()
interactive_rename(string $file, array<string|int, mixed> $violations[, bool $auto = false ]) : void
Parameters
- $file : string
- $violations : array<string|int, mixed>
- $auto : bool = false