Giter Site home page Giter Site logo

basicobject's Introduction

BasicObject

Yet anoyther object relational mapper

Performance hint:

This object relational mapper makes heavy use of information_schema in mysql, per default queries to this schema triggers recalculation of statistics every time it is queried which slows things down a lot. Try turning innodb_stats_on_metadata of to stop mysql doing this.

set global innodb_stats_on_metadata=0;

There are forks of this project solving this with a memcached instance caching the schema information instead.

basicobject's People

Contributors

edruid avatar ext avatar p-blomberg avatar torandi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

basicobject's Issues

Why should HTML_ACCESS be a constant?

I don't see the point of creating the lock-in that you cannot change the value of HTML_ACCESS once it has been defined. Using a global variable instead allows for more flexible MVC constructions.

Documentation is not up-to-date

The "documentation", aka comments in the beginning of BasicObject.php, is not up to date.
For example, it states that child classes shoud implement function from_id($id), but it is already implemented in the BasicObject class and I don't see the need to have it in the child classes.
The function from_id is not implemented in the example child classes.

fetch_field() in selection() might fail if bad params are sent - please throw exception instead of fatal error

Line https://github.com/edruid/BasicObject/blob/master/BasicObject.php#L477

This is what I get:
PHP Warning: mysqli_stmt::bind_param(): Number of variables doesn't match number of parameters in prepared s
tatement in /home/slafs/projekt/testing/phpbot/classes/BasicObject.php on line 472
PHP Fatal error: Call to a member function fetch_field() on a non-object in /home/slafs/projekt/testing/phpb
ot/classes/BasicObject.php on line 477

And of course, fatal error means die. I would like to catch this error and ignore it until I have time to figure out what is actually wrong - perhaps a try-catch-throw around that while loop?

Example data.sql is broken

mysql> create database bo_example;
Query OK, 1 row affected (0.00 sec)

mysql> use bo_example;
Database changed
mysql> source data.sql
Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected (0.18 sec)

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ENGINE=InnoDB DEFAULT CHARSET=utf8' at line 7
Query OK, 0 rows affected (0.22 sec)

ERROR 1005 (HY000): Can't create table 'bo_example.group_access' (errno: 150)
ERROR 1005 (HY000): Can't create table 'bo_example.group_members' (errno: 150)
mysql> 

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.