PHP code example of zfcampus / statuslib-example

1. Go to this page and download the library: Download zfcampus/statuslib-example 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/ */

    

zfcampus / statuslib-example example snippets


return [
    /* ... */
    'modules' => [
        /* ... */
        'StatusLib',
    ],
    /* ... */
];

[
    'statuslib' => [
        'db' => 'Name of service providing DB adapter',
        'table' => 'Name of database table within db to use',
        'array_mapper_path' => 'path to PHP file returning an array for use with ArrayMapper',
    ],
    'service_manager' => [
        'aliases' => [
            // Set to either StatusLib\ArrayMapper or StatusLib\TableGatewayMapper
            \StatusLib\Mapper::class => \StatusLib\ArrayMapper::class,
        ],
    ],
]

  
  return [];
  

  
  return [
      /* ... */
      'statuslib' => [
        'array_mapper_path' => 'data/statuslib.php',
      ],
  ];
  

      'statuslib' => [
         'array_mapper_path' => 'data/status.data.php',
      ],
      'service_manager' => [
          'aliases' => [
              \StatusLib\Mapper::class => \StatusLib\ArrayMapper::class,
          ],
      ],
      

      'db' => [
          'adapters' => [
              'MyDb' => [
                  'driver' => 'pdo_sqlite',
                  'database' => __DIR__ . '/../../data/status.db'
              ],
          ],
      ],
      'statuslib' => [
          'db' => 'MyDb',
          'table' => 'status',
      ],
      'service_manager' => [
          'aliases' => [
              \StatusLib\Mapper::class => \StatusLib\TableGatewayMapper::class,
          ],
      ],
      

   // test.php
   namespace StatusLib;

   use Zend\Mvc\Application;
   use Zend\Stdlib\ArrayUtils;

   g.php')) {
       $appConfig = ArrayUtils::merge(
           $appConfig,
            as $status) {
       printf(
           "[%d] [%s] %s (by %s)\n",
           $status->timestamp,
           $status->id,
           $status->message,
           $status->user
       );
   }
   
console
      $ cp config/autoload/local.php.dist config/autoload/local.php
      
console
      $ cp config/autoload/local.php.dist config/autoload/local.php