项目作者: pointybeard

项目描述 :
Wraps the core Symphony database connection with a PDO based library.
高级语言: PHP
项目地址: git://github.com/pointybeard/symphony-pdo.git
创建时间: 2015-08-20T05:31:48Z
项目社区:https://github.com/pointybeard/symphony-pdo

开源协议:Other

下载


SymphonyCMS: PDO Database Wrapper

Wraps the core Symphony CMS database connection with a PDO based library

Installation

This library is installed via Composer. To install, use composer require pointybeard/symphony-pdo or add "pointybeard/symphony-pdo": "~0.1" to your composer.json file.

And run composer to update your dependencies:

  1. $ curl -s http://getcomposer.org/installer | php
  2. $ php composer.phar update

Usage

  1. <?php
  2. use SymphonyPDO;
  3. $query = SymphonyPDO\Loader::instance()->query(
  4. 'SELECT * FROM `tbl_sections` ORDER BY `id` ASC;'
  5. );
  6. var_dump($query->fetchObject()->name);
  7. // string(8) "Articles"
  8. // Or, better yet, use a ResultIterator instead
  9. foreach(new SymphonyPDO\Lib\ResultIterator('\stdClass', $query) as $result) {
  10. printf('%d => %s (%s)' . PHP_EOL, $result->id, $result->name, $result->handle);
  11. }
  12. // 1 => Articles (articles)
  13. // 2 => Categorties (categories)

Support

If you believe you have found a bug, please report it using the GitHub issue tracker,
or better yet, fork the library and submit a pull request.

Contributing

We encourage you to contribute to this project. Please check out the Contributing documentation for guidelines about how to get involved.

License

“SymphonyCMS: PDO Database Wrapper” is released under the MIT License.