Updating vendors

skala
Julio Montoya 12 years ago
parent 581ca79746
commit 89e4e2c649
  1. 2
      vendor/autoload.php
  2. 16
      vendor/composer/autoload_classmap.php
  3. 7
      vendor/composer/autoload_real.php
  4. 166
      vendor/composer/installed.json
  5. 1
      vendor/kairos/phpqrcode
  6. 21
      vendor/pagerfanta/pagerfanta/README.md
  7. 80
      vendor/pagerfanta/pagerfanta/src/Pagerfanta/Adapter/DoctrineSelectableAdapter.php
  8. 89
      vendor/pagerfanta/pagerfanta/tests/Pagerfanta/Tests/Adapter/DoctrineSelectableAdapterTest.php

@ -4,4 +4,4 @@
require_once __DIR__ . '/composer' . '/autoload_real.php';
return ComposerAutoloaderInit619569345dbdca8191d598b543f27c69::getLoader();
return ComposerAutoloaderInit102cf15a9988b6f52f43ec8a48c5be8a::getLoader();

@ -187,7 +187,6 @@ return array(
'ForumThreadLink' => $baseDir . '/main/gradebook/lib/be/forumthreadlink.class.php',
'ForumTopic' => $baseDir . '/main/coursecopy/classes/ForumTopic.class.php',
'Frame' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/frame.cls.php',
'FrameFiller' => $baseDir . '/main/inc/lib/phpqrcode/qrencode.php',
'FrameList' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/frame.cls.php',
'FrameListIterator' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/frame.cls.php',
'FrameTreeIterator' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/frame.cls.php',
@ -472,20 +471,6 @@ return array(
'Portfolio\\User' => $baseDir . '/main/inc/lib/system/portfolio/user.class.php',
'Positioner' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/positioner.cls.php',
'Promotion' => $baseDir . '/main/inc/lib/promotion.lib.php',
'QRbitstream' => $baseDir . '/main/inc/lib/phpqrcode/qrbitstream.php',
'QRcode' => $baseDir . '/main/inc/lib/phpqrcode/qrencode.php',
'QRencode' => $baseDir . '/main/inc/lib/phpqrcode/qrencode.php',
'QRimage' => $baseDir . '/main/inc/lib/phpqrcode/phpqrcode.php',
'QRinput' => $baseDir . '/main/inc/lib/phpqrcode/qrinput.php',
'QRinputItem' => $baseDir . '/main/inc/lib/phpqrcode/qrinput.php',
'QRmask' => $baseDir . '/main/inc/lib/phpqrcode/qrmask.php',
'QRrawcode' => $baseDir . '/main/inc/lib/phpqrcode/qrencode.php',
'QRrs' => $baseDir . '/main/inc/lib/phpqrcode/qrrscode.php',
'QRrsItem' => $baseDir . '/main/inc/lib/phpqrcode/qrrscode.php',
'QRrsblock' => $baseDir . '/main/inc/lib/phpqrcode/qrencode.php',
'QRspec' => $baseDir . '/main/inc/lib/phpqrcode/qrspec.php',
'QRsplit' => $baseDir . '/main/inc/lib/phpqrcode/phpqrcode.php',
'QRtools' => $baseDir . '/main/inc/lib/phpqrcode/qrtools.php',
'Question' => $baseDir . '/main/exercice/question.class.php',
'QuickformElement' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/Renderer/Object.php',
'QuickformFlexyElement' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/Renderer/ObjectFlexy.php',
@ -748,7 +733,6 @@ return array(
'phpCAS' => $baseDir . '/main/auth/cas/lib/CAS.php',
'phpmailerException' => $baseDir . '/main/inc/lib/phpmailer/class.phpmailer.php',
'phpmailerTest' => $baseDir . '/main/inc/lib/phpmailer/test/phpmailerTest.php',
'qrstr' => $baseDir . '/main/inc/lib/phpqrcode/qrconst.php',
'quiz_processor' => $baseDir . '/main/inc/lib/search/tool_processors/quiz_processor.class.php',
'scorm' => $baseDir . '/main/newscorm/scorm.class.php',
'scormItem' => $baseDir . '/main/newscorm/scormItem.class.php',

@ -2,7 +2,7 @@
// autoload_real.php generated by Composer
class ComposerAutoloaderInit619569345dbdca8191d598b543f27c69
class ComposerAutoloaderInit102cf15a9988b6f52f43ec8a48c5be8a
{
private static $loader;
@ -19,9 +19,9 @@ class ComposerAutoloaderInit619569345dbdca8191d598b543f27c69
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit619569345dbdca8191d598b543f27c69', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit102cf15a9988b6f52f43ec8a48c5be8a', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit619569345dbdca8191d598b543f27c69', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit102cf15a9988b6f52f43ec8a48c5be8a', 'loadClassLoader'));
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
@ -40,6 +40,7 @@ class ComposerAutoloaderInit619569345dbdca8191d598b543f27c69
require $vendorDir . '/swiftmailer/swiftmailer/lib/swift_required.php';
require $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier.composer.php';
require $vendorDir . '/kairos/phpqrcode/qrlib.php';
return $loader;
}

@ -1156,68 +1156,6 @@
"migrations"
]
},
{
"name": "pagerfanta/pagerfanta",
"version": "dev-master",
"version_normalized": "9999999-dev",
"source": {
"type": "git",
"url": "https://github.com/whiteoctober/Pagerfanta.git",
"reference": "43feb3d11af5ea16e5f1ef61fbe05df8337b6c46"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/whiteoctober/Pagerfanta/zipball/43feb3d11af5ea16e5f1ef61fbe05df8337b6c46",
"reference": "43feb3d11af5ea16e5f1ef61fbe05df8337b6c46",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"doctrine/mongodb-odm": "*",
"doctrine/orm": "2.*",
"mandango/mandango": "*",
"propel/propel1": ">=1.6,<2.0",
"solarium/solarium": "dev-develop"
},
"suggest": {
"doctrine/mongodb-odm": "To use the DoctrineODMMongoDBAdapter.",
"doctrine/orm": "To use the DoctrineORMAdapter.",
"mandango/mandango": "To use the MandangoAdapter.",
"propel/propel1": "To use the PropelAdapter",
"solarium/solarium": "To use the SolariumAdapter."
},
"time": "2013-04-02 00:47:33",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"installation-source": "source",
"autoload": {
"psr-0": {
"Pagerfanta\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Pablo Díez",
"email": "pablodip@gmail.com",
"homepage": "http://github.com/pablodip"
}
],
"description": "Pagination for PHP 5.3",
"keywords": [
"page",
"paging"
]
},
{
"name": "knplabs/knp-menu",
"version": "dev-master",
@ -2587,5 +2525,109 @@
"keywords": [
"silex"
]
},
{
"name": "kairos/phpqrcode",
"version": "dev-master",
"version_normalized": "9999999-dev",
"source": {
"type": "git",
"url": "https://github.com/kairosagency/phpqrcode.git",
"reference": "6770ecbe0e8c7d806c5779ad38b20c9acf5427d9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/kairosagency/phpqrcode/zipball/6770ecbe0e8c7d806c5779ad38b20c9acf5427d9",
"reference": "6770ecbe0e8c7d806c5779ad38b20c9acf5427d9",
"shasum": ""
},
"require": {
"php": ">=4.3.10"
},
"time": "2013-03-20 17:48:23",
"type": "library",
"installation-source": "source",
"autoload": {
"files": [
"qrlib.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL"
],
"authors": [
{
"name": "Kairos Agency"
}
],
"description": "A PHP class to generate QR Code",
"homepage": "http://github.com/kairosagency/phpqrcode",
"keywords": [
"php",
"qrcode"
]
},
{
"name": "pagerfanta/pagerfanta",
"version": "dev-master",
"version_normalized": "9999999-dev",
"source": {
"type": "git",
"url": "https://github.com/whiteoctober/Pagerfanta.git",
"reference": "92921b9bb155cecc68695fb273729a08586ceaf4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/whiteoctober/Pagerfanta/zipball/92921b9bb155cecc68695fb273729a08586ceaf4",
"reference": "92921b9bb155cecc68695fb273729a08586ceaf4",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"doctrine/mongodb-odm": "*",
"doctrine/orm": "2.*",
"mandango/mandango": "*",
"propel/propel1": ">=1.6,<2.0",
"solarium/solarium": "dev-develop"
},
"suggest": {
"doctrine/mongodb-odm": "To use the DoctrineODMMongoDBAdapter.",
"doctrine/orm": "To use the DoctrineORMAdapter.",
"mandango/mandango": "To use the MandangoAdapter.",
"propel/propel1": "To use the PropelAdapter",
"solarium/solarium": "To use the SolariumAdapter."
},
"time": "2013-04-02 11:00:09",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"installation-source": "source",
"autoload": {
"psr-0": {
"Pagerfanta\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Pablo Díez",
"email": "pablodip@gmail.com",
"homepage": "http://github.com/pablodip"
}
],
"description": "Pagination for PHP 5.3",
"keywords": [
"page",
"paging"
]
}
]

