当前位置: 首页>>代码示例>>PHP>>正文


PHP reduce_double_slashes函数代码示例

本文整理汇总了PHP中reduce_double_slashes函数的典型用法代码示例。如果您正苦于以下问题:PHP reduce_double_slashes函数的具体用法?PHP reduce_double_slashes怎么用?PHP reduce_double_slashes使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了reduce_double_slashes函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Ftpsincro

 function Ftpsincro()
 {
     // $match[0] = ftp://username:password@sld.domain.tld/path1/path2/
     // $match[1] = username
     // $match[2] = password
     // $match[3] = sld.domain.tld
     // $match[4] = /path1/path2/
     $this->error = 0;
     $this->dirlocal = './sincro';
     $data = func_get_args();
     $this->connection = 0;
     $this->mascara = '*';
     if (count($data) == 1) {
         preg_match("/ftp:\\/\\/(.*?):(.*?)@(.*?)(\\/.*)/i", $data[0], $match);
         array_shift($match);
         if (count($match) != 4) {
             $this->error("ERROR LA ENTRADA DEBE SER ftp://usuario:clave@www.dominio.com/path1/path2/");
         }
         $this->user = empty($match[0]) ? "anonymous" : $match[0];
         $this->password = empty($match[1]) ? "nobody@nobody.com" : $match[1];
         $this->host = $match[2];
         $this->ftpdir = empty($match[3]) ? './' : reduce_double_slashes('/' . $match[3] . '/');
     } elseif (count($data) == 4) {
         $match = $data;
         $this->user = empty($match[0]) ? "anonymous" : $match[0];
         $this->password = empty($match[1]) ? "nobody@nobody.com" : $match[1];
         $this->host = $match[2];
         $this->ftpdir = empty($match[3]) ? './' : reduce_double_slashes('/' . $match[3] . '/');
     } else {
         //$this->error("ERROR FALTAN PARAMETROS usuario,clave,dominio,ftpdir");
     }
 }
开发者ID:codethics,项目名称:proteoerp,代码行数:32,代码来源:ftpsincro.php

示例2: preciosucu

 function preciosucu($sucursal = NULL, $codigo = null)
 {
     $this->load->helper('string');
     $host = $this->datasis->dameval("SELECT CONCAT_WS('/',url,proteo) AS valor FROM sucu WHERE codigo='{$sucursal}'");
     if (!empty($codigo)) {
         $server_url = "{$host}/rpcserver";
         $server_url = reduce_double_slashes($server_url);
         $this->load->library('xmlrpc');
         $this->xmlrpc->xmlrpcstr['http_error'] = "No hay conección con la sucursal";
         $this->xmlrpc->server($server_url, 80);
         $this->xmlrpc->method('sprecios');
         $request = array($codigo);
         $this->xmlrpc->request($request);
         if (!$this->xmlrpc->send_request()) {
             echo $this->xmlrpc->display_error();
         } else {
             $retorno = $this->xmlrpc->display_response();
             if (count($retorno) > 0) {
                 $row = $retorno;
                 echo '<table border=1><tr>';
                 echo '<td width="660p" align=center colspan=6>' . $row[6] . ' ' . $row[5] . '</td></tr></tr>';
                 echo '<td width="110p" align=right> ' . number_format($row[0], 2) . '</td>';
                 echo '<td width="110p" align=right> ' . number_format($row[1], 2) . '</td>';
                 echo '<td width="110p" align=right> ' . number_format($row[2], 2) . '</td>';
                 echo '<td width="110p" align=right> ' . number_format($row[3], 2) . '</td>';
                 echo '<td width="110p" align=right> ' . number_format($row[4], 2) . '</td>';
                 echo '</tr></table>';
             } else {
                 echo 'Producto no existe';
             }
         }
     } else {
         echo 'Faltan parametros';
     }
 }
开发者ID:codethics,项目名称:proteoerp,代码行数:35,代码来源:consulsucu.php

