/** * Registers all config options */ public function registerAll() { $this->registerNavigation(); $this->registerHooks(); // F**k it lets just do this quick and dirty until core supports this Backgroundjob::addRegularTask($this->config['cron']['job'], 'run'); App::registerAdmin($this->config['id'], $this->config['admin']); }
*/ namespace OCA\Music\App; $app = new Music(); $c = $app->getContainer(); /** * add navigation */ $navConfig = array('id' => $c->query('AppName'), 'order' => 10, 'name' => $c->query('L10N')->t('Music'), 'href' => $c->query('URLGenerator')->linkToRoute('music.page.index'), 'icon' => $c->query('URLGenerator')->imagePath($c->query('AppName'), 'music.svg')); $c->query('ServerContainer')->getNavigationManager()->add($navConfig); /** * register regular task */ // TODO: this is temporarily static because core jobs are not public // yet, therefore legacy code \OCP\Backgroundjob::addRegularTask('OCA\\Music\\Backgroundjob\\CleanUp', 'run'); /** * register hooks */ // FIXME: this is temporarily static because core emitters are not future // proof, therefore legacy code in here \OCP\Util::connectHook(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_post_write, 'OCA\\Music\\Hooks\\File', 'updated'); \OCP\Util::connectHook(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_delete, 'OCA\\Music\\Hooks\\File', 'deleted'); \OCP\Util::connectHook('OCP\\Share', 'post_unshare', 'OCA\\Music\\Hooks\\Share', 'itemUnshared'); // TODO: disabled because it can delay the share a lot /* \OCP\Util::connectHook( 'OCP\Share', 'post_shared', 'OCA\Music\Hooks\Share', 'itemShared' ); */
/** * Register a backgroundjob task * @param string $className full namespace and class name of the class * @param string $methodName the name of the static method that should be * called * @deprecated Use \OC::$server->getJobList()->add(); */ public function addRegularTask($className, $methodName) { \OCP\Backgroundjob::addRegularTask($className, $methodName); }
/** * Registers all jobs in the config */ public function registerBackgroundJobs() { // FIXME: this is temporarily static because core jobs are not public // yet, therefore legacy code foreach ($this->config['jobs'] as $job) { \OCP\Backgroundjob::addRegularTask($job, 'run'); } }
* it under the terms of the GNU Affero General Public License, version 3, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License, version 3, * along with this program. If not, see <http://www.gnu.org/licenses/> * */ namespace OCA\OCIPv6\AppInfo; //load the required files \OCP\Backgroundjob::addRegularTask('\\OCA\\ocipv6\\Cron\\dyndns', 'update'); \OCP\App::registerAdmin('ocipv6', 'settings/ipv6'); \OCP\App::registerAdmin('ocipv6', 'settings/upnp'); \OCP\App::registerAdmin('ocipv6', 'settings/dynv6'); use OCP\AppFramework\App; use OCA\OCIPv6\Service\AuthorService; class Application extends App { public function __construct(array $urlParams = array()) { parent::__construct('ocipv6', $urlParams); $container = $this->getContainer(); /** * Controllers */ $container->registerService('AuthorService', function ($c) {