[Linpha-cvs] SF.net SVN: linpha: [4540] trunk/linpha2
Status: Inactive
Brought to you by:
bzrudi
From: <fan...@us...> - 2006-04-16 16:41:35
|
Revision: 4540 Author: fangehrn Date: 2006-04-16 09:41:19 -0700 (Sun, 16 Apr 2006) ViewCVS: http://svn.sourceforge.net/linpha/?rev=4540&view=rev Log Message: ----------- * added "install" prefix to all functions in lib.install.php and lib.requirements.php Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/install/lib.install.php trunk/linpha2/install/lib.requirements.php trunk/linpha2/install/step2_requirements.php trunk/linpha2/install/step4_selectdirectories.php trunk/linpha2/install/step5_getlogin.php trunk/linpha2/install/step7_selectprefix.php trunk/linpha2/install/step9_createtables.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2006-04-16 16:30:56 UTC (rev 4539) +++ trunk/linpha2/ChangeLog 2006-04-16 16:41:19 UTC (rev 4540) @@ -3,6 +3,7 @@ (all folder paths are always stores without ending slash) * fixed some notices in installer * finished basket checkout features + * added "install" prefix to all functions in lib.install.php and lib.requirements.php 2006-04-15 flo * finished implementing basket checkout features (download, print, mail) Modified: trunk/linpha2/install/lib.install.php =================================================================== --- trunk/linpha2/install/lib.install.php 2006-04-16 16:30:56 UTC (rev 4539) +++ trunk/linpha2/install/lib.install.php 2006-04-16 16:41:19 UTC (rev 4540) @@ -104,7 +104,7 @@ } } -function linInstallget_PATH($array_path) +function installGetPATH($array_path) { /** * use the path variable instead of own array @@ -152,7 +152,7 @@ /** * delete directory recurisvely - same as "rm -rf" */ -function rm_rf($path,$followLinks=false) +function installRm_rf($path,$followLinks=false) { $dir = opendir($path) ; while (false !== ($entry = readdir($dir))) @@ -163,7 +163,7 @@ } elseif ( is_dir( "$path/$entry" ) && $entry!='.' && $entry!='..' ) { - rm_rf( "$path/$entry" ); + installRm_rf( "$path/$entry" ); } } closedir($dir) ; @@ -173,7 +173,7 @@ /** * create directory recursively - same as "mkdir -p" */ -function mkdir_p($target,$mode='0700') +function installMkdir_p($target,$mode='0700') { if(is_dir($target) || empty($target)) { // best case check first return true; @@ -181,7 +181,7 @@ if(file_exists($target) && !is_dir($target)) { // target exists bug isn't a directory.. return false; } - if( mkdir_p( substr( $target,0,strrpos( $target,'/') ) ) ) + if( installMkdir_p( substr( $target,0,strrpos( $target,'/') ) ) ) { return mkdir($target,intval($mode,8)); // crawl back up & create dir tree } @@ -193,11 +193,11 @@ /** * realpath() doesnt work if path is absolute - * linpha_realpath takes care of this + * installLinRealpath takes care of this */ -function linpha_realpath( $path) +function installLinRealpath( $path) { - if( ! is_absolute_path( $path ) ) + if( ! installIsAbsolutePath( $path ) ) { $path = realpath( $path ); } @@ -225,9 +225,9 @@ * @uses actions/submit_mod_data.php,photo_cache_cleanup_by_id(),photo_cache_delete_folder() * @package filesys */ -function get_full_path($path) +function installGetFullPath($path) { - if(is_absolute_path($path)) { + if(installIsAbsolutePath($path)) { $full_path = $path; } else { $full_path = LINPHA_DIR.'/'.$path; @@ -242,10 +242,10 @@ * @author flo * @param string $path a path * @return ture|false is an absolute path or not -* @uses get_full_path() +* @uses installGetFullPath() * @package filesys */ -function is_absolute_path($path) +function installIsAbsolutePath($path) { if(substr($path,0,1) == '/' OR // string begins with a '/' -> absolut path ((strpos($path, ':') !== false) AND (strpos( PHP_OS, 'WIN' ) !== FALSE)) // we are on windows and the string contains a ':' -> absolut path (c:/..) @@ -261,7 +261,7 @@ */ function get_available_language_files() { - $folder = get_full_path('install/lang'); + $folder = installGetFullPath('install/lang'); $file_handle = opendir($folder); $file = readdir($file_handle); Modified: trunk/linpha2/install/lib.requirements.php =================================================================== --- trunk/linpha2/install/lib.requirements.php 2006-04-16 16:30:56 UTC (rev 4539) +++ trunk/linpha2/install/lib.requirements.php 2006-04-16 16:41:19 UTC (rev 4540) @@ -20,15 +20,15 @@ /** * @package Installation */ -function check_convert() +function installCheckConvert() { if(installGetOS()=='win') { $convert = 'convert.exe'; } else { $convert = 'convert'; } - $array_path = linInstallget_PATH('PATH'); - $array_lookfor = linInstallget_PATH(Array('/bin','/usr/bin','/usr/local/bin','/sw/bin')); + $array_path = installGetPATH('PATH'); + $array_lookfor = installGetPATH(Array('/bin','/usr/bin','/usr/local/bin','/sw/bin')); /** * need a special check if safe_mode is on @@ -149,7 +149,7 @@ * @uses sec_stage_install.php, plugins/ftp/index.php * @package requirements */ -function check_posix() +function installCheckPosix() { $array_needed_functions = Array( 'posix_getuid', @@ -182,7 +182,7 @@ /** * @package requirements */ -function get_mem_limit() +function installGetMemLimit() { $memlimit=ini_get('memory_limit'); Modified: trunk/linpha2/install/step2_requirements.php =================================================================== --- trunk/linpha2/install/step2_requirements.php 2006-04-16 16:30:56 UTC (rev 4539) +++ trunk/linpha2/install/step2_requirements.php 2006-04-16 16:41:19 UTC (rev 4540) @@ -121,7 +121,7 @@ */ print_line_left("ImageMagick"); - list($convert_avail, $convert_path, $convert_version) = check_convert(); + list($convert_avail, $convert_path, $convert_version) = installCheckConvert(); if($convert_avail) { @@ -248,7 +248,7 @@ if(installGetOS() != "win") { print_line_left("Posix Extension"); - if(check_posix()) + if(installCheckPosix()) { print_line_middle("Yes"); print_line_right(success_msg()); @@ -301,7 +301,7 @@ * memory limit */ print_line_left("PHP Memory limit"); - $limit = get_mem_limit(); + $limit = installGetMemLimit(); if($limit === false) { print_line_middle("Unlimited"); Modified: trunk/linpha2/install/step4_selectdirectories.php =================================================================== --- trunk/linpha2/install/step4_selectdirectories.php 2006-04-16 16:30:56 UTC (rev 4539) +++ trunk/linpha2/install/step4_selectdirectories.php 2006-04-16 16:41:19 UTC (rev 4540) @@ -70,7 +70,7 @@ <input class="boxalignelement" type="text" id="check01" onKeyup="checkForm()" name="album_dir" size="30" value="<?php echo $album_dir; ?>"> </div> -(-> <?php echo linpha_realpath( get_full_path($album_dir) ); ?>) +(-> <?php echo installLinRealpath( installGetFullPath($album_dir) ); ?>) <br /><br /> <h2><?php echo tr("Warning: All Existing Subdirectories Will Be Deleted"); ?></h2> @@ -81,7 +81,7 @@ <input class="boxalignelement" type="text" id="check02" onKeyup="checkForm()" name="sql_dir" size="30" value="<?php echo $sql_dir; ?>"> </div> -(-> <?php echo linpha_realpath( get_full_path($sql_dir) ); ?>) +(-> <?php echo installLinRealpath( installGetFullPath($sql_dir) ); ?>) <br /><br /> <div class="boxalign"> @@ -89,7 +89,7 @@ <input class="boxalignelement" type="text" id="check03" onKeyup="checkForm()" name="cache_dir" size="30" value="<?php echo $cache_dir; ?>"> </div> -(-> <?php echo linpha_realpath( get_full_path($cache_dir) ); ?>) +(-> <?php echo installLinRealpath( installGetFullPath($cache_dir) ); ?>) <br /><br /> <div class="boxalign"> @@ -97,7 +97,7 @@ <input class="boxalignelement" type="text" id="check04" onKeyup="checkForm()" name="tmp_dir" size="30" value="<?php echo $tmp_dir; ?>"> </div> -(-> <?php echo linpha_realpath( get_full_path($tmp_dir) ); ?>) +(-> <?php echo installLinRealpath( installGetFullPath($tmp_dir) ); ?>) <br /><br /> <?php Modified: trunk/linpha2/install/step5_getlogin.php =================================================================== --- trunk/linpha2/install/step5_getlogin.php 2006-04-16 16:30:56 UTC (rev 4539) +++ trunk/linpha2/install/step5_getlogin.php 2006-04-16 16:41:19 UTC (rev 4540) @@ -72,7 +72,7 @@ * get correct dir names (take care of relativ and absolute paths, add * LINPHA_DIR if necessary) */ - $dirs[$value] = get_full_path( $_SESSION[$value.'_dir'] ); + $dirs[$value] = installGetFullPath( $_SESSION[$value.'_dir'] ); } /** @@ -101,12 +101,12 @@ if( is_writable( $dirs['album'] ) ) { echo success_msg(); - echo '<br /> ('.$_SESSION['album_dir'].' => '.linpha_realpath( $dirs['album'] ).')'; + echo '<br /> ('.$_SESSION['album_dir'].' => '.installLinRealpath( $dirs['album'] ).')'; } else { echo warning_msg(); - echo '<br /> ('.$_SESSION['album_dir'].' => '.linpha_realpath( $dirs['album'] ).')'; + echo '<br /> ('.$_SESSION['album_dir'].' => '.installLinRealpath( $dirs['album'] ).')'; echo "<br />".tr("Album Directory Not Writable. Some Features May Not Work")."<br />"; } } @@ -137,7 +137,7 @@ { echo warning_msg(); echo "<br />".tr("Directory Already Exists - Trying To Delete")."... "; - if( rm_rf( $dirs[$value] ) ) + if( installRm_rf( $dirs[$value] ) ) { echo success_msg(); } @@ -153,7 +153,7 @@ } echo "<br /> ".tr("Trying To Create Directory")."... "; - if( mkdir_p( $dirs[$value] ) ) + if( installMkdir_p( $dirs[$value] ) ) { echo success_msg(); @@ -167,7 +167,7 @@ throw new Exception(failed_msg()."<br />".tr("Cannot create folder, please check permissions!")); } - echo '<br /> ('.$_SESSION[$value.'_dir'].' => '.linpha_realpath( $dirs[$value] ).')<br />'; + echo '<br /> ('.$_SESSION[$value.'_dir'].' => '.installLinRealpath( $dirs[$value] ).')<br />'; } } catch(Exception $error) Modified: trunk/linpha2/install/step7_selectprefix.php =================================================================== --- trunk/linpha2/install/step7_selectprefix.php 2006-04-16 16:30:56 UTC (rev 4539) +++ trunk/linpha2/install/step7_selectprefix.php 2006-04-16 16:41:19 UTC (rev 4540) @@ -158,24 +158,16 @@ /** * save current value and append correct dir names */ - $_SESSION[$value.'_dir_parent'] = $_POST[$value.'_dir']; - switch($value) - { - case 'album': $_SESSION[$value.'_dir'] = $_POST[$value.'_dir']; break; - case 'sql': $_SESSION[$value.'_dir'] = $_POST[$value.'_dir'].'sql/'; break; - case 'cache': $_SESSION[$value.'_dir'] = $_POST[$value.'_dir'].'cache/'; break; - case 'tmp': $_SESSION[$value.'_dir'] = $_POST[$value.'_dir'].'tmp/'; break; - } + $_SESSION[$value.'_dir'] = $_POST[$value.'_dir']; } /** * get correct dir names (take care of relativ and absolute paths, add * LINPHA_DIR if necessary) */ - $dirs[$value] = get_full_path( $_SESSION[$value.'_dir'] ); - $dirs[$value.'_parent'] = get_full_path( $_SESSION[$value.'_dir_parent'] ); + $dirs[$value] = installGetFullPath( $_SESSION[$value.'_dir'] ); } - if(file_exists(LINPHA_DIR.'/'.$_SESSION['sql_dir'].$_SESSION['sql_dbname'])) + if(file_exists(LINPHA_DIR.'/'.$_SESSION['sql_dir'].'/'.$_SESSION['sql_dbname'])) { echo failed_msg(); echo "<br />".tr("Database Already Exists, Delete The File ".$_SESSION['sql_dbname']." first!").""; @@ -188,7 +180,7 @@ * store in session to be used when switching to adodb */ - if ($db = @sqlite_open(LINPHA_DIR.'/'.$_SESSION['sql_dir'].$_SESSION['sql_dbname'], 0666, $sqliteerror)) + if ($db = @sqlite_open(LINPHA_DIR.'/'.$_SESSION['sql_dir'].'/'.$_SESSION['sql_dbname'], 0666, $sqliteerror)) { echo success_msg(); } Modified: trunk/linpha2/install/step9_createtables.php =================================================================== --- trunk/linpha2/install/step9_createtables.php 2006-04-16 16:30:56 UTC (rev 4539) +++ trunk/linpha2/install/step9_createtables.php 2006-04-16 16:41:19 UTC (rev 4540) @@ -155,8 +155,8 @@ * create cache directories */ echo "<br /><br />".tr("Creating Cache Directories")."... "; - mkdir(get_full_path( $_SESSION['cache_dir'] ).'/img', 0700); - mkdir(get_full_path( $_SESSION['cache_dir'] ).'/thumb', 0700); + mkdir(installGetFullPath( $_SESSION['cache_dir'] ).'/img', 0700); + mkdir(installGetFullPath( $_SESSION['cache_dir'] ).'/thumb', 0700); echo success_msg(); @@ -198,7 +198,7 @@ * create config.sql.php file */ echo "<br />".tr("Writing config.sql.php File")."... "; - $fp = fopen( get_full_path( $_SESSION['sql_dir'] )."/config.sql.php","w+" ); + $fp = fopen( installGetFullPath( $_SESSION['sql_dir'] )."/config.sql.php","w+" ); if($fp) { $comment[1] = ''; @@ -214,7 +214,7 @@ fwrite( $fp, $str ); fclose($fp); - if( !@chmod( get_full_path( $_SESSION['sql_dir'] )."/config.sql.php", 0600 ) ) + if( !@chmod( installGetFullPath( $_SESSION['sql_dir'] )."/config.sql.php", 0600 ) ) { echo warning_msg().'<br />'; echo tr("Chmod Failed For config.sql.php")."<br />"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |