10.04.2018 Views

Doctrine_manual-1-2-en

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 25: Ext<strong>en</strong>sions 339<br />

$ cd /path/to/ext<strong>en</strong>sions/Sortable/tests<br />

$ php run.php<br />

You should see the tests output the following showing the tests were successful:<br />

<strong>Doctrine</strong> Unit Tests<br />

Listing<br />

25-6<br />

===================<br />

<strong>Doctrine</strong>_Template_Sortable_TestCase.............................................passed<br />

Tested: 1 test cases.<br />

Successes: 26 passes.<br />

Failures: 0 fails.<br />

Number of new Failures: 0<br />

Number of fixed Failures: 0<br />

Tests ran in 1 seconds and used 13024.9414062 KB of memory<br />

Now if you want to use the ext<strong>en</strong>sion in your project you will need register the ext<strong>en</strong>sion with<br />

<strong>Doctrine</strong> and setup the ext<strong>en</strong>sion autoloading mechanism.<br />

First lets setup the ext<strong>en</strong>sion autoloading.<br />

// bootstrap.php<br />

Listing<br />

25-7<br />

// ...<br />

spl_autoload_register(array('<strong>Doctrine</strong>', 'ext<strong>en</strong>sionsAutoload'));<br />

Now you can register the ext<strong>en</strong>sion and the classes inside that ext<strong>en</strong>sion will be<br />

autoloaded.<br />

$manager->registerExt<strong>en</strong>sion('Sortable');<br />

Listing<br />

25-8<br />

If you need to register an ext<strong>en</strong>sion from a differ<strong>en</strong>t location you can specify the full path to<br />

the ext<strong>en</strong>sion directory as the second argum<strong>en</strong>t to the registerExt<strong>en</strong>sion() method.<br />

----------------- Brought to you by

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!