2017 © Pedro Peláez
 

library spark-plug

Returns Codeigniter applications as single variables.

image

rougin/spark-plug

Returns Codeigniter applications as single variables.

  • Tuesday, February 6, 2018
  • by rougin
  • Repository
  • 1 Watchers
  • 9 Stars
  • 10,040 Installations
  • PHP
  • 5 Dependents
  • 1 Suggesters
  • 5 Forks
  • 0 Open issues
  • 13 Versions
  • 9 % Grown

The README.md

Spark Plug

Latest Version on Packagist ![Software License][ico-license] Build Status ![Coverage Status][ico-coverage] Total Downloads, (*1)

A special package that returns an application based on Codeigniter 3 as a single variable. Might be useful when testing a Codeigniter 3 project to frameworks such as PHPUnit., (*2)

Installation

Install Spark Plug through Composer:, (*3)

``` bash $ composer require rougin/spark-plug, (*4)


## Basic Usage ### Using the `Instance` helper ``` php $ci = Rougin\SparkPlug\Instance::create(); // You can now use the CI_Controller instance $ci->load->helper('inflector');

[!NOTE] Instead of CI_Controller, it returns Rougin\SparkPlug\Controller for type-hinting its helpers and libraries., (*5)

Using the SparkPlug class

``` php use Rougin\SparkPlug\SparkPlug;, (*6)

$sparkplug = new SparkPlug($GLOBALS, $_SERVER);, (*7)

$ci = $sparkplug->instance();, (*8)

// The Inflector helper is now loaded --- $ci->load->helper('inflector'); // --------------------------------------, (*9)


### Modify constants to be defined ``` php use Rougin\SparkPlug\SparkPlug; $sparkplug = new SparkPlug($GLOBALS, $_SERVER); // Set the value of the APPPATH constant --- $sparkplug->set('APPPATH', '/path/to/app'); // ----------------------------------------- $ci = $sparkplug->instance();

Available constants that can be modified:, (*10)

  • APPPATH
  • VENDOR
  • VIEWPATH

[!NOTE] If setting a new APPPATH value, the value of VIEWPATH will be set to APPPATH/views., (*11)

Mock CI_Controller for unit testing

``` php use Rougin\SparkPlug\Instance;, (*12)

class SampleTest extends \PHPUnit_Framework_TestCase { public function testCodeigniterInstance() { // Directory path to the test application $application = DIR . '/TestApp';, (*13)

    // Instance::create($path, $_SERVER, $GLOBALS)
    $ci = Instance::create($application);

    $this->assertInstanceOf('CI_Controller', $ci);
}

}, (*14)


## Changelog Please see [CHANGELOG][link-changelog] for more information what has changed recently. ## Testing ``` bash $ composer test

Credits

License

The MIT License (MIT). Please see LICENSE for more information., (*15)

The Versions

06/02 2018

dev-master

9999999-dev https://github.com/rougin/spark-plug

Returns Codeigniter applications as single variables.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

php codeigniter instance spark-plug

11/01 2018

v0.6.0

0.6.0.0 https://github.com/rougin/spark-plug

Returns Codeigniter applications as single variables.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

php codeigniter instance spark-plug

22/11 2016

v0.5.0

0.5.0.0 https://github.com/rougin/spark-plug

Returns an instance of CodeIgniter

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

php codeigniter instance spark-plug

09/09 2016

v0.4.4

0.4.4.0 https://github.com/rougin/spark-plug

Yet another way to access CodeIgniter's instance

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

php codeigniter instance spark-plug

12/05 2016

v0.4.3

0.4.3.0 https://github.com/rougin/spark-plug

Yet another way to access CodeIgniter's instance

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

php codeigniter instance spark-plug

09/05 2016

v0.4.2

0.4.2.0 https://github.com/rougin/spark-plug

Yet another way to access CodeIgniter's instance

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

php codeigniter instance spark-plug

28/04 2016

v0.4.1

0.4.1.0 https://github.com/rougin/spark-plug

Yet another way to access CodeIgniter's instance

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

php codeigniter instance spark-plug

25/04 2016

v0.4.0

0.4.0.0 https://github.com/rougin/spark-plug

Yet another way to access CodeIgniter's instance

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

php codeigniter instance spark-plug

23/03 2016

v0.3.0

0.3.0.0 https://github.com/rougin/spark-plug

Yet another way to access CodeIgniter's instance

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

php codeigniter instance spark-plug

23/10 2015

v0.2.0

0.2.0.0 https://github.com/rougin/spark-plug

Yet another way to access CodeIgniter's instance

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

php codeigniter instance spark-plug

18/09 2015

v0.1.2

0.1.2.0

Another way to access CodeIgniter's instance

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Rougin Gutib

php codeigniter instance

16/09 2015

v0.1.1

0.1.1.0

Another way to access CodeIgniter's instance

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Rougin Gutib

php codeigniter instance

25/06 2015

v0.1.0

0.1.0.0

Another way to access CodeIgniter's instance

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Rougin Gutib

php codeigniter instance