示例3: send_admin_notification

 /**
  * Send admin notification
  *
  * Sends an admin notification email
  *
  * @access	public
  * @param	string
  * @param	int
  * @param	int
  */
 function send_admin_notification($notify_address, $channel_id, $entry_id)
 {
     ee()->api->instantiate('channel_structure');
     ee()->load->model('channel_entries_model');
     $e = ee()->channel_entries_model->get_entry($entry_id, $channel_id);
     $c = ee()->api_channel_structure->get_channel_info($channel_id);
     $swap = array('name' => ee()->session->userdata('screen_name'), 'email' => ee()->session->userdata('email'), 'channel_name' => $c->row('channel_title'), 'entry_title' => $e->row('title'), 'entry_url' => reduce_double_slashes($c->row('channel_url') . '/' . $e->row('url_title')), 'comment_url' => reduce_double_slashes($c->row('comment_url') . '/' . $e->row('url_title')), 'cp_edit_entry_url' => cp_url('content_publish/entry_form', array('site_id' => $e->row('site_id'), 'channel_id' => $e->row('channel_id'), 'entry_id' => $e->row('entry_id')), TRUE));
     $template = ee()->functions->fetch_email_template('admin_notify_entry');
     $email_tit = ee()->functions->var_swap($template['title'], $swap);
     $email_msg = ee()->functions->var_swap($template['data'], $swap);
     // We don't want to send a notification to the user
     // triggering the event
     if (strpos($notify_address, ee()->session->userdata('email')) !== FALSE) {
         $notify_address = str_replace(ee()->session->userdata('email'), "", $notify_address);
     }
     $notify_address = reduce_multiples($notify_address, ',', TRUE);
     if ($notify_address != '') {
         //	Send email
         ee()->load->library('email');
         foreach (explode(',', $notify_address) as $addy) {
             ee()->email->EE_initialize();
             ee()->email->wordwrap = false;
             ee()->email->from(ee()->config->item('webmaster_email'), ee()->config->item('webmaster_name'));
             ee()->email->to($addy);
             ee()->email->reply_to(ee()->config->item('webmaster_email'));
             ee()->email->subject($email_tit);
             ee()->email->message(entities_to_ascii($email_msg));
             ee()->email->send();
         }
     }
 }
开发者ID:kentonquatman,项目名称:iofa,代码行数:41,代码来源:Notifications.php

示例4: test_reduce_double_slashes

 public function test_reduce_double_slashes()
 {
     $strs = array('http://codeigniter.com' => 'http://codeigniter.com', '//var/www/html/example.com/' => '/var/www/html/example.com/', '/var/www/html//index.php' => '/var/www/html/index.php');
     foreach ($strs as $str => $expect) {
         $this->assertEquals($expect, reduce_double_slashes($str));
     }
 }
开发者ID:saiful1105020,项目名称:Under-Construction-Bracathon-Project-,代码行数:7,代码来源:string_helper_test.php

