Ling Framework
Johney Park
2018.11.03
LING
=
Legacy Is Not Good
Why Legacy Matters?
Platform Company:
Too much money
Startup:
Don’t have time
Service Company:
Don’t need to be
up-to-date
All legacy issues can be
fixed by money
So legacy matters when
there’s little money
If you are a developer
You can’t buy yourself
Because you are expensive
If you are one person company
(Or clients are your friends..)
It is very difficult to make clients
pay for legacy
If you are a full-stack
developer
You have no time to care
about backend framework
If you are senior developer
You probably sick and tired
of learning new framework
Developers need legacy-
free web framework!
Easy Solution
Custom Framework!
Collection of my own utils
So I can manage it!
Ordinary Legacy Patterns
Performance
New functions
Security
Developer
Custom framework also
makes legacy issues.
Not a solution.
Is there any legacy-free
web framework in real
world?
Actually there is!
WordPress
Plugin & Hook
If A plugin becomes legacy
Use B plugin with A
Replace A with B gradually
If all parts of framework
are plugin
There will be no legacy
issue!
Is it possible to make all
parts of framework as
plugin?
Only two exceptions
Environment and hook
Env
$GLOBALS['LING_ENV'] = array();
function env($key, $default = null) {
$ENV = $GLOBALS['LING_ENV'];
if (is_array($key)) {
foreach($key as $k => $v) {
$ENV[$k] = $v;
}
$GLOBALS['LING_ENV'] = $ENV;
return null;
}
if (!strncmp($key, 'env.', 4)) { // get variable from env
return getenv(substr($key, 4)) ?: $default;
}
return isset($ENV[$key]) ? $ENV[$key] : $default;
}
Hook
function hook($hook_id, $args = array()) {
/** @var array $hooks */
$hooks = env($hook_id);
if ($hooks && is_array($args)) {
foreach ($hooks as $hook) {
call_user_func_array($hook, $args);
//$hook( ...$args); // PHP 5.6+
}
} else if (is_callable($args)){ // save to hook
if (!$hooks) {
$hooks = array();
}
$hooks[] = $args;
env(array($hook_id => $hooks));
}
}
Plugin = Composer
MVC = namespace
Orm = PDO + SQL
Input Validation = filter_var
Security = PHP, Best Practices
Performance = PHP
New functions = PHP, Composer
Ling Framework
Good for mental health
Good for small and long lasting site
Flexible
Simple
Modern
Fast performance
Fast prototyping
…
Pros
Only for framework, OS, language legacy
Still beta, just another custom framework
Lack of functionality
Only recommendable code is provided
Not for junior developer
Not tested for large site
No document yet
No logo yet
Cons
https://github.com/
ling-framework/
Contributors or Sponsors or
Clients Wanted
The End

Ling framework