Exemple #1
0
 /**
  * Removes data/procedures associated with this class.
  *
  * @param boolean $confirmation Defaults to FALSE. Set this to TRUE as a confirmation.
  *    If this is FALSE, nothing will happen; and this method returns FALSE.
  *
  * @return boolean TRUE if successfully uninstalled.
  *
  * @see deps_x_xd_v141226_dev::___uninstall___()
  *
  * @throws exception If invalid types are passed through arguments list.
  */
 public static function ___uninstall___($confirmation = FALSE)
 {
     if (!is_bool($confirmation)) {
         throw new exception(sprintf(xd_v141226_dev::__('Invalid arguments: `%1$s`'), print_r(func_get_args(), TRUE)));
     }
     if (!$confirmation) {
         return FALSE;
     }
     // Added security.
     delete_option('xd__deps__last_ok');
     delete_option('xd__deps__notice__dismissals');
     if (!class_exists('deps_x_xd_v141226_dev')) {
         require_once dirname(__FILE__) . '/deps-x.php';
     }
     $x = new deps_x_xd_v141226_dev();
     return $x->___uninstall___(TRUE);
 }
 /**
  * Static initializer; this runs ONE time only.
  *
  * @return boolean Returns the `$initialized` property w/ a TRUE value.
  *
  * @throws exception If attempting to run this from a root directory.
  */
 public static function initialize()
 {
     if (self::$initialized) {
         return TRUE;
     }
     // Initialized already.
     /*
      * Handle some dynamic regex replacement codes in class properties (as follows).
      */
     $webshark_home_dir = !empty($_SERVER['WEBSHARK_HOME']) ? (string) $_SERVER['WEBSHARK_HOME'] : '/webshark/home';
     self::$local_wp_dev_dir = str_replace('%%$_SERVER[WEBSHARK_HOME]%%', $webshark_home_dir, self::$local_wp_dev_dir);
     /*
      * Easier access for those who DON'T CARE about the version (PHP v5.3+ only).
      */
     if (!$GLOBALS[__FILE__]['is_in_stand_alone_mode'] && !class_exists('xd__deps_x') && function_exists('class_alias')) {
         class_alias('deps_x_xd_v141226_dev', 'xd__deps_x');
     }
     if ($GLOBALS[__FILE__]['is_in_stand_alone_mode'] && !class_exists('xd__deps_x_stand_alone') && function_exists('class_alias')) {
         class_alias('deps_x_stand_alone_xd_v141226_dev', 'xd__deps_x_stand_alone');
     }
     return self::$initialized = TRUE;
 }