Example #1
0
 /**
  * Populates the object using an array.
  *
  * This is particularly useful when populating an object from one of the
  * request arrays (e.g. $_POST).  This method goes through the column
  * names, checking to see whether a matching key exists in populated
  * array. If so the setByName() method is called for that column.
  *
  * You can specify the key type of the array by additionally passing one
  * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
  * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
  * The default key type is the column's phpname (e.g. 'AuthorId')
  *
  * @param      array  $arr     An array to populate the object from.
  * @param      string $keyType The type of keys the array uses.
  * @return     void
  */
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = ExportJobPeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setId($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setName($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setDescription($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setConfig($arr[$keys[3]]);
     }
     if (array_key_exists($keys[4], $arr)) {
         $this->setStartTime($arr[$keys[4]]);
     }
     if (array_key_exists($keys[5], $arr)) {
         $this->setEndTime($arr[$keys[5]]);
     }
     if (array_key_exists($keys[6], $arr)) {
         $this->setStatus($arr[$keys[6]]);
     }
     if (array_key_exists($keys[7], $arr)) {
         $this->setStatusCode($arr[$keys[7]]);
     }
     if (array_key_exists($keys[8], $arr)) {
         $this->setStatusChangeTime($arr[$keys[8]]);
     }
     if (array_key_exists($keys[9], $arr)) {
         $this->setStats($arr[$keys[9]]);
     }
     if (array_key_exists($keys[10], $arr)) {
         $this->setCmd($arr[$keys[10]]);
     }
 }
Example #2
0
width:15em;
display: inline;
float: none;
}

.checks p {
padding: 2px;
}

}
</style>
<?php 
if (!isset($exportJob)) {
    $c = new Criteria();
    //$c->add(ExportJobPeer::END_TIME, null);
    $exportJobs = ExportJobPeer::doSelect($c);
    if ($exportJobs) {
        print_window_header("Existing Export Jobs", "100%");
        ?>
		There appears to be existing export jobs.  There should only be one running.  If there are multiple showing as running, you should cancel them or purge them.  Click on a job to 
		view it's progress and it's log.
		<table class="jobs">
		<tr>
			<td><strong>Name</strong></td>
			<td><strong>Description</strong></td>
			<td><strong>Start Time</strong></td>
			<td><strong>Status</strong></td>
			<td colspan="2"><strong>Actions</strong></td>
		</tr>
		<?php 
        foreach ($exportJobs as $job) {
Example #3
0
 * 42 - SUCCESS WHEN FORKING SCRIPT
 */
set_time_limit(0);
// Remove time limit
if (pcntl_fork()) {
    // Fork process
    exit(42);
    // This marks a successful fork, so we should return success to the caller
}
posix_setsid();
// Make child process session leader
// Okay, we're now in our own execution space.  Let's begin
// We need to restart Propel to regain access to the DB
Propel::init(LILAC_FS_ROOT . "includes/lilac-conf.php");
if (isset($argv[1]) && is_numeric($argv[1])) {
    $exportJob = ExportJobPeer::retrieveByPK($argv[1]);
    if (!$exportJob) {
        print "Job with id: " . $argv[1] . " not found.\n";
        exit(20);
    }
    $exportJob->clearLog();
    // Okay, let's get the ExportConfig
    $config = $exportJob->getConfig();
    $config = unserialize($config);
    $engineClass = $config->getEngineClass();
    if (!class_exists($engineClass) || !is_subclass_of($engineClass, "ExportEngine")) {
        $exportJob->addError("Export Engine of type " . $engineClass . " not found.");
        exit(30);
    }
} else {
    print "No job id provided.\n";
Example #4
0
 /**
  * Get the associated ExportJob object
  *
  * @param      PropelPDO Optional Connection object.
  * @return     ExportJob The associated ExportJob object.
  * @throws     PropelException
  */
 public function getExportJob(PropelPDO $con = null)
 {
     if ($this->aExportJob === null && $this->job !== null) {
         $c = new Criteria(ExportJobPeer::DATABASE_NAME);
         $c->add(ExportJobPeer::ID, $this->job);
         $this->aExportJob = ExportJobPeer::doSelectOne($c, $con);
         /* The following can be used additionally to
         		   guarantee the related object contains a reference
         		   to this object.  This level of coupling may, however, be
         		   undesirable since it could result in an only partially populated collection
         		   in the referenced object.
         		   $this->aExportJob->addExportLogEntrys($this);
         		 */
     }
     return $this->aExportJob;
 }
Example #5
0
 /**
  * Selects a collection of ExportLogEntry objects pre-filled with all related objects.
  *
  * @param      Criteria  $c
  * @param      PropelPDO $con
  * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  * @return     array Array of ExportLogEntry objects.
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doSelectJoinAll(Criteria $c, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 {
     $c = clone $c;
     // Set the correct dbName if it has not been overridden
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     ExportLogEntryPeer::addSelectColumns($c);
     $startcol2 = ExportLogEntryPeer::NUM_COLUMNS - ExportLogEntryPeer::NUM_LAZY_LOAD_COLUMNS;
     ExportJobPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + (ExportJobPeer::NUM_COLUMNS - ExportJobPeer::NUM_LAZY_LOAD_COLUMNS);
     $c->addJoin(array(ExportLogEntryPeer::JOB), array(ExportJobPeer::ID), $join_behavior);
     $stmt = BasePeer::doSelect($c, $con);
     $results = array();
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         $key1 = ExportLogEntryPeer::getPrimaryKeyHashFromRow($row, 0);
         if (null !== ($obj1 = ExportLogEntryPeer::getInstanceFromPool($key1))) {
             // We no longer rehydrate the object, since this can cause data loss.
             // See http://propel.phpdb.org/trac/ticket/509
             // $obj1->hydrate($row, 0, true); // rehydrate
         } else {
             $omClass = ExportLogEntryPeer::getOMClass();
             $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
             $obj1 = new $cls();
             $obj1->hydrate($row);
             ExportLogEntryPeer::addInstanceToPool($obj1, $key1);
         }
         // if obj1 already loaded
         // Add objects for joined ExportJob rows
         $key2 = ExportJobPeer::getPrimaryKeyHashFromRow($row, $startcol2);
         if ($key2 !== null) {
             $obj2 = ExportJobPeer::getInstanceFromPool($key2);
             if (!$obj2) {
                 $omClass = ExportJobPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj2 = new $cls();
                 $obj2->hydrate($row, $startcol2);
                 ExportJobPeer::addInstanceToPool($obj2, $key2);
             }
             // if obj2 loaded
             // Add the $obj1 (ExportLogEntry) to the collection in $obj2 (ExportJob)
             $obj2->addExportLogEntry($obj1);
         }
         // if joined row not null
         $results[] = $obj1;
     }
     $stmt->closeCursor();
     return $results;
 }
Example #6
0
 /**
  * Retrieve multiple objects by pkey.
  *
  * @param      array $pks List of primary keys
  * @param      PropelPDO $con the connection to use
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function retrieveByPKs($pks, PropelPDO $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(ExportJobPeer::DATABASE_NAME, Propel::CONNECTION_READ);
     }
     $objs = null;
     if (empty($pks)) {
         $objs = array();
     } else {
         $criteria = new Criteria(ExportJobPeer::DATABASE_NAME);
         $criteria->add(ExportJobPeer::ID, $pks, Criteria::IN);
         $objs = ExportJobPeer::doSelect($criteria, $con);
     }
     return $objs;
 }