tomfrost / hydrogen Goto Github PK
View Code? Open in Web Editor NEWHydrogen is a PHP 5.3+ performance and portability library
Home Page: http://www.hydrogenphp.com
License: Other
Hydrogen is a PHP 5.3+ performance and portability library
Home Page: http://www.hydrogenphp.com
License: Other
Hey Tom,
I've extended the "Setting up Hydrogen on your server" page... accidentally I did it on my own wiki: https://github.com/gibbonweb/Hydrogen/wiki/Setting-up-Hydrogen-on-your-server
Is there a convenient way of synchronizing this to the "Main" wiki?
Cheers, Johannes
route caching currently doesn't seem to take HTTP Verb into account
For example
$router->post('/(:controller(/:function(/:*args)))',
array('controller' => 'home','function' => 'index'),
array('controller' => '\vespora\controllers\main\%{controller|capfirst}Controller',
'function' => '%{function|lower}_post'));
$router->request('/(:controller(/:function(/:*args)))',
array('controller' => 'home','function' => 'index' ),
array('controller' => '\vespora\controllers\main\%{controller|capfirst}Controller'));
when the following routes are added to the route, the first request GET: /user/login, maps properly as expected, to \vespora\controllers\main\UserController->login()
However, when the login page posts back to itself, it calls \vespora\controllers\main\UserController->login() rather then \vespora\controllers\main\UserController->login_post()
During the config load, the load process checks if the cache directory exists (Line # 206, as of release 0.2.0)
If the cache directory isn't in the current directory, the check fails ... and throws an exception.
changing:
if (!file_exists($cacheDir)) {
to:
if (!file_exists(static::getAbsolutePath($cacheDir))) {
Solved the issue for me. Wanted to share.
the {% for key, value in myarray %} throws an exception if key and value are not separated by a space.
i.e.
{% for key, value in myarray %} => works fine
{% for key,value in myarray %} => throws exception
This is very counter-intuitive and just cost me 15min to figure out ...
Don't have time to fix ist myself atm, just leaving it here fyi and might fix it later if I find the time...
Hey, these are just a couple of tiny things I noticed in /database/formatters/StandardSQLFormatter.php's getPreparedQuery() method while just exploring the Query creation process.
public function getPreparedQuery() {
$str = '';
for ($i = 0, $j = count($this->parsed); $i < $j; $i += 2) // instead of count()ing every time.
$str .= $this->parsed[$i] . '?';
return substr($str, 0, -1);
}
Or maybe, a viable option could be implode() instead of the loop although I don't know how you'd make it work with the $i += 2.
Hey Tom,
some time ago you mentioned that one of the reasons for Hydrogen not having a "proper" documentation (apart from the inline documentation) was the lack of documentation generators supporting namespaces and other 5.3+ features.
Well, here is one that does: http://apigen.org/
I'll test drive it in a few days and report back if it's any good!
I just ran into an issue where my queries on one table would always fail, although they were managed through an SQLBean.
Turns out I had a field in my table called 'as' which produced SQL whenever mentioned.
This could be fixed by using backticks around the field names like so:
SELECT `id`, `as` FROM mytable WHERE `id` = 2;
Instead of:
SELECT id, as FROM mytable WHERE id = 2;
...which would produce an error due to incorrect use of the keyword AS.
While you could argue that naming a field 'AS' is bad practice due to exactly this kind of possible confusion, 'AS' in this case stood for a german word with 15 letters in a table with 10 similar fields, which would be horrible to write out or display as a whole table...
What do you think? Would this have to be implemented in the MysqlPDOEngine, or even in the PDOEngine? I guess it could be solved by just wrapping field names with backticks anywhere they appear, but I'm not sure wether all supported database engines handle field name escaping the same way?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.