コード例 #1
0
ファイル: ModulesManager.php プロジェクト: kirkbauer2/kirkxc
 /**
  * Set module enabled flag fo "false"
  *
  * @param string $key Module actual name (key)
  *
  * @return boolean
  */
 public static function enableModule($key)
 {
     $installed = static::getModulesList();
     if (!isset(static::$activeModules[$key]) && isset($installed[$key]) && !static::callModuleMethod($key, 'isSystem')) {
         // Short names
         $data = $installed[$key];
         $path = static::getModulesFilePath();
         // Check if "xlite_modules" table exists
         if (\Includes\Utils\FileManager::isFileReadable($path)) {
             // Set flag in .ini-file
             $pattern = '/(\\[' . $data['author'] . '\\][^\\[]+\\s*' . $data['name'] . '\\s*=)\\s*\\S+/Ss';
             \Includes\Utils\FileManager::replace($path, '$1 1', $pattern);
         } else {
             // Set flag in DB.
             // This operation is highly NOT recommended in the usual workflow!
             // All info for this module must be stored before that!
             $query = 'UPDATE ' . static::getTableName() . ' SET enabled = ? WHERE moduleID = ?';
             \Includes\Utils\Database::execute($query, array(1, $data['moduleID']));
         }
         // Move the registry entry info into ENABLED registry to prevent LOST information
         static::moveModuleToEnabledRegistry($data['author'] . '\\' . $data['name']);
         // add to local cache
         static::$activeModules[$key] = $data;
     }
 }
コード例 #2
0
ファイル: Main.php プロジェクト: kirkbauer2/kirkxc
 /**
  * Correct (if needed) class doc block comment. Works for one element from the queue
  *
  * @param \Includes\Decorator\DataStructure\Graph\Classes $node Current node
  *
  * @return void
  */
 protected function correctTagsOnElement(\Includes\Decorator\DataStructure\Graph\Classes $node)
 {
     \Includes\Utils\FileManager::replace(\Includes\Decorator\ADecorator::getCacheClassesDir() . $node->getPath(), '@$1 ' . $this->getRepositoryCustomClassParameter($node), \Includes\Decorator\Utils\Operator::getTagPattern(array('Entity', 'MappedSuperClass')));
 }