示例5: Zip

 function Zip()
 {
     $LD = '\\{';
     $RD = '\\}';
     $SLASH = '\\/';
     $tagdata = ee()->TMPL->tagdata;
     $variable = "zip:files";
     $file_status = true;
     $this->cache_path = !$this->cache_path ? APPPATH . 'cache/' . MX_ZIP_KEY : false;
     if (preg_match("/" . LD . $variable . ".*?" . RD . "(.*?)" . LD . '\\/' . $variable . RD . "/s", $tagdata, $file_list)) {
         $max_size = !ee()->TMPL->fetch_param('max_size') ? 50 * 1024 * 1024 : ee()->TMPL->fetch_param('max_size') * 1024 * 1024;
         $method = ee()->TMPL->fetch_param('method', 'php');
         $direct_output = ee()->TMPL->fetch_param('direct_output') == 'yes' ? 'yes' : 'no';
         $overwrite = ee()->TMPL->fetch_param('overwrite', false) ? ee()->TMPL->fetch_param('overwrite') : 'no';
         $this->archive_name = $this->archive_fname = ee()->TMPL->fetch_param('filename', mktime() . '.zip');
         $this->archive_folder = ee()->TMPL->fetch_param('folder', $this->cache_path);
         $this->large_files = ee()->TMPL->fetch_param('large_files', 'yes');
         $this->remove_path = ee()->TMPL->fetch_param('remove_path', NULL);
         $this->add_path = ee()->TMPL->fetch_param('add_path', NULL);
         $this->comment = ee()->TMPL->fetch_param('comment', '');
         $this->no_compression = ee()->TMPL->fetch_param('no_compression', false);
         $this->remove_all_path = ee()->TMPL->fetch_param('remove_all_path', false);
         $this->speed = ee()->TMPL->fetch_param('speed', $this->speed);
         // $overwrite  yes / no / keep_both
         $pack_size = 0;
         $this->archive_name = reduce_double_slashes($this->archive_folder . '/' . $this->archive_name);
         $filenames = explode("]", str_replace(array('&#47;', '[', "\n"), array('/', '', ''), $file_list[1]));
         $file_status = file_exists($this->archive_name) ? true : false;
         foreach ($filenames as $key => $value) {
             $filenames[$key] = trim($value);
         }
         if ($overwrite == 'yes' && $file_status) {
             unlink($this->archive_name);
             $file_status = false;
         }
         if ($overwrite == 'keep_both' && $file_status) {
             $file_info = pathinfo($this->archive_name);
             $file_name = basename($this->archive_name, '.' . $file_info['extension']);
             for ($i = 0; $i < 99999; $i++) {
                 $this->archive_fname = $file_name . $i . '.zip';
                 $this->archive_name = reduce_double_slashes($this->archive_folder . '/' . $this->archive_fname);
                 $file_status = file_exists($this->archive_name) ? true : false;
                 if (!$file_status) {
                     break;
                 }
             }
         }
         if (!$file_status) {
             $this->_backup_pkzip($filenames);
         }
         if ($direct_output == 'yes') {
             $this->_download();
             unlink($this->archive_name);
         } else {
             return $this->return_data = $this->archive_name;
         }
     }
 }
开发者ID:MaxLazar,项目名称:mx-zip-ee3,代码行数:58,代码来源:pi.zip.php

示例6: Xmlinex

 function Xmlinex()
 {
     $this->ci =& get_instance();
     $this->ci->load->helper('xml');
     $this->ci->load->helper('string');
     //$this->dir='./'.$this->ci->config->item('uploads_dir').'/traspasos';
     $this->dir = './uploads/traspasos';
     $this->dir = reduce_double_slashes($this->dir);
 }
开发者ID:codethics,项目名称:proteoerp,代码行数:9,代码来源:Xmlinex.php

