/** * send youtube mail every day in week 2 * @param void * @return void */ public function youtubeAction() { $this->_helper->viewRenderer->setNoRender(); # in this case Zend_Registry::get('week') will be used as day of the week in model $day = $this->_request->getParam('day'); $dayObj = $day; $day += 7; Zend_registry::set('day', $day); Zend_Debug::dump(new Admin_Model_Youtube($dayObj)); Zend_Debug::dump($day); }
public function routeShutdown(Zend_Controller_Request_Abstract $request) { $displayLogin = true; if ($user = $request->getParam('User', null)) { if ("-1" !== $user->getUserId()) { $displayLogin = false; $acl = Showcase_Acl::factory($user->getRoles()); // Only load the Users ACL roles and resources Zend_registry::set('Acl', $acl); // Register the Acl for user access } else { $displayLogin = true; Zend_registry::set('Acl', NULL); // Register the Acl for user access } } if ($displayLogin) { if ("include" !== strtolower($request->getActionName()) && "static" !== strtolower($request->getControllerName())) { $request->setModuleName('default')->setControllerName('Login')->setActionName('index')->setDispatched(false); } } }
if (isset($opts->app_env)) { defined('APPLICATION_ENV') || define('APPLICATION_ENV', $opts->app_env); } else { echo "\n\nParametr app_env jest wymagany!"; echo "\n\n" . $opts->getUsageMessage() . "\n\n"; exit; } /** Zend_Application */ require_once 'Zend/Application.php'; // Create application, bootstrap, and run $application = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini'); Base_Controller_Action_Helper_Currentip::$_unitTestEnabled = true; $application->bootstrap(); $application->getBootstrap()->runForCmd(); Zend_Controller_Front::getInstance()->setParam('bootstrap', $application->getBootstrap()); Zend_registry::set('config', $application->getOptions()); $user = $application->getOption('bin'); $u = new User(); $u_data = $u->fetchAll("login = '******'user'] . "'", "id DESC", 1); if (null == $u_data) { throw new Exception('Brak użytkownika o podanym ID'); } $u_data = $u_data->toArray(); $storageRow = new stdClass(); foreach ($u_data[0] as $key => $value) { $storageRow->{$key} = $value; } $auth = Zend_Auth::getInstance(); $storage = $auth->getStorage(); $o = new Branch(); $data = $o->fetchAll("branch_name = '" . $user['branch'] . "'", "id DESC", 1)->toArray();