@ -0,0 +1 @@
Subproject commit 6770ecbe0e8c7d806c5779ad38b20c9acf5427d9

@ -178,6 +178,27 @@ $user = $em->find("Pagerfanta\Tests\Adapter\DoctrineORM\User", 1);
$adapter = new DoctrineCollectionAdapter($user->getGroups());
```
### DoctrineSelectableAdapter
To paginate a `Doctrine\Common\Collection\Selectable` interface you can use the `DoctrineSelectableAdapter`. It uses the matching() method on the Selectable interface for pagination. This is especially usefull when using the Doctrine Criteria object to filter a PersistentCollection:
```php
<?php
use Pagerfanta\Adapter\DoctrineSelectableAdapter;
use Doctrine\Common\Collections\Criteria;
$user = $em->find("Pagerfanta\Tests\Adapter\DoctrineORM\User", 1);
$comments = $user->getComments();
$criteria = Criteria::create()->andWhere(Criteria::expr()->in('id', array(1,2,3));
$adapter = new DoctrineSelectableAdapter($comments, $criteria);
```
Note that you should never use this adapter with a PersistentCollection which is not set to use the EXTRA_LAZY fetch mode.
*Be carefull when using the `count()` method, currently Doctrine2 needs to fetch all the records to count the number of elements.*
### PropelAdapter
To paginate a propel query:

@ -0,0 +1,80 @@
<?php
/*
* This file is part of the Pagerfanta package.
*
* (c) Pablo Díez <pablodip@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Pagerfanta\Adapter;
use Doctrine\Common\Collections\Criteria;
use Doctrine\Common\Collections\Selectable;
/**
* DoctrineSelectableAdapter.
*
* @author Boris Guéry <guery.b@gmail.com>
*/
class DoctrineSelectableAdapter implements AdapterInterface
{
/**
* @var Selectable
*/
private $selectable;
/**
* @var Criteria
*/
private $criteria;
/**
* Constructor.
*
* @param Selectable $selectable An implementation of the Selectable interface.
* @param Criteria $criteria A Doctrine criteria.
*/
public function __construct(Selectable $selectable, Criteria $criteria)
{
$this->selectable = $selectable;
$this->criteria = $criteria;
}
/**
* {@inheritdoc}
*/
public function getNbResults()
{
$firstResult = null;
$maxResults = null;
$criteria = $this->createCriteria($firstResult, $maxResults);
return $this->selectable->matching($criteria)->count();
}
/**
* {@inheritdoc}
*/
public function getSlice($offset, $length)
{
$firstResult = $offset;
$maxResults = $length;
$criteria = $this->createCriteria($firstResult, $maxResults);
return $this->selectable->matching($criteria);
}
private function createCriteria($firstResult, $maxResult)
{
$criteria = clone $this->criteria;
$criteria->setFirstResult($firstResult);
$criteria->setMaxResults($maxResult);
return $criteria;
}
}

@ -0,0 +1,89 @@
<?php
namespace Pagerfanta\Tests\Adapter;
use Pagerfanta\Adapter\DoctrineSelectableAdapter;
use Doctrine\Common\Collections\Selectable;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\Criteria;
use Doctrine\ORM\Version;
class DoctrineSelectableAdapterTest extends \PHPUnit_Framework_TestCase
{
private $selectable;
private $criteria;
private $adapter;
protected function setUp()
{
if ($this->isDoctrine23OrGreaterNotAvailable()) {
$this->markTestSkipped('This test can only be run using Doctrine >= 2.3');
}
$this->selectable = $this->createSelectableMock();
$this->criteria = $this->createCriteria();
$this->adapter = new DoctrineSelectableAdapter($this->selectable, $this->criteria);
}
private function isDoctrine23OrGreaterNotAvailable()
{
return version_compare(Version::VERSION, '2.3', '<');
}
private function createSelectableMock()
{
return $this->getMock('Doctrine\Common\Collections\Selectable');
}
private function createCriteria()
{
$criteria = new Criteria();
$criteria->orderBy(array('username' => 'ASC'));
$criteria->setFirstResult(2);
$criteria->setMaxResults(3);
return $criteria;
}
public function testGetNbResults()
{
$this->criteria->setFirstResult(null);
$this->criteria->setMaxResults(null);
$collection = $this->createCollectionMock();
$collection
->expects($this->any())
->method('count')
->will($this->returnValue(10));
$this->selectable
->expects($this->once())
->method('matching')
->with($this->equalTo($this->criteria))
->will($this->returnValue($collection));
$this->assertSame(10, $this->adapter->getNbResults());
}
private function createCollectionMock()
{
return $this->getMock('Doctrine\Common\Collections\Collection');
}
public function testGetSlice()
{
$this->criteria->setFirstResult(10);
$this->criteria->setMaxResults(20);
$slice = new \stdClass();
$this->selectable
->expects($this->once())
->method('matching')
->with($this->equalTo($this->criteria))
->will($this->returnValue($slice));
$this->assertSame($slice, $this->adapter->getSlice(10, 20));
}
}
Loading…
Cancel
Save