コード例 #1
0
 public static function getLoader()
 {
     if (null !== self::$loader) {
         return self::$loader;
     }
     spl_autoload_register(array('ComposerAutoloaderIniteb324ff5bf32417c5b870ad5a79be452', 'loadClassLoader'), true, true);
     self::$loader = $loader = new \Composer\Autoload\ClassLoader();
     spl_autoload_unregister(array('ComposerAutoloaderIniteb324ff5bf32417c5b870ad5a79be452', 'loadClassLoader'));
     $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
     if ($useStaticLoader) {
         require_once __DIR__ . '/autoload_static.php';
         call_user_func(\Composer\Autoload\ComposerStaticIniteb324ff5bf32417c5b870ad5a79be452::getInitializer($loader));
     } else {
         $map = (require __DIR__ . '/autoload_namespaces.php');
         foreach ($map as $namespace => $path) {
             $loader->set($namespace, $path);
         }
         $map = (require __DIR__ . '/autoload_psr4.php');
         foreach ($map as $namespace => $path) {
             $loader->setPsr4($namespace, $path);
         }
         $classMap = (require __DIR__ . '/autoload_classmap.php');
         if ($classMap) {
             $loader->addClassMap($classMap);
         }
     }
     $loader->register(true);
     return $loader;
 }
コード例 #2
0
 public static function getLoader()
 {
     if (null !== self::$loader) {
         return self::$loader;
     }
     spl_autoload_register(array('ComposerAutoloaderInitda8cc71177fbdecad4bed9a04ac54b4b', 'loadClassLoader'), true, true);
     self::$loader = $loader = new \Composer\Autoload\ClassLoader();
     spl_autoload_unregister(array('ComposerAutoloaderInitda8cc71177fbdecad4bed9a04ac54b4b', 'loadClassLoader'));
     $includePaths = (require __DIR__ . '/include_paths.php');
     array_push($includePaths, get_include_path());
     set_include_path(join(PATH_SEPARATOR, $includePaths));
     $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
     if ($useStaticLoader) {
         require_once __DIR__ . '/autoload_static.php';
         call_user_func(\Composer\Autoload\ComposerStaticInitda8cc71177fbdecad4bed9a04ac54b4b::getInitializer($loader));
     } else {
         $map = (require __DIR__ . '/autoload_namespaces.php');
         foreach ($map as $namespace => $path) {
             $loader->set($namespace, $path);
         }
         $map = (require __DIR__ . '/autoload_psr4.php');
         foreach ($map as $namespace => $path) {
             $loader->setPsr4($namespace, $path);
         }
         $classMap = (require __DIR__ . '/autoload_classmap.php');
         if ($classMap) {
             $loader->addClassMap($classMap);
         }
     }
     $loader->register(true);
     if ($useStaticLoader) {
         $includeFiles = Composer\Autoload\ComposerStaticInitda8cc71177fbdecad4bed9a04ac54b4b::$files;
     } else {
         $includeFiles = (require __DIR__ . '/autoload_files.php');
     }
     foreach ($includeFiles as $fileIdentifier => $file) {
         composerRequireda8cc71177fbdecad4bed9a04ac54b4b($fileIdentifier, $file);
     }
     return $loader;
 }
