コード例 #1
0
 /**
  * Class constructor
  *
  * @since 1.0.0
  * @internal
  */
 public function __construct()
 {
     parent::__construct();
     self::$core = $this;
     // A List of all components.
     $components = array('array', 'debug', 'html', 'net', 'session', 'updates', 'ui');
     // Create instances of each component.
     foreach ($components as $component) {
         if (!property_exists($this, $component)) {
             continue;
         }
         $class_name = 'TheLib_' . ucfirst($component);
         $this->{$component} = new $class_name();
     }
 }
コード例 #2
0
 /**
  * Class constructor
  *
  * @since 1.0.0
  * @internal
  */
 public function __construct()
 {
     parent::__construct();
     // Check for persistent data from last request that needs to be processed.
     $this->add_action('plugins_loaded', '_check_admin_notices');
 }
コード例 #3
0
 /**
  * Class constructor
  *
  * @since 1.1.0
  */
 public function __construct()
 {
     parent::__construct();
 }
コード例 #4
0
 /**
  * Session storage
  *
  * @since  1.1.0
  * @internal
  */
 private static function _sess_init()
 {
     if (null !== self::$_have_session) {
         return;
     }
     self::$_have_session = false;
     if (!session_id()) {
         if (!headers_sent()) {
             /**
              * Fix for IE: This is a privacy policy which states, that we do
              * not collect personal contact information without consent.
              * Without this declaraion IE might not save our session!
              *
              * Note that other plugins that output this header later will
              * overwrite it! So this is a default value if no other file
              * sends the P3P header.
              *
              * @since  3.0.0
              */
             if (WDEV_SEND_P3P) {
                 $p3p_done = false;
                 foreach (headers_list() as $header) {
                     if (false !== stripos($header, 'P3P:')) {
                         $p3p_done = true;
                         break;
                     }
                 }
                 if (!$p3p_done) {
                     header('P3P:' . WDEV_SEND_P3P);
                 }
             }
             session_start();
             self::$_have_session = true;
         }
     } else {
         self::$_have_session = true;
     }
 }