<commit_before><?php

namespace luya\admin\apis;

use Yii;
use luya\rest\Controller;
use luya\admin\models\ProxyMachine;
use yii\web\ForbiddenHttpException;
use yii\db\Query;
use luya\admin\models\ProxyBuild;
use yii\helpers\Json;
use luya\helpers\Url;
use luya\admin\models\StorageFile;

/**
 * Proxy API.
 *
 * How the data is prepared:
 *
 * 1. Foreach all tables
 * 2. Ignore the $ingoreTables list
 * 3. Table request estimated data write to $config
 * 4. Generate Build.
 * 5. Send build identifier to the client.
 *
 * @author <NAME> <<EMAIL>>
 * @since 1.0.0
 */
class ProxyController extends Controller
{
    protected $ignoreTables = [
        'admin_proxy_build', 'admin_proxy_machine', 'migration', 'admin_config',
    ];
    
    public function actionIndex($identifier, $token)
    {
        $machine = ProxyMachine::findOne(['identifier' => $identifier, 'is_deleted' => false]);
        
        if (!$machine) {
            throw new ForbiddenHttpException("Unable to acccess the proxy api.");
        }
        
        if (sha1($machine->access_token) !== $token) {
            throw new ForbiddenHttpException("Unable to acccess the proxy api due to invalid token.");
        }
        
        $rowsPerRequest = $this->module->proxyRowsPerRequest;
        
        $config = [
            'rowsPerRequest' => $rowsPerRequest,
            'tables' => [],
            'storageFilesCount' => StorageFile::find()->count(),
        ];<commit_msg>ignore admin user login<commit_after><?php

namespace luya\admin\apis;

use Yii;
use luya\rest\Controller;
use luya\admin\models\ProxyMachine;
use yii\web\ForbiddenHttpException;
use yii\db\Query;
use luya\admin\models\ProxyBuild;
use yii\helpers\Json;
use luya\helpers\Url;
use luya\admin\models\StorageFile;

/**
 * Proxy API.
 *
 * How the data is prepared:
 *
 * 1. Foreach all tables
 * 2. Ignore the $ingoreTables list
 * 3. Table request estimated data write to $config
 * 4. Generate Build.
 * 5. Send build identifier to the client.
 *
 * @author <NAME> <<EMAIL>>
 * @since 1.0.0
 */
class ProxyController extends Controller
{
	/**
	 * @var array A list of tables which will be ignored and can not be synced with the proxy command.
	 */
    protected $ignoreTables = [
        'migration', 'admin_proxy_build', 'admin_proxy_machine', 'admin_config', 'admin_user_login',
    ];
    
    public function actionIndex($identifier, $token)
    {
        $machine = ProxyMachine::findOne(['identifier' => $identifier, 'is_deleted' => false]);
        
        if (!$machine) {
            throw new ForbiddenHttpException("Unable to acccess the proxy api.");
        }
        
        if (sha1($machine->access_token) !== $token) {
            throw new ForbiddenHttpException("Unable to acccess the proxy api due to invalid token.");
        }
        
        $rowsPerRequest = $this->module->proxyRowsPerRequest;
        
        $config = [
            'rowsPerRequest' => $rowsPerRequest,
            'tables' => [],
            'storageFilesCount' => StorageFile::find()->count(),
        ];
{'fraction_non_alphanumeric': 0.12573481384715873, 'fraction_numerical': 0.005878510777269758, 'mean_word_length': 2.758282208588957, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7475708', 'n_tokens_mistral': 926, 'n_tokens_neox': 916, 'n_words': 247}