Giter Site home page Giter Site logo

hydrogen's People

Contributors

bcentinaro avatar gibbonweb avatar hamador avatar jackharley avatar magik avatar mesoptier avatar tomfrost avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

hydrogen's Issues

Bug in Tempate {% for key, value in myarray %} construct

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...

Hydrogen docs generator

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!

Database Engine: escaping table field names

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?

Route Caching

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()

Config Cache file/folder issue

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.

Count() in loop (StandardSQLFormatter)

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.