示例7: __construct

 /**
  * [__construct description]
  */
 public function __construct()
 {
     $libfolder = PATH_THIRD . 'qr_code/';
     $base_path = !ee()->TMPL->fetch_param('base_path') ? $_SERVER['DOCUMENT_ROOT'] . "/" : ee()->TMPL->fetch_param('base_path');
     $base_path = str_replace("\\", "/", $base_path);
     $base_path = reduce_double_slashes($base_path);
     $cache = !ee()->TMPL->fetch_param('cache') ? '' : ee()->TMPL->fetch_param('cache');
     $data = array('d' => !ee()->TMPL->fetch_param('data') ? ee()->TMPL->tagdata : str_replace(SLASH, '/', ee()->TMPL->fetch_param('data')), 'e' => !ee()->TMPL->fetch_param('ecc') ? 'M' : ee()->TMPL->fetch_param('ecc'), 't' => !ee()->TMPL->fetch_param('type') ? 'PNG' : ee()->TMPL->fetch_param('type'), 's' => !ee()->TMPL->fetch_param('size') ? '' : ee()->TMPL->fetch_param('size'), 'v' => !ee()->TMPL->fetch_param('version') ? null : ee()->TMPL->fetch_param('version'));
     $action = !ee()->TMPL->fetch_param('action') ? ee()->TMPL->tagdata : ee()->TMPL->fetch_param('action');
     $data['bk_color'] = ee()->TMPL->fetch_param('bk_color') ? ltrim(ee()->TMPL->fetch_param('bk_color'), '#') : 'ffffff';
     $data['px_color'] = ee()->TMPL->fetch_param('px_color') ? ltrim(ee()->TMPL->fetch_param('px_color'), '#') : '000000';
     $data['outline_size'] = ee()->TMPL->fetch_param('outline_size') ? ee()->TMPL->fetch_param('outline_size') : 2;
     switch ($action) {
         case "sms":
             $tel = !ee()->TMPL->fetch_param('tel') ? '' : ee()->TMPL->fetch_param('tel');
             $data['d'] = "SMSTO:" . (!ee()->TMPL->fetch_param('tel') ? '' : ee()->TMPL->fetch_param('tel')) . ':' . $data['d'];
             break;
         case "email":
             $data['d'] = "SMTP:" . (!ee()->TMPL->fetch_param('email') ? '' : ee()->TMPL->fetch_param('email')) . ':' . (!ee()->TMPL->fetch_param('sabj') ? '' : ee()->TMPL->fetch_param('sabj')) . ':' . $data['d'];
             break;
         case "tel":
             $data['d'] = "TEL:" . (!ee()->TMPL->fetch_param('tel') ? '' : ee()->TMPL->fetch_param('tel'));
             break;
         case "site":
             $data['d'] = $this->SmartUrlEncode($data['d']);
             break;
         case "bm":
             $data['d'] = "MEBKM:TITLE:" . (!ee()->TMPL->fetch_param('title') ? '' : ee()->TMPL->fetch_param('title')) . ':' . urlencode($data['d']);
             break;
     }
     $base_cache = reduce_double_slashes($base_path . "images/cache/");
     $base_cache = !ee()->TMPL->fetch_param('base_cache') ? $base_cache : ee()->TMPL->fetch_param('base_cache');
     $base_cache = reduce_double_slashes($base_cache);
     if (!is_dir($base_cache)) {
         // make the directory if we can
         if (!mkdir($base_cache, 0777, true)) {
             ee()->TMPL->log_item("Error: could not create cache directory " . $base_cache . " with 777 permissions");
             return ee()->TMPL->no_results();
         }
     }
     $file_ext = $data['t'] == 'J' ? '.jpeg' : '.png';
     $file_name = md5(serialize($data)) . $file_ext;
     if (!is_readable($base_cache . $file_name)) {
         $qrcode_data_string = $data['d'];
         $qrcode_error_correct = $data['e'];
         $qrcode_module_size = $data['s'];
         $qrcode_version = $data['v'];
         $qrcode_image_type = $data['t'];
         $path = $libfolder . 'qrcode_lib/data';
         $image_path = $libfolder . 'qrcode_lib/image';
         require_once $libfolder . 'qrcode/qrlib.php';
         QRcode::png($qrcode_data_string, $base_cache . $file_name, $qrcode_error_correct, $qrcode_module_size, $data['outline_size'], false, $data['px_color'], $data['bk_color']);
     }
     return $this->return_data = reduce_double_slashes("/" . str_replace($base_path, '', $base_cache . $file_name));
 }
开发者ID:MaxLazar,项目名称:mx-qr-code-ee3,代码行数:58,代码来源:pi.qr_code.php