コード例 #3
0
ファイル: autoload_real.php プロジェクト: novavex/textpad
 public static function getLoader()
 {
     if (null !== self::$loader) {
         return self::$loader;
     }
     spl_autoload_register(array('ComposerAutoloaderInit62f8e4f60a347dcec7422e68cad4a3ab', 'loadClassLoader'), true, true);
     self::$loader = $loader = new \Composer\Autoload\ClassLoader();
     spl_autoload_unregister(array('ComposerAutoloaderInit62f8e4f60a347dcec7422e68cad4a3ab', 'loadClassLoader'));
     $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
     if ($useStaticLoader) {
         require_once __DIR__ . '/autoload_static.php';
         call_user_func(\Composer\Autoload\ComposerStaticInit62f8e4f60a347dcec7422e68cad4a3ab::getInitializer($loader));
     } else {
         $map = (require __DIR__ . '/autoload_namespaces.php');
         foreach ($map as $namespace => $path) {
             $loader->set($namespace, $path);
         }
         $map = (require __DIR__ . '/autoload_psr4.php');
         foreach ($map as $namespace => $path) {
             $loader->setPsr4($namespace, $path);
         }
         $classMap = (require __DIR__ . '/autoload_classmap.php');
         if ($classMap) {
             $loader->addClassMap($classMap);
         }
     }
     $loader->register(true);
     if ($useStaticLoader) {
         $includeFiles = Composer\Autoload\ComposerStaticInit62f8e4f60a347dcec7422e68cad4a3ab::$files;
     } else {
         $includeFiles = (require __DIR__ . '/autoload_files.php');
     }
     foreach ($includeFiles as $fileIdentifier => $file) {
         composerRequire62f8e4f60a347dcec7422e68cad4a3ab($fileIdentifier, $file);
     }
     return $loader;
 }
コード例 #4
0
ファイル: IndexController.php プロジェクト: hubs/yuncms
 /**
  * 进行特征代码过滤
  */
 public function public_file_code()
 {
     @set_time_limit(600);
     $file_list = S('scan/scan_list');
     $scan = S('scan/scan_config');
     $badfiles = S('scan/scan_bad_file');
     if (isset($scan['code']) && !empty($scan['code'])) {
         foreach ($file_list as $key => $val) {
             $html = File::read(BASE_PATH . $key);
             if (stristr($key, '.php.') != false || preg_match_all('/[^a-z]?(' . $scan['code'] . ')/i', $html, $state, PREG_SET_ORDER)) {
                 $badfiles[$key]['code'] = $state;
             }
             if (strtolower(substr($key, -4)) == '.php' && function_exists('zend_loader_file_encoded') && zend_loader_file_encoded(BASE_PATH . $key)) {
                 $badfiles[$key]['zend'] = 'zend encoded';
             }
         }
     }
     S('scan/scan_bad_file', $badfiles);
     showmessage(L('scan_completed'), U('scan/index/scan_report', array('menuid' => 237)));
 }
