예제 #1
0
 public function init($values = array())
 {
     foreach ($this as $key => &$value) {
         // if it is not cpform property
         if (strposa($key, $this->cpform_exclude_prefix) === false) {
             // check if fieldType exists
             if (file_exists($this->cpform_path . 'Fields/' . $value['fieldType'] . '.php')) {
                 // load field type class
                 require_once $this->cpform_path . 'Fields/' . $value['fieldType'] . '.php';
                 // set values from parameter to config
                 if (isset($values[$key])) {
                     $value['config']['value'] = htmlentities($values[$key]);
                 }
                 // create field type object
                 $fieldtype = new $value['fieldType']($key, $value);
                 $this->cpform_output[$key] = $fieldtype;
                 unset($fieldtype);
                 // set validation rules
                 if (isset($value['rules'])) {
                     $this->cpform_CI->form_validation->set_rules($key, $value['label'], $value['rules'], isset($value['rule_messages']) ? $value['rule_messages'] : array());
                 }
             } else {
                 show_error('Field type ' . $value['fieldType'] . ' is not available.');
             }
         }
     }
 }
예제 #2
0
function add_defer_to_scripts($url)
{
    $scripts = array('stage.slider.min', 'group.slider.min', 'jquery.fancybox.min', 'content.animator.min', 'jwplayer', 'reflection', 'jw-player.init.min', 'jquery.tooltips', 'contact.form', 'jquery.themepunch.revolution.min.js', 'jquery.themepunch.plugins.min.js');
    if (FALSE === strposa($url, $scripts, 1)) {
        return $url;
    }
    return "{$url}' defer='defer' async='async";
}
예제 #3
0
 function saveChanges()
 {
     $_REQUEST->setType('fname', 'string');
     if ($_REQUEST['fname'] && strposa($_REQUEST['fname'], array('..', '/', '\\')) === false && $this->that->mayI(EDIT)) {
         if (@mkdir($this->path . '/' . $_REQUEST['fname'], 0700)) {
             Flash::queue(__('The folder was created successfully'));
         } else {
             Flash::queue(__('There was a problem creating the directory. Check permissions and the name'));
         }
     }
 }
예제 #4
0
            <?php 
}
?>
            <?php 
if (theme_get_setting('sidebar_position') == 'no') {
    ?>
                <div class="span12">
                    <?php 
    print render($page['content']);
    ?>
                </div>
            <?php 
}
?>
            <?php 
if (strposa(current_path(), array('taxonomy', 'comment', 'user', 'search')) !== false) {
    print '</div>';
}
?>
        </div>
    <?php 
if ($page['sidebar']) {
    ?>
        </div>
    </div>
    <?php 
}
?>

    </div>
예제 #5
0
}
?>
<section class="flx-entry-box">
    <div class="flx-entry-thumb">
        <?php 
if (isset($count) && $count > 1 && isset($file_type) && $file_type == 'image') {
    ?>
            <div class="flexslider" id="bp-flex">
                <ul class="slides">
                    <?php 
    print $slide_content;
    ?>
                </ul>
            </div><!--bp-flex-->
        <?php 
} elseif (strposa(current_path(), array('taxonomy')) !== false) {
    ?>
            <?php 
    print render($content['field_blog_multimedia'][0]);
    ?>
        <?php 
} else {
    ?>
            <?php 
    print render($content['field_blog_multimedia']);
    ?>
        <?php 
}
?>
        <?php 
