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

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/home/ccl/vendor/jenssegers/mongodb/src/Jenssegers/Mongodb/Eloquent/   drwxrwxr-x
Free 13.14 GB of 57.97 GB (22.67%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     Builder.php (7.01 KB)      -rw-rw-r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php namespace Jenssegers\Mongodb\Eloquent;

use 
Illuminate\Database\Eloquent\Builder as EloquentBuilder;
use 
Illuminate\Database\Eloquent\Relations\Relation;
use 
MongoCursor;

class 
Builder extends EloquentBuilder
{
    
/**
     * The methods that should be returned from query builder.
     *
     * @var array
     */
    
protected $passthru = [
        
'toSql''lists''insert''insertGetId''pluck',
        
'count''min''max''avg''sum''exists''push''pull',
    ];

    
/**
     * Update a record in the database.
     *
     * @param  array  $values
     * @param  array  $options
     * @return int
     */
    
public function update(array $values, array $options = [])
    {
        
// Intercept operations on embedded models and delegate logic
        // to the parent relation instance.
        
if ($relation $this->model->getParentRelation()) {
            
$relation->performUpdate($this->model$values);

            return 
1;
        }

        return 
$this->query->update($this->addUpdatedAtColumn($values), $options);
    }

    
/**
     * Insert a new record into the database.
     *
     * @param  array  $values
     * @return bool
     */
    
public function insert(array $values)
    {
        
// Intercept operations on embedded models and delegate logic
        // to the parent relation instance.
        
if ($relation $this->model->getParentRelation()) {
            
$relation->performInsert($this->model$values);

            return 
true;
        }

        return 
parent::insert($values);
    }

    
/**
     * Insert a new record and get the value of the primary key.
     *
     * @param  array   $values
     * @param  string  $sequence
     * @return int
     */
    
public function insertGetId(array $values$sequence null)
    {
        
// Intercept operations on embedded models and delegate logic
        // to the parent relation instance.
        
if ($relation $this->model->getParentRelation()) {
            
$relation->performInsert($this->model$values);

            return 
$this->model->getKey();
        }

        return 
parent::insertGetId($values$sequence);
    }

    
/**
     * Delete a record from the database.
     *
     * @return mixed
     */
    
public function delete()
    {
        
// Intercept operations on embedded models and delegate logic
        // to the parent relation instance.
        
if ($relation $this->model->getParentRelation()) {
            
$relation->performDelete($this->model);

            return 
$this->model->getKey();
        }

        return 
parent::delete();
    }

    
/**
     * Increment a column's value by a given amount.
     *
     * @param  string  $column
     * @param  int     $amount
     * @param  array   $extra
     * @return int
     */
    
public function increment($column$amount 1, array $extra = [])
    {
        
// Intercept operations on embedded models and delegate logic
        // to the parent relation instance.
        
if ($relation $this->model->getParentRelation()) {
            
$value $this->model->{$column};

            
// When doing increment and decrements, Eloquent will automatically
            // sync the original attributes. We need to change the attribute
            // temporary in order to trigger an update query.
            
$this->model->{$column} = null;

            
$this->model->syncOriginalAttribute($column);

            
$result $this->model->update([$column => $value]);

            return 
$result;
        }

        return 
parent::increment($column$amount$extra);
    }

    
/**
     * Decrement a column's value by a given amount.
     *
     * @param  string  $column
     * @param  int     $amount
     * @param  array   $extra
     * @return int
     */
    
public function decrement($column$amount 1, array $extra = [])
    {
        
// Intercept operations on embedded models and delegate logic
        // to the parent relation instance.
        
if ($relation $this->model->getParentRelation()) {
            
$value $this->model->{$column};

            
// When doing increment and decrements, Eloquent will automatically
            // sync the original attributes. We need to change the attribute
            // temporary in order to trigger an update query.
            
$this->model->{$column} = null;

            
$this->model->syncOriginalAttribute($column);

            return 
$this->model->update([$column => $value]);
        }

        return 
parent::decrement($column$amount$extra);
    }

    
/**
     * Add the "has" condition where clause to the query.
     *
     * @param  \Illuminate\Database\Eloquent\Builder  $hasQuery
     * @param  \Illuminate\Database\Eloquent\Relations\Relation  $relation
     * @param  string  $operator
     * @param  int  $count
     * @param  string  $boolean
     * @return \Illuminate\Database\Eloquent\Builder
     */
    
protected function addHasWhere(EloquentBuilder $hasQueryRelation $relation$operator$count$boolean)
    {
        
$query $hasQuery->getQuery();

        
// Get the number of related objects for each possible parent.
        
$relationCount array_count_values($query->lists($relation->getHasCompareKey()));

        
// Remove unwanted related objects based on the operator and count.
        
$relationCount array_filter($relationCount, function ($counted) use ($count$operator) {
            
// If we are comparing to 0, we always need all results.
            
if ($count == 0) {
                return 
true;
            }

            switch (
$operator) {
                case 
'>=':
                case 
'<':
                    return 
$counted >= $count;
                case 
'>':
                case 
'<=':
                    return 
$counted $count;
                case 
'=':
                case 
'!=':
                    return 
$counted == $count;
            }
        });

        
// If the operator is <, <= or !=, we will use whereNotIn.
        
$not in_array($operator, ['<''<=''!=']);

        
// If we are comparing to 0, we need an additional $not flip.
        
if ($count == 0) {
            
$not = !$not;
        }

        
// All related ids.
        
$relatedIds array_keys($relationCount);

        
// Add whereIn to the query.
        
return $this->whereIn($this->model->getKeyName(), $relatedIds$boolean$not);
    }

    
/**
     * Create a raw database expression.
     *
     * @param  closure  $expression
     * @return mixed
     */
    
public function raw($expression null)
    {
        
// Get raw results from the query builder.
        
$results $this->query->raw($expression);

        
// Convert MongoCursor results to a collection of models.
        
if ($results instanceof MongoCursor) {
            
$results iterator_to_array($resultsfalse);

            return 
$this->model->hydrate($results);
        }

        
// The result is a single object.
        
elseif (is_array($results) and array_key_exists('_id'$results)) {
            
$model $this->model->newFromBuilder($results);

            
$model->setConnection($this->model->getConnection());

            return 
$model;
        }

        return 
$results;
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

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

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