public function read($filename) { $file = new File($filename); if ($file->exists()) { switch ($this->storeMethod) { case 'ini': if ($this->vars = parse_ini_file($filename, true)) { return true; } else { throw new Exception('Could not parse ' . $filename . '!'); } break; case 'serialized': if ($this->vars = deserialize(file_get_content($filename))) { return true; } else { throw new Exception('Could not parse ' . $filename . '!'); } break; case 'xml': throw new Exception('Not implemented!'); break; } } else { throw new Exception('Could not find ' . $filename . '!'); } }
public function generate($classname) { $mainJs = file_get_content(Rajax_Application::$applicationPath . '/html/js/main.js'); foreach (self::$navigation as $navi) { } foreach (get_class_methods($classname) as $method) { } }
function getFileContents($fileLoc) { $contents = file_get_content($fileLoc); if ($contents === false) { return "ERROR"; } else { return $contents; } }
function get_errors() { if (!file_exists(NEMESIS_PROCESS_PATH . 'errors.log')) { touch(NEMESIS_PROCESS_PATH . 'errors.log'); } error_reporting(E_ALL); ini_set('log_errors', true); ini_set('ignore_repeated_errors', true); ini_set('error_log', NEMESIS_PROCESS_PATH . 'errors.log'); if (strpos($_SERVER['REQUEST_URI'], 'errors.log')) { echo @file_get_content(NEMESIS_PROCESS_PATH . 'errors.log'); exit; } }
foreach ($t_attachments as $t_attachment) { $writer->startElement('attachment'); # id $writer->writeElement('id', $t_attachment['id']); # title $writer->writeElement('title', $t_attachment['title']); # filename $writer->writeElement('filename', $t_attachment['filename']); # filesize $writer->writeElement('filesize', $t_attachment['filesize']); # file_type $writer->writeElement('file_type', $t_attachment['file_type']); # last added $writer->writeElement('date_added', $t_attachment['date_added']); # content $content = file_get_content($t_attachment['id']); $writer->writeElement('content', base64_encode($content['content'])); $writer->endElement(); # attachment } $writer->endElement(); # bugnotes } $writer->endElement(); # issue // Save memory by clearing cache //bug_clear_cache(); //bug_text_clear_cache(); } $writer->endElement(); # mantis
function LVM_LINK_DISK() { $groupname = $_GET["groupname"]; $dev = $_GET["dev"]; $unix = new unix(); $tmpstr = $unix->FILE_TEMP(); $cmd = $unix->find_program("vgextend") . " {$groupname} {$dev}"; writelogs_framework("{$cmd}", __FUNCTION__, __FILE__, __LINE__); shell_exec("{$cmd} >{$tmpstr} 2>&1"); $results = explode("\n", @file_get_content($tmpstr)); $results[] = "{$cmd}"; $results[] = "{$dev} -> {$groupname}"; echo "<articadatascgi>" . base64_encode(serialize($results)) . "</articadatascgi>"; }
function webim_template($template) { return $template; $head = file_get_content("template/webim.htm"); $template = preg_replace("/\\<body[^\\>]*\\>/i", "<body>" . $head, $template); }
function file_get_content($url) { if (function_exists('file_get_contents')) { $file_contents = @file_get_contents($url); } if ($file_contents == '') { $ch = curl_init(); $timeout = 30; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); $file_contents = curl_exec($ch); curl_close($ch); } return $file_contents; } $username = $_GET['username']; echo ini_get('allow_url_fopen'); $result = $file_contents = file_get_content("http://gh.taisha.org/openclass.php?username={$username}"); echo '<pre>'; var_dump($result); echo $_GET['username']; echo '</pre>'; $result = unserialize($result); if ($result['realname']) { $result['realname'] = iconv('GB2312', 'UTF-8', $result['realname']); } echo '<pre>'; var_dump($result); echo $_GET['username']; echo '</pre>';
require '../include/mysql.class.php'; require '../include/config.inc.php'; require '../include/function.inc.php'; function cut($str, $start, $end, $s = 2) { $contents = strstr($str, $start); $contents = substr_replace($contents, '', strpos($contents, $end)) . $end; if ($s != 1) { $contents = preg_replace("/\\<(.*?)\\>/", "", $contents); } $contents = str_replace($start, "", $contents); $contents = str_replace($end, "", $contents); return $contents; } $db = new database(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME, 'utf8'); $file = cut(file_get_content('http://zt.ku6.com/2006/hzw/'), "海贼王1-50话", "精彩壁纸", 1); $title = ""; preg_match_all("/\\/show\\/(.*).html/", $file, $url); preg_match_all("/class=\"ku6link\">(.*)<\\/a>/", $file, $title); $tag = "海贼王 路飞"; $sortid = 31; $pic = "4680aba3e8b27.jpg"; $intro = "故事发生在一个海盗横行的年代,主人公路飞从小就立志成为海盗王,不过不幸或者说是幸运的是因误食了魔鬼果实使他变成了橡皮人永远也无法游泳,路飞为了得到海盗王的宝物One Piece开始了..."; $count = count($url[1]); $url = $url[1]; $title = $title[1]; for ($i = 0; $i < $count; $i++) { $url1 = "http://img.ku6.com/common/V2.0.swf?vid=" . $url[$i]; $title1 = $title[$i]; $db->query("INSERT INTO `video` (`title`,`tag`,`date`,`sortid`,`url`,`pic`,`content`) VALUES ('{$title1}','{$tag}',now(),{$sortid},'{$url1}','{$pic}','{$intro}')"); }
<?php if (!empty($_GET['get'])) { header("Content-type:application/zip: ZIP"); if ($_GET['get'] == "CChart0.2AlphaWinXP.Net3.5.zip" || $_GET['get'] == "CChart0.1AlphaWin7.Net4.0.zip" || $_GET['get'] == "CChart0.1AlphaWin8.Net4.5.zip") { echo file_get_content($_GET['get']); $arr = json_decode("downloads.json", true); $arr['total']++; switch ($_GET['get']) { case "CChart0.2AlphaWinXP.Net3.5.zip": $arr['xp']++; break; case "CChart0.1AlphaWin7.Net4.0.zip": $arr['w7']++; break; case "CChart0.1AlphaWin8.Net4.5.zip": $arr['w8']++; break; } file_put_contents("downloads.json", json_encode($arr)); exit; } else { echo "404not found"; } } ?> <html> <head> </head> <body>
/** * Modules Update Features **/ function check_modules() { $modules = json_decode(file_get_content('https://raw.githubusercontent.com/Blair2004/tendoo-cms/3.0/modules.json')); $modules_status = force_array($this->options->get('modules_status')); foreach (Modules::get() as $namespace => $module) { // if current module is genuine if (in_array($namespace, array_keys($modules))) { // If a new version is available if (intval($module['version']) < $modules[$namespace]['version']) { $modules_status[$namespace] = array('version' => $modules[$namespace]['version'], 'zip_url' => $modules[$namespace]['zip_url']); } else { unset($modules_status[$namespace]); // make sure already updated module is removed from "updatable modules" } } } $this->options->set('modules_status', $modules_status); }