コード例 #5
0
ファイル: tools.ctrl.php プロジェクト: 7demo/we7
     message("特征函数过滤完成,进行特征代码过滤。。。", url('system/tools/scan', array('op' => 'filter_code')), 'success');
 }
 if ($op == 'filter_code') {
     @set_time_limit(0);
     $config = iunserializer(cache_read('scan:config'));
     $file = iunserializer(cache_read('scan:file'));
     $badfiles = iunserializer(cache_read('scan:badfile'));
     if (isset($config['code']) && !empty($config['code'])) {
         foreach ($file as $key => $val) {
             if (!empty($config['code'])) {
                 $html = file_get_contents(IA_ROOT . '/' . $key);
                 if (stristr($key, '.php.') != false || preg_match_all('/[^a-z]?(' . $config['code'] . ')/i', $html, $state, PREG_SET_ORDER)) {
                     $badfiles[$key]['code'] = $state;
                 }
             }
             if (strtolower(substr($key, -4)) == '.php' && function_exists('zend_loader_file_encoded') && zend_loader_file_encoded(IA_ROOT . '/' . $key)) {
                 $badfiles[$key]['zend'] = 'zend encoded';
             }
             $html = '';
         }
     }
     cache_write('scan:badfile', iserializer($badfiles));
     message("特征代码过滤完成,进行加密文件过滤。。。", url('system/tools/scan', array('op' => 'encode')), 'success');
 }
 if ($op == 'encode') {
     @set_time_limit(0);
     $file = iunserializer(cache_read('scan:file'));
     $badfiles = iunserializer(cache_read('scan:badfile'));
     foreach ($file as $key => $val) {
         if (strtolower(substr($key, -4)) == '.php') {
             $html = file_get_contents(IA_ROOT . '/' . $key);
コード例 #6
0
ファイル: index.php プロジェクト: panhongsheng/zl_cms
	public function public_file_code() {
		@set_time_limit(600);
		$file_list = getcache('scan_list', 'scan');
		$scan = getcache('scan_config', 'scan');
		$badfiles = getcache('scan_bad_file', 'scan');
		if (isset($scan['code']) && !empty($scan['code'])) {
			foreach ($file_list as $key=>$val) {
				$html = file_get_contents(ZLCMS_PATH.$key);
				if(stristr($key, '.php.') != false || preg_match_all('/[^a-z]?('.$scan['code'].')/i', $html, $state, PREG_SET_ORDER)) {
					$badfiles[$key]['code'] = $state;
	            }
	            if(strtolower(substr($key, -4)) == '.php' && function_exists('zend_loader_file_encoded') && zend_loader_file_encoded(ZLCMS_PATH.$key)) {
	            	$badfiles[$key]['zend'] = 'zend encoded';
	            }
			}
		}
		setcache('scan_bad_file', $badfiles, 'scan');
		showmessage(L('scan_completed'), '?m=scan&c=index&a=scan_report&menuid=1005');
	}
コード例 #7
0
ファイル: prepend.inc.php プロジェクト: rchicoria/epp-drs
	require_once (MODULES_PATH."/registries/class.RegistryResponse.php");
	require_once (MODULES_PATH."/registries/class.PendingOperationResponse.php");		
	require_once (SRC_PATH."/observers/interface.IInvoiceObserver.php");
	require_once (SRC_PATH."/observers/interface.IGlobalObserver.php");
	require_once (MODULES_PATH."/registries/interface.IRegistryModule.php");
	require_once (MODULES_PATH."/registries/interface.IRegistryTransport.php");
	require_once (MODULES_PATH."/registries/observers/interface.IRegistryObserver.php");
	


	
	/**
	/* A code specific to zencoded release
	 * Get license flags to check against them further during loading
	*/
	if (function_exists("zend_loader_file_licensed") && zend_loader_file_encoded())
	{
		// Get license flags
		$lic_flags = @zend_loader_file_licensed();
		if (!$lic_flags)
			throw new LicensingException("Cannot retrieve license flags. Make sure that you have correct license installed.");
		else
		{
			CONTEXTS::$SECURITY_CONTEXT = SECURITY_CONTEXT::ZENDED;
			EnumFactory::CookEnumFromArray("LICENSE_FLAGS", $lic_flags);
			unset($lic_flags);
		}
	}
	else
	{
		// Include development version (all enabled).
コード例 #8
0
ファイル: admin_safe.php プロジェクト: meiwenhui/hdwiki
 function doscancodes()
 {
     @set_time_limit(600);
     $file_list = $this->cache->getcache('safe_file');
     $badfiles = $this->cache->getcache('safe_backdoor');
     if ($this->safe['code']) {
         foreach ($file_list as $key => $val) {
             $html = file_get_contents($this->hdwiki_root . $key);
             if (stristr($key, '.php.') != false || preg_match_all('/[^a-z]?(' . $this->safe['code'] . ')/i', $html, $state, PREG_SET_ORDER)) {
                 $badfiles[$key]['code'] = $state;
             }
             if (strtolower(substr($key, -4)) == '.php' && function_exists('zend_loader_file_encoded') && zend_loader_file_encoded($this->hdwiki_root . $key)) {
                 $badfiles[$key]['zend'] = 'zend encoded';
             }
         }
     }
     if (!isset($badfiles)) {
         $badfiles = '';
     }
     $this->cache->writecache('safe_backdoor', $badfiles);
     echo 'ok';
 }
コード例 #9
0
ファイル: functions.lib.php プロジェクト: ADDAdev/Dolibarr
/**
 * Print common footer :
 * 		conf->global->MAIN_HTML_FOOTER
 * 		conf->global->MAIN_GOOGLE_AN_ID
 * 		DOL_TUNING
 * 		conf->logbuffer
 *
 * @param	string	$zone	'private' (for private pages) or 'public' (for public pages)
 * @return	void
 */
function printCommonFooter($zone = 'private')
{
    global $conf;
    global $micro_start_time;
    if ($zone == 'private') {
        print "\n" . '<!-- Common footer for private page -->' . "\n";
    } else {
        print "\n" . '<!-- Common footer for public page -->' . "\n";
    }
    if (!empty($conf->global->MAIN_HTML_FOOTER)) {
        print $conf->global->MAIN_HTML_FOOTER . "\n";
    }
    // Google Analytics (need Google module)
    if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AN_ID)) {
        if (empty($conf->dol_use_jmobile)) {
            print "\n";
            print '<script type="text/javascript">' . "\n";
            print '  var _gaq = _gaq || [];' . "\n";
            print '  _gaq.push([\'_setAccount\', \'' . $conf->global->MAIN_GOOGLE_AN_ID . '\']);' . "\n";
            print '  _gaq.push([\'_trackPageview\']);' . "\n";
            print '' . "\n";
            print '  (function() {' . "\n";
            print '    var ga = document.createElement(\'script\'); ga.type = \'text/javascript\'; ga.async = true;' . "\n";
            print '    ga.src = (\'https:\' == document.location.protocol ? \'https://ssl\' : \'http://www\') + \'.google-analytics.com/ga.js\';' . "\n";
            print '    var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(ga, s);' . "\n";
            print '  })();' . "\n";
            print '</script>' . "\n";
        }
    }
    // End of tuning
    if (!empty($_SERVER['DOL_TUNING']) || !empty($conf->global->MAIN_SHOW_TUNING_INFO)) {
        print "\n" . '<script type="text/javascript">' . "\n";
        print 'window.console && console.log("';
        if (!empty($conf->global->MEMCACHED_SERVER)) {
            print 'MEMCACHED_SERVER=' . $conf->global->MEMCACHED_SERVER . ' - ';
        }
        print 'MAIN_OPTIMIZE_SPEED=' . (isset($conf->global->MAIN_OPTIMIZE_SPEED) ? $conf->global->MAIN_OPTIMIZE_SPEED : 'off');
        if ($micro_start_time) {
            $micro_end_time = dol_microtime_float(true);
            print ' - Build time: ' . ceil(1000 * ($micro_end_time - $micro_start_time)) . ' ms';
        }
        if (function_exists("memory_get_usage")) {
            print ' - Mem: ' . memory_get_usage();
        }
        if (function_exists("xdebug_memory_usage")) {
            print ' - XDebug time: ' . ceil(1000 * xdebug_time_index()) . ' ms';
            print ' - XDebug mem: ' . xdebug_memory_usage();
            print ' - XDebug mem peak: ' . xdebug_peak_memory_usage();
        }
        if (function_exists("zend_loader_file_encoded")) {
            print ' - Zend encoded file: ' . (zend_loader_file_encoded() ? 'yes' : 'no');
        }
        print '");' . "\n";
        print '</script>' . "\n";
        // Add Xdebug coverage of code
        if (defined('XDEBUGCOVERAGE')) {
            var_dump(xdebug_get_code_coverage());
        }
    }
    // If there is some logs in buffer to show
    if (count($conf->logbuffer)) {
        print "\n";
        print "<!-- Start of log output\n";
        //print '<div class="hidden">'."\n";
        foreach ($conf->logbuffer as $logline) {
            print $logline . "<br>\n";
        }
        //print '</div>'."\n";
        print "End of log output -->\n";
    }
}
コード例 #10
0
ファイル: main.inc.php プロジェクト: netors/dolibarr
 function llxFooter($foot = '')
 {
     global $conf, $langs, $dolibarr_auto_user, $micro_start_time;
     // Core error message
     if (defined("MAIN_CORE_ERROR") && constant("MAIN_CORE_ERROR") == 1) {
         // Ajax version
         if ($conf->use_javascript_ajax) {
             $title = img_warning() . ' ' . $langs->trans('CoreErrorTitle');
             print ajax_dialog($title, $langs->trans('CoreErrorMessage'));
         } else {
             $msg = img_warning() . ' ' . $langs->trans('CoreErrorMessage');
             print '<div class="error">' . $msg . '</div>';
         }
         define("MAIN_CORE_ERROR", 0);
     }
     print "\n\n";
     if (preg_match('/^smartphone/', $conf->smart_menu) && isset($conf->browser->phone)) {
         print '</div> <!-- end div data-role="content" -->' . "\n";
         print '</div> <!-- end div data-role="page" -->' . "\n";
     }
     print '</div> <!-- end div class="fiche" -->' . "\n";
     print "\n" . '</td></tr></table> <!-- end right area -->' . "\n";
     if ($conf->use_javascript_ajax && !empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) {
         print '</div></div> <!-- end main layout -->' . "\n";
     }
     print "\n";
     if ($foot) {
         print '<!-- ' . $foot . ' -->' . "\n";
     }
     if (!empty($conf->global->MAIN_HTML_FOOTER)) {
         print $conf->global->MAIN_HTML_FOOTER . "\n";
     }
     // If there is some logs in buffer to show
     if (sizeof($conf->logbuffer)) {
         print "\n";
         print "<!-- Start of log output\n";
         //print '<div class="hidden">'."\n";
         foreach ($conf->logbuffer as $logline) {
             print $logline . "<br>\n";
         }
         //print '</div>'."\n";
         print "End of log output -->\n";
     }
     // End of tuning
     if (!empty($_SERVER['DOL_TUNING'])) {
         $micro_end_time = dol_microtime_float(true);
         print "\n" . '<script type="text/javascript">console.log("';
         if (!empty($conf->global->MEMCACHED_SERVER)) {
             print 'MEMCACHED_SERVER=' . $conf->global->MEMCACHED_SERVER . ' - ';
         }
         print 'MAIN_OPTIMIZE_SPEED=' . (isset($conf->global->MAIN_OPTIMIZE_SPEED) ? $conf->global->MAIN_OPTIMIZE_SPEED : 'off');
         print ' - Build time: ' . ceil(1000 * ($micro_end_time - $micro_start_time)) . ' ms';
         if (function_exists("memory_get_usage")) {
             print ' - Mem: ' . memory_get_usage();
         }
         if (function_exists("xdebug_memory_usage")) {
             print ' - XDebug time: ' . ceil(1000 * xdebug_time_index()) . ' ms';
             print ' - XDebug mem: ' . xdebug_memory_usage();
             print ' - XDebug mem peak: ' . xdebug_peak_memory_usage();
         }
         if (function_exists("zend_loader_file_encoded")) {
             print ' - Zend encoded file: ' . (zend_loader_file_encoded() ? 'yes' : 'no');
         }
         print '")</script>' . "\n";
         // Add Xdebug coverage of code
         if (defined('XDEBUGCOVERAGE')) {
             var_dump(xdebug_get_code_coverage());
         }
     }
     print "</body>\n";
     print "</html>\n";
 }
コード例 #11
0
/**
 * Print common footer :
 * 		conf->global->MAIN_HTML_FOOTER
 * 		conf->global->MAIN_GOOGLE_AN_ID
 * 		conf->global->MAIN_SHOW_TUNING_INFO or $_SERVER["MAIN_SHOW_TUNING_INFO"]
 * 		conf->logbuffer
 *
 * @param	string	$zone	'private' (for private pages) or 'public' (for public pages)
 * @return	void
 */
function printCommonFooter($zone = 'private')
{
    global $conf, $hookmanager;
    global $micro_start_time;
    if ($zone == 'private') {
        print "\n" . '<!-- Common footer for private page -->' . "\n";
    } else {
        print "\n" . '<!-- Common footer for public page -->' . "\n";
    }
    if (!empty($conf->global->MAIN_HTML_FOOTER)) {
        print $conf->global->MAIN_HTML_FOOTER . "\n";
    }
    print "\n";
    if (!empty($conf->use_javascript_ajax)) {
        print '<script type="text/javascript" language="javascript">jQuery(document).ready(function() {' . "\n";
        print '<!-- If page_y set, we set scollbar with it -->' . "\n";
        print "page_y=getParameterByName('page_y', 0);";
        print "if (page_y > 0) \$('html, body').scrollTop(page_y);";
        print '<!-- Set handler to add page_y param on some a href links -->' . "\n";
        print 'jQuery(".reposition").click(function() {
    	           var page_y = $(document).scrollTop();
    	           /* alert(page_y); */
    	           this.href=this.href+\'&page_y=\'+page_y;
    	           });' . "\n";
        print '});' . "\n";
        print '</script>' . "\n";
    }
    // Google Analytics (need Google module)
    if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AN_ID)) {
        if (empty($conf->dol_use_jmobile)) {
            print "\n";
            print '<script type="text/javascript">' . "\n";
            print '  var _gaq = _gaq || [];' . "\n";
            print '  _gaq.push([\'_setAccount\', \'' . $conf->global->MAIN_GOOGLE_AN_ID . '\']);' . "\n";
            print '  _gaq.push([\'_trackPageview\']);' . "\n";
            print '' . "\n";
            print '  (function() {' . "\n";
            print '    var ga = document.createElement(\'script\'); ga.type = \'text/javascript\'; ga.async = true;' . "\n";
            print '    ga.src = (\'https:\' == document.location.protocol ? \'https://ssl\' : \'http://www\') + \'.google-analytics.com/ga.js\';' . "\n";
            print '    var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(ga, s);' . "\n";
            print '  })();' . "\n";
            print '</script>' . "\n";
        }
    }
    // End of tuning
    if (!empty($_SERVER['MAIN_SHOW_TUNING_INFO']) || !empty($conf->global->MAIN_SHOW_TUNING_INFO)) {
        print "\n" . '<script type="text/javascript">' . "\n";
        print 'window.console && console.log("';
        if (!empty($conf->global->MEMCACHED_SERVER)) {
            print 'MEMCACHED_SERVER=' . $conf->global->MEMCACHED_SERVER . ' - ';
        }
        print 'MAIN_OPTIMIZE_SPEED=' . (isset($conf->global->MAIN_OPTIMIZE_SPEED) ? $conf->global->MAIN_OPTIMIZE_SPEED : 'off');
        if ($micro_start_time) {
            $micro_end_time = microtime(true);
            print ' - Build time: ' . ceil(1000 * ($micro_end_time - $micro_start_time)) . ' ms';
        }
        if (function_exists("memory_get_usage")) {
            print ' - Mem: ' . memory_get_usage();
        }
        if (function_exists("xdebug_memory_usage")) {
            print ' - XDebug time: ' . ceil(1000 * xdebug_time_index()) . ' ms';
            print ' - XDebug mem: ' . xdebug_memory_usage();
            print ' - XDebug mem peak: ' . xdebug_peak_memory_usage();
        }
        if (function_exists("zend_loader_file_encoded")) {
            print ' - Zend encoded file: ' . (zend_loader_file_encoded() ? 'yes' : 'no');
        }
        print '");' . "\n";
        print '</script>' . "\n";
        // Add Xdebug coverage of code
        if (defined('XDEBUGCOVERAGE')) {
            print_r(xdebug_get_code_coverage());
        }
    }
    // If there is some logs in buffer to show
    if (count($conf->logbuffer)) {
        print "\n";
        print "<!-- Start of log output\n";
        //print '<div class="hidden">'."\n";
        foreach ($conf->logbuffer as $logline) {
            print $logline . "<br>\n";
        }
        //print '</div>'."\n";
        print "End of log output -->\n";
    }
    $parameters = array();
    $reshook = $hookmanager->executeHooks('printCommonFooter', $parameters);
    // Note that $action and $object may have been modified by some hooks
}