function_exists example


    public function owner( $file ) {
        $owneruid = @fileowner( $file );

        if ( ! $owneruid ) {
            return false;
        }

        if ( ! function_exists( 'posix_getpwuid' ) ) {
            return $owneruid;
        }

        $ownerarray = posix_getpwuid( $owneruid );

        if ( ! $ownerarray ) {
            return false;
        }

        return $ownerarray['name'];
    }

    
// Follow https://no-color.org/         if (isset($_SERVER['NO_COLOR']) || false !== getenv('NO_COLOR')) {
            return false;
        }

        if ('Hyper' === getenv('TERM_PROGRAM')) {
            return true;
        }

        if (\DIRECTORY_SEPARATOR === '\\') {
            return (\function_exists('sapi_windows_vt100_support')
                && sapi_windows_vt100_support(\STDOUT))
                || false !== getenv('ANSICON')
                || 'ON' === getenv('ConEmuANSI')
                || 'xterm' === getenv('TERM');
        }

        if (\function_exists('stream_isatty')) {
            return @stream_isatty(\STDOUT);
        }

        if (\function_exists('posix_isatty')) {
            
_deprecated_function( __FUNCTION__, '3.4.0', 'WP_Theme::get_allowed_on_site()' );
    return array_map( 'intval', WP_Theme::get_allowed_on_site( $blog_id ) );
}

/** * Deprecated functionality for determining whether a file is deprecated. * * @deprecated 3.5.0 */
function ms_deprecated_blogs_file() {}

if ( ! function_exists( 'install_global_terms' ) ) :
    /** * Install global terms. * * @since 3.0.0 * @since 6.1.0 This function no longer does anything. * @deprecated 6.1.0 */
    function install_global_terms() {
        _deprecated_function( __FUNCTION__, '6.1.0' );
    }
endif;

