PHP Classes

File: sample/setupdb.cli.php

Recommend this page to a friend!
  Classes of Martin Pircher   PHP Cron Job Manager Script   sample/setupdb.cli.php   Download  
File: sample/setupdb.cli.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Cron Job Manager Script
Add PHP scripts to be executed periodically
Author: By
Last change: Update of sample/setupdb.cli.php
Date: 8 months ago
Size: 796 bytes
 

Contents

Class file image Download
#! /usr/bin/php
<?php
/**
 * sample table creating for cronjob class
 * @version 2009-11-16 17:49:25 +0100
 * @copyright Martin Pircher <mplx+code@donotreply.at>
 * @author Martin Pircher <mplx+code@donotreply.at>
 * @link http://www.pircher.net/
 * @license http://opensource.org/licenses/MIT MIT License
 * @package Cronjob
 */

use \mplx\toolkit\cronjob\CronJob;

/**
 * Database configuration
 */
include 'config.inc.php';

/**
 * Check for CLI
 */
if (@php_sapi_name() != 'cli') {
    die(
'ERROR: This script will only work in the shell'.PHP_EOL);
}

/**
 * Include cronjob php class
 */
include dirname(__FILE__).'/../src/cronjob.php';

/**
 * Initialize
 *
 * create object, initialize database connection and create table
 */
$job = new CronJob('samplejob', $dbcfg);
$job->createTable();