本文整理汇总了PHP中update_progress_bar函数的典型用法代码示例。如果您正苦于以下问题:PHP update_progress_bar函数的具体用法?PHP update_progress_bar怎么用?PHP update_progress_bar使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了update_progress_bar函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: replace_files
function replace_files ($dir, $pos=2,$fileitem,$environment,$namearray) {
$handle = @opendir($dir);
while ( $file = @readdir($handle) ) {
if ( preg_match("~^\.{1,2}$~u", $file) ) {
continue;
}
if ( is_dir($dir.$file) ) {
replace_files($dir.$file."/", $pos + 3,$fileitem,$environment,$namearray);
} else {
$extension = mb_strtolower(mb_substr(strrchr($dir.$file,"."),1), 'UTF-8');
if ( is_file($dir.$file) and ( $extension == "htm"
or $extension == "html"
or $extension == "js"
or $extension == "xml"
or $extension == "xslt"
or $extension == "xsd"
#or $extension == "css"
)
) {
$replacement = replacement($environment,$fileitem,$dir,$file,$namearray);
$open = fopen($dir.$file,'w');
fputs($open,$replacement);
fclose($open);
update_progress_bar(count_for_process($namearray));
}
}
}
@closedir($handle);
}
示例2: changeWikis2
function changeWikis2 ($directory,$count) {
$directory_handle = opendir($directory);
while ( false !== ($entry = readdir($directory_handle)) ) {
if ($entry != '.' and $entry != '..' and is_dir($directory.'/'.$entry)) {
changeWikis2($directory.'/'.$entry,$count);
} elseif (is_file($directory.'/'.$entry) and $entry == 'commsy_config.php') {
$str = file_get_contents($directory.'/'.$entry);
if ( mb_stristr($str,'$COMMSY_ROOM_ID') and !mb_stristr($str,'session_name') ) {
$str = str_replace(array("\r\n", "\r"), "\n", $str);
$str_array = explode("\n",$str);
$str_out = '';
foreach ( $str_array as $value ) {
$str_out .= $value.LF;
if ( mb_stristr($value, '$COMMSY_ROOM_ID = "') ) {
$str_out .= 'session_name(\'SESSID-\'.$COMMSY_ROOM_ID);'.LF;
}
}
if ( !empty($str_out) ) {
file_put_contents($directory.'/'.$entry,trim($str_out));
}
}
update_progress_bar($count);
}
}
}
示例3: testupdate_progress_bar
public function testupdate_progress_bar()
{
//execute the method and test if it doesn't throw an exception.
//this method uses flush so we cannot get and verify content printed
try {
ob_start();
update_progress_bar('test', 80, 100, false);
ob_end_clean();
$this->assertTrue(true);
} catch (Exception $e) {
$this->fail();
}
}
示例4: changeWikis
function changeWikis ($directory,$count) {
$directory_handle = opendir($directory);
while ( false !== ($entry = readdir($directory_handle)) ) {
if ($entry != '.' and $entry != '..' and is_dir($directory.'/'.$entry)) {
changeWikis($directory.'/'.$entry,$count);
} elseif (is_file($directory.'/'.$entry) and $entry == 'index.php') {
unlink($directory.'/'.$entry);
global $c_pmwiki_absolute_path_file;
$str = "<?php include('".$c_pmwiki_absolute_path_file."/pmwiki.php');?>";
file_put_contents($directory.'/'.$entry,$str);
update_progress_bar($count);
}
}
}
示例5: changeWikis
function changeWikis ($directory,$count) {
$directory_handle = opendir($directory);
while ( false !== ($entry = readdir($directory_handle)) ) {
if ($entry != '.' and $entry != '..' and is_dir($directory.'/'.$entry)) {
changeWikis($directory.'/'.$entry,$count);
} elseif (is_file($directory.'/'.$entry) and $entry == 'commsy_config.php') {
$str = file_get_contents($directory.'/'.$entry);
if ( mb_stristr($str,'authuser.php') and !mb_stristr($str,'authusercommsy.php') ) {
$str = str_replace('include_once("$FarmD/scripts/authuser.php");','include_once("$FarmD/cookbook/authusercommsy.php");'.LF.'include_once("$FarmD/scripts/authuser.php");',$str);
file_put_contents($directory.'/'.$entry,$str);
}
update_progress_bar($count);
}
}
}
示例6: check_syntax
function check_syntax ($file) {
global $c_commsy_path_file;
$retour = array();
$output = '';
$result = '';
$file_to_check = $c_commsy_path_file.'/'.$file;
$cmd = PHP_CMD . " -l ".$file_to_check;
exec($cmd,$output,$result);
$len = count($output);
if ( $len <= 0 ) {
echo "Sorry! internal error, no syntax check output :-(";
exit(1);
}
// finally parse output of syntax check
if ( mb_substr($output[0],0,mb_strlen(OK_LINE_START)) == OK_LINE_START ) {
$syntax_OK = true;
flush();
} else {
$error_array = array();
$syntax_OK = false;
$filtered_output = array();
if ( $len > 0 && rtrim($output[0]) == "<br />" ) {
array_shift($output);
$len--;
}
if ( $len > 0 && rtrim($output[$len-1]) == "Errors parsing " . $file ) {
$len--; // N.B. skip last line
}
for ( $i=0; $i < $len; $i++ ) {
$line = $output[$i];
$filtered_output[] = $line;
if ( preg_match(ON_LINE_PATTERN, $line, $matches) ) {
$error_array[] = $line;
}
}
$retour = $error_array;
}
global $count_files;
update_progress_bar($count_files);
return $retour;
}
示例7: changeWikis
function changeWikis ($directory,$count) {
global $c_commsy_path_file;
if ( empty($c_commsy_path_file) ) {
@include_once('../../etc/cs_config.php');
}
$str2 = file_get_contents($c_commsy_path_file.'/etc/pmwiki/wiki_config.php');
$directory_handle = opendir($directory);
while ( false !== ($entry = readdir($directory_handle)) ) {
if ($entry != '.' and $entry != '..' and is_dir($directory.'/'.$entry)) {
changeWikis($directory.'/'.$entry,$count);
} elseif (is_file($directory.'/'.$entry) and $entry == 'config.php') {
$str = file_get_contents($directory.'/'.$entry);
if ( mb_stristr($str,"include_once('commsy_config.php');") and !empty($str2) ) {
file_put_contents($directory.'/'.$entry,trim($str2));
}
update_progress_bar($count);
}
}
}
示例8: str_replace
if (mb_strpos($extra,'ontology_')!=false){
$home_conf_string = str_replace(',ontology_short','',$treffer[2]);
$home_conf_string = str_replace(',ontology_tiny','',$home_conf_string);
$home_conf_string = str_replace(',ontology_none','',$home_conf_string);
$home_conf_string = str_replace('ontology_short,','',$home_conf_string);
$home_conf_string = str_replace('ontology_tiny,','',$home_conf_string);
$home_conf_string = str_replace('ontology_none,','',$home_conf_string);
$extra = preg_replace('~(<HOMECONF>.+</HOMECONF>)~u', '<HOMECONF>'.$home_conf_string.'</HOMECONF>', $extra);
// save project
$insert_query = 'UPDATE room SET extras="'.addslashes($extra).'" WHERE item_id="'.$project_id.'"';
select($insert_query);
}
}
$row = mysql_fetch_row($result);
$project_id = $row[0];
$extra = $row[1];
update_progress_bar($count_project);
}
}
if ($success) {
echo('[ <font color="#00ff00">done</font> ]<br/>'."\n");
} else {
echo('[ <font color="#ff0000">failed</font> ]<br/>'."\n");
}
// end of execution time
$time_end = getmicrotime();
$time = round($time_end - $time_start,3);
echo "<br/>Execution time: ".mb_sprintf("%02d:%02d:%02d", (int)($time/3600), (int)(fmod($time,3600)/60), (int)fmod(fmod($time,3600), 60))."\n";
?>
示例9: disable
function disable($base_dir)
{
global $app_strings;
$total_steps = 3;
//min steps with no tasks
$current_step = 0;
$this->base_dir = $base_dir;
$tasks = array('disable_copy', 'disable_menus', 'disable_dashlets', 'disable_userpage', 'disable_administration', 'disable_vardefs', 'disable_layoutdefs', 'disable_relationships', 'disable_languages', 'disable_logichooks', 'reset_opcodes');
$total_steps += count($tasks);
//now the real number of steps
if (file_exists($this->base_dir . '/manifest.php')) {
if (!$this->silent) {
$current_step++;
display_progress_bar('install', $current_step, $total_steps);
echo '<div id ="displayLoglink" ><a href="#" onclick="toggleDisplay(\'displayLog\')">' . $app_strings['LBL_DISPLAY_LOG'] . '</a> </div><div id="displayLog" style="display:none">';
}
require_once $this->base_dir . '/manifest.php';
$this->installdefs = $installdefs;
$this->id_name = $this->installdefs['id'];
$installed_modules = array();
if (isset($this->installdefs['beans'])) {
foreach ($this->installdefs['beans'] as $bean) {
$installed_modules[] = $bean['module'];
}
mkdir_recursive("custom/Extension/application/Ext/Include/" . DISABLED_PATH, true);
//Clear any older disabled version
if (file_exists("custom/Extension/application/Ext/Include/" . DISABLED_PATH . '/' . $this->id_name . '.php')) {
rmdir_recursive("custom/Extension/application/Ext/Include/" . DISABLED_PATH . '/' . $this->id_name . '.php');
}
if (file_exists("custom/Extension/application/Ext/Include/{$this->id_name}.php")) {
rename("custom/Extension/application/Ext/Include/{$this->id_name}.php", "custom/Extension/application/Ext/Include/" . DISABLED_PATH . '/' . $this->id_name . '.php');
}
$this->rebuild_modules();
}
if (!$this->silent) {
$current_step++;
update_progress_bar('install', $current_step, $total_steps);
}
foreach ($tasks as $task) {
$this->{$task}();
if (!$this->silent) {
$current_step++;
update_progress_bar('install', $current_step, $total_steps);
}
}
if (!$this->silent) {
$current_step++;
update_progress_bar('install', $current_step, $total_steps);
echo '</div>';
}
UpdateSystemTabs('Restore', $installed_modules);
} else {
die("No manifest.php Defined In {$this->base_dir}/manifest.php");
}
}
示例10: ob_start
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
********************************************************************************/
ob_start();
require_once '../include/utils/progress_bar_utils.php';
display_flow_bar('myflow', 1);
display_progress_bar('myprogress', 0, 10);
for ($i = 0; $i <= 10; $i++) {
update_progress_bar('myprogress', $i, 10);
sleep(1);
}
destroy_flow_bar('myflow');
示例11: read_body_firmware
function read_body_firmware($ch, $string)
{
global $g, $fout, $file_size, $downloaded, $counter, $version, $latest_version;
$length = strlen($string);
$downloaded += intval($length);
$downloadProgress = round(100 * (1 - $downloaded / $file_size), 0);
$downloadProgress = 100 - $downloadProgress;
$a = $file_size;
$b = $downloaded;
$c = $downloadProgress;
$text = " " . gettext("Auto Update Download Status") . "\\n";
$text .= "----------------------------------------------------\\n";
$text .= " " . gettext("Current Version") . " : {$g['product_version']}\\n";
$text .= " " . gettext("Latest Version") . " : {$latest_version}\\n";
$text .= " " . gettext("File size") . " : {$a}\\n";
$text .= " " . gettext("Downloaded") . " : {$b}\\n";
$text .= " " . gettext("Percent") . " : {$c}%\\n";
$text .= "----------------------------------------------------\\n";
$counter++;
if ($counter > 150) {
update_output_window($text);
update_progress_bar($downloadProgress);
$counter = 0;
}
fwrite($fout, $string);
return $length;
}
示例12: disable
function disable($base_dir)
{
global $app_strings;
$total_steps = 3;
//min steps with no tasks
$current_step = 0;
$this->base_dir = $base_dir;
$tasks = array('disable_copy', 'disable_dashlets', 'disable_relationships', 'disable_extensions', 'disable_global_search', 'disable_manifest_logichooks', 'reset_opcodes');
$total_steps += count($tasks);
//now the real number of steps
if (file_exists($this->base_dir . '/manifest.php')) {
if (!$this->silent) {
$current_step++;
display_progress_bar('install', $current_step, $total_steps);
echo '<div id ="displayLoglink" ><a href="#" onclick="toggleDisplay(\'displayLog\')">' . $app_strings['LBL_DISPLAY_LOG'] . '</a> </div><div id="displayLog" style="display:none">';
}
require_once $this->base_dir . '/manifest.php';
$this->installdefs = $installdefs;
$this->id_name = $this->installdefs['id'];
$installed_modules = array();
if (isset($this->installdefs['beans'])) {
foreach ($this->installdefs['beans'] as $bean) {
$installed_modules[] = $bean['module'];
}
}
if (!$this->silent) {
$current_step++;
update_progress_bar('install', $current_step, $total_steps);
}
foreach ($tasks as $task) {
$this->{$task}();
if (!$this->silent) {
$current_step++;
update_progress_bar('install', $current_step, $total_steps);
}
}
if (!$this->silent) {
$current_step++;
update_progress_bar('install', $current_step, $total_steps);
echo '</div>';
}
UpdateSystemTabs('Restore', $installed_modules);
} else {
die("No manifest.php Defined In {$this->base_dir}/manifest.php");
}
}
示例13: array
$sql_array = array();
foreach ( $must_sort_father_array as $father_id ) {
$sql = 'SELECT * FROM tag WHERE item_id IN ('.implode(',',$children_array[$father_id]).') ORDER BY title';
$result = select($sql);
$new_place_array = array();
$place = 0;
while ( $row = mysql_fetch_assoc($result) ) {
$place++;
$new_place_array[$row['item_id']] = $place;
}
foreach ($children_array[$father_id] as $child_id) {
if ( !empty($new_place_array[$child_id]) ) {
$sql = 'UPDATE tag2tag SET sorting_place='.$new_place_array[$child_id].' WHERE from_item_id='.$father_id.' AND to_item_id='.$child_id.';';
$sql_array[] = $sql;
}
}
}
init_progress_bar(count(array_unique($sql_array)));
foreach ( array_unique($sql_array) as $sql ) {
$result = select($sql);
update_progress_bar(count(array_unique($sql_array)));
}
} else {
echo('<br/>nothing to do'."\n");
}
// end of execution time
$time_end = getmicrotime();
$time = round($time_end - $time_start,3);
echo "<br/>Execution time: ".mb_sprintf("%02d:%02d:%02d", (int)($time/3600), (int)(fmod($time,3600)/60), (int)fmod(fmod($time,3600), 60))."\n";
?>
示例14: read_body
function read_body($ch, $string)
{
global $fout, $file_size, $downloaded, $counter, $version, $latest_version, $current_installed_pfsense_version;
$length = strlen($string);
$downloaded += intval($length);
$downloadProgress = round(100 * (1 - $downloaded / $file_size), 0);
$downloadProgress = 100 - $downloadProgress;
$a = $file_size;
$b = $downloaded;
$c = $downloadProgress;
$text = " Auto Update Download Status\\n";
$text .= "---------------------------------\\n";
$text .= " Latest Version : {$latest_version}\\n";
$text .= " Current Version : {$current_installed_pfsense_version}\\n";
$text .= " File size : {$a}\\n";
$text .= " Downloaded : {$b}\\n";
$text .= " Percent : {$c}%\\n";
$text .= "---------------------------------\\n";
$counter++;
if ($counter > 150) {
update_output_window($text);
update_progress_bar($downloadProgress);
$counter = 0;
}
fwrite($fout, $string);
return $length;
}
示例15: select
$success_array[] = select($sql,false,'utf8');
unset($sql);
$sql = getCreateTableSQL(str_replace('utf8_','',$table),$column_array,'utf8');
$success_array[] = select($sql,false,'utf8');
unset($sql);
$sql = 'INSERT INTO '.str_replace('utf8_','',$table).' SELECT * FROM '.$table.';';
$success_array[] = select($sql,false,'utf8');
unset($sql);
$sql = 'DROP TABLE '.$table.';';
$success_array[] = select($sql,false,'utf8');
unset($sql);
update_progress_bar(count($utf8_table_array));
}
echo(LINEBREAK);
flush();
// success
foreach ( $success_array as $success_item ) {
$success = $success && $success_item;
}
$success_array = array();
// delete old_tables
echo(LINEBREAK);
echo('STEP8: delete old tables');
echo(LINEBREAK);
flush();