if (isset($count) && $count == 1 && isset($file_type) && $file_type == 'image') {
예제 #6
0
 	    [ServerName] => HYDMEDIA
 	    [job_name] => Verteilungscleanup: distribution
 	    [job_status] => Enabled
 	    [last_run_status] => Succeeded
 	    [last_run_date] => May  7 2014 02:25:00:000PM
 	    [run_duration] => 00:00:00
 	    [next_scheduled_run_date] => May  7 2014 02:34:59:997PM
 	    [step_description] => Der Auftrag war erfolgreich.  Der Auftrag wurde von Zeitplan 105 (Plan für den Replikations-Agent.) aufgerufen.  Als Letztes wurde Schritt 1 (Führt den Agent aus.) ausgeführt.
 	)
 	*/
 // init array
 $succeeded_jobArray = array();
 $failed_jobArray = array();
 while ($job = mssql_fetch_array($query, MSSQL_ASSOC)) {
     // proceed if job is not excluded
     if (strposa(trim($job['job_name']), $excludeList) === false) {
         if ($job['last_run_status'] != 'Succeeded') {
             $failed_jobArray[] = $job;
         } else {
             $succeeded_jobArray[] = $job;
         }
     }
 }
 #	$count_failed_jobs = count($failed_jobArray);
 $succeeded_jobs = !empty($succeeded_jobArray) ? max(array_keys($succeeded_jobArray)) + 1 : 0;
 $failed_jobs = !empty($failed_jobArray) ? max(array_keys($failed_jobArray)) + 1 : 0;
 if ($failed_jobs > 0) {
     $return_code = 2;
     $return_msg = $failed_jobs . " fehlerhafte jobs gefunden, {$succeeded_jobs} erfolgreiche Jobs gefunden\n";
     foreach ($failed_jobArray as $failed_job) {
         $return_msg = $return_msg . "Job-Name: " . $failed_job['job_name'] . "\tJob-Status: " . $failed_job['last_run_status'] . "\tBeschreibung: " . $failed_job['step_description'] . "\tLetzter Lauf: " . $failed_job['last_run_date'] . "\n";
function num_word_search($string)
{
    $array = array('one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten');
    if (strposa($string, $array) !== FALSE) {
        return true;
    } else {
        return false;
    }
}
 private function modification_record($extref = '', $section = 0)
 {
     $array = array();
     // array('LOC' => $_OPTB['LOC'],
     $extra = false;
     $index = 0;
     $type = 'STORAGE';
     $storageTypeArr = array('RESW', 'RESB', 'BYTE', 'WORD');
     $operatorArr = array('+', '-', '*', '/');
     foreach ($this->OPTB_WOC as $_OPTB) {
         //
         if (!empty($_OPTB['LOC']) && isset($_OPTB['LOC']) && $_OPTB['SECTION'] == $section && strposa($_OPTB['OPERAND'], $extref)) {
             $pos = strpos($_OPTB['OPERAND'], $extref);
             if ($pos == 0) {
                 $operator = '+';
             } else {
                 if (in_array($_OPTB['OPERAND'][$pos - 1], $operatorArr)) {
                     $operator = $_OPTB['OPERAND'][$pos - 1];
                 } else {
                     if ($_OPTB['OPERAND'][$pos] == '@' || $_OPTB['OPERAND'][$pos] == '#') {
                         $operator = '+';
                     }
                 }
             }
             if (count(preg_split("/[+\\/*-]/", $_OPTB['OPERAND'])) > 1) {
                 $size = '06';
             } else {
                 $size = '05';
             }
             if (!in_array($_OPTB['OPCODE'], $storageTypeArr)) {
                 $_OPTB['LOC'] = hexdec($_OPTB['LOC']) + 1;
                 $_OPTB['LOC'] = sprintf("%04X", $_OPTB['LOC']);
                 $type = 'OPCODE';
             }
             //array_push($array, array('SYMBOL' => $extref, 'LOC' => $_OPTB['LOC'], 'EXTRA' => $extra, 'operator' => $operator));
             $arrayTmp = array('SYMBOL' => $extref, 'SECTION' => $section, 'LOC' => sprintf("%06X", hexdec($_OPTB['LOC'])), 'DECLOC' => hexdec($_OPTB['LOC']), 'TYPE' => $type, 'EXTRA' => $extra, 'SIZE' => $size, 'OPERATOR' => $operator, 'INDEX' => $index);
             array_push($array, $arrayTmp);
         }
         ++$index;
     }
     return $array;
 }
예제 #9
0
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
// Will return the response, if false it print the response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Setting the URL
// Set the URL where is allocated the JSON file
$url = "http://www.thevaleonline.com/whats-on/?format=json";
curl_setopt($ch, CURLOPT_URL, $url);
// Execute
$result = curl_exec($ch);
// Closing
curl_close($ch);
$test = json_decode($result, true);
$output = "BEGIN:VCALENDAR\nMETHOD:PUBLISH\nVERSION:2.0\nPRODID:-Business Name//Product Name//EN\n";
foreach ($test["upcoming"] as $key => $value) {
    // If the url have the extension output the string completed
    if (strposa($value["assetUrl"], array("jpg", "png", "jpeg"))) {
        $attachment = $value["assetUrl"];
    } else {
        $attachment = substr($value["assetUrl"], 0, strlen($value["assetUrl"]) - 1) . ".jpg";
    }
    if ($value["body"] != "") {
        // Format description, add the link to read more and only take the first 100 characters.
        $description = substr(strip_tags(str_replace(array("\n", "\r", "\t", "\\u2022", "•", "&nbsp;"), '', preg_replace('/([\\,;])/', '\\\\$1', $value["body"]))), 0, 100) . "...<a href='http://www.thevaleonline.com/whats-on/" . $value["urlId"] . "?webview=1'>Read more</a>";
    } else {
        $description = "";
    }
    $output .= "BEGIN:VEVENT\nSUMMARY:" . addcslashes($value["title"], ",\\;") . "\nUID:" . $value["id"] . "\nDTSTART:" . date('Ymd\\THis\\Z', $value["startDate"] / 1000) . "\nDTEND:" . date('Ymd\\THis\\Z', $value["endDate"] / 1000) . "\nDESCRIPTION: " . $description . "\nLOCATION:" . addcslashes($value["location"]["addressTitle"], ",\\;") . " " . addcslashes($value["location"]["addressLine1"], ",\\;") . " " . addcslashes($value["location"]["addressLine2"], ",\\;") . " " . addcslashes($value["location"]["addressCountry"], ",\\;") . "\nGEO:" . $value["location"]["mapLat"] . ";" . $value["location"]["mapLng"] . "\nATTACH:" . $attachment . "\nEND:VEVENT\n";
}
// close calendar
$output .= "END:VCALENDAR";
// Output to .ics file
예제 #10
0
}
// Load all claim types.
$types = array(array('title' => 'Accident and Emergency Claims', 'keywords' => 'accident,and,emergency,claims,999,a&e,failure,xray,x-ray,misdiagnose', 'icon' => 'ambulance', 'location' => '15'), array('title' => 'Anaesthetic Related Claims', 'keywords' => 'anaesthetic,related,claims,administered,agents,damage,nerves,brain,damage,strokes', 'icon' => 'syringe', 'location' => '16'), array('title' => 'Bariatric Surgery Claims', 'keywords' => 'bariatric,surgery,claims,gastric,bypass,band,weight,loss,gain,stomach,tummy', 'icon' => 'surgeon', 'location' => '17'), array('title' => 'Cancer Treatment Claims', 'keywords' => 'cancer,treatment,claims,misdiagnose,misdiagnosis,delay', 'icon' => 'virus', 'location' => '18'), array('title' => 'Consent Claims', 'keywords' => 'consent,claims,operation,procedure,permission,informed', 'icon' => 'prescription', 'location' => '19'), array('title' => 'Cosmetic Claims', 'keywords' => 'eye,cosmetic,claims,botox,dermal,filler,breast,implants,uplifts,chin,cheek,procedures,ear,surgery,face,lift,laser,skin,resurfacing,liposuction,nose,reshaping,tummy,tucks,stomach,rhinoplasty', 'icon' => 'scalpel', 'location' => '20'), array('title' => 'Dental Negligence Claims', 'keywords' => 'dental,negligence,claims,teeth,tooth,ache,dentist,gums,oral,orthodontic,implants,crown,bridge,root,canal,extraction,removal', 'icon' => 'tooth', 'location' => '21'), array('title' => 'General Practice Claims', 'keywords' => 'general,practice,claims,gp,practictioner,surgery,office,doctor,misdiagnose,misdiagnosis,prescription,prescribe,specialist', 'icon' => 'steth', 'location' => '22'), array('title' => 'Gynaecology Claims', 'keywords' => 'gynaecology,gynaecologist,claims,fertility,abortion,laparoscopic,coil,contraception,contraceptive,pregant,pregnancy,hysterectomy,pelvic,pelvis,cancer', 'icon' => 'nurse', 'location' => '23'), array('title' => 'Pressure Sore Negligence Claims', 'keywords' => 'pressure,sore,negligence,claims,bed,ulcers,diabetic,diabetes,elderly,skin,discolouration,blister,subcutaneous,necrosis,tissue', 'icon' => 'bandaid', 'location' => '24'), array('title' => 'Laser Hair Removal Claims', 'keywords' => 'laser,hair,removal,claims,hirsutism,eczema,psoriasis,chemical,peels,skin,burning,burns,texture', 'icon' => 'clipboard', 'location' => '25'), array('title' => 'Neurological/surgical Claims', 'keywords' => 'neuro,surgical,claims,surgery,procedure,removal,negligence,neurological,neurosurgical', 'icon' => 'ecg', 'location' => '27'), array('title' => 'Ophthalmic Claims', 'keywords' => 'surgical,claims,glasses,eyes,sight,vision,blindness', 'icon' => 'microscope', 'location' => '28'), array('title' => 'Orthopaedic Claims', 'keywords' => 'claims,bones,surgery,joints,ligaments,tendons,fracture,broken', 'icon' => 'bone', 'location' => '29'), array('title' => 'Prescription Errors', 'keywords' => 'allergic,reactions,health,problems,medication,syringe,needle,anaesthetic,digestive,reactions,ulcers,internal,bleeding,blindness,brain,injuries,psychological,damage', 'icon' => 'bottle', 'location' => '30'), array('title' => 'Surgical Error Claims', 'keywords' => 'surgical,error,claims,surgery,procedure,instrument,removal,negligence', 'icon' => 'scalpel', 'location' => '26'));
$colour = array("red", "pink", "purple", "blue", "teal", "green", "orange", "brown");
$icon = array("&#xE862;", "&#xE86D;", "&#xE86A;", "&#xE8AF;", "&#xE8F4;");
if (isset($_GET['search']) && !empty($_GET['search'])) {
    // Explode the search by spaces
    $search = explode(" ", $_GET['search']);
    // Init results variable as an array
    $results = array();
    // Loop through all claim types
    foreach ($types as $key => $value) {
        // Assign keywords to a static variable
        $keywords = $value['keywords'];
        // Search the keywords for each word in the search string
        if (strposa($keywords, $search)) {
            // If found, assign the parent key to the results array
            // so we can return all child keys related to the result
            $results[$key] = $value;
        }
    }
    // If any results were found...
    if (count($results) > 0) {
        echo '<div class="row"><div class="col s12 center-align"><p>Currently displaying <strong>' . count($results) . '</strong> claim types related to &quot;' . $_GET['search'] . '&quot;</p></div></div>';
        // Spit out the title's of each claim type
        // echo '<h2>Found the following:</h2>';
        $colourSelector = 1;
        $i = 1;
        $opp = "odd";
        foreach ($results as $t) {
            if ($i == 1) {
예제 #11
0
$tooMuchFilesCrit = $options['c'];
// current timestamp
$now = time();
// nagios stuff
$return_code = 0;
$return_msg = "Everything's fine";
$perf_msg = "";
// check every subfolder for .zip.aes
$fileArray = glob($path . "/*/*" . $ext);
// helper
$i = 0;
$j = 0;
$filesTooOldArray = array();
foreach ($fileArray as $file) {
    // break if file matches exclude pattern
    if (!strposa($file, $excludeList)) {
        // get file modification time
        $fileMTime = fileatime($file);
        // calculate file age in seconds
        if ($now - $fileMTime > $tooOldSecondsCrit) {
            // remove path
            $file = str_replace(array($path . "/", $ext), "", $file);
            // split too gutachter and filename
            $file = explode("/", $file);
            // build Array
            if (array_key_exists($file[0], $filesTooOldArray)) {
                $filesTooOldArray[$file[0]] .= ", " . $file[1];
            } else {
                $filesTooOldArray[$file[0]] = $file[1];
            }
            unset($file);
예제 #12
0
// end db connect
// build query string
$query = "SELECT \n\t\n\t( COUNT(*) * 100) / LIC.LIC_SOFT_LIMIT AS lic_usage_percent,\n\tCOUNT(*) \t\tAS lic_usage,\n\tIIF.IIF_FEATURE \tAS feature_name,\n\tLIC.LIC_FEATURE_NAME \tAS lic_feature_name,\n\tLIC.LIC_SOFT_LIMIT \tAS lic_soft_limit\nFROM \n\tIVT_INST_FEATURES IIF\nLEFT JOIN\n\tLICENCES LIC\n\t\tON LIC.LIC_FEATURE = IIF.IIF_FEATURE\nGROUP BY \n\tIIF.IIF_FEATURE, LIC.LIC_SOFT_LIMIT, LIC.LIC_FEATURE_NAME\n";
try {
    // prepare + execute db query
    $sth = $dbh->prepare($query);
    $sth->execute();
    $result = $sth->fetchAll();
} catch (PDOException $e) {
    echo "UNKNOWN: query execution failed: " . $e->getMessage() . PHP_EOL;
    exit(3);
}
// end db
foreach ($result as $line) {
    // exclude list
    if (strposa(trim($line['lic_feature_name']), $excludeList) === false) {
        if ($line['lic_usage_percent'] >= $crit) {
            // critical > all
            $exitCode = 2;
            $tempCode = 2;
        } else {
            if ($line['lic_usage_percent'] >= $warn) {
                // raise exit code if below warning
                $exitCode = $exitCode == 0 ? 1 : $exitCode;
                $tempCode = 1;
            } else {
                $tempCode = 0;
            }
        }
        // end if percentage
        // calculate perfdata values, round float values
예제 #13
0
 /**
  * Renames the file
  * @param string $newName New name
  * @return void
  */
 function rename($newName)
 {
     if (preg_match("#" . self::rootDir() . '/UserDirectory/([^/]+)$#', $this->path)) {
         return false;
     }
     global $USER, $DB;
     if (!$this->may($USER, EDIT)) {
         return false;
     }
     if (!$newName) {
         return false;
     }
     if (strposa($newName, array('/', '\\'))) {
         return false;
     }
     $newPath = $this->dirname . DIRECTORY_SEPARATOR . $newName;
     if (file_exists($newPath)) {
         return false;
     }
     if (!rename($this->path, $newPath)) {
         return false;
     }
     $this->path = $newPath;
     $this->expandPath();
     $DB->files->{(string) $this->ID} = array('name' => $newName);
 }
예제 #14
0
function getTweetInformation($tweet)
{
    // an  information array
    global $preferences;
    $contents = strtolower($tweet->text);
    $information = new stdClass();
    // first get the type
    $information->contenttype = strposa($contents, $preferences->TAGS['book']) ? 'book' : (strposa($contents, $preferences->TAGS['film']) ? 'film' : '');
    // then other properties
    updateTweetInformation($tweet, $information);
    // done
    return $information;
}
예제 #15
0
    foreach ($needles as $needle) {
        $res = strpos($haystack, $needle, $offset);
        if ($res !== false) {
            $chr[$needle] = $res;
        }
    }
    if (empty($chr)) {
        return false;
    }
    return min($chr);
}
$string = '<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> ';
foreach ($files1 as $file) {
    if (stripos($file, '.php') !== false) {
        if (strposa($file, $not_pages, 1)) {
        } else {
            $string .= '<url>
    <loc>' . $url . $file . '</loc> 
  </url>' . "\n\r";
        }
    }
}
foreach ($books as $book) {
    $nbook = ${$book};
    foreach ($nbook as $k => $v) {
        $string .= '<url>
    <loc>' . $url . $book . '_chapters.php?ch=' . $k . '</loc> 
  </url>' . "\n\r";
    }
}
예제 #16
0
function var_debug($inputvar, $strlen = STRLEN, $width = WIDTH, $depth = DEPTH, $i = 0, &$objects = [])
{
    static $iterations, $init, $skip, $nkey, $j, $objcloned, $objids, $objids, $aKeys;
    if (!$iterations) {
        $iterations = 0;
    }
    $iterations++;
    if (isset($_ENV['a']['kill']) || $iterations > MAXIT || ($x = globalTimeLimit())) {
        return;
    }
    if ($x = timelimit()) {
        timelimit(1);
        return $x;
    }
    if (memory_get_usage(1) / 1000000 > MAXRAM) {
        $_ENV['a']['MAXRAM'] = 1;
        return '-- ram limit exceeded : ' . MAXRAM . 'Mo';
    }
    $parentKeys = '';
    if (is_array($strlen)) {
        extract($strlen);
        $strlen = STRLEN;
    }
    if (!$init || !$i) {
        init();
        $init = 1;
        $objids = $aKeys = [];
        $skip = explode(',', $_SESSION['filter']);
        gt1('var_debug:0');
    }
    $type = gettype($inputvar);
    #if($type=='object' && \ReflectionClass::isCloneable($inputvar))die(get_class($inputvar).'clonable');
    #if(!in_Array($type,['array','object']))return $inputvar;#retourne simple string
    if (!$objcloned && $type == 'object') {
        $var = clone $inputvar;
        $objcloned = 1;
    } else {
        $var = $inputvar;
    }
    #,'Symfony\Component\Form\FormBuilder'
    $search = ["*", "", "\\a", "\\b", "\f", "\n", "\r", "\t", "\v"];
    $replace = ['', '', '\\a', '\\b', '\\f', '\\n', '\\r', '\\t', '\\v'];
    #'\0'
    $string = $s2 = '';
    switch (gettype($var)) {
        case 'NULL':
            return null;
            break;
            #$string.='null';
        #$string.='null';
        case 'boolean':
            $string .= $var ? 'true' : 'false';
            break;
        case 'integer':
            $string .= $var;
            break;
        case 'double':
            $string .= $var;
            break;
        case 'resource':
            $string .= '[resource]';
            break;
        case 'string':
            if (substr($var, 0, 2) == '#!') {
                return null;
            }
            if (substr($var, 0, 1) == '#') {
                if (in_array(trim($var, '#*'), $aKeys)) {
                    return "<a class='hash' href='#" . trim($var, '#*') . "'>" . $var . '</a>' . (strpos($var, $parentKeys) !== false ? ' *' : '');
                    #£:marquer recursions par le dessous avec une étoile *
                }
                #die(__line__.$var);##[proposition0][logstatut][102][statut]
            }
            ##[proposition0][taches]
            $len = strlen($var);
            $var = str_replace($search, $replace, substr($var, 0, $strlen), $count);
            $var = substr($var, 0, $strlen);
            $var = htmlspecialchars(str_replace('""', '', $var));
            if ($len < $strlen) {
                $string .= $var;
            } else {
                $string .= 'string(' . $len . '): ' . $var . '...';
            }
            //('.$len.')
            #if(substr_count($string,'"')%2)$string.='"';#fermeture
            #if(preg_match('~\.{3}\n?$~',$string))$string.='"';#correcteur
            break;
        case 'array':
            $len = count($var);
            if ($i == $depth) {
                $string .= 'array(' . $len . ') #depth';
            } elseif (!$len && CLEANULL) {
                $string = '';
            } elseif (!$len) {
                $string .= 'a:null';
            } else {
                $spaces = str_repeat(' ', $i * 2);
                $j++;
                $closin = $j;
                #J Shall remain the same uh ? Nahhh :(
                $count = 0;
                #$keys = array_keys($var);foreach $keys as $key
                foreach ($var as $key => $value2) {
                    if (isset($_ENV['a']['MAXRAM'])) {
                        break;
                    }
                    if (is_string($value2) && substr($value2, 0, 2) == '#!') {
                        continue;
                    }
                    #if (CLEANULL && (!isset($value2) || !$value2)) {continue;}
                    if ($count === $width) {
                        $s2 .= "\n" . $spaces . "  ...";
                        break;
                    }
                    $currentKey = $parentKeys . "[{$key}]";
                    $aKeys[] = $currentKey;
                    $s2 .= "\n" . $spaces . " <a href='#{$parentKeys}'>&lt;</a><c id='" . $currentKey . "' title='{$currentKey}'>[{$key}]</c> => ";
                    if ($key === 'HomeRh' && 0) {
                        //&& stripos($var,'div class')>-1||stripos($var,'sur notre page recrutement')||stripos($var,'"')
                        fpco(R1 . '1.php', gettype($value2) . $value2 . print_r($value2, 1));
                        $_ENV['break'] = 1;
                        var_debug($value2);
                        $_ENV['break'] = 0;
                    }
                    $s2 .= var_debug($value2, compact('objects') + ['i' => $i + 1, 'parentKeys' => $currentKey]);
                    $count++;
                }
                if (CLEANEMPTYARRAYS && !$s2) {
                    return null;
                    $string = '';
                    break;
                }
                $string .= "<a id='o{$j}' href='#c{$j}' class='open'>array({$len})</a>\n" . $spaces . "{" . $s2;
                #<b class='".($i*2)."'>
                $string .= "\n" . $spaces . "<a id='c{$closin}' href='#o{$closin}' title='{$closin}' class='close'>}--</a></b>";
            }
            break;
            #Salomon\DatabaseBundle\Entity\Subsidiary:advancedProductPages] => Doctrine\ORM\PersistentCollection
        #Salomon\DatabaseBundle\Entity\Subsidiary:advancedProductPages] => Doctrine\ORM\PersistentCollection
        case 'object':
            #n'est plus utilisé si déjà passé dans l'anti-recursion primaire
            timelimit(1);
            $id = $objid = null;
            $classname = get_class($var);
            $cn = shortClass($var);
            if (strposa($classname, $skip)) {
                $_ENV['skipped'][] = $classname;
                return $classname . '#skip';
            }
            if (method_exists($var, 'getId')) {
                $objid = $var->getId();
            } elseif (isset($var->id) && is_integer($var->id)) {
                $objid = $var->id;
            }
            if (isset($objid) && isset($objids[$cn]) && array_key_exists($objid, $objids[$cn])) {
                return '<a class=obj href="#' . $cn . $objid . '">' . $cn . '#listed as ' . $objid . "</a>";
            }
            $hash = spl_object_hash($var);
            $id = array_search($hash, $objects, true);
            if ($id !== false) {
                return '<a class=obj href="#' . $cn . ($id + 1) . '">' . $cn . '#listed as ' . ($id + 1) . "</a>";
            } else {
                if ($i == $depth) {
                    $string .= $cn . ' #!depth';
                } else {
                    if ($objid && $cn != 'stdclass') {
                        $id = $objid;
                        $objids[$cn][$objid] = 1;
                    } else {
                        $id = array_push($objects, $hash);
                    }
                    $spaces = str_repeat(' ', $i * 2);
                    $j++;
                    $closin = $j;
                    $cast = castAction($var);
                    if ($cast === 'unset') {
                        continue;
                    }
                    if ($cast !== false && in_array(gettype($cast), ['array', 'object'])) {
                        $string .= var_debug($cast, compact('objects') + ['i' => $i + 1]);
                        #$string .= var_debug($cast, compact('objects')+['i'=>$i+1,'parentKeys'=>$currentKey]);
                        continue;
                    } elseif ($cast !== false) {
                        $string .= $cast;
                    } elseif (PERSISTENTCOLL && $cn === 'persistentcollection') {
                        # && !in_array($var->get('backRefFieldName'),['subsidiary']) && $var->getValues() && count($var->getValues())>0
                        $next = $var->getValues();
                        $count = count($next);
                        if ($count === 0 && CLEANULL) {
                            return;
                        }
                        if ($count === 0) {
                            $string .= " pc => 0";
                        } elseif ($count > 1000) {
                            $string .= " pc + 1000";
                        } else {
                            $string .= 'pc';
                            $type = shortClass($next[0]);
                            if (0 && method_exists($next[0], 'getId')) {
                                #is_integer($next[0]->id)){
                                $tids = [];
                                foreach ($next as $t) {
                                    $tids[] = $t->getId();
                                }
                                $string .= " pc:ids => " . implode(',', $tids);
                            } else {
                                if ($x = timelimit()) {
                                    $string .= $x;
                                    break;
                                }
                                $string .= var_debug($next, compact('objects') + ['i' => $i + 1]);
                                #$string .= var_debug($next,compact('objects')+['i'=>$i+1,'parentKeys'=>$currentKey]);
                            }
                        }
                        unset($next);
                        #die('<pre>'.print_r($var->getValues(),1));die(var_debug($var->getValues()));
                    } else {
                        $methods = get_class_methods($var);
                        foreach ($methods as &$method) {
                            if (substr($method, 0, 2) == '__') {
                                $method = null;
                            }
                        }
                        unset($method);
                        $methods = array_filter($methods);
                        $methods = implode(', ', $methods);
                        $string .= "<a title=\"{$classname}\" class=i id='" . $cn . $id . "' href='#c{$j}'>#" . $cn . "#{$id}</a>";
                        $string .= "\n" . $spaces . "{" . $spaces;
                        if ($methods) {
                            $string .= "\n" . $spaces . "  [*] => " . $methods;
                        }
                        $array = (array) $var;
                        #$properties = array_keys($array);
                        foreach ($array as $property => $value2) {
                            if (isset($_ENV['a']['MAXRAM'])) {
                                break;
                            }
                            if (is_string($value2) && substr($value2, 0, 2) == '#!') {
                                continue;
                            }
                            if (substr($property, 0, 2) === '__') {
                                continue;
                            }
                            #initialize,cloner
                            if (CLEANULL && !$value2) {
                                continue;
                            }
                            $currentKey = $parentKeys . "[{$property}]";
                            $aKeys[] = $currentKey;
                            $name = str_ireplace([STRIPNAMESPACE, $classname, $cn, "", '*'], ['', '', '', '', ''], trim($property));
                            $cast = castAction($value2, $name);
                            if ($cast === 'unset') {
                                continue;
                            }
                            if ($cast !== false && in_array(gettype($cast), ['array', 'object'])) {
                                $value2 = $cast;
                            } elseif (!isset($_ENV['a']['nr']) && $cast !== false && $cn != 'stdclass') {
                                $string .= "\n" . $spaces . "  [{$name}] => " . $cast;
                                #$e=error_get_last();if(strpos($e['message'],'ndefined index'));else{$_ENV['a']['nr']=1;dbe(['nr'=>1,$e]);die;}
                                continue;
                            }
                            if (strposa($name, $skip)) {
                                $_ENV['skipped'][] = $name;
                                $string .= '#s';
                            } else {
                                $x = var_debug($value2, compact('objects') + ['i' => $i + 1, 'parentKeys' => $currentKey]);
                                if ($x) {
                                    $string .= "\n" . $spaces . "  [{$name}] => " . $x;
                                }
                            }
                        }
                        $string .= "\n" . $spaces . "<a id='c{$closin}' href='#" . $cn . $id . "' title='{$closin}'>}--</a></b>";
                    }
                }
            }
            break;
        default:
            $string .= '???#unknow type';
            break;
    }
    #if ($i > 0)return $string;#do not returns first index
    return $string;
}
예제 #17
0
echo $_SERVER['PHP_SELF'];
?>
" id="varnishpurge">
    <p>Enter the URL to purge</p>
    <p>Use * as wildcard for multiple purges</p>
    <input type="text" value="<?php 
isset($_POST['txtURL']) ? $_POST['txtURL'] : '';
?>
" name="txtURL" class="defaultText" title="http://yourhost/some-url.html" />
  </form>

  <button type="submit" name="cmdSubmit" form="varnishpurge" value="Purge URL" class="clean-gray">Purge URL</button>

<?php 
if (isset($_POST['cmdSubmit'])) {
    $txtUrl = $_POST['txtURL'];
    $protocols = array('http://', 'https://');
    $strpos = strposa($txtUrl, $protocols);
    if ($strpos === false) {
        die("<p><span class='error'>Sorry, this doesn't seem like a valid URL, make sure you include the http:// at the start</span></p>");
    } elseif (!isset($_POST['txtURL']) || empty($_POST['txtURL']) || $_POST['txtURL'] === "http://yourhost/some-url.html") {
        die("<p><span class='error'>Please enter a URL</span></p>");
    }
    varnishPurge($txtUrl);
}
?>

</div>

</body>
</html>

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="bs/js/html5shiv.js"></script>
      <script src="bs/js/respond.min.js"></script>
    <![endif]-->
  </head>

  <body>

    <div class="container">
<br>
      <?php 
include 'header.php';
if (strposa($_SESSION['unitname'], $highranks, 1)) {
} else {
    header("Location:dash.php");
}
?>

      <!-- Main component for a primary marketing message or call to action -->
      <div class="jumbotron">
        <form class="form-horizontal" action="process/processannouncement.php" method="post" role="form">
  <div class="form-group">
    <label for="inputunitid" class="col-lg-2 control-label">Unit ID</label>
    <div class="col-lg-5">
      <input type="text" class="form-control" id="inputunitid" name='unit' readonly value="<?php 
echo $_SESSION['unitname'];
?>
">
예제 #19
0
파일: post.php 프로젝트: 2Rainbow/fukuro
     $image->delete();
     error($config['error']['maxsize']);
 }
 $post['width'] = $image->size->width;
 $post['height'] = $image->size->height;
 if ($config['minimum_copy_resize'] && $image->size->width <= $config['thumb_width'] && $image->size->height <= $config['thumb_height'] && $post['extension'] == ($config['thumb_ext'] ? $config['thumb_ext'] : $post['extension'])) {
     // Copy, because there's nothing to resize
     copy($upload, $post['thumb']);
     $post['thumbwidth'] = $image->size->width;
     $post['thumbheight'] = $image->size->height;
 } else {
     $thumb = $image->resize($config['thumb_ext'] ? $config['thumb_ext'] : $post['extension'], $post['op'] ? $config['thumb_op_width'] : $config['thumb_width'], $post['op'] ? $config['thumb_op_height'] : $config['thumb_height']);
     $thumb->to($post['thumb']);
     $post['thumbwidth'] = $thumb->width;
     $post['thumbheight'] = $thumb->height;
     if ($config['spoiler_images'] && isset($_POST['spoiler']) || $config['spoiler_images'] && $config['autospoiler_images'] && strposa($post['filename'], $config['autospoiler_tags'])) {
         $post['thumb'] = 'spoiler';
     }
     $thumb->_destroy();
 }
 if ($config['redraw_image'] || !@$post['exif_stripped'] && $config['strip_exif'] && ($post['extension'] == 'jpg' || $post['extension'] == 'jpeg')) {
     if (!$config['redraw_image'] && $config['use_exiftool']) {
         if ($error = shell_exec_error('exiftool -overwrite_original -ignoreMinorErrors -q -q -all= ' . escapeshellarg($upload))) {
             error('Could not strip EXIF metadata!', null, $error);
         }
     } else {
         $image->to($post['file']);
         $dont_copy_file = true;
     }
 }
 $image->destroy();