PHP code example of vanchelo / phalcon-console

1. Go to this page and download the library: Download vanchelo/phalcon-console library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

vanchelo / phalcon-console example snippets


$user = Users::findFirst(1);

echo $user->name;

vanchelo

// $loader = new Loader();

$loader->registerNamespaces([
    'Vanchelo\Console' => __DIR__ . '/../library/console/src/', // The path may be different
]);

/**
 * Register Console Service
 */
new Vanchelo\Console\ConsoleService($di);

/* ... */
'whitelist' => [
    '127.0.0.1',
    '::1'
],
/* ... */


// app/config/console-config.php
return new \Phalcon\Config([
    // If you want to specify the class test access rights to the console
    'check_access_class' => 'MyConsoleAccessCheck',

    // Check the permissions on the IP
    'check_ip' => false, // disable scanning by IP address
]);

$di['console.config'] = function ()
{
    // Path to correct its
    $config = 

define('PHALCONSTART', microtime(true));


// public/index.php
define('PHALCONSTART', microtime(true));