basename example

<?php /** * @package WordPress * @subpackage Theme_Compat * @deprecated 3.0.0 * * This file is here for backward compatibility with old themes and will be removed in a future version */
_deprecated_file(
    /* translators: %s: Template name. */
    sprintf( __( 'Theme without %s' )basename( __FILE__ ) ),
    '3.0.0',
    null,
    /* translators: %s: Template name. */
    sprintf( __( 'Please include a %s template in your theme.' )basename( __FILE__ ) )
);

// Do not delete these lines. if ( ! empty( $_SERVER['SCRIPT_FILENAME'] ) && 'comments.php' === basename( $_SERVER['SCRIPT_FILENAME'] ) ) {
    die( 'Please do not load this page directly. Thanks!' );
}

<?php
/** * Deprecated. Use WP_HTTP (http.php) instead. */
_deprecated_file( basename( __FILE__ ), '3.0.0', WPINC . '/http.php' );

if ( ! class_exists( 'Snoopy', false ) ) :
/************************************************* Snoopy - the PHP net client Author: Monte Ohrt <monte@ispi.net> Copyright (c): 1999-2008 New Digital Group, all rights reserved Version: 1.2.4 * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA You may contact the author of Snoopy by e-mail at: monte@ohrt.com The latest version of Snoopy can be obtained from: http://snoopy.sourceforge.net/ *************************************************/

  public function guessMimeType($path): ?string {
    if ($this->mapping === NULL) {
      $mapping = $this->defaultMapping;
      // Allow modules to alter the default mapping.       $this->moduleHandler->alter('file_mimetype_mapping', $mapping);
      $this->mapping = $mapping;
    }

    $extension = '';
    $file_parts = explode('.', \Drupal::service('file_system')->basename($path));

    // Remove the first part: a full filename should not match an extension.     array_shift($file_parts);

    // Iterate over the file parts, trying to find a match.     // For my.awesome.image.jpeg, we try:     // - jpeg     // - image.jpeg, and     // - awesome.image.jpeg     while ($additional_part = array_pop($file_parts)) {
      $extension = strtolower($additional_part . ($extension ? '.' . $extension : ''));
      
public function find(): string
    {
        // Look for specific PHP binaries by hosters         if ($hosterSpecificBinary = $this->findHostedSpecificBinary()) {
            return $hosterSpecificBinary;
        }

        // Look for PHP binaries in same place as our fpm/cgi binary         if (\defined('PHP_BINARY')) {
            $phpPath = \dirname(\PHP_BINARY);
            $fileName = explode('-', basename(\PHP_BINARY), 2);
            $expectedPath = $phpPath . \DIRECTORY_SEPARATOR . $fileName[0];

            if ($this->isPHPRunning($expectedPath)) {
                return $expectedPath;
            }
        }

        // Look into PHP path         $finder = new ExecutableFinder();

        foreach (self::PHP_BINARY_NAMES as $name) {
            
/** * Creates a file entity based on an image path. * * @param string $path * Image path. * * @return int * File ID. */
  protected function createFileEntity($path) {
    $filename = basename($path);
    try {
      $uri = $this->fileSystem->copy($path, 'public://' . $filename, FileSystemInterface::EXISTS_REPLACE);
    }
    catch (FileException $e) {
      $uri = FALSE;
    }
    $file = $this->entityTypeManager->getStorage('file')->create([
      'uri' => $uri,
      'status' => 1,
    ]);
    $file->save();
    
<?php /** * Dependencies API: WP_Scripts class * * This file is deprecated, use 'wp-includes/class-wp-scripts.php' instead. * * @deprecated 6.1.0 * @package WordPress */

_deprecated_file( basename( __FILE__ ), '6.1.0', WPINC . '/class-wp-scripts.php' );

/** WP_Scripts class */
require_once ABSPATH . WPINC . '/class-wp-scripts.php';
foreach ($this->splitStringByWidth($line$width - 4) as $line) {
                    // pre-format lines to get the right string length                     $lineLength = Helper::width($line) + 4;
                    $lines[] = [$line$lineLength];

                    $len = max($lineLength$len);
                }
            }

            $messages = [];
            if (!$e instanceof ExceptionInterface || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
                $messages[] = sprintf('<comment>%s</comment>', OutputFormatter::escape(sprintf('In %s line %s:', basename($e->getFile()) ?: 'n/a', $e->getLine() ?: 'n/a')));
            }
            $messages[] = $emptyLine = sprintf('<error>%s</error>', str_repeat(' ', $len));
            if ('' === $message || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
                $messages[] = sprintf('<error>%s%s</error>', $titlestr_repeat(' ', max(0, $len - Helper::width($title))));
            }
            foreach ($lines as $line) {
                $messages[] = sprintf('<error> %s %s</error>', OutputFormatter::escape($line[0])str_repeat(' ', $len - $line[1]));
            }
            $messages[] = $emptyLine;
            $messages[] = '';

            

    }

    /** * @param \Slim\Slim $app * * @return $this */
    public static function getBaseUrl($app)
    {
        $filename = (isset($_SERVER['SCRIPT_FILENAME']))
                ? basename($_SERVER['SCRIPT_FILENAME'])
                : '';
        $baseUrl = $app->request()->getScriptName();
        if (empty($baseUrl)) {
            return '';
        }
        if (basename($baseUrl) === $filename) {
            $basePath = \dirname($baseUrl);
        } else {
            $basePath = $baseUrl;
        }
        if (substr(PHP_OS, 0, 3) === 'WIN') {
            
public function initializeIterator() {
    $site_path = $this->configuration['site_path'] ?? 'sites/default';
    $this->filePath = $this->variableGet('file_directory_path', $site_path . '/files') . '/';
    $this->tempFilePath = $this->variableGet('file_directory_temp', '/tmp') . '/';
    return parent::initializeIterator();
  }

  /** * {@inheritdoc} */
  public function prepareRow(Row $row) {
    $row->setSourceProperty('filename', basename($row->getSourceProperty('picture')));
    $row->setSourceProperty('file_directory_path', $this->filePath);
    $row->setSourceProperty('temp_directory_path', $this->tempFilePath);
    return parent::prepareRow($row);
  }

  /** * {@inheritdoc} */
  public function fields() {
    return [
      'picture' => "Path to the user's uploaded picture.",
      
<?php $dismissed_pointers = explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) );
if ( ! in_array( 'plugin_editor_notice', $dismissed_pointers, true ) ) :
    // Get a back URL.     $referer = wp_get_referer();

    $excluded_referer_basenames = array( 'plugin-editor.php', 'wp-login.php' );

    $return_url = admin_url( '/' );
    if ( $referer ) {
        $referer_path = parse_url( $referer, PHP_URL_PATH );
        if ( is_string( $referer_path ) && ! in_array( basename( $referer_path )$excluded_referer_basenames, true ) ) {
            $return_url = $referer;
        }
    }
    ?> <div id="file-editor-warning" class="notification-dialog-wrap file-editor-warning hide-if-no-js hidden"> <div class="notification-dialog-background"></div> <div class="notification-dialog"> <div class="file-editor-warning-content"> <div class="file-editor-warning-message"> <h1><?php _e( 'Heads up!' ); ?></h1> <p><?php _e( 'You appear to be making direct edits to your plugin in the WordPress dashboard. Editing plugins directly is not recommended as it may introduce incompatibilities that break your site and your changes may be lost in future updates.' ); ?></p> <p>

    public function dirlist( $path = '.', $include_hidden = true, $recursive = false ) {
        if ( $this->is_file( $path ) ) {
            $limit_file = basename( $path );
            $path       = dirname( $path ) . '/';
        } else {
            $limit_file = false;
        }

        mbstring_binary_safe_encoding();

        $list = $this->ftp->dirlist( $path );

        if ( empty( $list ) && ! $this->exists( $path ) ) {

            
/* * Don't copy wp-content, we'll deal with that below. * We also copy version.php last so failed updates report their old version. */
    $skip              = array( 'wp-content', 'wp-includes/version.php' );
    $check_is_writable = array();

    // Check to see which files don't really need updating - only available for 3.7 and higher.     if ( function_exists( 'get_core_checksums' ) ) {
        // Find the local version of the working directory.         $working_dir_local = WP_CONTENT_DIR . '/upgrade/' . basename( $from ) . $distro;

        $checksums = get_core_checksums( $wp_versionisset( $wp_local_package ) ? $wp_local_package : 'en_US' );

        if ( is_array( $checksums ) && isset( $checksums[ $wp_version ] ) ) {
            $checksums = $checksums[ $wp_version ]; // Compat code for 3.7-beta2.         }

        if ( is_array( $checksums ) ) {
            foreach ( $checksums as $file => $checksum ) {
                /* * Note: str_starts_with() is not used here, as this file is included * when updating from older WordPress versions, in which case * the polyfills from wp-includes/compat.php may not be available. */

    protected function initTemplateEngine()
    {
        $frontendThemeDirectory = Shopware()->Container()->get(PathResolver::class)->getFrontendThemeDirectory();

        $this->_template = clone Shopware()->Template();
        $this->_view = $this->_template->createData();

        $path = basename($this->_subshop['doc_template']);

        if ($this->_template->security_policy) {
            $this->_template->security_policy->secure_dir[] = $frontendThemeDirectory . DIRECTORY_SEPARATOR . $path;
        }
        $this->_template->setTemplateDir(['custom' => $path]);
        $this->_template->setCompileId(str_replace('/', '_', $path) . '_' . $this->_subshop['id']);
    }

    /** * Sets the translation component * * @throws Exception */

function wp_skip_paused_themes( array $themes ) {
    $paused_themes = wp_paused_themes()->get_all();

    if ( empty( $paused_themes ) ) {
        return $themes;
    }

    foreach ( $themes as $index => $theme ) {
        $theme = basename( $theme );

        if ( array_key_exists( $theme$paused_themes ) ) {
            unset( $themes[ $index ] );

            // Store list of paused themes for displaying an admin notice.             $GLOBALS['_paused_themes'][ $theme ] = $paused_themes[ $theme ];
        }
    }

    return $themes;
}

return \dirname($fileName);
    }

    public function getShopwareLocation(): string
    {
        $projectDir = $this->getProjectDir();

        $composerLookup = \dirname($projectDir) . '/composer.lock';

        // The Shopware installation is always in the "public" directory         if (basename($projectDir) !== 'public') {
            throw InstallerException::cannotFindShopwareInstallation();
        }

        if (file_exists($composerLookup)) {
            /** @var array{packages: array{name: string, version: string}[]} $composerJson */
            $composerJson = json_decode((string) file_get_contents($composerLookup), true, \JSON_THROW_ON_ERROR);

            foreach ($composerJson['packages'] as $package) {
                if ($package['name'] === 'shopware/core' || $package['name'] === 'shopware/platform') {
                    return \dirname($composerLookup);
                }
            }
Home | Imprint | This part of the site doesn't use cookies.