首先,请谨慎使用该程序,当你对其有任何怀疑,或觉得有任何不妥时,请立即停止使用,或许你的感觉是对的。
5 |作者博客:http://www.loveyu.org,这绝对是一个不错的反馈地址。
6 |程序主页:http://www.loveyu.net/LyFm
7 |免责:作者不对你所做的任何失误操作进行负责,不会要求搜集使用则的任何信息,但会对程序版本进行统计。
8 |├── .gitignore ├── .htaccess ├── LySystem ├── LyCore │ ├── LyCookie.php │ ├── LyCore.php │ ├── LyFile.php │ ├── LyGet.php │ ├── LyPost.php │ ├── LyRequest.php │ ├── LySafe.php │ ├── LyTime.php │ ├── LyUrl.php │ ├── helper │ │ ├── mime.php │ │ └── system.php │ ├── library │ │ ├── CLibMail.php │ │ ├── phpmailer.php │ │ └── smtp.php │ └── page │ │ ├── 404.php │ │ └── error.php ├── LyLib │ ├── LibFile.php │ ├── LibFilter.php │ ├── LibLogin.php │ ├── LibMenu.php │ └── LibTemplate.php ├── LyPage │ ├── About.php │ ├── Api.php │ ├── Help.php │ ├── Login.php │ └── Welcome.php └── LyView │ ├── about.php │ ├── api_list.php │ ├── footer.php │ ├── header.php │ ├── help.php │ ├── index.php │ ├── login.php │ └── menu.php ├── README.md ├── config.php ├── css ├── colorbox.css ├── images │ ├── border.png │ ├── controls.png │ ├── ie6 │ │ ├── borderBottomCenter.png │ │ ├── borderBottomLeft.png │ │ ├── borderBottomRight.png │ │ ├── borderMiddleLeft.png │ │ ├── borderMiddleRight.png │ │ ├── borderTopCenter.png │ │ ├── borderTopLeft.png │ │ └── borderTopRight.png │ ├── loading.gif │ ├── loading_background.png │ ├── overlay.png │ └── uploadify-cancel.png ├── style.css └── uploadify.css ├── edit_area ├── autocompletion.js ├── edit_area.css ├── edit_area.js ├── edit_area_compressor.php ├── edit_area_full.gz ├── edit_area_full.js ├── edit_area_functions.js ├── edit_area_loader.js ├── elements_functions.js ├── highlight.js ├── images │ ├── autocompletion.gif │ ├── close.gif │ ├── fullscreen.gif │ ├── go_to_line.gif │ ├── help.gif │ ├── highlight.gif │ ├── load.gif │ ├── move.gif │ ├── newdocument.gif │ ├── opacity.png │ ├── processing.gif │ ├── redo.gif │ ├── reset_highlight.gif │ ├── save.gif │ ├── search.gif │ ├── smooth_selection.gif │ ├── spacer.gif │ ├── statusbar_resize.gif │ ├── undo.gif │ └── word_wrap.gif ├── keyboard.js ├── langs │ ├── bg.js │ ├── cs.js │ ├── de.js │ ├── dk.js │ ├── en.js │ ├── eo.js │ ├── es.js │ ├── fi.js │ ├── fr.js │ ├── hr.js │ ├── it.js │ ├── ja.js │ ├── mk.js │ ├── nl.js │ ├── pl.js │ ├── pt.js │ ├── ru.js │ ├── sk.js │ └── zh.js ├── license_apache.txt ├── license_bsd.txt ├── license_lgpl.txt ├── manage_area.js ├── plugins │ ├── charmap │ │ ├── charmap.js │ │ ├── css │ │ │ └── charmap.css │ │ ├── images │ │ │ └── charmap.gif │ │ ├── jscripts │ │ │ └── map.js │ │ ├── langs │ │ │ ├── bg.js │ │ │ ├── cs.js │ │ │ ├── de.js │ │ │ ├── dk.js │ │ │ ├── en.js │ │ │ ├── eo.js │ │ │ ├── es.js │ │ │ ├── fr.js │ │ │ ├── hr.js │ │ │ ├── it.js │ │ │ ├── ja.js │ │ │ ├── mk.js │ │ │ ├── nl.js │ │ │ ├── pl.js │ │ │ ├── pt.js │ │ │ ├── ru.js │ │ │ ├── sk.js │ │ │ └── zh.js │ │ └── popup.html │ └── test │ │ ├── css │ │ └── test.css │ │ ├── images │ │ └── test.gif │ │ ├── langs │ │ ├── bg.js │ │ ├── cs.js │ │ ├── de.js │ │ ├── dk.js │ │ ├── en.js │ │ ├── eo.js │ │ ├── es.js │ │ ├── fr.js │ │ ├── hr.js │ │ ├── it.js │ │ ├── ja.js │ │ ├── mk.js │ │ ├── nl.js │ │ ├── pl.js │ │ ├── pt.js │ │ ├── ru.js │ │ ├── sk.js │ │ └── zh.js │ │ ├── test.js │ │ └── test2.js ├── reg_syntax.js ├── reg_syntax │ ├── basic.js │ ├── brainfuck.js │ ├── c.js │ ├── coldfusion.js │ ├── cpp.js │ ├── css.js │ ├── html.js │ ├── java.js │ ├── js.js │ ├── pas.js │ ├── perl.js │ ├── php.js │ ├── python.js │ ├── robotstxt.js │ ├── ruby.js │ ├── sql.js │ ├── tsql.js │ ├── vb.js │ └── xml.js ├── regexp.js ├── resize_area.js ├── search_replace.js └── template.html ├── images ├── LyFM.png ├── alipay_pay.png ├── audio_ico.png ├── file_ico.png ├── folder_ico.png ├── img_ico.png ├── pdf_ico.png ├── text_ico.png ├── video_ico.png └── zip_ico.png ├── index.php ├── js ├── LyApi.js ├── LyCode.js ├── LyEdit.js ├── LyUpload.js ├── LyUpload2.js ├── full.js ├── full.min.js ├── jquery-1.8.2.min.js ├── jquery.colorbox-min.js ├── jquery.md5.js ├── jquery.uploadify.min.js └── load.js ├── license.txt ├── nginx.conf └── swf └── uploadify.swf /.gitignore: -------------------------------------------------------------------------------- 1 | ################# 2 | ## Eclipse 3 | ################# 4 | 5 | *.pydevproject 6 | .project 7 | .metadata 8 | bin/ 9 | tmp/ 10 | *.tmp 11 | *.bak 12 | *.swp 13 | *~.nib 14 | local.properties 15 | .classpath 16 | .settings/ 17 | .loadpath 18 | 19 | # External tool builders 20 | .externalToolBuilders/ 21 | 22 | # Locally stored "Eclipse launch configurations" 23 | *.launch 24 | 25 | # CDT-specific 26 | .cproject 27 | 28 | # PDT-specific 29 | .buildpath 30 | 31 | 32 | ################# 33 | ## Visual Studio 34 | ################# 35 | 36 | ## Ignore Visual Studio temporary files, build results, and 37 | ## files generated by popular Visual Studio add-ons. 38 | 39 | # User-specific files 40 | *.suo 41 | *.user 42 | *.sln.docstates 43 | 44 | # Build results 45 | [Dd]ebug/ 46 | [Rr]elease/ 47 | *_i.c 48 | *_p.c 49 | *.ilk 50 | *.meta 51 | *.obj 52 | *.pch 53 | *.pdb 54 | *.pgc 55 | *.pgd 56 | *.rsp 57 | *.sbr 58 | *.tlb 59 | *.tli 60 | *.tlh 61 | *.tmp 62 | *.vspscc 63 | .builds 64 | *.dotCover 65 | 66 | ## TODO: If you have NuGet Package Restore enabled, uncomment this 67 | #packages/ 68 | 69 | # Visual C++ cache files 70 | ipch/ 71 | *.aps 72 | *.ncb 73 | *.opensdf 74 | *.sdf 75 | 76 | # Visual Studio profiler 77 | *.psess 78 | *.vsp 79 | 80 | # ReSharper is a .NET coding add-in 81 | _ReSharper* 82 | 83 | # Installshield output folder 84 | [Ee]xpress 85 | 86 | # DocProject is a documentation generator add-in 87 | DocProject/buildhelp/ 88 | DocProject/Help/*.HxT 89 | DocProject/Help/*.HxC 90 | DocProject/Help/*.hhc 91 | DocProject/Help/*.hhk 92 | DocProject/Help/*.hhp 93 | DocProject/Help/Html2 94 | DocProject/Help/html 95 | 96 | # Click-Once directory 97 | publish 98 | 99 | # Others 100 | [Bb]in 101 | [Oo]bj 102 | sql 103 | TestResults 104 | *.Cache 105 | ClientBin 106 | stylecop.* 107 | ~$* 108 | *.dbmdl 109 | Generated_Code #added for RIA/Silverlight projects 110 | 111 | # Backup & report files from converting an old project file to a newer 112 | # Visual Studio version. Backup files are not needed, because we have git ;-) 113 | _UpgradeReport_Files/ 114 | Backup*/ 115 | UpgradeLog*.XML 116 | 117 | 118 | 119 | ############ 120 | ## Windows 121 | ############ 122 | 123 | # Windows image file caches 124 | Thumbs.db 125 | 126 | # Folder config file 127 | Desktop.ini 128 | 129 | 130 | ############# 131 | ## Python 132 | ############# 133 | 134 | *.py[co] 135 | 136 | # Packages 137 | *.egg 138 | *.egg-info 139 | dist 140 | build 141 | eggs 142 | parts 143 | bin 144 | var 145 | sdist 146 | develop-eggs 147 | .installed.cfg 148 | 149 | # Installer logs 150 | pip-log.txt 151 | 152 | # Unit test / coverage reports 153 | .coverage 154 | .tox 155 | 156 | #Translations 157 | *.mo 158 | 159 | #Mr Developer 160 | .mr.developer.cfg 161 | 162 | # Mac crap 163 | .DS_Store 164 | 165 | .idea 166 | -------------------------------------------------------------------------------- /.htaccess: -------------------------------------------------------------------------------- 1 | RewriteEngine On 2 | RewriteBase /file/ 3 | RewriteCond %{REQUEST_FILENAME} !-f 4 | RewriteRule ^(.*)$ /file/index.php/$1 [L] 5 | 6 | #禁止访问系统目录和配置目录 7 | RewriteCond %{REQUEST_URI} ^(\/file\/LySystem\/).* [NC] 8 | RewriteRule ^(.*)$ /file/index.php [L] -------------------------------------------------------------------------------- /LySystem/LyCore/LyCookie.php: -------------------------------------------------------------------------------- 1 | 6 | */ 7 | class LyCookie{ 8 | private $domain; 9 | private $hash; 10 | private $prefix; 11 | function __construct(){ 12 | $this->domain = get_config('system','cookie_domain'); 13 | $this->hash = get_config('system','cookie_hash'); 14 | $this->prefix = get_config('system','cookie_prefix'); 15 | $this->_array = &$_COOKIE; 16 | } 17 | public function get(){ 18 | $arr = func_get_args(); 19 | $array = $_COOKIE; 20 | foreach($arr as $v){ 21 | if(isset($array[$this->prefix.$v])){ 22 | $array = $array[$this->prefix.$v]; 23 | }else{ 24 | return false; 25 | } 26 | } 27 | $this->decode_array($array); 28 | return $array; 29 | } 30 | public function set($name,$value,$expire=0,$path='',$domain='',$secure=false,$httponly=false){ 31 | setcookie($this->prefix.$name,$this->encode($value),$expire,$this->get_path($path),$this->get_domain($domain),$secure,$httponly); 32 | } 33 | public function del($name,$path='',$domain=''){ 34 | setcookie($this->prefix.$name,"",0,$this->get_path($path),$this->get_domain($domain),''); 35 | } 36 | private function get_path($path){ 37 | if(''==$path){ 38 | $path = URL_PATH; 39 | }else{ 40 | $path = trim($path); 41 | } 42 | $path= str_replace('\\',"/",$path); 43 | return $path; 44 | } 45 | private function get_domain($domain){ 46 | $host = $_SERVER['HTTP_HOST']; 47 | $i = strpos($host,":"); 48 | if($i>0){ 49 | $host = substr($host,0,$i); 50 | } 51 | if(strpos($host,".")===false){ 52 | return $host; 53 | } 54 | if(strlen($host) >3 && is_numeric(str_replace(".","",substr($host,-3)))){ 55 | //排除HOST为IP的情形 56 | return $domain; 57 | } 58 | if(''==$domain){ 59 | if(!$this->domain){ 60 | if(strpos($host,'www.')===0){ 61 | return substr($host,3); 62 | }else{ 63 | return ".".$host; 64 | } 65 | }else{ 66 | return $this->domain; 67 | } 68 | }else{ 69 | return $domain; 70 | } 71 | } 72 | private function encode($cookie){ 73 | if($this->hash){ 74 | return get_core('LySafe')->encrypt($cookie,$this->hash); 75 | }else{ 76 | return $cookie; 77 | } 78 | } 79 | private function decode($cookie){ 80 | if($this->hash){ 81 | return get_core('LySafe')->decrypt($cookie,$this->hash); 82 | }else{ 83 | return $cookie; 84 | } 85 | } 86 | private function decode_array(&$array){ 87 | if($this->hash){ 88 | if(is_array($array)){ 89 | foreach($array as $id => $v){ 90 | if(is_array($v)){ 91 | $this->decode_array($array[$id]); 92 | }else{ 93 | $array[$id] = $this->decode($array[$id]); 94 | } 95 | } 96 | }else{ 97 | $array = $this->decode($array); 98 | } 99 | } 100 | } 101 | } 102 | ?> -------------------------------------------------------------------------------- /LySystem/LyCore/LyGet.php: -------------------------------------------------------------------------------- 1 | 6 | */ 7 | class LyGet extends LyRequest{ 8 | function __construct(){ 9 | $this->_array = &$_GET; 10 | } 11 | public function is_get(){ 12 | return 'GET'==$_SERVER['REQUEST_METHOD']; 13 | } 14 | } 15 | ?> -------------------------------------------------------------------------------- /LySystem/LyCore/LyPost.php: -------------------------------------------------------------------------------- 1 | 6 | */ 7 | class LyPost extends LyRequest{ 8 | function __construct(){ 9 | $this->_array = &$_POST; 10 | } 11 | public function is_post(){ 12 | return 'POST'==$_SERVER['REQUEST_METHOD']; 13 | } 14 | } 15 | ?> -------------------------------------------------------------------------------- /LySystem/LyCore/LyRequest.php: -------------------------------------------------------------------------------- 1 | 6 | */ 7 | class LyRequest{ 8 | public $_array; 9 | function __construct(){ 10 | $this->_array = array(); 11 | } 12 | public function get(){ 13 | $arr = func_get_args(); 14 | $array = $this->_array; 15 | foreach($arr as $v){ 16 | if(isset($array[$v])){ 17 | $array = $array[$v]; 18 | }else{ 19 | return false; 20 | } 21 | } 22 | return $array; 23 | } 24 | public function get_s(){ 25 | $args = func_get_args(); 26 | $rt = call_user_func_array(array($this,'get'),$args); 27 | if(is_array($rt)){ 28 | foreach($rt as $id => $v){ 29 | if(is_array($v)){ 30 | get_core('LySafe')->escape_array($rt[$id]); 31 | }else{ 32 | $rt[$id] = get_core('LySafe')->escape($rt[$id]); 33 | } 34 | } 35 | return $rt; 36 | }else{ 37 | return get_core('LySafe')->escape($rt); 38 | } 39 | } 40 | } 41 | ?> -------------------------------------------------------------------------------- /LySystem/LyCore/LySafe.php: -------------------------------------------------------------------------------- 1 | 6 | */ 7 | class LySafe 8 | { 9 | function __construct() 10 | { 11 | if(version_compare(PHP_VERSION, '5.3.0', "<")) { 12 | set_magic_quotes_runtime(0); 13 | } 14 | if(version_compare(PHP_VERSION, '7.0.0', "<") && get_magic_quotes_gpc()) { 15 | $this->tescape_array($_GET); 16 | $this->tescape_array($_POST); 17 | $this->tescape_array($_COOKIE); 18 | } 19 | } 20 | 21 | public function encrypt($encrypt, $key = '') 22 | { 23 | if(!function_exists('mcrypt_encrypt') || version_compare(PHP_VERSION, '7.1.0', ">=")) { 24 | return self::encrypt_self($encrypt, $key); 25 | } 26 | $passcrypt = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($key), $encrypt, MCRYPT_MODE_ECB); 27 | $encode = base64_encode($passcrypt); 28 | return $encode; 29 | } 30 | 31 | public function encrypt_self($txt, $key = '') 32 | { 33 | //当不存在mcrypt函数库时的加密方法 34 | srand((double)microtime() * 1000000); 35 | $encrypt_key = md5(rand(0, 32000)); 36 | $ctr = 0; 37 | $tmp = ''; 38 | for($i = 0; $i < strlen($txt); $i++) { 39 | $ctr = $ctr == strlen($encrypt_key) ? 0 : $ctr; 40 | $tmp .= $encrypt_key[$ctr].($txt[$i] ^ $encrypt_key[$ctr++]); 41 | } 42 | return base64_encode(self::passport_key($tmp, $key)); 43 | } 44 | 45 | public function decrypt_self($txt, $key) 46 | { 47 | //当不存在mcrypt函数库时的解密方法 48 | $txt = self::passport_key(base64_decode($txt), $key); 49 | $tmp = ''; 50 | for($i = 0; $i < strlen($txt); $i++) { 51 | $md5 = $txt[$i]; 52 | $tmp .= $txt[++$i] ^ $md5; 53 | } 54 | return $tmp; 55 | } 56 | 57 | function passport_key($txt, $encrypt_key) 58 | { 59 | $encrypt_key = md5($encrypt_key); 60 | $ctr = 0; 61 | $tmp = ''; 62 | for($i = 0; $i < strlen($txt); $i++) { 63 | $ctr = $ctr == strlen($encrypt_key) ? 0 : $ctr; 64 | $tmp .= $txt[$i] ^ $encrypt_key[$ctr++]; 65 | } 66 | return $tmp; 67 | } 68 | 69 | public function decrypt($decrypt, $key = '') 70 | { 71 | if(!function_exists('mcrypt_decrypt') || version_compare(PHP_VERSION, '7.1.0', ">=")) { 72 | return self::decrypt_self($decrypt, $key); 73 | } 74 | $decoded = base64_decode($decrypt); 75 | $decrypted = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($key), $decoded, MCRYPT_MODE_ECB); 76 | return $decrypted; 77 | } 78 | 79 | public function escape($string) 80 | { 81 | return mysql_real_escape_string($string); 82 | } 83 | 84 | public function tescape($string) 85 | { 86 | return stripslashes($string); 87 | } 88 | 89 | private function tescape_array(&$array) 90 | { 91 | //数组数据反转义 92 | foreach($array as $id => $v) { 93 | if(is_array($v)) { 94 | $this->tescape_array($array[$id]); 95 | } else { 96 | $array[$id] = $this->tescape($array[$id]); 97 | } 98 | } 99 | } 100 | 101 | private function escape_array(&$array) 102 | { 103 | //数组转义 104 | foreach($array as $id => $v) { 105 | if(is_array($v)) { 106 | $this->escape_array($array[$id]); 107 | } else { 108 | $array[$id] = $this->escape($array[$id]); 109 | } 110 | } 111 | } 112 | 113 | public function text($content) 114 | { 115 | return htmlspecialchars($content); 116 | } 117 | } 118 | 119 | ?> -------------------------------------------------------------------------------- /LySystem/LyCore/LyTime.php: -------------------------------------------------------------------------------- 1 | 6 | */ 7 | class LyTime{ 8 | private $begin_time; 9 | private $end_time; 10 | function __construct(){ 11 | $this->start(); 12 | } 13 | public function start(){ 14 | $this->begin_time = $this->get_microtime(); 15 | $this->end_time = 0; 16 | } 17 | public function get_microtime() 18 | { 19 | list($usec, $sec) = explode(' ', microtime()); 20 | return ((float)$usec + (float)$sec); 21 | } 22 | public function stop(){ 23 | $this->end_time = $this->begin = $this->get_microtime(); 24 | } 25 | public function get_second(){ 26 | if($this->end_time==0)$this->stop(); 27 | return round($this->end_time-$this->begin_time,5); 28 | } 29 | public function get_minute(){ 30 | if($this->end_time==0)$this->stop(); 31 | return round(($this->end_time-$this->begin_time)/60,5); 32 | } 33 | public function get_Millisecond(){ 34 | if($this->end_time==0)$this->stop(); 35 | return round(($this->end_time-$this->begin_time)*1000,5); 36 | } 37 | } 38 | ?> -------------------------------------------------------------------------------- /LySystem/LyCore/LyUrl.php: -------------------------------------------------------------------------------- 1 | 6 | */ 7 | class LyUrl{ 8 | private $path; 9 | private $url_list; 10 | function __construct() { 11 | if(!isset( $_SERVER['REQUEST_URI'])){ 12 | $_SERVER['REQUEST_URI'] = $_SERVER['PHP_SELF']; 13 | if(isset($_SERVER['QUERY_STRING'])){ 14 | $_SERVER['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING']; 15 | } 16 | } 17 | $this->init_param(); 18 | } 19 | private function make_list(){ 20 | if($this->path=='' || '/'==$this->path || $_SERVER['SCRIPT_NAME']==$this->path)return array(); 21 | if(substr($this->path,0,1)!='/'){ 22 | $this->path = "/".$this->path; 23 | } 24 | if(substr($this->path,-1)=='/'){ 25 | return explode("/",substr($this->path,1,-1)); 26 | }else{ 27 | return explode("/",substr($this->path,1)); 28 | } 29 | } 30 | public function get_req_list(){ 31 | return $this->url_list; 32 | } 33 | private function init_param(){ 34 | $this->make_req(); 35 | $this->url_list = $this->make_list(); 36 | $is_https = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' && !empty($_SERVER['HTTPS']); 37 | define('NOW_URL',($is_https?'https://':'http://').$_SERVER["HTTP_HOST"].$_SERVER['REQUEST_URI']); 38 | define('URL_PATH',dirname($_SERVER['SCRIPT_NAME'])); 39 | $i = strpos($_SERVER['REQUEST_URI'],$_SERVER['SCRIPT_NAME']); 40 | if($i==0 && $i!==false){ 41 | define('WEB_URL',($is_https?'https://':'http://').$_SERVER["HTTP_HOST"].$this->clean_url_more_char($_SERVER['SCRIPT_NAME']."/")); 42 | define('WEB_FILE_URL',($is_https?'https://':'http://').$this->clean_url_more_char($_SERVER["HTTP_HOST"].dirname($_SERVER['SCRIPT_NAME'])."/")); 43 | }else{ 44 | define('WEB_URL',($is_https?'https://':'http://').$_SERVER["HTTP_HOST"].$this->clean_url_more_char(dirname($_SERVER['SCRIPT_NAME'])."/")); 45 | define('WEB_FILE_URL',WEB_URL); 46 | } 47 | } 48 | private function clean_url_more_char($url){ 49 | return preg_replace("/[\\/\\\\]+/","/",$url); 50 | } 51 | private function make_req(){ 52 | if(isset($_SERVER['SERVER_SOFTWARE']) && strtolower($_SERVER['SERVER_SOFTWARE'])=="microsoft-iis/5.1" &&!isset($_SERVER['PATH_INFO']) && isset($_SERVER['HTTP_X_ORIGINAL_URL'])){ 53 | $pos = strpos($_SERVER['HTTP_X_ORIGINAL_URL'],'?'); 54 | $len = strlen($_SERVER["PHP_SELF"]); 55 | if($pos===false){ 56 | $_SERVER['PATH_INFO'] = substr($_SERVER['HTTP_X_ORIGINAL_URL'],$len); 57 | }else{ 58 | $_SERVER['PATH_INFO'] = substr($_SERVER['HTTP_X_ORIGINAL_URL'],$len,$pos-$len); 59 | } 60 | } 61 | if(!isset($_SERVER['PATH_INFO']) || $_SERVER['PATH_INFO']===""){ 62 | $i = strpos($_SERVER['REQUEST_URI'],'?'); 63 | if($i===false){ 64 | $this->path = $_SERVER['REQUEST_URI']; 65 | }else{ 66 | $this->path = substr($_SERVER['REQUEST_URI'],0,$i); 67 | } 68 | $dir = dirname($_SERVER['SCRIPT_NAME']); 69 | $j = strpos($this->path,$dir); 70 | if($j===0){ 71 | $this->path = substr($this->path,strlen($dir)); 72 | } 73 | }else{ 74 | $this->path = $_SERVER['PATH_INFO']; 75 | } 76 | $this->path = trim($this->path); 77 | } 78 | } 79 | ?> -------------------------------------------------------------------------------- /LySystem/LyCore/helper/system.php: -------------------------------------------------------------------------------- 1 | 6 | */ 7 | function get_core($name = ''){ 8 | $r_core = LyCore::$core; 9 | if($name!='' && isset($r_core->$name)){ 10 | return $r_core->$name; 11 | }else{ 12 | return $r_core; 13 | } 14 | } 15 | function get_lib($name=''){ 16 | $r_core = LyCore::$core; 17 | if($name=='')return $r_core->lib; 18 | if(isset($r_core->lib[$name])){ 19 | return $r_core->lib[$name]; 20 | }else{ 21 | return get_core()->load_lib($name); 22 | } 23 | } 24 | function get_config(){ 25 | $args = func_get_args(); 26 | return call_user_func_array(array(get_core(),'get_config'),$args); 27 | } 28 | function get_url($param=''){ 29 | if(is_array($param))return WEB_URL.implode("/",$param); 30 | return WEB_URL.$param; 31 | } 32 | function get_file_url($param=''){ 33 | if(is_array($param))return WEB_URL.implode("/",$param); 34 | return WEB_FILE_URL.$param; 35 | } 36 | 37 | /** 38 | * 打印调试信息 39 | * @return string 40 | */ 41 | function print_stack_trace() 42 | { 43 | $array =debug_backtrace(); 44 | //print_r($array);//信息很齐全 45 | unset($array[0]); 46 | $html = ""; 47 | foreach($array as $row) 48 | { 49 | $html .="
".(isset($row['file'])?$row['file']:"__").':'. 50 | (isset($row['line'])?$row['line']:"__").' line, call:'. 51 | (isset($row['function'])?$row['function']:"__")."
\n";
52 | }
53 | return $html;
54 | }
55 | function redirect($uri = '', $method = 'location', $http_response_code = 302){
56 | if ( ! preg_match('#^https?://#i', $uri)){
57 | $uri = get_url($uri);
58 | }
59 | switch($method){
60 | case 'refresh' : header("Refresh:0;url=".$uri);
61 | break;
62 | default : header("Location: ".$uri, TRUE, $http_response_code);
63 | break;
64 | }
65 | exit;
66 | }
67 | function system_path($path){
68 | static $convert = null;
69 | if($convert === null) {
70 | $convert = ((PHP_OS == 'WIN32' || PHP_OS == 'WINNT') && version_compare(PHP_VERSION, '7.1.0', '<'));
71 | }
72 | if($convert)
73 | return rtrim(mb_convert_encoding($path,"GBK","UTF-8"));
74 | else
75 | return rtrim($path);
76 | }
77 | function porgram_path($path){
78 | static $convert = null;
79 | if($convert === null) {
80 | $convert = ((PHP_OS == 'WIN32' || PHP_OS == 'WINNT') && version_compare(PHP_VERSION, '7.1.0', '<'));
81 | }
82 | if($convert) {
83 | return rtrim(mb_convert_encoding($path, "UTF-8", "GBK"));
84 | }else {
85 | return rtrim($path);
86 | }
87 | }
88 |
89 | /**
90 | * 输出错误信息
91 | * @param $error
92 | * @param $message
93 | * @param $file
94 | * @param $line
95 | */
96 | function php_error_log($error=null, $message=null, $file=null, $line=null){
97 | $type = NULL;
98 | switch($error){
99 | case E_COMPILE_ERROR:
100 | $type = "E_COMPILE_ERROR";
101 | break;
102 | case E_ERROR:
103 | $type = "E_ERROR";
104 | break;
105 | case E_WARNING:
106 | $type = "E_WARNING";
107 | break;
108 | case E_NOTICE:
109 | $type = "E_NOTICE";
110 | break;
111 | default:
112 | $type = "UNKNOWN";
113 | }
114 | echo @"\n
\n{$type}: {$message} in {$file} on line {$line}
\n";
115 | echo print_stack_trace();
116 | }
117 |
118 | function shutdown_error_log(){
119 | if ( ( $e = error_get_last() ) && $e['type'] == E_ERROR || $e['type'] == E_COMPILE_ERROR ) {
120 | call_user_func_array( 'php_error_log', $e );
121 | }
122 | }
--------------------------------------------------------------------------------
/LySystem/LyCore/library/CLibMail.php:
--------------------------------------------------------------------------------
1 |
6 | */
7 | class CLibMail{
8 | private $mailer;
9 | private $status;
10 | public function __construct(){
11 | require_once(CORE_PATH."library/phpmailer.php");
12 | require_once(CORE_PATH."library/smtp.php");
13 | $this->mailer = new PHPMailer();
14 | $this->status = false;
15 | }
16 | public function set_config($config){
17 | if(is_array($config)){
18 | foreach($config as $name => $value){
19 | if(isset($this->mailer->$name)){
20 | $this->mailer->$name = $value;
21 | }
22 | }
23 | }
24 | }
25 | public function set_from($add,$name=''){
26 | $this->mailer->SetFrom($add,$name);
27 | }
28 | public function AddAddress($add,$name=''){
29 | $this->mailer->AddAddress($add,$name);
30 | }
31 | public function get_mailer(){
32 | return $this->mailer;
33 | }
34 | public function set_method($arg){
35 | switch(strtolower($arg)){
36 | case 'smtp':
37 | $this->mailer->IsSMTP();
38 | break;
39 | case 'mail':
40 | $this->mailer->IsMail();
41 | break;
42 | case 'sendmail':
43 | $this->mailer->IsSendmail();
44 | break;
45 | case 'qmail':
46 | $this->mailer->IsQmail();
47 | break;
48 | }
49 | }
50 | public function body($content){
51 | $this->mailer->MsgHTML($content);
52 | }
53 | public function send(){
54 | try {
55 | if($this->mailer->send()){
56 | return true;
57 | }else{
58 | return false;
59 | }
60 | }catch (phpmailerException $e) {
61 | return $e->errorMessage();
62 | }catch (Exception $e) {
63 | return $e->getMessage();
64 | }
65 | }
66 | public function status(){
67 | return $this->status;
68 | }
69 | public function AddAttachment($file_list,$max_size=0){
70 |
71 | $size = 0;
72 | if(!is_array($file_list)){
73 | $file_list = array($file_list);
74 | }
75 | foreach($file_list as $v){
76 | if(!is_file($v) || !is_readable($v)){
77 | return false;
78 | }else{
79 | $s = filesize($v);
80 | if($s<0){
81 | return false;
82 | }else{
83 | $size += $s;
84 | if($max_size>0 && $size>$max_size){
85 | return false;
86 | }
87 | }
88 | }
89 | }
90 | foreach($file_list as $v){
91 | $this->mailer->AddAttachment($v);
92 | }
93 | return true;
94 | }
95 | }
96 | ?>
--------------------------------------------------------------------------------
/LySystem/LyCore/page/404.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
首先,请谨慎使用该程序,当你对其有任何怀疑,或觉得有任何不妥时,请立即停止使用,或许你的感觉是对的。
5 |作者博客:http://www.loveyu.org,这绝对是一个不错的反馈地址。
6 |程序主页:http://www.loveyu.net/LyFm
7 |免责:作者不对你所做的任何失误操作进行负责,不会要求搜集使用则的任何信息,但会对程序版本进行统计。
8 |Copyright (c) 2013 Loveyu
12 |Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
13 |The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
14 |THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
15 |参数:
133 |