Changing galician name order see BT#7345

1.9.x
Julio Montoya 12 years ago
parent 8761afab54
commit a11f82813e
  1. 8
      main/inc/global.inc.php
  2. 3
      main/inc/lib/database.lib.php
  3. 6
      main/inc/lib/display.lib.php
  4. 4
      main/inc/lib/internationalization_database/name_order_conventions.php
  5. 1
      main/inc/lib/main_api.lib.php
  6. 4
      main/inc/lib/usergroup.lib.php
  7. 2
      main/newscorm/lp_controller.php
  8. 5
      vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/ArrayCacheTest.php
  9. 210
      vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/CacheTest.php
  10. 33
      vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/FilesystemCacheTest.php
  11. 31
      vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/MemcacheCacheTest.php
  12. 36
      vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/MemcachedCacheTest.php
  13. 42
      vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/PhpFileCacheTest.php
  14. 26
      vendor/doctrine/cache/tests/Doctrine/Tests/TestInit.php

@ -137,7 +137,7 @@ if (!$_configuration['db_host']) {
if (!empty($_configuration['multiple_access_urls'])) {
$_configuration['access_url'] = 1;
$access_urls = api_get_access_urls();
$root_rel = api_get_self();
$root_rel = substr($root_rel,1);
$pos = strpos($root_rel,'/');
@ -317,6 +317,7 @@ if (file_exists($mail_conf)) {
// ===== "who is logged in?" module section =====
// check and modify the date of user in the track.e.online table
if (!$x = strpos($_SERVER['PHP_SELF'], 'whoisonline.php')) {
LoginCheck(isset($_user['user_id']) ? $_user['user_id'] : '');
@ -325,8 +326,9 @@ if (!$x = strpos($_SERVER['PHP_SELF'], 'whoisonline.php')) {
// ===== end "who is logged in?" module section =====
if (api_get_setting('server_type') == 'test') {
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
//error_reporting(-1);
//error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
ini_set('display_errors', '1');
error_reporting(-1);
} else {
/*
Server type is not test

@ -1158,7 +1158,8 @@ class Database {
* @example array('where'=> array('name = "Julio" AND lastname = "montoya"))
*/
public static function select($columns, $table_name, $conditions = array(), $type_result = 'all', $option = 'ASSOC') {
public static function select($columns, $table_name, $conditions = array(), $type_result = 'all', $option = 'ASSOC')
{
$conditions = self::parse_conditions($conditions);
//@todo we could do a describe here to check the columns ...

@ -58,13 +58,15 @@ class Display {
/**
* Displays the reduced page header (without banner)
*/
public static function display_reduced_header() {
public static function display_reduced_header()
{
global $show_learnpath, $tool_name;
self::$global_template = new Template($tool_name, false, false, $show_learnpath);
echo self::$global_template ->show_header_template();
}
public static function display_no_header() {
public static function display_no_header()
{
global $tool_name;
$disable_js_and_css_files = true;
self::$global_template = new Template($tool_name, false, false, $show_learnpath);

@ -44,7 +44,7 @@ return array(
'french' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'),
'frisian' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'),
'friulian' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'),
'galician' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'),
'galician' => array('format' => 'title last_name, first_name', 'sort_by' => 'last_name'),
'georgian' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'),
'german' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'),
'greek' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'),
@ -90,7 +90,7 @@ return array(
// Some experimental settings for Spanish language:
//'spanish' => array( 'format' => 'title first_name LAST_NAME', 'sort_by' => 'first_name'), // Western order, last name is uppercase when a full name is assembled
//'spanish' => array( 'format' => 'title first_name LAST_NAME', 'sort_by' => 'last_name'), // Western order, last name is uppercase when a full name is assembled
'spanish' => array( 'format' => 'title last_name, first_name', 'sort_by' => 'last_name'), // Library order
'spanish' => array('format' => 'title last_name, first_name', 'sort_by' => 'last_name'), // Library order
//'spanish' => array( 'format' => 'title LAST_NAME, first_name', 'sort_by' => 'last_name'), // Library order, last name is uppercase when a full name is assembled
'swahili' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name'),

@ -6568,6 +6568,7 @@ function api_set_memory_limit($mem){
}
return false;
}
/**
* Gets memory limit in bytes
* @param string The memory size (128M, 1G, 1000K, etc)

@ -25,12 +25,14 @@ class UserGroup extends Model
public function __construct()
{
$this->table = Database::get_main_table(TABLE_USERGROUP);
$this->usergroup_rel_user_table = Database::get_main_table(TABLE_USERGROUP_REL_USER);
$this->usergroup_rel_course_table = Database::get_main_table(TABLE_USERGROUP_REL_COURSE);
$this->usergroup_rel_session_table = Database::get_main_table(TABLE_USERGROUP_REL_SESSION);
$this->access_url_rel_usergroup = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USERGROUP);
$this->table_course = Database::get_main_table(TABLE_MAIN_COURSE);
$this->table_user = Database::get_main_table(TABLE_MAIN_USER);
global $_configuration;
if (isset($_configuration['enable_multiple_url_support_for_classes'])) {
$this->useMultipleUrl = $_configuration['enable_multiple_url_support_for_classes'];

@ -7,9 +7,7 @@
* @package chamilo.learnpath
* @author Yannick Warnier <ywarnier@beeznest.org>
*/
use \ChamiloSession as Session;
$debug = 0;
if ($debug > 0) error_log('New LP -+- Entered lp_controller.php -+- (action: '.$_REQUEST['action'].')', 0);

@ -18,4 +18,9 @@ class ArrayCacheTest extends CacheTest
$this->assertNull($stats);
}
protected function isSharedStorage()
{
return false;
}
}

@ -3,69 +3,194 @@
namespace Doctrine\Tests\Common\Cache;
use Doctrine\Common\Cache\Cache;
use ArrayObject;
abstract class CacheTest extends \Doctrine\Tests\DoctrineTestCase
{
public function testBasics()
/**
* @dataProvider provideCrudValues
*/
public function testBasicCrudOperations($value)
{
$cache = $this->_getCacheDriver();
// Test save
$cache->save('test_key', 'testing this out');
// Test contains to test that save() worked
$this->assertTrue($cache->contains('test_key'));
// Test saving a value, checking if it exists, and fetching it back
$this->assertTrue($cache->save('key', 'value'));
$this->assertTrue($cache->contains('key'));
$this->assertEquals('value', $cache->fetch('key'));
// Test fetch
$this->assertEquals('testing this out', $cache->fetch('test_key'));
// Test updating the value of a cache entry
$this->assertTrue($cache->save('key', 'value-changed'));
$this->assertTrue($cache->contains('key'));
$this->assertEquals('value-changed', $cache->fetch('key'));
// Test delete
$cache->save('test_key2', 'test2');
$cache->delete('test_key2');
$this->assertFalse($cache->contains('test_key2'));
// Test deleting a value
$this->assertTrue($cache->delete('key'));
$this->assertFalse($cache->contains('key'));
}
public function testObjects()
public function provideCrudValues()
{
$cache = $this->_getCacheDriver();
// Fetch/save test with objects (Is cache driver serializes/unserializes objects correctly ?)
$cache->save('test_object_key', new \ArrayObject());
$this->assertTrue($cache->fetch('test_object_key') instanceof \ArrayObject);
return array(
'array' => array(array('one', 2, 3.0)),
'string' => array('value'),
'integer' => array(1),
'float' => array(1.5),
'object' => array(new ArrayObject()),
);
}
public function testDeleteAll()
{
$cache = $this->_getCacheDriver();
$cache->save('test_key1', '1');
$cache->save('test_key2', '2');
$cache->deleteAll();
$this->assertFalse($cache->contains('test_key1'));
$this->assertFalse($cache->contains('test_key2'));
$this->assertTrue($cache->save('key1', 1));
$this->assertTrue($cache->save('key2', 2));
$this->assertTrue($cache->deleteAll());
$this->assertFalse($cache->contains('key1'));
$this->assertFalse($cache->contains('key2'));
}
public function testDeleteAllAndNamespaceVersioningBetweenCaches()
{
if ( ! $this->isSharedStorage()) {
$this->markTestSkipped('The ' . __CLASS__ .' does not use shared storage');
}
$cache1 = $this->_getCacheDriver();
$cache2 = $this->_getCacheDriver();
$this->assertTrue($cache1->save('key1', 1));
$this->assertTrue($cache2->save('key2', 2));
/* Both providers are initialized with the same namespace version, so
* they can see entries set by each other.
*/
$this->assertTrue($cache1->contains('key1'));
$this->assertTrue($cache1->contains('key2'));
$this->assertTrue($cache2->contains('key1'));
$this->assertTrue($cache2->contains('key2'));
/* Deleting all entries through one provider will only increment the
* namespace version on that object (and in the cache itself, which new
* instances will use to initialize). The second provider will retain
* its original version and still see stale data.
*/
$this->assertTrue($cache1->deleteAll());
$this->assertFalse($cache1->contains('key1'));
$this->assertFalse($cache1->contains('key2'));
$this->assertTrue($cache2->contains('key1'));
$this->assertTrue($cache2->contains('key2'));
/* A new cache provider should not see the deleted entries, since its
* namespace version will be initialized.
*/
$cache3 = $this->_getCacheDriver();
$this->assertFalse($cache3->contains('key1'));
$this->assertFalse($cache3->contains('key2'));
}
public function testFlushAll()
{
$cache = $this->_getCacheDriver();
$cache->save('test_key1', '1');
$cache->save('test_key2', '2');
$cache->flushAll();
$this->assertFalse($cache->contains('test_key1'));
$this->assertFalse($cache->contains('test_key2'));
$this->assertTrue($cache->save('key1', 1));
$this->assertTrue($cache->save('key2', 2));
$this->assertTrue($cache->flushAll());
$this->assertFalse($cache->contains('key1'));
$this->assertFalse($cache->contains('key2'));
}
public function testFlushAllAndNamespaceVersioningBetweenCaches()
{
if ( ! $this->isSharedStorage()) {
$this->markTestSkipped('The ' . __CLASS__ .' does not use shared storage');
}
$cache1 = $this->_getCacheDriver();
$cache2 = $this->_getCacheDriver();
/* Deleting all elements from the first provider should increment its
* namespace version before saving the first entry.
*/
$cache1->deleteAll();
$this->assertTrue($cache1->save('key1', 1));
/* The second provider will be initialized with the same namespace
* version upon its first save operation.
*/
$this->assertTrue($cache2->save('key2', 2));
/* Both providers have the same namespace version and can see entires
* set by each other.
*/
$this->assertTrue($cache1->contains('key1'));
$this->assertTrue($cache1->contains('key2'));
$this->assertTrue($cache2->contains('key1'));
$this->assertTrue($cache2->contains('key2'));
/* Flushing all entries through one cache will remove all entries from
* the cache but leave their namespace version as-is.
*/
$this->assertTrue($cache1->flushAll());
$this->assertFalse($cache1->contains('key1'));
$this->assertFalse($cache1->contains('key2'));
$this->assertFalse($cache2->contains('key1'));
$this->assertFalse($cache2->contains('key2'));
/* Inserting a new entry will use the same, incremented namespace
* version, and it will be visible to both providers.
*/
$this->assertTrue($cache1->save('key1', 1));
$this->assertTrue($cache1->contains('key1'));
$this->assertTrue($cache2->contains('key1'));
/* A new cache provider will be initialized with the original namespace
* version and not share any visibility with the first two providers.
*/
$cache3 = $this->_getCacheDriver();
$this->assertFalse($cache3->contains('key1'));
$this->assertFalse($cache3->contains('key2'));
$this->assertTrue($cache3->save('key3', 3));
$this->assertTrue($cache3->contains('key3'));
}
public function testNamespace()
{
$cache = $this->_getCacheDriver();
$cache->setNamespace('test_');
$cache->setNamespace('ns1_');
$this->assertTrue($cache->save('key1', 1));
$this->assertTrue($cache->contains('key1'));
$cache->setNamespace('ns2_');
$this->assertFalse($cache->contains('key1'));
}
public function testDeleteAllNamespace()
{
$cache = $this->_getCacheDriver();
$cache->setNamespace('ns1');
$this->assertFalse($cache->contains('key1'));
$cache->save('key1', 'test');
$this->assertTrue($cache->contains('key1'));
$cache->setNamespace('ns2');
$this->assertFalse($cache->contains('key1'));
$cache->save('key1', 'test');
$this->assertTrue($cache->contains('key1'));
$cache->setNamespace('test2_');
$cache->setNamespace('ns1');
$this->assertTrue($cache->contains('key1'));
$cache->deleteAll();
$this->assertFalse($cache->contains('key1'));
$cache->setNamespace('ns2');
$this->assertTrue($cache->contains('key1'));
$cache->deleteAll();
$this->assertFalse($cache->contains('key1'));
}
@ -77,25 +202,38 @@ abstract class CacheTest extends \Doctrine\Tests\DoctrineTestCase
$cache = $this->_getCacheDriver();
$stats = $cache->getStats();
$this->assertArrayHasKey(Cache::STATS_HITS, $stats);
$this->assertArrayHasKey(Cache::STATS_HITS, $stats);
$this->assertArrayHasKey(Cache::STATS_MISSES, $stats);
$this->assertArrayHasKey(Cache::STATS_UPTIME, $stats);
$this->assertArrayHasKey(Cache::STATS_MEMORY_USAGE, $stats);
$this->assertArrayHasKey(Cache::STATS_MEMORY_AVAILABLE, $stats);
}
/**
* Make sure that all supported caches return "false" instead of "null" to be compatible
* with ORM integration.
*/
public function testFalseOnFailedFetch()
public function testFetchMissShouldReturnFalse()
{
$cache = $this->_getCacheDriver();
/* Ensure that caches return boolean false instead of null on a fetch
* miss to be compatible with ORM integration.
*/
$result = $cache->fetch('nonexistent_key');
$this->assertFalse($result);
$this->assertNotNull($result);
}
/**
* Return whether multiple cache providers share the same storage.
*
* This is used for skipping certain tests for shared storage behavior.
*
* @return boolean
*/
protected function isSharedStorage()
{
return true;
}
/**
* @return \Doctrine\Common\Cache\CacheProvider
*/

@ -8,24 +8,8 @@ use Doctrine\Common\Cache\FilesystemCache;
/**
* @group DCOM-101
*/
class FilesystemCacheTest extends CacheTest
class FilesystemCacheTest extends BaseFileCacheTest
{
/**
* @var \Doctrine\Common\Cache\FilesystemCache
*/
private $driver;
protected function _getCacheDriver()
{
$dir = sys_get_temp_dir() . "/doctrine_cache_". uniqid();
$this->assertFalse(is_dir($dir));
$this->driver = new FilesystemCache($dir);
$this->assertTrue(is_dir($dir));
return $this->driver;
}
public function testLifetime()
{
$cache = $this->_getCacheDriver();
@ -84,19 +68,8 @@ class FilesystemCacheTest extends CacheTest
$this->assertGreaterThan(0, $stats[Cache::STATS_MEMORY_AVAILABLE]);
}
public function tearDown()
protected function _getCacheDriver()
{
$dir = $this->driver->getDirectory();
$ext = $this->driver->getExtension();
$iterator = new \RecursiveDirectoryIterator($dir);
foreach (new \RecursiveIteratorIterator($iterator, \RecursiveIteratorIterator::CHILD_FIRST) as $file) {
if ($file->isFile()) {
@unlink($file->getRealPath());
} else {
@rmdir($file->getRealPath());
}
}
return new FilesystemCache($this->directory);
}
}

@ -3,25 +3,35 @@
namespace Doctrine\Tests\Common\Cache;
use Doctrine\Common\Cache\MemcacheCache;
use Memcache;
class MemcacheCacheTest extends CacheTest
{
private $_memcache;
private $memcache;
public function setUp()
{
if (extension_loaded('memcache')) {
$this->_memcache = new \Memcache;
$ok = @$this->_memcache->connect('localhost', 11211);
if (!$ok) {
$this->markTestSkipped('The ' . __CLASS__ .' requires the use of memcache');
}
} else {
if ( ! extension_loaded('memcache')) {
$this->markTestSkipped('The ' . __CLASS__ .' requires the use of memcache');
}
$this->memcache = new Memcache();
if (@$this->memcache->connect('localhost', 11211) === false) {
unset($this->memcache);
$this->markTestSkipped('The ' . __CLASS__ .' cannot connect to memcache');
}
}
public function testNoExpire() {
public function tearDown()
{
if ($this->memcache instanceof Memcache) {
$this->memcache->flush();
}
}
public function testNoExpire()
{
$cache = $this->_getCacheDriver();
$cache->save('noexpire', 'value', 0);
sleep(1);
@ -38,8 +48,7 @@ class MemcacheCacheTest extends CacheTest
protected function _getCacheDriver()
{
$driver = new MemcacheCache();
$driver->setMemcache($this->_memcache);
$driver->setMemcache($this->memcache);
return $driver;
}
}

@ -3,6 +3,7 @@
namespace Doctrine\Tests\Common\Cache;
use Doctrine\Common\Cache\MemcachedCache;
use Memcached;
class MemcachedCacheTest extends CacheTest
{
@ -10,21 +11,29 @@ class MemcachedCacheTest extends CacheTest
public function setUp()
{
if (extension_loaded('memcached')) {
$this->memcached = new \Memcached();
$this->memcached->setOption(\Memcached::OPT_COMPRESSION, false);
$this->memcached->addServer('127.0.0.1', 11211);
$fh = @fsockopen('127.0.0.1', 11211);
if (!$fh) {
$this->markTestSkipped('The ' . __CLASS__ .' requires the use of memcache');
}
} else {
$this->markTestSkipped('The ' . __CLASS__ .' requires the use of memcache');
if ( ! extension_loaded('memcached')) {
$this->markTestSkipped('The ' . __CLASS__ .' requires the use of memcached');
}
$this->memcached = new Memcached();
$this->memcached->setOption(Memcached::OPT_COMPRESSION, false);
$this->memcached->addServer('127.0.0.1', 11211);
if (@fsockopen('127.0.0.1', 11211) === false) {
unset($this->memcached);
$this->markTestSkipped('The ' . __CLASS__ .' cannot connect to memcache');
}
}
public function testNoExpire() {
public function tearDown()
{
if ($this->memcached instanceof Memcached) {
$this->memcached->flush();
}
}
public function testNoExpire()
{
$cache = $this->_getCacheDriver();
$cache->save('noexpire', 'value', 0);
sleep(1);
@ -35,8 +44,7 @@ class MemcachedCacheTest extends CacheTest
{
$cache = $this->_getCacheDriver();
$cache->save('key', 'value', 30 * 24 * 3600 + 1);
$this->assertTrue($cache->contains('key'), 'Memcached provider should support TTL > 30 days');
$this->assertTrue($cache->contains('key'), 'Memcache provider should support TTL > 30 days');
}
protected function _getCacheDriver()

@ -8,29 +8,8 @@ use Doctrine\Common\Cache\PhpFileCache;
/**
* @group DCOM-101
*/
class PhpFileCacheTest extends CacheTest
class PhpFileCacheTest extends BaseFileCacheTest
{
/**
* @var \Doctrine\Common\Cache\PhpFileCache
*/
private $driver;
protected function _getCacheDriver()
{
$dir = sys_get_temp_dir() . "/doctrine_cache_". uniqid();
$this->assertFalse(is_dir($dir));
$this->driver = new PhpFileCache($dir);
$this->assertTrue(is_dir($dir));
return $this->driver;
}
public function testObjects()
{
$this->markTestSkipped('PhpFileCache does not support saving objects that dont implement __set_state()');
}
public function testLifetime()
{
$cache = $this->_getCacheDriver();
@ -106,25 +85,10 @@ class PhpFileCacheTest extends CacheTest
$this->assertGreaterThan(0, $stats[Cache::STATS_MEMORY_AVAILABLE]);
}
public function tearDown()
protected function _getCacheDriver()
{
if (!$this->driver) {
return;
}
$dir = $this->driver->getDirectory();
$ext = $this->driver->getExtension();
$iterator = new \RecursiveDirectoryIterator($dir);
foreach (new \RecursiveIteratorIterator($iterator, \RecursiveIteratorIterator::CHILD_FIRST) as $file) {
if ($file->isFile()) {
@unlink($file->getRealPath());
} else {
@rmdir($file->getRealPath());
}
}
return new PhpFileCache($this->directory);
}
}
class NotSetStateClass

@ -6,18 +6,16 @@ namespace Doctrine\Tests;
error_reporting(E_ALL | E_STRICT);
// register silently failing autoloader
spl_autoload_register(function($class)
{
if (0 === strpos($class, 'Doctrine\Tests\\')) {
$path = __DIR__.'/../../'.strtr($class, '\\', '/').'.php';
if (is_file($path) && is_readable($path)) {
require_once $path;
return true;
}
}
});
require_once __DIR__ . "/../../../vendor/autoload.php";
if (file_exists(__DIR__ . '/../../../vendor/autoload.php')) {
// dependencies were installed via composer - this is the main project
$classLoader = require __DIR__ . '/../../../vendor/autoload.php';
} elseif (file_exists(__DIR__ . '/../../../../../autoload.php')) {
// installed as a dependency in `vendor`
$classLoader = require __DIR__ . '/../../../../../autoload.php';
} else {
throw new \Exception('Can\'t find autoload.php. Did you install dependencies via composer?');
}
/* @var $classLoader \Composer\Autoload\ClassLoader */
$classLoader->add('Doctrine\\Tests\\', __DIR__ . '/../../');
unset($classLoader);

Loading…
Cancel
Save