/** * コンストラクタ。 * コンシューマキー、及びコンシューマ秘密鍵はプロパティファイルに定義することも可能です。 * * config/global_properties.yml の設定例: * <code> * twitter: * # コンシューマキー。 * consumerKey: * * # コンシューマ秘密鍵。 * consumerSecret: * </code> * @see Mars_OAuthProvider::__construct() * @author Naomichi Yamakita <*****@*****.**> */ protected function __construct($consumerKey = NULL, $consumerSecret = NULL) { $config = Mars_Config::loadProperties('twitter'); if ($consumerKey === NULL) { $consumerKey = array_find($config, 'consumerKey'); } if ($consumerSecret === NULL) { $consumerSecret = array_find($config, 'consumerSecret'); } parent::__construct($consumerKey, $consumerSecret); }
/** * コンストラクタ。 * コンシューマキー、及びコンシューマ秘密鍵はプロパティファイルに定義することも可能です。 * * config/global_properties.yml の設定例: * <code> * mixiGraph: * # コンシューマキー。 * consumerKey: * * # コンシューマ秘密鍵。 * consumerSecret: * </code> * @see Mars_OAuthProvider::__construct() * @author Naomichi Yamakita <*****@*****.**> */ protected function __construct($consumerKey = NULL, $consumerSecret = NULL) { $config = Mars_Config::loadProperties('mixiGraph'); if ($consumerKey === NULL) { $consumerKey = array_find($config, 'consumerKey'); } if ($consumerSecret === NULL) { $consumerSecret = array_find($config, 'consumerSecret'); } $this->_userAgent = $this->request->getUserAgent(); parent::__construct($consumerKey, $consumerSecret); }
/** * コンストラクタ。 * コンシューマキー、及びコンシューマ秘密鍵はコンストラクタの引数、またはプロパティファイルに定義することが可能です。 * (プロパティファイルの設定例は {@link Mars_MixiMobileApp} クラスの API を参照) * * @param string $consumerKey コンシューマキー。 * @param string $consumerSecret コンシューマ秘密鍵。 * @author Naomichi Yamakita <*****@*****.**> */ protected function __construct($consumerKey = NULL, $consumerSecret = NULL) { $config = Mars_Config::loadProperties('mixi'); if ($consumerKey === NULL) { $consumerKey = array_find($config, 'consumerKey'); } if ($consumerSecret === NULL) { $consumerSecret = array_find($config, 'consumerSecret'); } parent::__construct($consumerKey, $consumerSecret); $this->_consumer = new OAuthConsumer($consumerKey, $consumerSecret); $this->_hasZlib = extension_loaded('zlib'); }
/** * テーブルの未使用領域を解放し、データファイルを最適化します。 * MySQLController::optimizeTable() を実行するには、MySQL のプロセスがあらかじめ終了している必要があります。 * * @author Naomichi Yamakita <*****@*****.**> * @see http://dev.mysql.com/doc/refman/4.1/ja/optimisation.html */ public function optimizeTable() { // MySQLController::checkTable() で統計を更新するため、ここでは OPTIMIZE TABLE を使用しない $command = sprintf('%s/bin/myisamchk -r %s/%s/', self::MYSQL_ROOT_DIR, self::MYSQL_DATA_DIR, $dbName); // "Deleted blocks" がおおよそ 100000 以上となるテーブルを対象とする $optimizeTables = Mars_Config::loadProperties('database.optimizeTables'); pcntl_setpriority(20); foreach ($optimizeTables as $table) { $start = microtime(TRUE); shell_exec(sprintf('%s%s.MYI', $command, $table)); $second = microtime(TRUE) - $start; file_put_contents('/home/mysql/isambench', sprintf("%s:%s\n", $table, $second), FILE_APPEND); } }
/** * コンストラクタ。 * * @author Naomichi Yamakita <*****@*****.**> */ public function __construct() { $helperConfig = Mars_Config::load(Mars_Config::YAML_GLOBAL_HELPERS, 'html'); $this->_contentsBaseURI = Mars_Config::loadProperties('mixi.contentsBaseURI'); parent::__construct($helperConfig); }
/** * @author Naomichi Yamakita <*****@*****.**> */ public function getReplicationStatus() { $replication = Mars_Config::loadProperties('database.replication'); return $replication; }
/** * 現在アプリにアクセスしているユーザの ID を取得します。 * デバッグモードが有効かつ ID が見つからない場合は、global_properties.yml からデバッグ用アプリ ID の取得を試みます。 * * プロパティ設定例: * <code> * mixi: * debug: * ownerId: ... * </code> * <i>{@link getApplicationId()} メソッドの項も参照。</i> * * @link http://developer.mixi.co.jp/appli/spec/mob/for_partners/transmitted_information SAP サーバに送信される情報 * @return string 現在のアプリ ID を返します。 * @see Mars_MixiMobileApp::getApplicationId() * @author Naomichi Yamakita <*****@*****.**> */ public static function getOwnerId() { $ownerId = Mars_DIContainerFactory::getContainer()->getRequest()->getQuery('opensocial_owner_id'); if ($ownerId === NULL && is_output_debug()) { $ownerId = Mars_Config::loadProperties('mixi.debug.ownerId'); } return $ownerId; }