Giter Club home page Giter Club logo

dashboard_realioseb's People

Contributors

realioseb avatar

Watchers

 avatar  avatar

dashboard_realioseb's Issues

RSS/MRss/Atom ფიდების კეშირება

#6 იშუში აღწერილი პროცესის შედეგი სასურველია დავაკეშიროთ ლოკალურად მონაცემთა ბაზაში რათა ყოველ ჯერზე არ ვაგზავნოთ მოთხოვნები ქსელში.

კეშირებისთვის დაგვჭირდება მიღებული სტრუქტურის JSON ფორმატში გარდაქმნა json_encode(...) ფუნქციის მეშვეობით.

ვიდჯეტის HTML სტრუქტურა

<section class="widget">
  <header class="widget-header">...</header>
  <section class="widget-content">...</section>
  <footer class="widget-footer">...</footer>
</section>

სტრუქტურის მონახაზი არის ეს. დანარჩენი დისკუსია აქ გავაგრძელოთ.

RSS/MRss/Atom ფიდების პარსერი

უნდა გავაკეთოთ ზოგადი რეალიზაცია რომელიც:

  • RSS ფიდის მისამართს წაკითხავს
  • Atom ფიდის მისამართს წაკითხავს
  • MRss ფიდის მისამართს წაიკითხვვს

სამივე შემთხვევაში უნდა მივიღოთ ერთი შუალედური მონაცემთა სტრუქტურა რომელიც თანაბრად გამოყენებადი იქნება ნებისმიერ ვიდჯეტში.

$feed = array(
  "chanel" => "World News",
  "url" => "http://.../world-news",
  "items" => array(
    array(
      "title" => "Barak Obama Sucks",
      "author" => "Ioseb Dzmanashvili",
      "content" => "Barak Obama Really Sucks...",
      "url" => "http://.../barak-obama-sucks"
    ),
    array(
      "title" => "Puting is Bastard",
      "author" => "Ioseb Dzmanashvili",
      "content" => "Puting is Bastard and sucks more than Obama...",
      "url" => "http://.../putin-is-bastard"
    )
  )
);

მონაცემთა ბაზის აბსტრაქცია

განახორციელეთ შემდეგი ინტერფეისის იმპლემენტაცია. გაითვალისწინეთ, რომ აპლიკაციის კოდში უნდა გამოიყენოთ მხოლოდ ეს ინტერფეისი.

  • მოთხოვნების გენერაცია;
  • ე.წ. პრიპეარდ სტეიტმენტები და ა.შ.

მთლიანად თქვენი გასაკეთებელია.

ინტერფეისი:

function db_update($table, $data, $conditions) { }

function db_insert($table, $data) { }

function db_select($table, $conditions) { }

function db_delete($table, $conditions) { }

function db_query($query) { }

გამოყენების ნიმუშები:

// SELECT * FROM users WHERE name='john'
$users = db_select("users", array(
  "name" => "john"
));

// SELECT * FROM users WHERE role='admin' AND sex='female'
$users = db_select("users", array(
  "role" => "admin",
  "sex"  => "female"
));

// INSERT INTO users
//  (first_name, last_name, email, password)
// VALUES
//  ('john', 'doe', '[email protected]', '1234123413241234')
//
$result = db_insert("users", array(
  "first_name" => "John",
  "last_name"  => "Doe",
  "email"      => "[email protected]",
  "password"   => md5("test"),
));

if ($result) {
  // do something meaningfull...
}

// UPDATE users
//  SET last_name='Doe Doe'
// WHERE
//  email='[email protected]
//
$result = db_update("users", array(
  "last_name" => "Doe Doe",
 ), array(
  "email" => "[email protected]"
));

// DELETE FROM users WHERE email='[email protected]'
// 
$result = db_delete("users", array(
  "email" => "[email protected]"
));

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.