public function swappAction() { $associd = trim($this->_getParam('associationid')); $is_archived = false; $swapp_relations = new Default_Model_ContextScriptAssocs(); $swapp_relations->filter->id->numequals($associd); if (count($swapp_relations->items) === 0) { return $this->echo_file(null); } $swapp_relation = $swapp_relations->items[0]; $contextscripts = new Default_Model_ContextScripts(); $contextscripts->filter->id->numequals($swapp_relation->contextscriptid); if (count($contextscripts->items) === 0) { return $this->echo_file(null); } $cscript = $contextscripts->items[0]; $url = $cscript->url; $cs_guid = $cscript->guid; $group = 'cs/swapp'; $filename = basename($url); $path = Storage::search($group, $cs_guid, $filename, false); if (!$path) { $path = Storage::searchArchive($group, $cs_guid, $filename); if ($path) { $is_archived = true; } } $this->echo_file($path, $is_archived); }
public function actionExport() { $model = new Storage(); $model->unsetAttributes(); // clear any default values if (isset($_POST['Storage'])) { $model->attributes = $_POST['Storage']; } $exportType = $_POST['fileType']; $this->widget('ext.heart.export.EHeartExport', array('title' => 'List of Storage', 'dataProvider' => $model->search(), 'filter' => $model, 'grid_mode' => 'export', 'exportType' => $exportType, 'columns' => array('storage_id', 'curDate', 'prod_id', 'curCount'))); }
<?php require 'src/SharedMemory.php'; require 'src/Storage.php'; $store = new Storage(1048576); $store[0] = 0; $store[1] = 1; $store[2] = 2; $store[3] = 3; $store[4] = 4; $store[5] = 5; $store[6] = 10; //unset($store[0]); //$store->destroy(); var_dump($store->search(0)); //var_dump($store);