aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2010-03-18 14:30:04 +0000
committerrvelices <rv-github@modusoptimus.com>2010-03-18 14:30:04 +0000
commit15fdea6925f005d057e748707a07bc571685d6e2 (patch)
treefc8e813dffbda341015bfc85c5ef6a3331eb75a2
parent7d7f20e80455b661ff436d44bbb1ae61bba92ec6 (diff)
- removed compatibility with php4 (file_put_contents exists in php5)
- when synchronizing local files , sort them alphabetically git-svn-id: http://piwigo.org/svn/trunk@5176 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r--admin/site_reader_local.php5
-rw-r--r--include/common.inc.php21
-rw-r--r--include/php_compat/file_put_contents.php14
3 files changed, 9 insertions, 31 deletions
diff --git a/admin/site_reader_local.php b/admin/site_reader_local.php
index 3951185a1..4803dddbc 100644
--- a/admin/site_reader_local.php
+++ b/admin/site_reader_local.php
@@ -114,6 +114,7 @@ function get_elements($path)
$tmp_fs = $this->get_elements($path.'/'.$subdir);
$fs = array_merge($fs, $tmp_fs);
}
+ ksort($fs);
} //end if is_dir
return $fs;
}
@@ -198,10 +199,10 @@ function get_element_metadata($file, $has_high = false)
if ($has_high)
{
$high_file = dirname($file).'/pwg_high/'.basename($file);
-
+
$data['high_filesize'] = floor(filesize($high_file)/1024);
}
-
+
if ($conf['use_exif'])
{
$data = array_merge($data, get_sync_exif_data($file) );
diff --git a/include/common.inc.php b/include/common.inc.php
index d4ad9ad5c..ecd6266a1 100644
--- a/include/common.inc.php
+++ b/include/common.inc.php
@@ -81,7 +81,6 @@ foreach( array(
'array_intersect_key', //PHP 5 >= 5.1.0RC1
'hash_hmac', //(hash) - enabled by default as of PHP 5.1.2
'preg_last_error', // PHP 5 >= 5.2.0
- 'file_put_contents', //PHP5
) as $func)
{
if (!function_exists($func))
@@ -105,8 +104,8 @@ include(PHPWG_ROOT_PATH . 'include/functions.inc.php');
include( PHPWG_ROOT_PATH .'include/template.class.php');
// Database connection
-$pwg_db_link = pwg_db_connect($conf['db_host'], $conf['db_user'],
- $conf['db_password'], $conf['db_base'])
+$pwg_db_link = pwg_db_connect($conf['db_host'], $conf['db_user'],
+ $conf['db_password'], $conf['db_base'])
or my_error('pwg_db_connect', true);
pwg_db_check_charset();
@@ -116,19 +115,11 @@ load_plugins();
include(PHPWG_ROOT_PATH.'include/user.inc.php');
-if ('fr_FR' == $user['language']) {
- define('PHPWG_DOMAIN', 'fr.piwigo.org');
-}
-else if ('de_DE' == $user['language']) {
- define('PHPWG_DOMAIN', 'de.piwigo.org');
-}
-else if ('es_ES' == $user['language']) {
- define('PHPWG_DOMAIN', 'es.piwigo.org');
-}
-else if ('pl_PL' == $user['language']) {
- define('PHPWG_DOMAIN', 'pl.piwigo.org');
+if (in_array( substr($user['language'],0,2), array('fr','de','es','pl') ) )
+{
+ define('PHPWG_DOMAIN', substr($user['language'],0,2).'.piwigo.org');
}
-else if ('zh_CN' == $user['language']) {
+elseif ('zh_CN' == $user['language']) {
define('PHPWG_DOMAIN', 'cn.piwigo.org');
}
else {
diff --git a/include/php_compat/file_put_contents.php b/include/php_compat/file_put_contents.php
deleted file mode 100644
index 679d9c984..000000000
--- a/include/php_compat/file_put_contents.php
+++ /dev/null
@@ -1,14 +0,0 @@
-<?php
-//php 5
-function file_put_contents($filename, $data)
-{
- $fp = fopen($filename, 'w');
- if ($fp)
- {
- $ret = fwrite($fp, $data);
- fclose($fp);
- return $ret;
- }
- return false;
-}
-?> \ No newline at end of file