当前位置: 首页 > 软件库 > 开发工具 > PHP开发工具 >

laravel-oci8

Oracle DB driver for Laravel 4|5|6|7|8 via OCI8
授权协议 MIT License
开发语言 PHP
所属分类 开发工具、 PHP开发工具
软件类型 开源软件
地区 不详
投 递 者 姜飞飙
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

Oracle DB driver for Laravel 4|5|6|7|8 via OCI8

Build StatusTotal DownloadsLatest Stable VersionLicense

Laravel-OCI8

Laravel-OCI8 is an Oracle Database Driver package for Laravel. Laravel-OCI8 is an extension of Illuminate/Database that uses OCI8 extension to communicate with Oracle. Thanks to @taylorotwell.

Documentations

Laravel Version Compatibility

Laravel Package
5.1.x 5.1.x
5.2.x 5.2.x
5.3.x 5.3.x
5.4.x 5.4.x
5.5.x 5.5.x
5.6.x 5.6.x
5.7.x 5.7.x
5.8.x 5.8.x
6.x.x 6.x.x
7.x.x 7.x.x
8.x.x 8.x.x

Quick Installation

composer require yajra/laravel-oci8:^8

Service Provider (Optional on Laravel 5.5+)

Once Composer has installed or updated your packages you need to register Laravel-OCI8. Open up config/app.php and find the providers key and add:

Yajra\Oci8\Oci8ServiceProvider::class,

Configuration (OPTIONAL)

Finally you can optionally publish a configuration file by running the following Artisan command.If config file is not publish, the package will automatically use what is declared on your .env file database configuration.

php artisan vendor:publish --tag=oracle

This will copy the configuration file to config/oracle.php.

Note: For Laravel Lumen configuration, make sure you have a config/database.php file on your project and append the configuration below:

'oracle' => [
    'driver'        => 'oracle',
    'tns'           => env('DB_TNS', ''),
    'host'          => env('DB_HOST', ''),
    'port'          => env('DB_PORT', '1521'),
    'database'      => env('DB_DATABASE', ''),
    'username'      => env('DB_USERNAME', ''),
    'password'      => env('DB_PASSWORD', ''),
    'charset'       => env('DB_CHARSET', 'AL32UTF8'),
    'prefix'        => env('DB_PREFIX', ''),
    'prefix_schema' => env('DB_SCHEMA_PREFIX', ''),
    'edition'       => env('DB_EDITION', 'ora$base'),
],

If you need to connect with the service name instead of tns, you can use the configuration below:

'oracle' => [
    'driver' => 'oracle',
    'host' => 'oracle.host',
    'port' => '1521',
    'database' => 'xe',
    'service_name' => 'sid_alias',
    'username' => 'hr',
    'password' => 'hr',
    'charset' => '',
    'prefix' => '',
]

In some cases you may wish to set the connection parameters dynamically in your app. For instance, you may access more than one database, or your users may already have their own accounts on the Oracle database:

'oracle' => [
    'driver' => 'oracle',
    'host' => 'oracle.host',
    'port' => '1521',
    'service_name' => 'sid_alias',
    'prefix' => 'schemaowner',
    'dynamic' => [App\Models\Oracle\Config::class, 'dynamicConfig'],
]

The callback function in your app must be static and accept a reference to the $config[] array (which will already be populated with values set in the config file):

namespace App\Models\Oracle;

class Config {

    public static function dynamicConfig(&$config) {

        if (Illuminate\Support\Facades\Auth::check()) {
            $config['username'] = App\Oracle\Config::getOraUser();
            $config['password'] = App\Oracle\Config::getOraPass();
        }

    }
}

Then run your laravel installation...

[Laravel 5.2++] Oracle User Provider

When using oracle, we may encounter a problem on authentication because oracle queries are case sensitive by default.By using this oracle user provider, we will now be able to avoid user issues when logging in and doing a forgot password failure because of case sensitive search.

To use, just update auth.php config and set the driver to oracle

'providers' => [
    'users' => [
        'driver' => 'oracle',
        'model' => App\User::class,
    ],
]

Credits

License

The MIT License (MIT). Please see License File for more information.

  • 安装composer composer下载: https://getcomposer.org/download/ composer安装: 双击Composer-Setup.exe 安装composer 安装之前需要开启php的一些扩展 打开php的php.ini文件开启下列扩展 extension=bz2 extension=curl extension=fileinfo extension=gd

  • 问题摘要 我为php 7.1.19安装了oci8 在Laravel Framework 5.6.3上运行 //在尝试为laravel安装Yajra oci8 github时遇到的错误 您的要求无法解析为可安装的软件包集 . 问题1 yajra / laravel-oci8 v5.6.0需要ext-oci8> = 2.0.0 - >系统中缺少所请求的PHP扩展名oci8 . yajra / lara

 相关资料
  • 本文向大家介绍如何修复和保护Linux服务器免受CentOS 5/6/7或RHEL 5/6/7上的脏COW漏洞的侵害,包括了如何修复和保护Linux服务器免受CentOS 5/6/7或RHEL 5/6/7上的脏COW漏洞的侵害的使用技巧和注意事项,需要的朋友参考一下 在本文中,我们将学习如何修复Dirty Cow Linux漏洞CentOS / Red Hat,Dirty Cow Linux漏洞已

  • Laravel 系列入门教程 如果你想下载我的代码到本地运行,下载完成后记得运行 composer update 命令呦~ 环境要求 PHP 7.0.0 以上 此为代码示例,教程地址: 2017 版 Laravel 系列入门教程(一)【最适合中国人的 Laravel 教程】 2017 版 Laravel 系列入门教程(二)【最适合中国人的 Laravel 教程】 2017 版 Laravel 系列

  • Laravel 6 Ajax CRUD Tutorial You can follow step by step tutorial for Laravel 6 Ajax CRUD: https://itsolutionstuff.com/post/laravel-6-ajax-crud-tutorialexample.html

  • 我正在尝试从laravel 7升级到8的错误,我得到了错误 无法将您的需求解析为一组可安装的软件包。 问题1 使用选项--with-all-dependencies(-w)允许对当前锁定到特定版本的包进行升级、降级和删除。 我的作曲家 什么是错误,我如何修复它?

  • 问题内容: 我正在尝试将文件夹移动到其他地方。但是,我找不到修改变量的地方。现在,“ public_path()”返回错误的文件夹路径。 在哪里可以设置变量? 问题答案: 您可以使用ioc容器覆盖公共路径: 完美地为我工作的是增加了以下三行:

  • Laravel 5 语言包,包含37种语言, 基于 Laravel4-lang. 安装 composer require "overtrue/laravel-lang:dev-master" 或者添加下面一行到你的项目 composer.json 中 require 部分: "require": { "overtrue/laravel-lang": "dev-master" } 然后 compos

  • 总体差异 想装回过去的一些工具 安装:yum install -y tree net-tools bind-utils tree sysstat vim-en* lrzsz NetworkManager-tui ntp ntpdate iftop tcpdump telnet traceroute 查看版本号/主机名 cat /etc/redhat-release cat /etc/hostnam

  • 笔试分为选择题(单选和多选)和编程题(2) 选择题知识点:虚函数特性,自旋锁特性,哈夫曼树,子网掩码与主机数,基类与继承类 编程题: 1、给定数组降序排序输出前百分之三十中的最小数 思路:我用了冒泡排序直接求数组数×0.3-1 的下标元素 2、求一组 ipv4 网址的最大子网掩码中 1 的个数 这个完全没思路,计网看得少,对于二进制的操作也不会😔😔😔 #实习笔试# #CVTE# #C++暑期