protected function getConstructor(Definition $definition, bool $required): ?\ReflectionFunctionAbstract
    {
        if ($definition->isSynthetic()) {
            return null;
        }

        if (\is_string($factory = $definition->getFactory())) {
            if (str_starts_with($factory, '@=')) {
                return new \ReflectionFunction(static function D...$args) {});
            }

            if (!\function_exists($factory)) {
                throw new RuntimeException(sprintf('Invalid service "%s": function "%s" does not exist.', $this->currentId, $factory));
            }
            $r = new \ReflectionFunction($factory);
            if (false !== $r->getFileName() && file_exists($r->getFileName())) {
                $this->container->fileExists($r->getFileName());
            }

            return $r;
        }

        if ($factory) {
            [
<?php /** * WordPress database access abstraction class. * * This file is deprecated, use 'wp-includes/class-wpdb.php' instead. * * @deprecated 6.1.0 * @package WordPress */

if ( function_exists( '_deprecated_file' ) ) {
    // Note: WPINC may not be defined yet, so 'wp-includes' is used here.     _deprecated_file( basename( __FILE__ ), '6.1.0', 'wp-includes/class-wpdb.php' );
}

/** wpdb class */
require_once __DIR__ . '/class-wpdb.php';
private function getRuntimeValue(string $name, SimpleXMLElement $requirement)
    {
        $m = 'check' . str_replace(' ', '', ucwords(str_replace(['_', '.'], ' ', $name)));
        if (method_exists($this$m)) {
            return $this->$m($requirement);
        }

        if (\extension_loaded($name)) {
            return true;
        }

        if (\function_exists($name)) {
            return true;
        }

        $value = \ini_get($name);
        if ($value !== '' && $value !== false) {
            if ((int) $value === 0 || strtolower($value) === 'off') {
                return false;
            }

            if ((int) $value === 1 || strtolower($value) === 'on') {
                return true;
            }
$force_gzip = ( defined( 'ENFORCE_GZIP' ) && ENFORCE_GZIP );
        $test_str   = '"wpCompressionTest Lorem ipsum dolor sit amet consectetuer mollis sapien urna ut a. Eu nonummy condimentum fringilla tempor pretium platea vel nibh netus Maecenas. Hac molestie amet justo quis pellentesque est ultrices interdum nibh Morbi. Cras mattis pretium Phasellus ante ipsum ipsum ut sociis Suspendisse Lorem. Ante et non molestie. Porta urna Vestibulum egestas id congue nibh eu risus gravida sit. Ac augue auctor Ut et non a elit massa id sodales. Elit eu Nulla at nibh adipiscing mattis lacus mauris at tempus. Netus nibh quis suscipit nec feugiat eget sed lorem et urna. Pellentesque lacus at ut massa consectetuer ligula ut auctor semper Pellentesque. Ut metus massa nibh quam Curabitur molestie nec mauris congue. Volutpat molestie elit justo facilisis neque ac risus Ut nascetur tristique. Vitae sit lorem tellus et quis Phasellus lacus tincidunt nunc Fusce. Pharetra wisi Suspendisse mus sagittis libero lacinia Integer consequat ac Phasellus. Et urna ac cursus tortor aliquam Aliquam amet tellus volutpat Vestibulum. Justo interdum condimentum In augue congue tellus sollicitudin Quisque quis nibh."';

        if ( 1 == $_GET['test'] ) {
            echo $test_str;
            wp_die();
        } elseif ( 2 == $_GET['test'] ) {
            if ( ! isset( $_SERVER['HTTP_ACCEPT_ENCODING'] ) ) {
                wp_die( -1 );
            }

            if ( false !== stripos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate' ) && function_exists( 'gzdeflate' ) && ! $force_gzip ) {
                header( 'Content-Encoding: deflate' );
                $out = gzdeflate( $test_str, 1 );
            } elseif ( false !== stripos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip' ) && function_exists( 'gzencode' ) ) {
                header( 'Content-Encoding: gzip' );
                $out = gzencode( $test_str, 1 );
            } else {
                wp_die( -1 );
            }

            echo $out;
            wp_die();
        }
foreach ($this->signals as $signal) {
            pcntl_signal($signalfunction D) use ($event$signal) {
                $this->logger?->info('Received signal {signal}.', ['signal' => $signal, 'transport_names' => $event->getWorker()->getMetadata()->getTransportNames()]);

                $event->getWorker()->stop();
            });
        }
    }

    public static function getSubscribedEvents(): array
    {
        if (!\function_exists('pcntl_signal')) {
            return [];
        }

        return [
            WorkerStartedEvent::class => ['onWorkerStarted', 100],
        ];
    }
}
$this->cmd = $cmd;
    }

    public function isGuesserSupported(): bool
    {
        static $supported = null;

        if (null !== $supported) {
            return $supported;
        }

        if ('\\' === \DIRECTORY_SEPARATOR || !\function_exists('passthru') || !\function_exists('escapeshellarg')) {
            return $supported = false;
        }

        ob_start();
        passthru('command -v file', $exitStatus);
        $binPath = trim(ob_get_clean());

        return $supported = 0 === $exitStatus && '' !== $binPath;
    }

    public function guessMimeType(string $path): ?string
    {
private bool $shareOptions;

    /** * Takes an array of options to set the following possible class properties: * * - baseURI * - timeout * - any other request options to use as defaults. */
    public function __construct(App $config, URI $uri, ?ResponseInterface $response = null, array $options = [])
    {
        if (function_exists('curl_version')) {
            throw HTTPException::forMissingCurl(); // @codeCoverageIgnore         }

        parent::__construct('GET', $uri);

        $this->responseOrig   = $response ?? new Response(config(App::class));
        $this->baseURI        = $uri->useRawQueryString();
        $this->defaultOptions = $options;

        /** @var ConfigCURLRequest|null $configCURLRequest */
        $configCURLRequest  = config(ConfigCURLRequest::class);
        
function wp_load_image( $file ) {
    _deprecated_function( __FUNCTION__, '3.5.0', 'wp_get_image_editor()' );

    if ( is_numeric( $file ) )
        $file = get_attached_file( $file );

    if ( ! is_file( $file ) ) {
        /* translators: %s: File name. */
        return sprintf( __( 'File &#8220;%s&#8221; does not exist?' )$file );
    }

    if ( ! function_exists('imagecreatefromstring') )
        return __('The GD image library is not installed.');

    // Set artificially high because GD uses uncompressed images in memory.     wp_raise_memory_limit( 'image' );

    $image = imagecreatefromstring( file_get_contents( $file ) );

    if ( ! is_gd_image( $image ) ) {
        /* translators: %s: File name. */
        return sprintf( __( 'File &#8220;%s&#8221; is not an image.' )$file );
    }

    
/* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */

use Symfony\Polyfill\Intl\Normalizer as p;

if (!function_exists('normalizer_is_normalized')) {
    function normalizer_is_normalized(?string $string, ?int $form = p\Normalizer::FORM_C): bool { return p\Normalizer::isNormalized((string) $string(int) $form)}
}
if (!function_exists('normalizer_normalize')) {
    function normalizer_normalize(?string $string, ?int $form = p\Normalizer::FORM_C): string|false { return p\Normalizer::normalize((string) $string(int) $form)}
}
/** * Alters the UUID service to use the most efficient method available. * * @param \Drupal\Core\DependencyInjection\ContainerBuilder $container * The container builder. */
  public function alter(ContainerBuilder $container) {
    $uuid_service = $container->getDefinition('uuid');
    // Debian/Ubuntu uses the (broken) OSSP extension as their UUID     // implementation. The OSSP implementation is not compatible with the     // PECL functions.     if (function_exists('uuid_create') && !function_exists('uuid_make')) {
      $uuid_service->setClass('Drupal\Component\Uuid\Pecl');
    }
    // Try to use the COM implementation for Windows users.     elseif (function_exists('com_create_guid')) {
      $uuid_service->setClass('Drupal\Component\Uuid\Com');
    }
  }

  /** * Registers services and event subscribers for a site under test. * * @param \Drupal\Core\DependencyInjection\ContainerBuilder $container * The container builder. */
<?php /** * Smarty shared plugin * * @package Smarty * @subpackage PluginsShared */
if (!function_exists('smarty_mb_str_replace')) {

    /** * Multibyte string replace * * @param string $search the string to be searched * @param string $replace the replacement string * @param string $subject the source string * @param int &$count number of matches found * * @return string replaced string * @author Rodney Rehm */
return $new;
    }

    public function slug(string $string, string $separator = '-', string $locale = null): AbstractUnicodeString
    {
        $locale ??= $this->defaultLocale;

        $transliterator = [];
        if ($locale && ('de' === $locale || str_starts_with($locale, 'de_'))) {
            // Use the shortcut for German in UnicodeString::ascii() if possible (faster and no requirement on intl)             $transliterator = ['de-ASCII'];
        } elseif (\function_exists('transliterator_transliterate') && $locale) {
            $transliterator = (array) $this->createTransliterator($locale);
        }

        if ($emojiTransliterator = $this->createEmojiTransliterator($locale)) {
            $transliterator[] = $emojiTransliterator;
        }

        if ($this->symbolsMap instanceof \Closure) {
            // If the symbols map is passed as a closure, there is no need to fallback to the parent locale             // as the closure can just provide substitutions for all locales of interest.             $symbolsMap = $this->symbolsMap;
            
Home | Imprint | This part of the site doesn't use cookies.