Giter Club home page Giter Club logo

Comments (11)

optikalefx avatar optikalefx commented on June 3, 2024

100%. Ill add it as a milestone actually. Timeline? I'm not sure, work is pretty busy at the moment. Hopefully in the next month or so though.

from openjs-grid.

markc avatar markc commented on June 3, 2024

Great, good to hear. Just looking now and I have no idea what lib/nib is or how to rebuild grid.css so maybe I could start work on converting the PHP backend scripts to PDO and make sure they work with PHP 5.5.

PHP Deprecated:  mysql_select_db(): The mysql extension is deprecated and will be removed in the future:
 use mysqli or PDO instead in /home/markc/Public/jsgrid/world-ajax.php on line 5

I see you have tagged 2.1.3 so is it safe to assume we can move towards a 3.0 version and not worry about backwards compatibility?

Also, how about I get the dev branch in sync with current master so I can send you some test requests for you to look at (if you have the time)?

Woops, sorry, another question... how committed are you to using hard tabs?

from openjs-grid.

optikalefx avatar optikalefx commented on June 3, 2024

Yea I have someone doing a PDO conversion, but I'll probably do it myself next sit down.

Yea it's safe to move and not support back

I just pushed to the dev branch, so it should be up to date now
Anything you make a PR for I'll take a look at usually in the evenings, much appreciated.

Ha, funny question. The old spaces vs tabs debate. All my text editors are set for tabs, so I'd probably opt to keep that personally. It really makes coding faster when deleting back.

from openjs-grid.

optikalefx avatar optikalefx commented on June 3, 2024

If you wanna do PDO, you're more than welcome to. Keep it simple and easy to understand, some PDO implementations are really convoluted.

I use NodeJS now a days for a lot of projects, and I'm making a backend file for that soon too.

from openjs-grid.

optikalefx avatar optikalefx commented on June 3, 2024

Also, lib/nib is the stylus nib library

this is nib
http://visionmedia.github.io/nib/

It goes with stylus a css preprocessor
http://learnboost.github.io/stylus/

from openjs-grid.

markc avatar markc commented on June 3, 2024

Ha, funny question. The old spaces vs tabs debate.

I generally try to follow these guidelines...

HTML and CSS -> https://github.com/mdo/code-guide

Javascript -> https://npmjs.org/doc/coding-style.html

PHP -> http://www.php-fig.org/psr/psr-2/

Glad you are into NodeJS. I'm setup to test both PHP and nodejs via nginx.

from openjs-grid.

markc avatar markc commented on June 3, 2024

This is no where near a pull request but if you want to have a look at what I've done so far...

https://github.com/markc/OpenJS-Grid/tree/dev

  • moved all assets into the lib/ directory
  • initial conversion of myslq_funcs to PDO
  • almost works without major errors/exceptions
  • added simple config override system
  • added one extra db_init() to ajax.php
  • next is prepared statements then testing with SQLite

from openjs-grid.

optikalefx avatar optikalefx commented on June 3, 2024

A couple notes so far

  • Your ajax.php is a bit too abstracted (up for discussion). The goal is not to give them a formula for their own project, most have their own DB connect function, we shouldn't offer one. The goal is to show the minimal amount needed to get off the ground, as to understand everything. The override config and the db_init() are cool but unless you are building that into grid.php (which you could do) it shouldn't be found in ajax.php at all
  • You have a bunch of comments, that are not indented to match their blocks
  • You have a bunch of error_log functions that are not indented to match their blocks
  • I would like to keep curly braces on the same line as the function, personally it's a huge waste to give an entire line to 1 curly brace.
  • It looks like your changing the mysql_query to the db->query(). Is that really taking advantage of PDO? I would think that while this great to at least make it compatible, we should add a mile stone to use prepared stmts instead of these raw queries.

Awesome work so far, thanks for taking the reigns on this!

from openjs-grid.

markc avatar markc commented on June 3, 2024

Misc comments. The point of the simple config override is so my MySQL auth details don't end up in git. The db_init() function is about the simplest way I know of being able to switch between MySQL and SQLite by changing one variable ($cfg[type]). It could easily be incorporated into Grid::__construct(). It's not worth adding prepared statements until the basic 1:1 "port" actually works. For me, the main point of PDO is to be able to also use SQLite, and then the example index.html can work with near zero setup. The coding style can change, I'm so used to psr-2 that anything else just looks weird, and the error_log() statements are indeed temporary.

Hopefully I'll get the right json to return tomorrow and can proceed with adding proper prepared statements.

from openjs-grid.

optikalefx avatar optikalefx commented on June 3, 2024

You can just opt to not commit ajax.php after you've added your credentials. The problem is that it adds 1 file, and it's a 100% guaranteed thing to change for someone else. They will download this and delete that file because they have their own way of doing the db work.

This goes for the 2nd comment too. The reason we don't need to make a function is because people will think that's what they need to do. We shouldn't do the connect in grid.php after thinking about it, because they probably have their own db connect going on already, or in their own way. So just like the above comment, we want to give them the minimal setup.

I use the grid a lot, and the first thing I do everytime is delete ajax.php. So for openJS Grid beginners, it's important that that file is SUPER easy to understand. Like line by line understand. They don't need the config override or the extra db function call. When they are learning its do this, then this, then this, then this.

If you wanna keep moving with what you're doing, I can modify it to show you what I'm talking about.

Sorry I'm a bit picky about how those demo files are setup, I try really hard to make really easy to understand code for people to pickup. One thing I hate as a developer is downloading something from someone only to have all their own ideas jammed into the demo file making it hard for me to see the 1 thing their code actually does.

from openjs-grid.

ioconnor avatar ioconnor commented on June 3, 2024

If the sqlite/pdo is getting close and you need somebody to test it I'd be
up for trying...

On Sun, Dec 8, 2013 at 10:13 PM, Sean Clark [email protected]:

You can just opt to not commit ajax.php after you've added your
credentials. The problem is that it adds 1 file, and it's a 100% guaranteed
thing to change for someone else. They will download this and delete that
file because they have their own way of doing the db work.

This goes for the 2nd comment too. The reason we don't need to make a
function is because people will think that's what they need to do. We
shouldn't do the connect in grid.php after thinking about it, because they
probably have their own db connect going on already, or in their own way.
So just like the above comment, we want to give them the minimal setup.

I use the grid a lot, and the first thing I do everytime is delete
ajax.php. So for openJS Grid beginners, it's important that that file is
SUPER easy to understand. Like line by line understand. They don't need the
config override or the extra db function call. When they are learning its
do this, then this, then this, then this.

If you wanna keep moving with what you're doing, I can modify it to show
you what I'm talking about.

Sorry I'm a bit picky about how those demo files are setup, I try really
hard to make really easy to understand code for people to pickup. One thing
I hate as a developer is downloading something from someone only to have
all their own ideas jammed into the demo file making it hard for me to see
the 1 thing their code actually does.


Reply to this email directly or view it on GitHubhttps://github.com//issues/40#issuecomment-30107677
.

from openjs-grid.

Related Issues (20)

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.