承接 sysel/nette-database-myisam 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sysel/nette-database-myisam

最新稳定版本:v1.3.0

Composer 安装命令:

composer require sysel/nette-database-myisam

包简介

Nette-Database-MyISAM - MyISAM driver for Nette Database

README 文档

README

Build Status

Nette Database doesn't support MySQL MyISAM tables by default because this database storage doesn't store information about foreign keys. Unfortunately, there are still servers which support only MyISAM storage tables because they don't consume too many system resources. This driver enables you to use Nette database on those servers.

Requirements

  • Nette for PHP 5.6+ (tested on version 2.4.0)
  • table's referenced columns names shall be in format table_columnName, like author_id or shall have @refs table.columnName in column's comment. The schema can look like:
|          Category                |
| Column name  | Column comment    |
+----------------------------------+
| id           | Category id       |
| name         | Category name     |

|            Text                                 |
| Column name  | Column comment                   |
+-------------------------------------------------+
| id           | Text id                          |
| category_id  | Some comment                     |
| category     | @refs category.id Some comment :)|
| text         | Text content                     |

Installation

Download and copy driver to libs/Sysel/Nette-Database-MyISAM dir or somewhere else where robot loader can find it. Or use composer

composer require sysel/nette-database-myisam

Use

Create database connection:

$options = [
    'driverClass' => '\\Sysel\\Nette\\Database\\Drivers\\MySqlMyIsamDriver',
];
$connection = new \Nette\Database\Connection(
        'mysql:host='.$servername.';dbname='.$database,
        $user,
        $password,
        $options
    );

Or you can add it to you config.neon:

database:
    default:
        dsn: '%database.driver%:host=%database.host%;dbname=%database.database%'
        user: %database.user%
        password: %database.password%
        conventions: discovered
        autowired: true
        options:
            driverClass: Sysel\Nette\Database\Drivers\MySqlMyIsamDriver

Running tests

Please use Composer to download all dependencies.

composer update

Than run Nette Tester with your php.ini file configuration. The configuration is required for correct PDO class use.

# Linux users
vendor/bin/tester -c tests/php-unix.ini tests
# Windows users
vendor/bin/tester -c tests/php-win.ini tests

Known limitations

Getting relations from information schema is not very effective therefore using cache storage is recommended. Despite of that first run can still take several seconds.

统计信息

  • 总下载量: 22
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3
  • 更新时间: 2015-02-12