示例8: procesa

    function procesa($nombre)
    {
        $atras = site_url('sincro/cargasinv/carga');
        $link = site_url('sincro/cargasinv/deshacer');
        $script = '
		function deshacer(){
			a=confirm("�Esta Seguro que de desea deshacer la ultima actualizaci&oacute;n realizada?");
			if(a){
				$.ajax({
					url: "' . $link . '",
					success: function(msg){
						if(msg){
							alert("Fue realizada exitosamente la operaci&oacute;n");
						}
						else{
							alert("La operaci&oacute;n no pudo ser completada. Intente mas tarde");
						}
					}
				});
			}
		}
		';
        $path1 = reduce_double_slashes(FCPATH . '/uploads/archivos/');
        $campos = array();
        $query = "TRUNCATE TABLE sinvactu";
        $this->db->query($query);
        $archivo = file($path1 . $nombre);
        $i = 0;
        foreach ($archivo as $linea) {
            //$campos[]=explode("\t",$linea);
            //			$campos[]= nl2br($linea);
            $campos[] = $this->parte($linea);
            $codigo = $campos[$i][0];
            $descrip = $campos[$i][1];
            $monto = $campos[$i][2];
            $query = "INSERT INTO sinvactu (codigo,descrip,costo) VALUES ('{$codigo}','{$descrip}','{$monto}')";
            $this->db->query($query);
            $i++;
        }
        $eje = $this->ejecuta();
        if ($eje == 1) {
            $msj = "Actualizacion Correcta<br>";
            $msj .= '<a href="javascript:deshacer();" title="Haz Click para Deshacer La Ultima Actualizaci&oacute;n" onclick="">Deshacer La Ultima Actualizaci&oacute;n</a>';
        } else {
            $msj = "No se pudo actualizar inventario";
        }
        //				print("<pre>");
        //				print_r($campos);
        $data['content'] = $msj;
        $data['smenu'] = "<a href=" . $atras . ">ATRAS</a>";
        $data['title'] = "<h1>Actualizaci&oacute;n de Inventario</h1>";
        $data["head"] = script("jquery.pack.js") . $this->rapyd->get_head() . script($script);
        $this->load->view('view_ventanas', $data);
    }
开发者ID:codethics,项目名称:proteoerp,代码行数:54,代码来源:cargasinv.php

示例9: comments_do_search

 function comments_do_search()
 {
     if ($_POST['search_by_keyword']) {
         $togo_tags = "/tags:{$_POST['search_by_keyword']}";
     } else {
         $togo_tags = false;
     }
     $gogo = site_url('admin/comments/index') . $togo_tags;
     $gogo = reduce_double_slashes($gogo);
     header("Location: {$gogo} ");
     exit;
 }
开发者ID:Gninety,项目名称:Microweber,代码行数:12,代码来源:comments.php

示例10: _path_proccess

 /**
  * Добавляет cd к команде
  */
 private function _path_proccess($path)
 {
     $path = reduce_double_slashes($path);
     switch ($this->os) {
         case 'windows':
             $path = str_replace('/', "\\", $path);
             $path = "cd /D " . $path;
             break;
         default:
             $path = "cd " . $path;
             break;
     }
     return $path;
 }
开发者ID:mefisto2009,项目名称:GameAP,代码行数:17,代码来源:Control.php

示例11: Publicidad

 function Publicidad()
 {
     parent::Controller();
     $this->id_modulo = '91A';
     $this->load->library('rapyd');
     $this->load->library('path');
     $path = new Path();
     $path->setPath($this->config->item('uploads_dir'));
     $path->append('publicidad');
     $this->upload_path = $path->getPath() . '/';
     $this->rel_path = reduce_double_slashes(str_replace($this->config->item('base_url'), '', $this->upload_path));
     $this->write = is_writable($this->rel_path);
     if (!is_writable($this->rel_path)) {
         show_error('No se puede escribir en el directorio ' . $this->rel_path . ', debe ajustar los permisos');
     }
 }
开发者ID:codethics,项目名称:proteoerp,代码行数:16,代码来源:publicidad.php

示例12: linea

 function linea($url, $proteoerp)
 {
     $CI =& get_instance();
     $CI->load->library('xmlrpc');
     $CI->xmlrpc->xmlrpc_defencoding = $CI->config->item('charset');
     $server_url = reduce_double_slashes("http://{$url}" . "/{$proteoerp}/" . 'rpcserver');
     $CI->xmlrpc->server($server_url, 80);
     $CI->xmlrpc->method('ventanainf');
     $request = array('a');
     $CI->xmlrpc->request($request);
     if (!$CI->xmlrpc->send_request()) {
         return 'No Disponible';
     } else {
         $ima = "http://" . $url . "/" . $proteoerp . "/supervisor/enlinea/ventana";
         return "<iframe src='{$ima}' width='500px' height='110px'/></iframe>";
     }
 }
