-
-
Notifications
You must be signed in to change notification settings - Fork 241
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 8.x: Bump v8.1.2 🚀 Remove dummy test. Apply fixes from StyleCI Add connection methods to toggle case senstive sessions. Fix unique and exists case insensitive validation. Revert NLS_COMP and NLS_SORT. Setup orchestra/testbench testcase. Apply fixes from StyleCI Refactor tests and move to namespace. Update github action script. Use oci8-2.2.0.
- Loading branch information
Showing
23 changed files
with
601 additions
and
282 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,35 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit bootstrap="vendor/autoload.php" | ||
backupGlobals="false" | ||
<phpunit backupGlobals="false" | ||
backupStaticAttributes="false" | ||
beStrictAboutTestsThatDoNotTestAnything="false" | ||
bootstrap="tests/bootstrap.php" | ||
colors="true" | ||
verbose="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
processIsolation="false" | ||
stopOnFailure="false"> | ||
stopOnError="false" | ||
stopOnFailure="false" | ||
verbose="true" | ||
> | ||
<testsuites> | ||
<testsuite name="Laravel OCI8 Test Suite"> | ||
<directory>tests</directory> | ||
<directory suffix="Test.php">./tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
<filter> | ||
<whitelist> | ||
<directory suffix=".php">src/</directory> | ||
</whitelist> | ||
</filter> | ||
<logging> | ||
<log type="tap" target="build/report.tap"/> | ||
<log type="junit" target="build/report.junit.xml"/> | ||
<log type="coverage-html" target="build/coverage"/> | ||
<log type="coverage-text" target="build/coverage.txt"/> | ||
<log type="coverage-clover" target="build/logs/clover.xml"/> | ||
</logging> | ||
<coverage processUncoveredFiles="true"> | ||
<include> | ||
<directory suffix=".php">./src</directory> | ||
</include> | ||
<exclude> | ||
<directory suffix=".blade.php">./src/</directory> | ||
</exclude> | ||
</coverage> | ||
<php> | ||
<ini name="memory_limit" value="2048M" /> | ||
<!-- | ||
<env name="REDIS_HOST" value="127.0.0.1" /> | ||
<env name="REDIS_PORT" value="6379" /> | ||
--> | ||
</php> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace Yajra\Oci8; | ||
|
||
use Illuminate\Validation\ValidationServiceProvider; | ||
use Yajra\Oci8\Validation\Oci8DatabasePresenceVerifier; | ||
|
||
class Oci8ValidationServiceProvider extends ValidationServiceProvider | ||
{ | ||
protected function registerPresenceVerifier() | ||
{ | ||
$this->app->singleton('validation.presence', function ($app) { | ||
return new Oci8DatabasePresenceVerifier($app['db']); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?php | ||
|
||
namespace Yajra\Oci8\Validation; | ||
|
||
use Illuminate\Validation\DatabasePresenceVerifier; | ||
use Yajra\Oci8\Oci8Connection; | ||
|
||
class Oci8DatabasePresenceVerifier extends DatabasePresenceVerifier | ||
{ | ||
/** | ||
* Count the number of objects in a collection having the given value. | ||
* | ||
* @param string $collection | ||
* @param string $column | ||
* @param string $value | ||
* @param int|null $excludeId | ||
* @param string|null $idColumn | ||
* @param array $extra | ||
* @return int | ||
*/ | ||
public function getCount($collection, $column, $value, $excludeId = null, $idColumn = null, array $extra = []) | ||
{ | ||
$connection = $this->table($collection)->getConnection(); | ||
|
||
if (! $connection instanceof Oci8Connection) { | ||
return parent::getCount($collection, $column, $value, $excludeId, $idColumn, $extra); | ||
} | ||
|
||
$connection->useCaseInsensitiveSession(); | ||
$count = parent::getCount($collection, $column, $value, $excludeId, $idColumn, $extra); | ||
$connection->useCaseSensitiveSession(); | ||
|
||
return $count; | ||
} | ||
|
||
/** | ||
* Count the number of objects in a collection with the given values. | ||
* | ||
* @param string $collection | ||
* @param string $column | ||
* @param array $values | ||
* @param array $extra | ||
* @return int | ||
*/ | ||
public function getMultiCount($collection, $column, array $values, array $extra = []) | ||
{ | ||
$connection = $this->table($collection)->getConnection(); | ||
|
||
if (! $connection instanceof Oci8Connection) { | ||
return parent::getMultiCount($collection, $column, $values, $extra); | ||
} | ||
|
||
$connection->useCaseInsensitiveSession(); | ||
$count = parent::getMultiCount($collection, $column, $values, $extra); | ||
$connection->useCaseSensitiveSession(); | ||
|
||
return $count; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.