set_time_limit example

private $pluginManager;

    public function preDispatch()
    {
        parent::preDispatch();

        $this->pluginManager = $this->get(\Shopware\Bundle\PluginInstallerBundle\Service\InstallerService::class);
    }

    public function installPluginAction()
    {
        @set_time_limit(300);

        $plugin = $this->getPluginModel($this->Request()->getParam('technicalName'));

        if (!$plugin instanceof Plugin) {
            $this->pluginManager->refreshPluginList();
            $plugin = $this->getPluginModel($this->Request()->getParam('technicalName'));
        }

        if (!$plugin instanceof Plugin) {
            $this->View()->assign([
                'success' => false,
                
$last = !empty($result['last']) ? unserialize($result['last']['allowed_classes' => false]) : null;

        if (empty($last) || empty($result['not_force']) || strtotime($last) < strtotime($result['current']) - $interval) {
            $this->build();
        }
    }

    public function build()
    {
        MemoryLimit::setMinimumMemoryLimit(1024 * 1024 * 512);
        @set_time_limit(0);

        $this->setNextUpdateTimestamp();

        // Truncate search index table (using DELETE to avoid committing database transactions in tests)         $this->connection->executeStatement('DELETE FROM `s_search_index`');

        // Get a list of all tables and columns in this tables that should be processed by search         /** * Example return: * tableID | table | where | reference_table | fieldIDs | fields | foreign_key * 1 | s_articles | NULL | NULL | 3,4 | name, keywords | NULL * 2 | s_categories | NULL | s_articles_categories | 1,2 | metakeywords, description | categoryID */

function update_core( $from$to ) {
    global $wp_filesystem$_old_files$_old_requests_files$_new_bundled_files$wpdb;

    if ( function_exists( 'set_time_limit' ) ) {
        set_time_limit( 300 );
    }

    /* * Merge the old Requests files and directories into the `$_old_files`. * Then preload these Requests files first, before the files are deleted * and replaced to ensure the code is in memory if needed. */
    $_old_files = array_merge( $_old_filesarray_values( $_old_requests_files ) );
    _preload_old_requests_classes_and_interfaces( $to );

    /** * Filters feedback messages displayed during the core update process. * * The filter is first evaluated after the zip file for the latest version * has been downloaded and unzipped. It is evaluated five more times during * the process: * * 1. Before WordPress begins the core upgrade process. * 2. Before Maintenance Mode is enabled. * 3. Before WordPress begins copying over the necessary files. * 4. Before Maintenance Mode is disabled. * 5. Before the database is upgraded. * * @since 2.5.0 * * @param string $feedback The core update feedback messages. */
if (!$media) {
            echo self::FILE_NOT_FOUND_MESSAGE;

            return;
        }

        $file = $media['path'];
        $tmpFileName = sprintf('%s.%s', $media['name']$media['extension']);
        $mediaService = $this->get(MediaServiceInterface::class);

        @set_time_limit(0);
        $response = $this->Response();
        $response->headers->set('cache-control', 'public', true);
        $response->headers->set('content-description', 'File Transfer');
        $response->headers->set('content-disposition', 'attachment; filename=' . $tmpFileName);
        $response->headers->set('content-transfer-encoding', 'binary');
        $response->headers->set('content-length', (string) $mediaService->getSize($file));
        echo $mediaService->read($file);
    }

    /** * The getAlbumMediaAction returns the associated media for the passed album id. * Is used for the listing of the media. * The media listing supports a filter, paging and order function, which can be controlled * by the parameters: "filter", "order", "limit", "start" * * @return void */
'hook_extra'                  => array(),
        );

        $args = wp_parse_args( $args$defaults );

        // These were previously extract()'d.         $source            = $args['source'];
        $destination       = $args['destination'];
        $clear_destination = $args['clear_destination'];

        if ( function_exists( 'set_time_limit' ) ) {
            set_time_limit( 300 );
        }

        if ( empty( $source ) || empty( $destination ) ) {
            return new WP_Error( 'bad_request', $this->strings['bad_request'] );
        }
        $this->skin->feedback( 'installing_package' );

        /** * Filters the installation response before the installation has started. * * Returning a value that could be evaluated as a `WP_Error` will effectively * short-circuit the installation, returning that value instead. * * @since 2.8.0 * * @param bool|WP_Error $response Installation response. * @param array $hook_extra Extra arguments passed to hooked filters. */
<?php declare(strict_types=1);

use Shopware\Core\Kernel;
use Symfony\Component\Dotenv\Dotenv;

set_time_limit(0);

require __DIR__ . '/../../../../vendor/autoload.php';

if (!class_exists(Dotenv::class)) {
    throw new \RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add "symfony/dotenv" as a Composer dependency to load variables from a .env file.');
}

$projectRoot = dirname(__DIR__, 4);
if (class_exists(Dotenv::class) && (file_exists($projectRoot . '/.env.local.php') || file_exists($projectRoot . '/.env') || file_exists($projectRoot . '/.env.dist'))) {
    (new Dotenv())->usePutenv()->bootEnv($projectRoot . '/.env');
}

if ($filesystem->has($path) === false) {
            $this->Front()->Plugins()->Json()->setRenderer();
            $this->View()->assign(['message' => 'File not found', 'success' => false]);

            return;
        }

        $meta = $filesystem->getMetadata($path);
        $mimeType = $filesystem->getMimetype($path) ?: 'application/octet-stream';

        @set_time_limit(0);

        $this->Front()->Plugins()->ViewRenderer()->setNoRender();

        $response = $this->Response();
        $response->headers->set('content-type', $mimeType);
        $response->headers->set('content-disposition', sprintf('attachment; filename="%s"', basename($path)));
        $response->headers->set('content-length', $meta['size']);
        $response->headers->set('content-transfer-encoding', 'binary');
        $response->sendHeaders();
        $response->sendResponse();

        


class Shopware_Controllers_Backend_SearchIndex extends Shopware_Controllers_Backend_ExtJs
{
    /** * This controller action is used to build the search index. */
    public function buildAction()
    {
        @set_time_limit(1200);

        $indexer = $this->get(\Shopware\Bundle\SearchBundleDBAL\SearchTerm\SearchIndexer::class);
        $indexer->build();

        $this->View()->assign(['success' => true]);
    }
}

    do_action_ref_array( 'pre_ping', array( &$post_links, &$pung$post->ID ) );

    foreach ( (array) $post_links as $pagelinkedto ) {
        $pingback_server_url = discover_pingback_server_uri( $pagelinkedto );

        if ( $pingback_server_url ) {
            if ( function_exists( 'set_time_limit' ) ) {
                set_time_limit( 60 );
            }

            // Now, the RPC call.             $pagelinkedfrom = get_permalink( $post );

            // Using a timeout of 3 seconds should be enough to cover slow servers.             $client          = new WP_HTTP_IXR_Client( $pingback_server_url );
            $client->timeout = 3;
            /** * Filters the user agent sent when pinging-back a URL. * * @since 2.9.0 * * @param string $concat_useragent The user agent concatenated with ' -- WordPress/' * and the WordPress version. * @param string $useragent The useragent. * @param string $pingback_server_url The server URL being linked to. * @param string $pagelinkedto URL of page linked to. * @param string $pagelinkedfrom URL of page linked from. */

function wp_get_http( $url$file_path = false, $red = 1 ) {
    _deprecated_function( __FUNCTION__, '4.4.0', 'WP_Http' );

    if ( function_exists( 'set_time_limit' ) ) {
        @set_time_limit( 60 );
    }

    if ( $red > 5 )
        return false;

    $options = array();
    $options['redirection'] = 5;

    if ( false == $file_path )
        $options['method'] = 'HEAD';
    else
        


            return false;
        }

        //SMTP server can take longer to respond, give longer timeout for first read         //Windows does not have support for this timeout function         if (strpos(PHP_OS, 'WIN') !== 0) {
            $max = (int)ini_get('max_execution_time');
            //Don't bother if unlimited, or if set_time_limit is disabled             if (0 !== $max && $timeout > $max && strpos(ini_get('disable_functions'), 'set_time_limit') === false) {
                @set_time_limit($timeout);
            }
            stream_set_timeout($connection$timeout, 0);
        }

        return $connection;
    }

    /** * Initiate a TLS (encrypted) session. * * @return bool */
$this->Response()
                ->clearHeaders()
                ->setStatusCode(Response::HTTP_FORBIDDEN)
                ->appendBody('Forbidden');

            return;
        }

        /** @var Enlight_Components_Cron_Manager $cronManager */
        $cronManager = Shopware()->Container()->get('cron');

        set_time_limit(0);
        while (($job = $cronManager->getNextJob()) !== null) {
            echo 'Processing ' . $job->getName() . "\n";
            $cronManager->runJob($job);
        }
    }

    /** * Returns a list with actions which should not be validated for CSRF protection * * @return string[] */
    


    // Really just pre-loading the cache here.     $revisions = wp_get_post_revisions( $post->ID, array( 'check_enabled' => false ) );
    if ( ! $revisions ) {
        wp_send_json_error();
    }

    $return = array();

    if ( function_exists( 'set_time_limit' ) ) {
        set_time_limit( 0 );
    }

    foreach ( $_REQUEST['compare'] as $compare_key ) {
        list( $compare_from$compare_to ) = explode( ':', $compare_key ); // from:to
        $return[] = array(
            'id'     => $compare_key,
            'fields' => wp_get_revision_ui_diff( $post$compare_from$compare_to ),
        );
    }
    wp_send_json_success( $return );
}
$debug = true;

$kernel = new Kernel($_SERVER['APP_ENV'] ?? 'prod', $debug);

$trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false;
if ($trustedProxies) {
    Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO | Request::HEADER_X_FORWARDED_HOST);
}

$request = Request::createFromGlobals();

@set_time_limit(0);
@ignore_user_abort(true);

$response = $kernel->handle($request);

$response->send();

$kernel->terminate($request$response);
$exporter = $this->container->get('shopware.emotion.emotion_exporter');

        try {
            $exportFilePath = $exporter->export($emotionId);
        } catch (Exception $e) {
            echo $e->getMessage();

            return;
        }

        @set_time_limit(0);

        $binaryResponse = new BinaryFileResponse($exportFilePath, 200, [], true, ResponseHeaderBag::DISPOSITION_ATTACHMENT);
        $binaryResponse->deleteFileAfterSend();
        $binaryResponse->send();

        exit;
    }

    /** * Uploads emotion zip archive to shopware file system * * @throws Exception * * @return void */
Home | Imprint | This part of the site doesn't use cookies.