开发者ID:codethics,项目名称:proteoerp,代码行数:17,代码来源:enlinea.php

示例13: index

 /**
  * Control Panel Index
  *
  * @access	public
  */
 function index($message = '')
 {
     ee()->load->library('table');
     $vars = array('message' => $message, 'cp_page_title' => lang('simple_commerce_module_name'), 'api_url' => ee()->functions->fetch_site_index(0, 0) . QUERY_MARKER . 'ACT=' . ee()->cp->fetch_action_id('Simple_commerce', 'incoming_ipn'), 'action_url' => 'C=addons_modules' . AMP . 'M=show_module_cp' . AMP . 'module=simple_commerce' . AMP . 'method=various_settings', 'paypal_account' => ee()->config->item('sc_paypal_account'));
     $base = reduce_double_slashes(str_replace('/public_html', '', substr(BASEPATH, 0, -strlen(SYSDIR . '/'))) . '/encryption/');
     foreach (array('certificate_id', 'public_certificate', 'private_key', 'paypal_certificate', 'temp_path') as $val) {
         if ($val == 'certificate_id') {
             $vars[$val] = ee()->config->item('sc_' . $val) === FALSE ? '' : ee()->config->item('sc_' . $val);
         } else {
             $vars[$val] = (ee()->config->item('sc_' . $val) === FALSE or ee()->config->item('sc_' . $val) == '') ? $base . $val . '.pem' : ee()->config->item('sc_' . $val);
         }
     }
     if (ee()->config->item('sc_encrypt_buttons') == 'y') {
         $vars['encrypt_y'] = TRUE;
         $vars['encrypt_n'] = FALSE;
     } else {
         $vars['encrypt_y'] = FALSE;
         $vars['encrypt_n'] = TRUE;
     }
     return ee()->load->view('index', $vars, TRUE);
 }
开发者ID:nigelpeters,项目名称:css-recruitment-ee,代码行数:26,代码来源:mcp.simple_commerce.php

示例14: index

 function index()
 {
     $gogo = site_url('admin/content/posts_manage') . $togo_categories . $togo_tags;
     $gogo = reduce_double_slashes($gogo);
     header("Location: {$gogo} ");
     //var_dump ( $gogo );
     exit;
     //http://test3.ooyes.net/admin
     $this->template['functionName'] = strtolower(__FUNCTION__);
     if (CI::library('session')->userdata('user') == false) {
         //redirect ( 'index' );
     }
     $this->load->vars($this->template);
     $layout = CI::view('admin/layout', true, true);
     $primarycontent = '';
     $secondarycontent = '';
     $primarycontent = CI::view('admin/index', true, true);
     //$layout = str_ireplace ( '{primarycontent }', $primarycontent, $layout );
     //$layout = str_ireplace ( '{secondarycontent}', $secondarycontent, $layout );
     //CI::view('welcome_message');
     CI::library('output')->set_output($layout);
 }
开发者ID:Gninety,项目名称:Microweber,代码行数:22,代码来源:index.php

示例15: Datacenter

 function Datacenter()
 {
     parent::Controller();
     $this->geneticket = true;
     $this->load->helper('string');
     $this->load->library('rapyd');
     $this->load->library('encrypt');
     $this->sucu = $this->datasis->traevalor('NROSUCU');
     $this->clave = sha1($this->config->item('encryption_key'));
     $this->dir = reduce_double_slashes($this->config->item('uploads_dir') . '/traspasos');
     //$this->dir='./uploads/traspasos/';
     $path = reduce_double_slashes(FCPATH . '/uploads/traspasos');
     if (!file_exists($path)) {
         if (!mkdir($path)) {
             exit("Error: no se pudo crear el directorio {$path}");
         }
     }
     if (!is_writable($path)) {
         exit("Error: no tiene permisos de escritura en {$path}");
     }
     if (empty($this->sucu)) {
         redirect('supervisor/valores/dataedit/show/NROSUCU');
     }
 }
开发者ID:codethics,项目名称:proteoerp,代码行数:24,代码来源:datacenter.php


注:本文中的reduce_double_slashes函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。