1. Go to this page and download the library: Download rougin/spark-plug library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
rougin / spark-plug example snippets
php
$ci = Rougin\SparkPlug\Instance::create();
// You can now use the CI_Controller instance
$ci->load->helper('inflector');
php
use Rougin\SparkPlug\SparkPlug;
$sparkplug = new SparkPlug($GLOBALS, $_SERVER);
$ci = $sparkplug->instance();
// The Inflector helper is now loaded ---
$ci->load->helper('inflector');
// --------------------------------------
php
use Rougin\SparkPlug\Instance;
class SampleTest extends \PHPUnit_Framework_TestCase
{
public function testCodeigniterInstance()
{
// Directory path to the test application
$application = __DIR__ . '/TestApp';
// Instance::create($path, $_SERVER, $GLOBALS)
$ci = Instance::create($application);
$this->assertInstanceOf('CI_Controller', $ci);
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.